From 3f4165e4b187ccf8b7ce0899001cd7bb3a98b552 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 5 May 2025 20:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=9B=B8=E5=85=B3=E6=96=87=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E6=A8=A1=E6=9D=BF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.ts | 5 +- src/locales/zh-CN.ts | 9 +- src/locales/zh-TW.ts | 7 +- .../setting/AccountSettingNotification.vue | 151 +++++++++++------- 4 files changed, 104 insertions(+), 68 deletions(-) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 2b2a8314..c8be7abc 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -726,6 +726,7 @@ export default { filterEdition: 'Edition', filterResolution: 'Resolution', filterReleaseGroup: 'Release Group', + noMatchingResults: 'No matching data', }, calendar: { episode: 'Episode {number}', @@ -792,6 +793,7 @@ export default { }, site: { noSites: 'No Sites', + noFilterData: 'No matching sites found', sitesWillBeShownHere: 'Added and supported sites will be displayed here.', title: 'Site', status: { @@ -1120,7 +1122,8 @@ export default { downloadAdded: 'Download Added', subscribeAdded: 'Subscribe Added', subscribeComplete: 'Subscribe Complete', - templateConfig: 'Template Configuration', + templateConfigTitle: 'Message Template', + templateConfigDesc: 'Set message template, support Jinja2 syntax.', templateSaveFailed: 'Failed to save template!', templateSaveSuccess: 'Template saved successfully', templateLoadFailed: 'Failed to load template!', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 79574315..e3de9dd0 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -723,6 +723,7 @@ export default { filterEdition: '质量', filterResolution: '分辨率', filterReleaseGroup: '制作组', + noMatchingResults: '没有数据', }, calendar: { episode: '第{number}集', @@ -790,6 +791,7 @@ export default { site: { noSites: '没有站点', sitesWillBeShownHere: '已添加并支持的站点将会在这里显示。', + noFilterData: '没有符合条件的站点', title: '站点', status: { enabled: '启用', @@ -1106,9 +1108,10 @@ export default { channelsDesc: '设置消息发送渠道参数。', organizeSuccess: '资源入库', downloadAdded: '资源下载', - subscribeAdded: '订阅添加', + subscribeAdded: '添加订阅', subscribeComplete: '订阅完成', - templateConfig: '模板格式配置', + templateConfigTitle: '通知模板', + templateConfigDesc: '设置通知模板,支持Jinja2语法。', templateSaveFailed: '模板保存失败!', templateSaveSuccess: '模板保存成功', templateLoadFailed: '模板加载失败!', @@ -1869,7 +1872,7 @@ export default { renamingAll: '正在重命名 {path} 及目录内所有文件...', close: '关闭', loadingDirectoryStructure: '加载目录结构...', - reorganize: '重新整理', + reorganize: '整理', }, person: { alias: '别名:', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 245cfa95..30ded1a7 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -724,6 +724,7 @@ export default { filterEdition: '质量', filterResolution: '分辨率', filterReleaseGroup: '製作組', + noMatchingResults: '沒有數據', }, calendar: { episode: '第{number}集', @@ -791,6 +792,7 @@ export default { }, site: { noSites: '沒有站點', + noFilterData: '沒有符合條件的站點', sitesWillBeShownHere: '已添加並支持的站點將會在這裡顯示。', title: '站點', status: { @@ -1108,9 +1110,10 @@ export default { channelsDesc: '設置消息發送渠道參數。', organizeSuccess: '資源入庫', downloadAdded: '資源下載', - subscribeAdded: '訂閱添加', + subscribeAdded: '添加訂閱', subscribeComplete: '訂閱完成', - templateConfig: '消息模板配置', + templateConfigTitle: '通知模板', + templateConfigDesc: '設置通知模板,支持Jinja2語法。', templateSaveFailed: '模板保存失敗!', templateSaveSuccess: '模板保存成功', templateLoadFailed: '模板載入失敗!', diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index 0645f79a..855c1b74 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -7,6 +7,7 @@ import NotificationChannelCard from '@/components/cards/NotificationChannelCard. import ProgressDialog from '@/components/dialog/ProgressDialog.vue' import { useI18n } from 'vue-i18n' import { notificationSwitchDict } from '@/api/constants' +import { useTheme } from 'vuetify' // 国际化 const { t } = useI18n() @@ -16,29 +17,35 @@ const templateConfigs = ref>({ organizeSuccess: '{}', downloadAdded: '{}', subscribeAdded: '{}', - subscribeComplete: '{}' + subscribeComplete: '{}', }) // 模板类型配置 const templateTypes = ref([ - { + { type: 'organizeSuccess', - label: t('setting.notification.organizeSuccess') + label: t('setting.notification.organizeSuccess'), }, { type: 'downloadAdded', - label: t('setting.notification.downloadAdded') + label: t('setting.notification.downloadAdded'), }, - { + { type: 'subscribeAdded', - label: t('setting.notification.subscribeAdded') + label: t('setting.notification.subscribeAdded'), }, - { + { type: 'subscribeComplete', - label: t('setting.notification.subscribeComplete') - } + label: t('setting.notification.subscribeComplete'), + }, ]) +// 编辑器主题 +const { name: themeName, global: globalTheme } = useTheme() +const savedTheme = ref(localStorage.getItem('theme') ?? themeName) +const currentThemeName = ref(savedTheme.value) +const editorTheme = computed(() => (currentThemeName.value === 'light' ? 'github' : 'monokai')) + // 所有消息渠道 const notifications = ref([]) @@ -153,7 +160,7 @@ async function saveTemplate() { try { await api.post('system/setting/NotificationTemplates', { ...templateConfigs.value, - [currentTemplate.value]: editorContent.value + [currentTemplate.value]: editorContent.value, }) $toast.success(t('setting.notification.templateSaveSuccess')) editorVisible.value = false @@ -286,7 +293,7 @@ onMounted(() => { {{ t('common.save') }} - + {{ t('setting.notification.wechat') }} @@ -315,33 +322,46 @@ onMounted(() => { - - - {{ t('setting.notification.templateConfig') }} - - - - - - -
- {{ item.label }} -
-
-
-
-
-
-
+ + + + + {{ t('setting.notification.templateConfigTitle') }} + {{ t('setting.notification.templateConfigDesc') }} + + + + + + + + {{ item.label }} + + + + + + + + + @@ -418,29 +438,27 @@ onMounted(() => { :indeterminate="true" /> - - - {{ templateTypes.find(t => t.type === currentTemplate)?.label }} - - - - - - - {{ t('common.save') }} - - - {{ t('common.cancel') }} - - - - + + + + {{ templateTypes.find(t => t.type === currentTemplate)?.label }}消息模板 + + + + + + + + {{ t('common.save') }} + + + + \ No newline at end of file + +.template-card { + cursor: pointer; + transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; +} + +.template-card.on-hover:hover { + transform: translateY(-4px); +} +