兼容Modal属性

This commit is contained in:
whyour 2022-09-17 22:50:58 +08:00
parent 6e56a55f6f
commit 518e8903a3
21 changed files with 122 additions and 101 deletions

View File

@ -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",

View File

@ -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;

View File

@ -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'

View File

@ -445,7 +445,7 @@ const CronDetailModal = ({
</div>
}
centered
visible={visible}
open={visible}
forceRender
footer={false}
onCancel={() => handleCancel()}

View File

@ -119,7 +119,7 @@ const CronLogModal = ({
return (
<Modal
title={titleElement()}
visible={visible}
open={visible}
centered
className="log-modal"
bodyStyle={{

View File

@ -48,7 +48,7 @@ const CronModal = ({
return (
<Modal
title={cron ? '编辑任务' : '新建任务'}
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}
@ -172,7 +172,7 @@ const CronLabelModal = ({
return (
<Modal
title="批量修改标签"
visible={visible}
open={visible}
footer={buttons}
centered
maskClosable={false}

View File

@ -138,7 +138,7 @@ const ViewCreateModal = ({
return (
<Modal
title={view ? '编辑视图' : '新建视图'}
visible={visible}
open={visible}
forceRender
width={580}
centered

View File

@ -212,7 +212,7 @@ const ViewManageModal = ({
return (
<Modal
title="视图管理"
visible={visible}
open={visible}
centered
width={620}
onCancel={() => handleCancel()}

View File

@ -498,17 +498,24 @@ const Dependence = ({ headerStyle, isPhone, socketMessage }: any) => {
size="small"
tabPosition="top"
onChange={onTabChange}
>
<Tabs.TabPane tab="NodeJs" key="nodejs">
{panelContent()}
</Tabs.TabPane>
<Tabs.TabPane tab="Python3" key="python3">
{panelContent()}
</Tabs.TabPane>
<Tabs.TabPane tab="Linux" key="linux">
{panelContent()}
</Tabs.TabPane>
</Tabs>
items={[
{
key: 'nodejs',
label: 'NodeJs',
children: panelContent(),
},
{
key: 'python3',
label: 'Python3',
children: panelContent(),
},
{
key: 'linux',
label: 'Linux',
children: panelContent(),
},
]}
/>
<DependenceModal
visible={isModalVisible}
handleCancel={handleCancel}

View File

@ -112,7 +112,7 @@ const DependenceLogModal = ({
return (
<Modal
title={titleElement()}
visible={visible}
open={visible}
centered
className="log-modal"
bodyStyle={{

View File

@ -71,7 +71,7 @@ const DependenceModal = ({
return (
<Modal
title={dependence ? '编辑依赖' : '新建依赖'}
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}

View File

@ -44,7 +44,7 @@ const EditNameModal = ({
return (
<Modal
title="修改环境变量名称"
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}

View File

@ -60,7 +60,7 @@ const EnvModal = ({
return (
<Modal
title={env ? '编辑变量' : '新建变量'}
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}

View File

@ -214,7 +214,7 @@ const EditModal = ({
width={'100%'}
headerStyle={{ padding: '11px 24px' }}
onClose={cancel}
visible={visible}
open={visible}
>
<SplitPane
split="vertical"

View File

@ -101,7 +101,7 @@ const EditScriptNameModal = ({
return (
<Modal
title="新建"
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}

View File

@ -41,7 +41,7 @@ const SaveModal = ({
return (
<Modal
title="保存文件"
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}

View File

@ -41,7 +41,7 @@ const SettingModal = ({
return (
<Modal
title="运行设置"
visible={visible}
open={visible}
forceRender
centered
onCancel={() => handleCancel()}

View File

@ -46,7 +46,7 @@ const AppModal = ({
return (
<Modal
title={app ? '编辑应用' : '新建应用'}
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}

View File

@ -333,70 +333,87 @@ const Setting = ({
size="small"
tabPosition="top"
onChange={tabChange}
>
<Tabs.TabPane tab="安全设置" key="security">
<SecuritySettings user={user} userChange={reloadUser} />
</Tabs.TabPane>
<Tabs.TabPane tab="应用设置" key="app">
<Table
columns={columns}
pagination={false}
dataSource={dataSource}
rowKey="id"
size="middle"
scroll={{ x: 768 }}
loading={loading}
/>
</Tabs.TabPane>
<Tabs.TabPane tab="通知设置" key="notification">
<NotificationSetting data={notificationInfo} />
</Tabs.TabPane>
<Tabs.TabPane tab="登录日志" key="login">
<LoginLog data={loginLogData} />
</Tabs.TabPane>
<Tabs.TabPane tab="其他设置" key="other">
<Form layout="vertical" form={form}>
<Form.Item
label="主题设置"
name="theme"
initialValue={defaultTheme}
>
<Radio.Group
options={optionsWithDisabled}
onChange={themeChange}
value={defaultTheme}
optionType="button"
buttonStyle="solid"
items={[
{
key: 'security',
label: '安全设置',
children: <SecuritySettings user={user} userChange={reloadUser} />,
},
{
key: 'app',
label: '应用设置',
children: (
<Table
columns={columns}
pagination={false}
dataSource={dataSource}
rowKey="id"
size="middle"
scroll={{ x: 768 }}
loading={loading}
/>
</Form.Item>
<Form.Item
label="日志删除频率"
name="frequency"
tooltip="每x天自动删除x天以前的日志"
>
<Input.Group compact>
<InputNumber
addonBefore="每"
addonAfter="天"
style={{ width: 150 }}
min={0}
value={logRemoveFrequency}
onChange={(value) => setLogRemoveFrequency(value)}
/>
<Button type="primary" onClick={updateRemoveLogFrequency}>
</Button>
</Input.Group>
</Form.Item>
<Form.Item label="检查更新" name="update">
<CheckUpdate socketMessage={socketMessage} />
</Form.Item>
</Form>
</Tabs.TabPane>
<Tabs.TabPane tab="关于" key="about">
<About />
</Tabs.TabPane>
</Tabs>
),
},
{
key: 'notification',
label: '通知设置',
children: <NotificationSetting data={notificationInfo} />,
},
{
key: 'login',
label: '登录日志',
children: <LoginLog data={loginLogData} />,
},
{
key: 'other',
label: '其他设置',
children: (
<Form layout="vertical" form={form}>
<Form.Item
label="主题设置"
name="theme"
initialValue={defaultTheme}
>
<Radio.Group
options={optionsWithDisabled}
onChange={themeChange}
value={defaultTheme}
optionType="button"
buttonStyle="solid"
/>
</Form.Item>
<Form.Item
label="日志删除频率"
name="frequency"
tooltip="每x天自动删除x天以前的日志"
>
<Input.Group compact>
<InputNumber
addonBefore="每"
addonAfter="天"
style={{ width: 150 }}
min={0}
value={logRemoveFrequency}
onChange={(value) => setLogRemoveFrequency(value)}
/>
<Button type="primary" onClick={updateRemoveLogFrequency}>
</Button>
</Input.Group>
</Form.Item>
<Form.Item label="检查更新" name="update">
<CheckUpdate socketMessage={socketMessage} />
</Form.Item>
</Form>
),
},
{
key: 'about',
label: '关于',
children: <About />,
},
]}
></Tabs>
<AppModal
visible={isModalVisible}
handleCancel={handleCancel}

View File

@ -93,7 +93,7 @@ const SubscriptionLogModal = ({
return (
<Modal
title={titleElement()}
visible={visible}
open={visible}
centered
className="log-modal"
bodyStyle={{

View File

@ -272,7 +272,7 @@ const SubscriptionModal = ({
</span>
)
}
visible={visible}
open={visible}
forceRender
centered
maskClosable={false}