diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 7f083a4b..42c63f0b 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -415,6 +415,7 @@ "user_api__btn_import": "Import", "user_api__btn_remove": "Remove", "user_api__import_file": "Select music API script file", + "user_api__max_tip": "There can only be a maximum of 20 sources at the same time🤪\nIf you want to continue importing, please remove some old sources to make room", "user_api__noitem": "There is nothing here...😲", "user_api__note": "Tip: Although we have isolated the script's running environment as much as possible, importing scripts containing malicious behaviors may still affect your system. Please import them carefully.", "user_api__readme": "Source writing instructions: ", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index cb7ea4ac..16eeeb09 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -415,6 +415,7 @@ "user_api__btn_import": "导入", "user_api__btn_remove": "移除", "user_api__import_file": "选择音乐API脚本文件", + "user_api__max_tip": "最多只能同时存在20个源哦🤪\n想要继续导入的话,请先移除一些旧的源腾出位置吧", "user_api__noitem": "这里竟然是空的 😲", "user_api__note": "提示:虽然我们已经尽可能地隔离了脚本的运行环境,但导入包含恶意行为的脚本仍可能会影响你的系统,请谨慎导入。", "user_api__readme": "源编写说明:", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index fbf348d1..a56a00ae 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -415,6 +415,7 @@ "user_api__btn_import": "導入", "user_api__btn_remove": "移除", "user_api__import_file": "選擇音樂API腳本文件", + "user_api__max_tip": "最多只能同時存在20個源哦🤪\n想要繼續導入的話,請先移除一些舊的源騰出位置吧", "user_api__noitem": "這裡竟然是空的 😲", "user_api__note": "提示:雖然我們已經盡可能地隔離了腳本的運行環境,但導入包含惡意行為的腳本仍可能會影響你的系統,請謹慎導入。", "user_api__readme": "源編寫說明:", diff --git a/src/renderer/views/setting/components/UserApiModal.vue b/src/renderer/views/setting/components/UserApiModal.vue index 64fa1649..37030acb 100644 --- a/src/renderer/views/setting/components/UserApiModal.vue +++ b/src/renderer/views/setting/components/UserApiModal.vue @@ -53,6 +53,13 @@ export default { }, methods: { handleImport() { + if (this.userApi.list.length > 20) { + this.$dialog({ + message: this.$t('user_api__max_tip'), + confirmButtonText: this.$t('ok'), + }) + return + } selectDir({ title: this.$t('user_api__import_file'), properties: ['openFile'],