Skip to content

Commit 7463bbe

Browse files
committed
feat: 优化复制安装命令提示
1 parent 63bb672 commit 7463bbe

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/install-commands.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((p
2929
if (!copy) {
3030
try {
3131
setCopy(true);
32-
if (settings)
33-
await copyToClipboard(generateCommand(type, settings) || '');
34-
35-
} catch (e) {
32+
if (!settings) throw new Error("Settings is not found.");
33+
await copyToClipboard(generateCommand(type, settings) || '');
34+
} catch (e: Error | any) {
3635
console.error(e);
3736
toast(t("Error"), {
38-
description: t("Results.UnExpectedError"),
37+
description: e.message,
3938
})
4039
} finally {
4140
setTimeout(() => {
@@ -64,7 +63,7 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((p
6463

6564
const generateCommand = (type: number, { agent_secret_key, install_host, listen_port, tls }: ModelConfig) => {
6665
if (!install_host)
67-
throw new Error("You have not specify the installed host.");
66+
throw new Error("You have not specify the installed host.")
6867

6968
const env = `NZ_SERVER=${install_host}:${listen_port} NZ_TLS=${tls || false} NZ_CLIENT_SECRET=${agent_secret_key}`;
7069

src/locales/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"DDNS": "Dynamic DNS",
2828
"NATT": "NAT Traversal",
2929
"Group": "Group",
30-
"Profile": "personal information",
30+
"Profile": "Profile",
3131
"Settings": "System settings",
3232
"Logout": "Log out",
3333
"NavigateTo": "Navigate to",

0 commit comments

Comments
 (0)