添加源数量限制

pull/930/merge
lyswhut 2022-02-18 15:50:51 +08:00
parent abbf067625
commit 5844232a00
4 changed files with 10 additions and 0 deletions

View File

@ -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: ",

View File

@ -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": "源编写说明:",

View File

@ -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": "源編寫說明:",

View File

@ -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'],