From c9fc9b4b456f2cc0daa0ed08994af2b9e269361f Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 11 Nov 2025 01:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=AE=A2=E9=98=85=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/crontab/index.tsx | 19 +++++++++++++++++++ src/pages/setting/index.tsx | 1 + 2 files changed, 20 insertions(+) diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index a9feda49..68aa7280 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -66,6 +66,7 @@ const SHOW_TAB_COUNT = 10; const Crontab = () => { const { headerStyle, isPhone, theme } = useOutletContext(); + const [allSubscriptions, setAllSubscriptions] = useState([]); const columns: ColumnProps[] = [ { title: intl.get('名称'), @@ -272,6 +273,12 @@ const Crontab = () => { title: intl.get('关联订阅'), width: 185, render: (text, record: any) => record?.subscription?.name || '-', + key: 'sub_id', + dataIndex: 'sub_id', + filters: allSubscriptions.map((sub) => ({ + text: sub.name || sub.alias, + value: sub.id, + })), }, { title: intl.get('操作'), @@ -794,8 +801,20 @@ const Crontab = () => { } }, [viewConf, enabledCronViews]); + const getAllSubscriptions = () => { + request + .get(`${config.apiPrefix}subscriptions`) + .then(({ code, data }) => { + if (code === 200) { + setAllSubscriptions(data || []); + } + }) + .catch(() => {}); + }; + useEffect(() => { getCronViews(); + getAllSubscriptions(); }, []); const viewAction = (key: string) => { diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx index b846b7ee..a3242536 100644 --- a/src/pages/setting/index.tsx +++ b/src/pages/setting/index.tsx @@ -49,6 +49,7 @@ const Setting = () => { reloadTheme, systemInfo, } = useOutletContext(); + console.log('user',user) const columns = [ { title: intl.get('名称'),