From 44c5f5c5fca2ba23b6f14d171b83d402273f9cb3 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 23 Jun 2025 18:09:32 +0800 Subject: [PATCH] feat: plugin no data --- .../auto-update-setting/config.ts | 2 +- .../auto-update-setting/index.tsx | 11 +++++++---- .../auto-update-setting/plugins-picker.tsx | 11 +++++++---- web/i18n/en-US/plugin.ts | 4 ++++ web/i18n/zh-Hans/plugin.ts | 4 ++++ 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/web/app/components/plugins/reference-setting-modal/auto-update-setting/config.ts b/web/app/components/plugins/reference-setting-modal/auto-update-setting/config.ts index 2144293762..6c325e0719 100644 --- a/web/app/components/plugins/reference-setting-modal/auto-update-setting/config.ts +++ b/web/app/components/plugins/reference-setting-modal/auto-update-setting/config.ts @@ -3,7 +3,7 @@ import { AUTO_UPDATE_MODE, AUTO_UPDATE_STRATEGY } from './types' export const defaultValue: AutoUpdateConfig = { strategy_setting: AUTO_UPDATE_STRATEGY.fixOnly, // For test upgrade_time_of_day: 0, - upgrade_mode: AUTO_UPDATE_MODE.update_all, + upgrade_mode: AUTO_UPDATE_MODE.exclude, // For test exclude_plugins: [], include_plugins: [], } diff --git a/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx b/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx index 67f4f5e034..1219fe9c78 100644 --- a/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx +++ b/web/app/components/plugins/reference-setting-modal/auto-update-setting/index.tsx @@ -132,10 +132,13 @@ const AutoUpdateSetting: FC = ({ ))} - + {upgrade_mode !== AUTO_UPDATE_MODE.update_all && ( + + )} )} diff --git a/web/app/components/plugins/reference-setting-modal/auto-update-setting/plugins-picker.tsx b/web/app/components/plugins/reference-setting-modal/auto-update-setting/plugins-picker.tsx index 148f121fd0..fa348efa0a 100644 --- a/web/app/components/plugins/reference-setting-modal/auto-update-setting/plugins-picker.tsx +++ b/web/app/components/plugins/reference-setting-modal/auto-update-setting/plugins-picker.tsx @@ -1,28 +1,31 @@ 'use client' import type { FC } from 'react' import React from 'react' +import NoPluginSelected from './no-plugin-selected' +import type { AUTO_UPDATE_MODE } from './types' type Props = { + updateMode: AUTO_UPDATE_MODE value: string[] // plugin ids onChange: (value: string[]) => void } const PluginsPicker: FC = ({ + updateMode, value, onChange, }) => { const hasSelected = value.length > 0 return ( -
+
{hasSelected ? (
Selected plugins will not auto-update
) : ( -
- Only selected plugins will auto-update. No plugins are currently selected, so no plugins will auto-update. -
+ )} +
) } diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index bf626326e5..c8a5fb27b5 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -151,6 +151,10 @@ const translation = { exclude: 'Exclude selected', partial: 'Only selected', }, + upgradeModePlaceholder: { + exclude: 'Selected plugins will not auto-update', + partial: 'Only selected plugins will auto-update. No plugins are currently selected, so no plugins will auto-update.', + }, }, pluginInfoModal: { title: 'Plugin info', diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index b650e857a7..f2a4fd5173 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -151,6 +151,10 @@ const translation = { exclude: '排除选定', partial: '仅选定', }, + upgradeModePlaceholder: { + exclude: '选定的插件将不会自动更新', + partial: '仅选定的插件将自动更新。目前未选择任何插件,因此不会自动更新任何插件。', + }, }, pluginInfoModal: { title: '插件信息',