Skip to content

Commit 44570c8

Browse files
committed
destinationの初期値を空に設定し、空の場合はURLからdestinationパラメータを削除するロジックを追加
1 parent 294ee1a commit 44570c8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
function App() {
168168
const [endpoint, setEndpoint] = useState("http://shell.opencloudshell.com/connect.php");
169169
const [port, setPort] = useState("");
170-
const [destination, setDestination] = useState("user@localhost");
170+
const [destination, setDestination] = useState("");
171171
const [password, setPassword] = useState("");
172172
const [key, setKey] = useState("");
173173
const [copied, setCopied] = useState(false);
@@ -183,7 +183,11 @@
183183
} else {
184184
url.searchParams.delete("port");
185185
}
186-
url.searchParams.set("destination", destination);
186+
if (destination.trim()) {
187+
url.searchParams.set("destination", destination);
188+
} else {
189+
url.searchParams.delete("destination");
190+
}
187191
if (password.trim()) {
188192
url.searchParams.set("password", password);
189193
} else {
@@ -245,7 +249,7 @@ <h1>OpenCloudShell</h1>
245249
type="text"
246250
value={destination}
247251
onChange={(e) => setDestination(e.target.value)}
248-
placeholder="linuxserver.io@localhost"
252+
placeholder="user@localhost"
249253
/>
250254
</label>
251255

0 commit comments

Comments
 (0)