chore(package-lock): mark dependencies as peer dependencies
snowmerak committed
Dec 21, 2025 at 12:00 UTC
991c97216be203f79b4cc3ee4ad94a23ba6ccb07
1 file changed
+44
-1
cmd/relay-server/frontend/src/components/TunnelCommandModal.tsx
+44
-1
@@ -1,5 +1,6 @@
1
import { useState, useMemo, useRef } from "react";
2
import { Copy, Check, Terminal, X } from "lucide-react";
3
+import { cn } from "@/lib/utils";
4
import {
5
Dialog,
6
DialogContent,
@@ -32,6 +33,7 @@ export function TunnelCommandModal({ trigger }: TunnelCommandModalProps) {
33
const [relayUrls, setRelayUrls] = useState<string[]>([currentOrigin]);
34
const [urlInput, setUrlInput] = useState("");
35
const [copied, setCopied] = useState(false);
36
+ const [os, setOs] = useState<"unix" | "windows">("unix");
37
const urlInputRef = useRef<HTMLInputElement>(null);
38
39
const addRelayUrl = (url: string) => {
@@ -71,8 +73,13 @@ export function TunnelCommandModal({ trigger }: TunnelCommandModalProps) {
73
const nameVal = name === "" ? defaultName : name;
74
const relayUrlVal =
75
relayUrls.length > 0 ? relayUrls.join(",") : currentOrigin;
76
+
77
+ if (os === "windows") {
78
+ return `irm ${currentOrigin}/tunnel/ps1 | iex; Start-PortalTunnel -HostAddr "${hostVal}" -Name "${nameVal}" -RelayUrl "${relayUrlVal}"`;
79
+ }
80
+
81
return `curl -fsSL ${currentOrigin}/tunnel | HOST=${hostVal} NAME=${nameVal} RELAY_URL="${relayUrlVal}" sh`;
75
- }, [currentOrigin, host, name, relayUrls]);
82
+ }, [currentOrigin, host, name, relayUrls, os]);
83
84
const handleCopy = async () => {
85
try {
@@ -191,6 +198,42 @@ export function TunnelCommandModal({ trigger }: TunnelCommandModalProps) {
198
</p>
199
</div>
200
201
+ {/* OS Selection */}
202
+ <div className="space-y-2">
203
+ <label className="text-sm font-medium text-foreground">
204
+ Operating System
205
+ </label>
206
+ <div className="flex p-1 bg-border rounded-md">
207
+ <button
208
+ onClick={() => setOs("unix")}
209
+ className={cn(
210
+ "flex-1 px-3 py-1.5 text-sm font-medium rounded-sm transition-all",
211
+ os === "unix"
212
+ ? "bg-background text-foreground shadow-sm"
213
+ : "text-muted-foreground hover:text-foreground"
214
+ )}
215
+ >
216
+ Linux / macOS
217
+ </button>
218
+ <button
219
+ onClick={() => setOs("windows")}
220
+ className={cn(
221
+ "flex-1 px-3 py-1.5 text-sm font-medium rounded-sm transition-all",
222
+ os === "windows"
223
+ ? "bg-background text-foreground shadow-sm"
224
+ : "text-muted-foreground hover:text-foreground"
225
+ )}
226
+ >
227
+ Windows
228
+ </button>
229
+ </div>
230
+ </div>
231
+
232
+ {/* className="text-xs text-text-muted">
233
+ Press Enter to add. Multiple relay servers for redundancy.
234
+ </p>
235
+ </div>
236
+
237
{/* Generated Command */}
238
<div className="space-y-2">
239
<label className="text-sm font-medium text-foreground">