Skip to content

Commit 294ee1a

Browse files
committed
ポートの初期値を空に設定し、ポートが指定されていない場合にURLからポートパラメータを削除するロジックを追加
1 parent bc19378 commit 294ee1a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166

167167
function App() {
168168
const [endpoint, setEndpoint] = useState("http://shell.opencloudshell.com/connect.php");
169-
const [port, setPort] = useState("10022");
169+
const [port, setPort] = useState("");
170170
const [destination, setDestination] = useState("user@localhost");
171171
const [password, setPassword] = useState("");
172172
const [key, setKey] = useState("");
@@ -178,7 +178,11 @@
178178

179179
try {
180180
const url = new URL(base);
181-
url.searchParams.set("port", port);
181+
if (port.trim()) {
182+
url.searchParams.set("port", port);
183+
} else {
184+
url.searchParams.delete("port");
185+
}
182186
url.searchParams.set("destination", destination);
183187
if (password.trim()) {
184188
url.searchParams.set("password", password);

0 commit comments

Comments
 (0)