From b14883c9af12f0a79525951389176e52ee1062a4 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 12 Mar 2024 14:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9C=A8=E7=BA=BF=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=BA=90=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E5=85=81=E8=AE=B8=E9=80=9A=E8=BF=87http/https?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=AF=BC=E5=85=A5=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/lang/en-us.json | 11 +- src/lang/zh-cn.json | 11 +- src/lang/zh-tw.json | 11 +- .../views/Setting/components/UserApiModal.vue | 29 +++- .../components/UserApiOnlineImportModal.vue | 130 ++++++++++++++++++ 6 files changed, 182 insertions(+), 11 deletions(-) create mode 100644 src/renderer/views/Setting/components/UserApiOnlineImportModal.vue diff --git a/publish/changeLog.md b/publish/changeLog.md index bebd145a..52437b38 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,6 +1,7 @@ ### 新增 - 主题编辑器添加“深色字体”选项,启用后将减少字体颜色梯度,各类字体(正文、标签字体等)颜色将更接近,这有助于解决创建全透明主题时可能出现的字体配色问题(#1799) +- 新增在线自定义源导入功能,允许通过http/https链接导入自定义源 ### 优化 diff --git a/src/lang/en-us.json b/src/lang/en-us.json index b44e2414..8f67e9ca 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -5,6 +5,7 @@ "audio_visualization": "Audio visualization (experimental)", "back": "Back", "btn_cancel": "Cancel", + "btn_close": "Closure", "btn_confirm": "Confirm", "btn_save": "Save", "cancel_button_text": "Cancel", @@ -685,7 +686,8 @@ "update__timeout_top": "Download time is too long prompt\n\nYour current network access to GitHub is slow, and the new version has been downloaded for an hour and has not been completed yet😳, you can still choose to continue waiting, but the wall crack recommends manually updating the version!", "user_api__allow_show_update_alert": "Allow update popup to show", "user_api__btn_export": "Export", - "user_api__btn_import": "Import", + "user_api__btn_import": "Local import", + "user_api__btn_import_online": "Online import", "user_api__btn_remove": "Remove", "user_api__import_file": "Select music API script file", "user_api__init_failed_alert": "Custom source [{name}] failed to initialize:", @@ -695,5 +697,10 @@ "user_api__readme": "Source writing instructions: ", "user_api__title": "Custom Source Management", "user_api__update_alert": "Custom source [{name}] found new version:", - "user_api__update_alert_open_url": "Open update address" + "user_api__update_alert_open_url": "Open update address", + "user_api_import__failed": "Custom source import failed:\n{message}", + "user_api_import_online__input_confirm": "Import", + "user_api_import_online__input_loading": "Importing...", + "user_api_import_online__input_tip": "Please enter HTTP link", + "user_api_import_online__title": "Import custom sources online" } diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 671b9c1b..bf85afb7 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -5,6 +5,7 @@ "audio_visualization": "音频可视化(实验性)", "back": "返回", "btn_cancel": "取消", + "btn_close": "关闭", "btn_confirm": "确定", "btn_save": "保存", "cancel_button_text": "我不", @@ -685,7 +686,8 @@ "update__timeout_top": "下载时间过长提示\n\n你当前所在网络访问GitHub较慢,新版本已经下了一个钟了还没完成😳,你仍可选择继续等,但墙裂建议手动更新版本!", "user_api__allow_show_update_alert": "允许显示更新弹窗", "user_api__btn_export": "导出", - "user_api__btn_import": "导入", + "user_api__btn_import": "本地导入", + "user_api__btn_import_online": "在线导入", "user_api__btn_remove": "移除", "user_api__import_file": "选择音乐API脚本文件", "user_api__init_failed_alert": "自定义源 [{name}] 初始化失败:", @@ -695,5 +697,10 @@ "user_api__readme": "源编写说明:", "user_api__title": "自定义源管理", "user_api__update_alert": "自定义源 [{name}] 发现新版本:", - "user_api__update_alert_open_url": "打开更新地址" + "user_api__update_alert_open_url": "打开更新地址", + "user_api_import__failed": "自定义源导入失败:\n{message}", + "user_api_import_online__input_confirm": "导入", + "user_api_import_online__input_loading": "导入中...", + "user_api_import_online__input_tip": "请输入 HTTP 链接", + "user_api_import_online__title": "在线导入自定义源" } diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 1126a4a3..1b99ae90 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -5,6 +5,7 @@ "audio_visualization": "音訊視覺化(實驗性)", "back": "返回", "btn_cancel": "取消", + "btn_close": "關閉", "btn_confirm": "確定", "btn_save": "儲存", "cancel_button_text": "取消", @@ -685,7 +686,8 @@ "update__timeout_top": "下載時間過長提示\n\n你目前所在網路訪問GitHub較慢,新版本已經下了一個鐘了還沒完成😳,你仍可選擇繼續等,但牆裂建議手動更新版本!", "user_api__allow_show_update_alert": "允許顯示更新彈窗", "user_api__btn_export": "匯出", - "user_api__btn_import": "導入", + "user_api__btn_import": "本地導入", + "user_api__btn_import_online": "線上匯入", "user_api__btn_remove": "移除", "user_api__import_file": "選擇音樂API腳本文件", "user_api__init_failed_alert": "自訂來源 [{name}] 初始化失敗:", @@ -695,5 +697,10 @@ "user_api__readme": "來源編寫說明:", "user_api__title": "自訂來源管理", "user_api__update_alert": "自訂來源 [{name}] 發現新版本:", - "user_api__update_alert_open_url": "開啟更新地址" + "user_api__update_alert_open_url": "開啟更新地址", + "user_api_import__failed": "自訂來源導入失敗:\n{message}", + "user_api_import_online__input_confirm": "導入", + "user_api_import_online__input_loading": "導入中...", + "user_api_import_online__input_tip": "請輸入 HTTP 連結", + "user_api_import_online__title": "線上導入自訂來源" } diff --git a/src/renderer/views/Setting/components/UserApiModal.vue b/src/renderer/views/Setting/components/UserApiModal.vue index 70361d8e..1a823a48 100644 --- a/src/renderer/views/Setting/components/UserApiModal.vue +++ b/src/renderer/views/Setting/components/UserApiModal.vue @@ -23,8 +23,10 @@ material-modal(:show="modelValue" bg-close teleport="#view" @close="handleClose" span.hover.underline(aria-label="https://lxmusic.toside.cn/desktop/custom-source" @click="handleOpenUrl('https://lyswhut.github.io/lx-music-doc/desktop/custom-source')") FAQ p {{ $t('user_api__note') }} div(:class="$style.footer") + base-btn(:class="$style.footerBtn" @click="isShowOnlineImportModal = true") {{ $t('user_api__btn_import_online') }} base-btn(:class="$style.footerBtn" @click="handleImport") {{ $t('user_api__btn_import') }} //- base-btn(:class="$style.footerBtn" @click="handleExport") {{ $t('user_api__btn_export') }} + UserApiOnlineImportModal(v-model:show="isShowOnlineImportModal" @import="importUserApi") + + +