From 518e8903a3473f900cbade3fd55a15304395f3c0 Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 17 Sep 2022 22:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9Modal=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/layouts/index.less | 4 - src/layouts/index.tsx | 11 +- src/pages/crontab/detail.tsx | 2 +- src/pages/crontab/logModal.tsx | 2 +- src/pages/crontab/modal.tsx | 4 +- src/pages/crontab/viewCreateModal.tsx | 2 +- src/pages/crontab/viewManageModal.tsx | 2 +- src/pages/dependence/index.tsx | 29 ++++-- src/pages/dependence/logModal.tsx | 2 +- src/pages/dependence/modal.tsx | 2 +- src/pages/env/editNameModal.tsx | 2 +- src/pages/env/modal.tsx | 2 +- src/pages/script/editModal.tsx | 2 +- src/pages/script/editNameModal.tsx | 2 +- src/pages/script/saveModal.tsx | 2 +- src/pages/script/setting.tsx | 2 +- src/pages/setting/appModal.tsx | 2 +- src/pages/setting/index.tsx | 143 ++++++++++++++------------ src/pages/subscription/logModal.tsx | 2 +- src/pages/subscription/modal.tsx | 2 +- 21 files changed, 122 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index c22b54bb..71f9e640 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "devDependencies": { "@ant-design/icons": "^4.7.0", "@ant-design/pro-layout": "^6.33.1", - "@monaco-editor/react": "^4.3.1", + "@monaco-editor/react": "4.2.1", "@sentry/react": "^7.12.1", "@types/body-parser": "^1.19.2", "@types/cors": "^2.8.12", diff --git a/src/layouts/index.less b/src/layouts/index.less index b8926978..02bebc34 100644 --- a/src/layouts/index.less +++ b/src/layouts/index.less @@ -326,10 +326,6 @@ background-color: #373739; } -.ant-layout-sider { - border-right: 1px solid rgba(0, 0, 0, 0.06) !important; -} - .ant-pro-sider-logo { padding: 16px 8px !important; diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index b37f7a43..6c013d86 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -136,7 +136,7 @@ export default function (props: any) { }, []); useEffect(() => { - if (!user) return; + if (!user || !user.username) return; ws.current = new SockJS( `${location.origin}/api/ws?token=${localStorage.getItem(config.authKey)}`, ); @@ -146,9 +146,9 @@ export default function (props: any) { const data = JSON.parse(e.data); if (data.type === 'ping') { if (data && data.message === 'hanhh') { - console.log('websocket连接成功', e); + console.log('WS connection succeeded !!!'); } else { - console.log('websocket连接失败', e); + console.log('WS connection Failed !!!', e); } } setSocketMessage(data); @@ -186,8 +186,9 @@ export default function (props: any) { if ( ['/login', '/initialization', '/error'].includes(props.location.pathname) ) { - document.title = `${(config.documentTitleMap as any)[props.location.pathname] - } - 控制面板`; + document.title = `${ + (config.documentTitleMap as any)[props.location.pathname] + } - 控制面板`; if ( systemInfo?.isInitialized && props.location.pathname === '/initialization' diff --git a/src/pages/crontab/detail.tsx b/src/pages/crontab/detail.tsx index fc9f3d01..df9da0ed 100644 --- a/src/pages/crontab/detail.tsx +++ b/src/pages/crontab/detail.tsx @@ -445,7 +445,7 @@ const CronDetailModal = ({ } centered - visible={visible} + open={visible} forceRender footer={false} onCancel={() => handleCancel()} diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index 32ad1d54..6d595b89 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -119,7 +119,7 @@ const CronLogModal = ({ return ( handleCancel()} diff --git a/src/pages/dependence/index.tsx b/src/pages/dependence/index.tsx index 6b39ed60..aab8e262 100644 --- a/src/pages/dependence/index.tsx +++ b/src/pages/dependence/index.tsx @@ -498,17 +498,24 @@ const Dependence = ({ headerStyle, isPhone, socketMessage }: any) => { size="small" tabPosition="top" onChange={onTabChange} - > - - {panelContent()} - - - {panelContent()} - - - {panelContent()} - - + items={[ + { + key: 'nodejs', + label: 'NodeJs', + children: panelContent(), + }, + { + key: 'python3', + label: 'Python3', + children: panelContent(), + }, + { + key: 'linux', + label: 'Linux', + children: panelContent(), + }, + ]} + /> handleCancel()} diff --git a/src/pages/setting/appModal.tsx b/src/pages/setting/appModal.tsx index b21b6a8d..1fff2b0e 100644 --- a/src/pages/setting/appModal.tsx +++ b/src/pages/setting/appModal.tsx @@ -46,7 +46,7 @@ const AppModal = ({ return ( - - - - - - - - - - - - - -
- - , + }, + { + key: 'app', + label: '应用设置', + children: ( +
- - - - setLogRemoveFrequency(value)} - /> - - - - - - - - - - - - + ), + }, + { + key: 'notification', + label: '通知设置', + children: , + }, + { + key: 'login', + label: '登录日志', + children: , + }, + { + key: 'other', + label: '其他设置', + children: ( +
+ + + + + + setLogRemoveFrequency(value)} + /> + + + + + + + + ), + }, + { + key: 'about', + label: '关于', + children: , + }, + ]} + > ) } - visible={visible} + open={visible} forceRender centered maskClosable={false}