Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
02e300f0
Unverified
Commit
02e300f0
authored
Oct 14, 2022
by
zhu-mingye
Committed by
GitHub
Oct 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[optimization][web] Frontend code optimization (#1102)
* [Feature][*] Modify version into 0.6.8-SNAPSHOT * Frontend code optimization
parent
d76ccd50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
480 additions
and
474 deletions
+480
-474
index.tsx
dlink-web/src/pages/AlertGroup/index.tsx
+3
-3
AlertInstanceChooseForm.tsx
...ages/AlertInstance/components/AlertInstanceChooseForm.tsx
+20
-18
DingTalkForm.tsx
...k-web/src/pages/AlertInstance/components/DingTalkForm.tsx
+11
-11
EmailForm.tsx
dlink-web/src/pages/AlertInstance/components/EmailForm.tsx
+30
-28
FeiShuForm.tsx
dlink-web/src/pages/AlertInstance/components/FeiShuForm.tsx
+12
-12
WeChatForm.tsx
dlink-web/src/pages/AlertInstance/components/WeChatForm.tsx
+42
-42
index.tsx
dlink-web/src/pages/AlertInstance/index.tsx
+132
-132
NameSpaceForm.tsx
...ationCenter/NamespaceManager/components/NameSpaceForm.tsx
+1
-1
RoleForm.tsx
.../AuthenticationCenter/RoleManager/components/RoleForm.tsx
+1
-1
TenantForm.tsx
...henticationCenter/TenantManager/components/TenantForm.tsx
+1
-1
index.tsx
...eb/src/pages/AuthenticationCenter/TenantManager/index.tsx
+1
-1
PasswordForm.tsx
...henticationCenter/UserManager/components/PasswordForm.tsx
+1
-1
UserForm.tsx
.../AuthenticationCenter/UserManager/components/UserForm.tsx
+1
-1
index.tsx
...-web/src/pages/AuthenticationCenter/UserManager/index.tsx
+1
-1
ClusterForm.tsx
dlink-web/src/pages/Cluster/components/ClusterForm.tsx
+3
-3
index.tsx
dlink-web/src/pages/Cluster/index.tsx
+0
-0
ClusterConfigurationForm.tsx
...sterConfiguration/components/ClusterConfigurationForm.tsx
+2
-2
index.tsx
dlink-web/src/pages/ClusterConfiguration/index.tsx
+109
-110
DBForm.tsx
dlink-web/src/pages/DataBase/components/DBForm.tsx
+15
-13
index.tsx
dlink-web/src/pages/DataBase/index.tsx
+1
-1
DocumentForm.tsx
dlink-web/src/pages/Document/components/DocumentForm.tsx
+14
-13
index.tsx
dlink-web/src/pages/Document/index.tsx
+58
-58
FragmentForm.tsx
...eb/src/pages/FragmentVariable/components/FragmentForm.tsx
+7
-7
index.tsx
dlink-web/src/pages/FragmentVariable/index.tsx
+1
-1
JarForm.tsx
dlink-web/src/pages/Jar/components/JarForm.tsx
+6
-6
index.tsx
dlink-web/src/pages/Jar/index.tsx
+1
-1
index.tsx
dlink-web/src/pages/SettingCenter/FlinkSettings/index.tsx
+4
-4
index.tsx
dlink-web/src/pages/user/Login/index.tsx
+2
-2
No files found.
dlink-web/src/pages/AlertGroup/index.tsx
View file @
02e300f0
...
@@ -175,7 +175,7 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
...
@@ -175,7 +175,7 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
];
];
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProTable
<
AlertGroupTableListItem
>
<
ProTable
<
AlertGroupTableListItem
>
headerTitle="报警组管理"
headerTitle="报警组管理"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
...
@@ -290,7 +290,7 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
...
@@ -290,7 +290,7 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
modalVisible=
{
updateModalVisible
}
modalVisible=
{
updateModalVisible
}
values=
{
formValues
}
values=
{
formValues
}
/>
/>
):
null
}
)
:
null
}
<
Drawer
<
Drawer
width=
{
600
}
width=
{
600
}
visible=
{
!!
row
}
visible=
{
!!
row
}
...
@@ -317,4 +317,4 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
...
@@ -317,4 +317,4 @@ const AlertGroupTableList: React.FC<{}> = (props: any) => {
);
);
};
};
export default
connect()(AlertGroupTableList);
export default connect()(AlertGroupTableList);
dlink-web/src/pages/AlertInstance/components/AlertInstanceChooseForm.tsx
View file @
02e300f0
...
@@ -50,11 +50,11 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -50,11 +50,11 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
const
[
alertType
,
setAlertType
]
=
useState
<
string
>
();
const
[
alertType
,
setAlertType
]
=
useState
<
string
>
();
const
chooseOne
=
(
item
:
AlertConfig
)
=>
{
const
chooseOne
=
(
item
:
AlertConfig
)
=>
{
setAlertType
(
item
.
type
);
setAlertType
(
item
.
type
);
};
};
const
onSubmit
=
async
(
value
:
any
)
=>
{
const
onSubmit
=
async
(
value
:
any
)
=>
{
const
success
=
await
createOrModifyAlertInstance
(
value
);
const
success
=
await
createOrModifyAlertInstance
(
value
);
if
(
success
)
{
if
(
success
)
{
handleChooseModalVisible
();
handleChooseModalVisible
();
...
@@ -63,26 +63,26 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -63,26 +63,26 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
}
}
};
};
const
onTest
=
async
(
value
:
any
)
=>
{
const
onTest
=
async
(
value
:
any
)
=>
{
await
sendTest
(
value
);
await
sendTest
(
value
);
};
};
return
(
return
(
<
Modal
<
Modal
width=
{
800
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
title=
{
values
?.
id
?
'编辑报警实例'
:
'创建报警实例'
}
title=
{
values
?.
id
?
'编辑报警实例'
:
'创建报警实例'
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setAlertType
(
undefined
);
setAlertType
(
undefined
);
handleChooseModalVisible
();
handleChooseModalVisible
();
}
}
}
}
maskClosable
=
{
false
}
maskClosable
=
{
false
}
destroyOnClose
=
{
true
}
destroyOnClose
=
{
true
}
footer=
{
null
}
footer=
{
null
}
>
{
>
{
(
!
alertType
&&!
values
?.
id
)
&&
(<
List
(
!
alertType
&&
!
values
?.
id
)
&&
(<
List
grid=
{
{
grid=
{
{
gutter
:
16
,
gutter
:
16
,
xs
:
1
,
xs
:
1
,
...
@@ -93,8 +93,10 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -93,8 +93,10 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
xxl
:
4
,
xxl
:
4
,
}
}
}
}
dataSource=
{
ALERT_CONFIG_LIST
}
dataSource=
{
ALERT_CONFIG_LIST
}
renderItem=
{
(
item
:
AlertConfig
)
=>
(
renderItem=
{
(
item
:
AlertConfig
)
=>
(
<
List
.
Item
onClick=
{
()
=>
{
chooseOne
(
item
)}
}
>
<
List
.
Item
onClick=
{
()
=>
{
chooseOne
(
item
)
}
}
>
<
Card
>
<
Card
>
{
getAlertIcon
(
item
.
type
)
}
{
getAlertIcon
(
item
.
type
)
}
</
Card
>
</
Card
>
...
@@ -102,7 +104,7 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -102,7 +104,7 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
)
}
)
}
/>)
/>)
}
}
{
(
values
?.
type
==
ALERT_TYPE
.
DINGTALK
||
alertType
==
ALERT_TYPE
.
DINGTALK
)?
{
(
values
?.
type
==
ALERT_TYPE
.
DINGTALK
||
alertType
==
ALERT_TYPE
.
DINGTALK
)
?
<
DingTalkForm
<
DingTalkForm
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setAlertType
(
undefined
);
setAlertType
(
undefined
);
...
@@ -116,9 +118,9 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -116,9 +118,9 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
onTest=
{
(
value
)
=>
{
onTest=
{
(
value
)
=>
{
onTest
(
value
);
onTest
(
value
);
}
}
}
}
/>
:
undefined
/>
:
undefined
}
}
{
(
values
?.
type
==
ALERT_TYPE
.
WECHAT
||
alertType
==
ALERT_TYPE
.
WECHAT
)?
{
(
values
?.
type
==
ALERT_TYPE
.
WECHAT
||
alertType
==
ALERT_TYPE
.
WECHAT
)
?
<
WeChatForm
<
WeChatForm
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setAlertType
(
undefined
);
setAlertType
(
undefined
);
...
@@ -132,9 +134,9 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -132,9 +134,9 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
onTest=
{
(
value
)
=>
{
onTest=
{
(
value
)
=>
{
onTest
(
value
);
onTest
(
value
);
}
}
}
}
/>
:
undefined
/>
:
undefined
}
}
{
(
values
?.
type
==
ALERT_TYPE
.
FEISHU
||
alertType
==
ALERT_TYPE
.
FEISHU
)?
{
(
values
?.
type
==
ALERT_TYPE
.
FEISHU
||
alertType
==
ALERT_TYPE
.
FEISHU
)
?
<
FeiShuForm
<
FeiShuForm
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setAlertType
(
undefined
);
setAlertType
(
undefined
);
...
@@ -148,9 +150,9 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -148,9 +150,9 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
onTest=
{
(
value
)
=>
{
onTest=
{
(
value
)
=>
{
onTest
(
value
);
onTest
(
value
);
}
}
}
}
/>
:
undefined
/>
:
undefined
}
}
{
(
values
?.
type
==
ALERT_TYPE
.
EMAIL
||
alertType
==
ALERT_TYPE
.
EMAIL
)?
{
(
values
?.
type
==
ALERT_TYPE
.
EMAIL
||
alertType
==
ALERT_TYPE
.
EMAIL
)
?
<
EmailForm
<
EmailForm
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setAlertType
(
undefined
);
setAlertType
(
undefined
);
...
@@ -164,7 +166,7 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -164,7 +166,7 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
onTest=
{
(
value
)
=>
{
onTest=
{
(
value
)
=>
{
onTest
(
value
);
onTest
(
value
);
}
}
}
}
/>
:
undefined
/>
:
undefined
}
}
</
Modal
>
</
Modal
>
);
);
...
...
dlink-web/src/pages/AlertInstance/components/DingTalkForm.tsx
View file @
02e300f0
...
@@ -55,20 +55,20 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -55,20 +55,20 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
modalVisible
,
modalVisible
,
}
=
props
;
}
=
props
;
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
setFormVals
({...
formVals
,...
change
});
setFormVals
({...
formVals
,
...
change
});
};
};
const
sendTestForm
=
async
()
=>
{
const
sendTestForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
renderContent
=
(
vals
)
=>
{
const
renderContent
=
(
vals
)
=>
{
...
@@ -107,7 +107,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -107,7 +107,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
defaultChecked=
{
vals
.
isEnableProxy
}
/>
defaultChecked=
{
vals
.
isEnableProxy
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
vals
.
isEnableProxy
?
<>
{
vals
.
isEnableProxy
?
<>
<
Form
.
Item
<
Form
.
Item
name=
"proxy"
name=
"proxy"
label=
"代理"
label=
"代理"
...
@@ -131,7 +131,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -131,7 +131,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
label=
"密码"
label=
"密码"
>
>
<
Input
.
Password
placeholder=
"请输入password"
/>
<
Input
.
Password
placeholder=
"请输入password"
/>
</
Form
.
Item
></>
:
undefined
</
Form
.
Item
></>
:
undefined
}
}
<
Form
.
Item
<
Form
.
Item
name=
"isAtAll"
name=
"isAtAll"
...
@@ -162,7 +162,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -162,7 +162,7 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
label=
"展示方式"
label=
"展示方式"
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
>
>
<
Radio
.
Group
>
<
Radio
.
Group
>
<
Radio
value=
'markdown'
>
MarkDown
</
Radio
>
<
Radio
value=
'markdown'
>
MarkDown
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
...
@@ -186,10 +186,10 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -186,10 +186,10 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/AlertInstance/components/EmailForm.tsx
View file @
02e300f0
...
@@ -55,20 +55,20 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -55,20 +55,20 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
modalVisible
,
modalVisible
,
}
=
props
;
}
=
props
;
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
setFormVals
({...
formVals
,...
change
});
setFormVals
({...
formVals
,
...
change
});
};
};
const
sendTestForm
=
async
()
=>
{
const
sendTestForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
...
@@ -88,13 +88,15 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -88,13 +88,15 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
label=
"收件人"
label=
"收件人"
rules=
{
[{
required
:
true
,
message
:
'请输入收件人邮箱!多个英文逗号隔开'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入收件人邮箱!多个英文逗号隔开'
}]
}
>
>
<
Input
.
TextArea
placeholder=
"请输入收件人邮箱!多个英文逗号隔开!"
allowClear
autoSize=
{
{
minRows
:
1
,
maxRows
:
5
}
}
/>
<
Input
.
TextArea
placeholder=
"请输入收件人邮箱!多个英文逗号隔开!"
allowClear
autoSize=
{
{
minRows
:
1
,
maxRows
:
5
}
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"receiverCcs"
name=
"receiverCcs"
label=
"抄送人"
label=
"抄送人"
>
>
<
Input
.
TextArea
placeholder=
"请输入抄送人邮箱!多个英文逗号隔开!"
allowClear
autoSize=
{
{
minRows
:
1
,
maxRows
:
5
}
}
/>
<
Input
.
TextArea
placeholder=
"请输入抄送人邮箱!多个英文逗号隔开!"
allowClear
autoSize=
{
{
minRows
:
1
,
maxRows
:
5
}
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"serverHost"
name=
"serverHost"
...
@@ -126,21 +128,21 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -126,21 +128,21 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
</
Form
.
Item
>
</
Form
.
Item
>
{
vals
.
enableSmtpAuth
&&
{
vals
.
enableSmtpAuth
&&
<>
<>
<
Form
.
Item
<
Form
.
Item
name=
"User"
name=
"User"
label=
"邮箱用户名"
label=
"邮箱用户名"
rules=
{
[{
required
:
true
,
message
:
'请输入邮箱用户名!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入邮箱用户名!'
}]
}
>
>
<
Input
allowClear
placeholder=
"请输入邮箱用户名"
/>
<
Input
allowClear
placeholder=
"请输入邮箱用户名"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"Password"
name=
"Password"
label=
"邮箱密码"
label=
"邮箱密码"
rules=
{
[{
required
:
true
,
message
:
'请输入邮箱密码/授权码!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入邮箱密码/授权码!'
}]
}
>
>
<
Input
.
Password
allowClear
placeholder=
"请输入邮箱密码! 注意:密码为授权码"
/>
<
Input
.
Password
allowClear
placeholder=
"请输入邮箱密码! 注意:密码为授权码"
/>
</
Form
.
Item
>
</
Form
.
Item
>
</>
}
</>
}
<
Form
.
Item
<
Form
.
Item
name=
"starttlsEnable"
name=
"starttlsEnable"
label=
"是否开启tls证书验证"
label=
"是否开启tls证书验证"
...
@@ -155,7 +157,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -155,7 +157,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
defaultChecked=
{
vals
.
sslEnable
}
/>
defaultChecked=
{
vals
.
sslEnable
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
(
vals
.
sslEnable
)
&&
{
(
vals
.
sslEnable
)
&&
<
Form
.
Item
<
Form
.
Item
name=
"smtpSslTrust"
name=
"smtpSslTrust"
label=
"受信任域"
label=
"受信任域"
...
@@ -175,7 +177,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -175,7 +177,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
label=
"展示方式"
label=
"展示方式"
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
>
>
<
Radio
.
Group
>
<
Radio
.
Group
>
<
Radio
value=
'text'
>
文本
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
<
Radio
value=
'table'
>
表格
</
Radio
>
<
Radio
value=
'table'
>
表格
</
Radio
>
<
Radio
value=
'attachment'
>
附件
</
Radio
>
<
Radio
value=
'attachment'
>
附件
</
Radio
>
...
@@ -191,7 +193,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -191,7 +193,7 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Input
allowClear
placeholder=
"请输入XLS存放目录! 默认为 /tmp/xls"
/>
<
Input
allowClear
placeholder=
"请输入XLS存放目录! 默认为 /tmp/xls"
/>
</
Form
.
Item
>
</
Form
.
Item
>
</>
}
</>
}
</>
</>
);
);
...
@@ -212,10 +214,10 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -212,10 +214,10 @@ const EmailForm: React.FC<AlertInstanceFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/AlertInstance/components/FeiShuForm.tsx
View file @
02e300f0
...
@@ -55,20 +55,20 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -55,20 +55,20 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
modalVisible
,
modalVisible
,
}
=
props
;
}
=
props
;
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
setFormVals
({...
formVals
,...
change
});
setFormVals
({...
formVals
,
...
change
});
};
};
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
sendTestForm
=
async
()
=>
{
const
sendTestForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
getFieldsValue
();
const
fieldsValue
=
await
form
.
getFieldsValue
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
renderContent
=
(
vals
)
=>
{
const
renderContent
=
(
vals
)
=>
{
...
@@ -107,7 +107,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -107,7 +107,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
defaultChecked=
{
vals
.
isEnableProxy
}
/>
defaultChecked=
{
vals
.
isEnableProxy
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
vals
.
isEnableProxy
?
<>
{
vals
.
isEnableProxy
?
<>
<
Form
.
Item
<
Form
.
Item
name=
"proxy"
name=
"proxy"
label=
"代理"
label=
"代理"
...
@@ -131,7 +131,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -131,7 +131,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
label=
"密码"
label=
"密码"
>
>
<
Input
.
Password
placeholder=
"请输入password"
/>
<
Input
.
Password
placeholder=
"请输入password"
/>
</
Form
.
Item
></>
:
undefined
</
Form
.
Item
></>
:
undefined
}
}
<
Form
.
Item
<
Form
.
Item
name=
"isAtAll"
name=
"isAtAll"
...
@@ -139,7 +139,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -139,7 +139,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
defaultChecked=
{
vals
.
isAtAll
}
/>
defaultChecked=
{
vals
.
isAtAll
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
(
!
vals
.
isAtAll
)
&&
{
(
!
vals
.
isAtAll
)
&&
<
Form
.
Item
<
Form
.
Item
name=
"users"
name=
"users"
label=
"被@用户"
label=
"被@用户"
...
@@ -159,7 +159,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -159,7 +159,7 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
label=
"展示方式"
label=
"展示方式"
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
>
>
<
Radio
.
Group
>
<
Radio
.
Group
>
<
Radio
value=
'post'
>
富文本
</
Radio
>
<
Radio
value=
'post'
>
富文本
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
...
@@ -183,10 +183,10 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -183,10 +183,10 @@ const FeiShuForm: React.FC<AlertInstanceFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/AlertInstance/components/WeChatForm.tsx
View file @
02e300f0
...
@@ -55,19 +55,19 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -55,19 +55,19 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
modalVisible
,
modalVisible
,
}
=
props
;
}
=
props
;
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
setFormVals
({...
formVals
,...
change
});
setFormVals
({...
formVals
,
...
change
});
};
};
const
sendTestForm
=
async
()
=>
{
const
sendTestForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
handleTest
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
setFormVals
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
renderContent
=
(
vals
)
=>
{
const
renderContent
=
(
vals
)
=>
{
...
@@ -92,7 +92,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -92,7 +92,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Radio
value=
'群聊'
>
群聊
</
Radio
>
<
Radio
value=
'群聊'
>
群聊
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Form
.
Item
>
{
(
vals
.
sendType
==
"群聊"
)
?
{
(
vals
.
sendType
==
"群聊"
)
?
<>
<>
<
Form
.
Item
<
Form
.
Item
name=
"webhook"
name=
"webhook"
...
@@ -114,7 +114,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -114,7 +114,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
defaultChecked=
{
vals
.
isAtAll
}
/>
defaultChecked=
{
vals
.
isAtAll
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
(
!
vals
.
isAtAll
)
&&
{
(
!
vals
.
isAtAll
)
&&
<
Form
.
Item
<
Form
.
Item
name=
"users"
name=
"users"
label=
"被@用户"
label=
"被@用户"
...
@@ -124,44 +124,44 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -124,44 +124,44 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
</
Form
.
Item
>
</
Form
.
Item
>
}
}
</>
</>
:
:
<>
<>
<
Form
.
Item
<
Form
.
Item
name=
"corpId"
name=
"corpId"
label=
"企业Id"
label=
"企业Id"
rules=
{
[{
required
:
true
,
message
:
'请输入企业Id!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入企业Id!'
}]
}
>
>
<
Input
placeholder=
"请输入CorpId"
/>
<
Input
placeholder=
"请输入CorpId"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"secret"
name=
"secret"
label=
"密令"
label=
"密令"
rules=
{
[{
required
:
true
,
message
:
'请输入密令!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入密令!'
}]
}
>
>
<
Input
placeholder=
"请输入secret"
/>
<
Input
placeholder=
"请输入secret"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"users"
name=
"users"
label=
"用户"
label=
"用户"
rules=
{
[{
required
:
true
,
message
:
'请输入用户!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入用户!'
}]
}
>
>
<
Input
placeholder=
"请输入用户"
/>
<
Input
placeholder=
"请输入用户"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"agentId"
name=
"agentId"
label=
"代理ID"
label=
"代理ID"
rules=
{
[{
required
:
true
,
message
:
'请输入代理ID!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入代理ID!'
}]
}
>
>
<
Input
placeholder=
"请输入代理ID"
/>
<
Input
placeholder=
"请输入代理ID"
/>
</
Form
.
Item
>
</
Form
.
Item
>
</>
</>
}
}
<
Form
.
Item
<
Form
.
Item
name=
"msgtype"
name=
"msgtype"
label=
"展示方式"
label=
"展示方式"
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择展示方式!'
}]
}
>
>
<
Radio
.
Group
>
<
Radio
.
Group
>
<
Radio
value=
'markdown'
>
MarkDown
</
Radio
>
<
Radio
value=
'markdown'
>
MarkDown
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
<
Radio
value=
'text'
>
文本
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
...
@@ -192,10 +192,10 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -192,10 +192,10 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
title=
{
formVals
.
id
?
"维护报警实例配置"
:
"创建报警实例配置"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/AlertInstance/index.tsx
View file @
02e300f0
...
@@ -60,17 +60,17 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
...
@@ -60,17 +60,17 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
}
>
=
({
item
})
=>
(
}
>
=
({
item
})
=>
(
<
Dropdown
<
Dropdown
overlay=
{
overlay=
{
<
Menu
onClick=
{
({
key
})
=>
editAndDelete
(
key
,
item
)
}
>
<
Menu
onClick=
{
({
key
})
=>
editAndDelete
(
key
,
item
)
}
>
<
Menu
.
Item
key=
"edit"
>
编辑
</
Menu
.
Item
>
<
Menu
.
Item
key=
"edit"
>
编辑
</
Menu
.
Item
>
<
Menu
.
Item
key=
"delete"
>
删除
</
Menu
.
Item
>
<
Menu
.
Item
key=
"delete"
>
删除
</
Menu
.
Item
>
</
Menu
>
</
Menu
>
}
}
>
>
<
a
>
<
a
>
更多
<
DownOutlined
/>
更多
<
DownOutlined
/>
</
a
>
</
a
>
</
Dropdown
>
</
Dropdown
>
);
);
const
columns
:
ProColumns
<
AlertInstanceTableListItem
>
[]
=
[
const
columns
:
ProColumns
<
AlertInstanceTableListItem
>
[]
=
[
{
{
...
@@ -108,13 +108,13 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
...
@@ -108,13 +108,13 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
{
{
text
:
'DingTalk'
,
text
:
'DingTalk'
,
value
:
'DingTalk'
,
value
:
'DingTalk'
,
},{
},
{
text
:
'WeChat'
,
text
:
'WeChat'
,
value
:
'WeChat'
,
value
:
'WeChat'
,
},{
},
{
text
:
'FeiShu'
,
text
:
'FeiShu'
,
value
:
'FeiShu'
,
value
:
'FeiShu'
,
},{
},
{
text
:
'Email'
,
text
:
'Email'
,
value
:
'Email'
,
value
:
'Email'
,
}
}
...
@@ -176,131 +176,131 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
...
@@ -176,131 +176,131 @@ const AlertInstanceTableList: React.FC<{}> = (props: any) => {
render
:
(
_
,
record
)
=>
[
render
:
(
_
,
record
)
=>
[
<
a
<
a
onClick=
{
()
=>
{
onClick=
{
()
=>
{
handleModalVisible
(
true
);
handleModalVisible
(
true
);
setValues
(
record
);
setValues
(
record
);
}
}
}
}
>
>
配置
配置
</
a
>,
</
a
>,
<
MoreBtn
key=
"more"
item=
{
record
}
/>,
<
MoreBtn
key=
"more"
item=
{
record
}
/>,
],
],
},
},
];
];
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProTable
<
AlertInstanceTableListItem
>
<
ProTable
<
AlertInstanceTableListItem
>
headerTitle="报警实例管理"
headerTitle="报警实例管理"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
rowKey="id"
rowKey="id"
search=
{
{
search=
{
{
labelWidth
:
120
,
labelWidth
:
120
,
}
}
}
}
toolBarRender=
{
()
=>
[
toolBarRender=
{
()
=>
[
<
Button
type=
"primary"
onClick=
{
()
=>
handleModalVisible
(
true
)
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
handleModalVisible
(
true
)
}
>
<
PlusOutlined
/>
新建
<
PlusOutlined
/>
新建
</
Button
>,
</
Button
>,
]
}
]
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{...
params
,
sorter
,
filter
})
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{...
params
,
sorter
,
filter
})
}
columns=
{
columns
}
columns=
{
columns
}
rowSelection=
{
{
rowSelection=
{
{
onChange
:
(
_
,
selectedRows
)
=>
setSelectedRows
(
selectedRows
),
onChange
:
(
_
,
selectedRows
)
=>
setSelectedRows
(
selectedRows
),
}
}
}
}
/
>
/
>
{
selectedRowsState
?.
length
>
0
&&
(
{
selectedRowsState
?.
length
>
0
&&
(
<
FooterToolbar
<
FooterToolbar
extra=
{
extra=
{
<
div
>
<
div
>
已选择
<
a
style=
{
{
fontWeight
:
600
}
}
>
{
selectedRowsState
.
length
}
</
a
>
项
已选择
<
a
style=
{
{
fontWeight
:
600
}
}
>
{
selectedRowsState
.
length
}
</
a
>
项
<
span
>
<
span
>
被禁用的报警实例共
{
selectedRowsState
.
length
-
selectedRowsState
.
reduce
((
pre
,
item
)
=>
pre
+
(
item
.
enabled
?
1
:
0
),
0
)
}
人
被禁用的报警实例共
{
selectedRowsState
.
length
-
selectedRowsState
.
reduce
((
pre
,
item
)
=>
pre
+
(
item
.
enabled
?
1
:
0
),
0
)
}
人
</
span
>
</
span
>
</
div
>
</
div
>
}
}
>
>
<
Button
type=
"primary"
danger
<
Button
type=
"primary"
danger
onClick=
{
()
=>
{
onClick=
{
()
=>
{
Modal
.
confirm
({
Modal
.
confirm
({
title
:
'删除报警实例'
,
title
:
'删除报警实例'
,
content
:
'确定删除选中的报警实例吗?'
,
content
:
'确定删除选中的报警实例吗?'
,
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
onOk
:
async
()
=>
{
await
handleRemove
(
url
,
selectedRowsState
);
await
handleRemove
(
url
,
selectedRowsState
);
setSelectedRows
([]);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
actionRef
.
current
?.
reloadAndRest
?.();
}
}
});
});
}
}
}
}
>
>
批量删除
批量删除
</
Button
>
</
Button
>
<
Button
type=
"primary"
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
Modal
.
confirm
({
Modal
.
confirm
({
title
:
'启用报警实例'
,
title
:
'启用报警实例'
,
content
:
'确定启用选中的报警实例吗?'
,
content
:
'确定启用选中的报警实例吗?'
,
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
onOk
:
async
()
=>
{
await
updateEnabled
(
url
,
selectedRowsState
,
true
);
await
updateEnabled
(
url
,
selectedRowsState
,
true
);
setSelectedRows
([]);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
actionRef
.
current
?.
reloadAndRest
?.();
}
}
});
});
}
}
}
}
>
批量启用
</
Button
>
>
批量启用
</
Button
>
<
Button
danger
<
Button
danger
onClick=
{
()
=>
{
onClick=
{
()
=>
{
Modal
.
confirm
({
Modal
.
confirm
({
title
:
'禁用报警实例'
,
title
:
'禁用报警实例'
,
content
:
'确定禁用选中的报警实例吗?'
,
content
:
'确定禁用选中的报警实例吗?'
,
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
onOk
:
async
()
=>
{
await
updateEnabled
(
url
,
selectedRowsState
,
false
);
await
updateEnabled
(
url
,
selectedRowsState
,
false
);
setSelectedRows
([]);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
actionRef
.
current
?.
reloadAndRest
?.();
}
}
});
});
}
}
}
}
>
批量禁用
</
Button
>
>
批量禁用
</
Button
>
</
FooterToolbar
>
</
FooterToolbar
>
)
}
)
}
<
AlertInstanceChooseForm
onCancel=
{
()
=>
{
<
AlertInstanceChooseForm
onCancel=
{
()
=>
{
handleModalVisible
(
false
);
handleModalVisible
(
false
);
setValues
(
undefined
);
setValues
(
undefined
);
}
}
}
}
modalVisible=
{
modalVisible
}
modalVisible=
{
modalVisible
}
onSubmit=
{
()
=>
{
onSubmit=
{
()
=>
{
actionRef
.
current
?.
reloadAndRest
?.();
actionRef
.
current
?.
reloadAndRest
?.();
}
}
}
}
values=
{
values
}
values=
{
values
}
/>
/>
<
Drawer
<
Drawer
width=
{
600
}
width=
{
600
}
visible=
{
!!
row
}
visible=
{
!!
row
}
onClose=
{
()
=>
{
onClose=
{
()
=>
{
setRow
(
undefined
);
setRow
(
undefined
);
}
}
}
}
closable=
{
false
}
closable=
{
false
}
>
>
{
row
?.
name
&&
(
{
row
?.
name
&&
(
<
ProDescriptions
<
AlertInstanceTableListItem
>
<
ProDescriptions
<
AlertInstanceTableListItem
>
column=
{
2
}
column=
{
2
}
title=
{
row
?.
name
}
title=
{
row
?.
name
}
request=
{
async
()
=>
({
request=
{
async
()
=>
({
data
:
row
||
{},
data
:
row
||
{},
})
}
})
}
params=
{
{
params=
{
{
id
:
row
?.
name
,
id
:
row
?.
name
,
}
}
}
}
columns=
{
columns
}
columns=
{
columns
}
/
>
/
>
)
}
)
}
</
Drawer
>
</
Drawer
>
</
PageContainer
>
</
PageContainer
>
);
);
};
};
export default AlertInstanceTableList;
export default AlertInstanceTableList;
dlink-web/src/pages/AuthenticationCenter/NamespaceManager/components/NameSpaceForm.tsx
View file @
02e300f0
...
@@ -111,7 +111,7 @@ const NameSpaceForm: React.FC<TenantFormProps> = (props) => {
...
@@ -111,7 +111,7 @@ const NameSpaceForm: React.FC<TenantFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
640
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
l
(
'pages.nameSpace.update'
)
:
l
(
'pages.nameSpace.create'
)
}
title=
{
formVals
.
id
?
l
(
'pages.nameSpace.update'
)
:
l
(
'pages.nameSpace.create'
)
}
...
...
dlink-web/src/pages/AuthenticationCenter/RoleManager/components/RoleForm.tsx
View file @
02e300f0
...
@@ -148,7 +148,7 @@ const RoleForm: React.FC<TenantFormProps> = (props) => {
...
@@ -148,7 +148,7 @@ const RoleForm: React.FC<TenantFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1000
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
l
(
'pages.role.update'
)
:
l
(
'pages.role.create'
)
}
title=
{
formVals
.
id
?
l
(
'pages.role.update'
)
:
l
(
'pages.role.create'
)
}
...
...
dlink-web/src/pages/AuthenticationCenter/TenantManager/components/TenantForm.tsx
View file @
02e300f0
...
@@ -97,7 +97,7 @@ const TenantForm: React.FC<TenantFormProps> = (props) => {
...
@@ -97,7 +97,7 @@ const TenantForm: React.FC<TenantFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
640
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
intl
.
formatMessage
({
id
:
'pages.tenant.update'
})
:
intl
.
formatMessage
({
id
:
'pages.tenant.create'
})
}
title=
{
formVals
.
id
?
intl
.
formatMessage
({
id
:
'pages.tenant.update'
})
:
intl
.
formatMessage
({
id
:
'pages.tenant.create'
})
}
...
...
dlink-web/src/pages/AuthenticationCenter/TenantManager/index.tsx
View file @
02e300f0
...
@@ -84,7 +84,7 @@ const TenantFormList: React.FC<{}> = (props: any) => {
...
@@ -84,7 +84,7 @@ const TenantFormList: React.FC<{}> = (props: any) => {
const
handleGrantTenantForm
=
()
=>
{
const
handleGrantTenantForm
=
()
=>
{
return
(
return
(
<
Modal
title=
{
l
(
'pages.tenant.AssignUser'
)
}
visible=
{
handleGrantTenant
}
<
Modal
title=
{
l
(
'pages.tenant.AssignUser'
)
}
visible=
{
handleGrantTenant
}
destroyOnClose=
{
true
}
width=
{
"
1500px
"
}
destroyOnClose=
{
true
}
width=
{
"
90%
"
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setHandleGrantTenant
(
false
);
setHandleGrantTenant
(
false
);
}
}
}
}
...
...
dlink-web/src/pages/AuthenticationCenter/UserManager/components/PasswordForm.tsx
View file @
02e300f0
...
@@ -114,7 +114,7 @@ const PasswordForm: React.FC<PasswordFormProps> = (props) => {
...
@@ -114,7 +114,7 @@ const PasswordForm: React.FC<PasswordFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
l
(
'button.changePassword'
)
}
title=
{
l
(
'button.changePassword'
)
}
...
...
dlink-web/src/pages/AuthenticationCenter/UserManager/components/UserForm.tsx
View file @
02e300f0
...
@@ -122,7 +122,7 @@ const UserForm: React.FC<UserFormProps> = (props) => {
...
@@ -122,7 +122,7 @@ const UserForm: React.FC<UserFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
l
(
'pages.user.UserUpdateUser'
)
:
l
(
'pages.user.UserCreateUser'
)
}
title=
{
formVals
.
id
?
l
(
'pages.user.UserUpdateUser'
)
:
l
(
'pages.user.UserCreateUser'
)
}
...
...
dlink-web/src/pages/AuthenticationCenter/UserManager/index.tsx
View file @
02e300f0
...
@@ -89,7 +89,7 @@ const UserTableList: React.FC<{}> = (props: any) => {
...
@@ -89,7 +89,7 @@ const UserTableList: React.FC<{}> = (props: any) => {
const
handleGrantRoleForm
=
()
=>
{
const
handleGrantRoleForm
=
()
=>
{
return
(
return
(
<
Modal
title=
{
l
(
'pages.user.AssignRole'
)
}
visible=
{
handleGrantRole
}
destroyOnClose=
{
true
}
width=
{
"
1500px
"
}
<
Modal
title=
{
l
(
'pages.user.AssignRole'
)
}
visible=
{
handleGrantRole
}
destroyOnClose=
{
true
}
width=
{
"
90%
"
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setHandleGrantRole
(
false
);
setHandleGrantRole
(
false
);
}
}
}
}
...
...
dlink-web/src/pages/Cluster/components/ClusterForm.tsx
View file @
02e300f0
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
*/
*/
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Form
,
Button
,
Input
,
Modal
,
Select
,
Switch
}
from
'antd'
;
import
{
Button
,
Form
,
Input
,
Modal
,
Select
,
Switch
}
from
'antd'
;
import
{
ClusterTableListItem
}
from
"@/pages/Cluster/data"
;
import
{
ClusterTableListItem
}
from
"@/pages/Cluster/data"
;
import
{
RUN_MODE
}
from
"@/components/Studio/conf"
;
import
{
RUN_MODE
}
from
"@/components/Studio/conf"
;
...
@@ -154,7 +154,7 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
...
@@ -154,7 +154,7 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
640
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"修改集群"
:
"创建集群"
}
title=
{
formVals
.
id
?
"修改集群"
:
"创建集群"
}
...
...
dlink-web/src/pages/Cluster/index.tsx
View file @
02e300f0
This diff is collapsed.
Click to expand it.
dlink-web/src/pages/ClusterConfiguration/components/ClusterConfigurationForm.tsx
View file @
02e300f0
...
@@ -376,8 +376,8 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
...
@@ -376,8 +376,8 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"60%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
,
height
:
'600px'
,
overflowY
:
'auto'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护集群配置"
:
"创建集群配置"
}
title=
{
formVals
.
id
?
"维护集群配置"
:
"创建集群配置"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
...
...
dlink-web/src/pages/ClusterConfiguration/index.tsx
View file @
02e300f0
...
@@ -19,11 +19,10 @@
...
@@ -19,11 +19,10 @@
import
React
,
{
useRef
,
useState
}
from
"react"
;
import
React
,
{
useRef
,
useState
}
from
"react"
;
import
{
DownOutlined
,
HeartOutlined
,
PlusOutlined
,
UserOutlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ActionType
,
ProColumns
}
from
"@ant-design/pro-table"
;
import
ProTable
,
{
ActionType
,
ProColumns
}
from
"@ant-design/pro-table"
;
import
{
Button
,
message
,
Input
,
Drawer
,
Modal
,
Dropdown
,
Menu
}
from
'antd'
;
import
{
Button
,
Drawer
,
Dropdown
,
Menu
,
Modal
}
from
'antd'
;
import
{
PageContainer
,
FooterToolbar
}
from
'@ant-design/pro-layout'
;
import
{
FooterToolbar
,
PageContainer
}
from
'@ant-design/pro-layout'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
ProDescriptions
from
'@ant-design/pro-descriptions'
;
import
ProDescriptions
from
'@ant-design/pro-descriptions'
;
import
{
ClusterConfigurationTableListItem
}
from
"@/pages/ClusterConfiguration/data"
;
import
{
ClusterConfigurationTableListItem
}
from
"@/pages/ClusterConfiguration/data"
;
import
{
handleAddOrUpdate
,
handleRemove
,
queryData
,
updateEnabled
}
from
"@/components/Common/crud"
;
import
{
handleAddOrUpdate
,
handleRemove
,
queryData
,
updateEnabled
}
from
"@/components/Common/crud"
;
...
@@ -219,104 +218,104 @@ const ClusterConfigurationTableList: React.FC<{}> = (props: any) => {
...
@@ -219,104 +218,104 @@ const ClusterConfigurationTableList: React.FC<{}> = (props: any) => {
];
];
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProTable
<
ClusterConfigurationTableListItem
>
<
ProTable
<
ClusterConfigurationTableListItem
>
headerTitle="集群配置管理"
headerTitle="集群配置管理"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
rowKey="id"
rowKey="id"
search=
{
{
search=
{
{
labelWidth
:
120
,
labelWidth
:
120
,
}
}
}
}
toolBarRender=
{
()
=>
[
toolBarRender=
{
()
=>
[
<
Button
type=
"primary"
onClick=
{
()
=>
handleModalVisible
(
true
)
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
handleModalVisible
(
true
)
}
>
<
PlusOutlined
/>
新建
<
PlusOutlined
/>
新建
</
Button
>,
</
Button
>,
]
}
]
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{...
params
,
sorter
,
filter
})
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{...
params
,
sorter
,
filter
})
}
columns=
{
columns
}
columns=
{
columns
}
rowSelection=
{
{
rowSelection=
{
{
onChange
:
(
_
,
selectedRows
)
=>
setSelectedRows
(
selectedRows
),
onChange
:
(
_
,
selectedRows
)
=>
setSelectedRows
(
selectedRows
),
}
}
}
}
/
>
/
>
{
selectedRowsState
?.
length
>
0
&&
(
{
selectedRowsState
?.
length
>
0
&&
(
<
FooterToolbar
<
FooterToolbar
extra=
{
extra=
{
<
div
>
<
div
>
已选择
<
a
style=
{
{
fontWeight
:
600
}
}
>
{
selectedRowsState
.
length
}
</
a
>
项
已选择
<
a
style=
{
{
fontWeight
:
600
}
}
>
{
selectedRowsState
.
length
}
</
a
>
项
<
span
>
<
span
>
被禁用的集群配置共
{
selectedRowsState
.
length
-
selectedRowsState
.
reduce
((
pre
,
item
)
=>
pre
+
(
item
.
enabled
?
1
:
0
),
0
)
}
人
被禁用的集群配置共
{
selectedRowsState
.
length
-
selectedRowsState
.
reduce
((
pre
,
item
)
=>
pre
+
(
item
.
enabled
?
1
:
0
),
0
)
}
人
</
span
>
</
span
>
</
div
>
</
div
>
}
}
>
<
Button
type=
"primary"
danger
onClick=
{
()
=>
{
Modal
.
confirm
({
title
:
'删除集群配置'
,
content
:
'确定删除选中的集群配置吗?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
await
handleRemove
(
url
,
selectedRowsState
);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
}
});
}
}
>
>
<
Button
type=
"primary"
danger
批量删除
onClick=
{
()
=>
{
</
Button
>
Modal
.
confirm
({
<
Button
type=
"primary"
title
:
'删除集群配置'
,
onClick=
{
()
=>
{
content
:
'确定删除选中的集群配置吗?'
,
Modal
.
confirm
({
okText
:
'确认'
,
title
:
'启用集群配置'
,
cancelText
:
'取消'
,
content
:
'确定启用选中的集群配置吗?'
,
onOk
:
async
()
=>
{
okText
:
'确认'
,
await
handleRemove
(
url
,
selectedRowsState
);
cancelText
:
'取消'
,
setSelectedRows
([]);
onOk
:
async
()
=>
{
actionRef
.
current
?.
reloadAndRest
?.();
await
updateEnabled
(
url
,
selectedRowsState
,
true
);
}
setSelectedRows
([]);
});
actionRef
.
current
?.
reloadAndRest
?.();
}
}
}
>
});
批量删除
}
}
</
Button
>
>
批量启用
</
Button
>
<
Button
type=
"primary"
<
Button
danger
onClick=
{
()
=>
{
onClick=
{
()
=>
{
Modal
.
confirm
({
Modal
.
confirm
({
title
:
'启用集群配置'
,
title
:
'禁用集群配置'
,
content
:
'确定启用选中的集群配置吗?'
,
content
:
'确定禁用选中的集群配置吗?'
,
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
onOk
:
async
()
=>
{
await
updateEnabled
(
url
,
selectedRowsState
,
true
);
await
updateEnabled
(
url
,
selectedRowsState
,
false
);
setSelectedRows
([]);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
actionRef
.
current
?.
reloadAndRest
?.();
}
}
});
});
}
}
}
}
>
批量启用
</
Button
>
>
批量禁用
</
Button
>
<
Button
danger
</
FooterToolbar
>
onClick=
{
()
=>
{
)
}
Modal
.
confirm
({
<
ClusterConfigurationForm
title
:
'禁用集群配置'
,
onSubmit=
{
async
(
value
)
=>
{
content
:
'确定禁用选中的集群配置吗?'
,
const
success
=
await
handleAddOrUpdate
(
"api/clusterConfiguration"
,
value
);
okText
:
'确认'
,
if
(
success
)
{
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
await
updateEnabled
(
url
,
selectedRowsState
,
false
);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
}
});
}
}
>
批量禁用
</
Button
>
</
FooterToolbar
>
)
}
<
ClusterConfigurationForm
onSubmit=
{
async
(
value
)
=>
{
const
success
=
await
handleAddOrUpdate
(
"api/clusterConfiguration"
,
value
);
if
(
success
)
{
handleModalVisible
(
false
);
setFormValues
({});
if
(
actionRef
.
current
)
{
actionRef
.
current
.
reload
();
}
showClusterConfiguration
(
dispatch
);
}
}
}
onCancel=
{
()
=>
{
handleModalVisible
(
false
);
handleModalVisible
(
false
);
}
}
setFormValues
({});
modalVisible=
{
modalVisible
}
if
(
actionRef
.
current
)
{
values=
{
{}
}
actionRef
.
current
.
reload
();
/>
}
{
formValues
&&
Object
.
keys
(
formValues
).
length
?
(
showClusterConfiguration
(
dispatch
);
}
}
}
onCancel=
{
()
=>
{
handleModalVisible
(
false
);
}
}
modalVisible=
{
modalVisible
}
values=
{
{}
}
/>
{
formValues
&&
Object
.
keys
(
formValues
).
length
?
(
<
ClusterConfigurationForm
<
ClusterConfigurationForm
onSubmit=
{
async
(
value
)
=>
{
onSubmit=
{
async
(
value
)
=>
{
const
success
=
await
handleAddOrUpdate
(
"api/clusterConfiguration"
,
value
);
const
success
=
await
handleAddOrUpdate
(
"api/clusterConfiguration"
,
value
);
...
@@ -336,31 +335,31 @@ const ClusterConfigurationTableList: React.FC<{}> = (props: any) => {
...
@@ -336,31 +335,31 @@ const ClusterConfigurationTableList: React.FC<{}> = (props: any) => {
modalVisible=
{
updateModalVisible
}
modalVisible=
{
updateModalVisible
}
values=
{
formValues
}
values=
{
formValues
}
/>
/>
)
:
null
}
)
:
null
}
<
Drawer
<
Drawer
width=
{
600
}
width=
{
600
}
visible=
{
!!
row
}
visible=
{
!!
row
}
onClose=
{
()
=>
{
onClose=
{
()
=>
{
setRow
(
undefined
);
setRow
(
undefined
);
}
}
}
}
closable=
{
false
}
closable=
{
false
}
>
>
{
row
?.
name
&&
(
{
row
?.
name
&&
(
<
ProDescriptions
<
ClusterConfigurationTableListItem
>
<
ProDescriptions
<
ClusterConfigurationTableListItem
>
column=
{
2
}
column=
{
2
}
title=
{
row
?.
name
}
title=
{
row
?.
name
}
request=
{
async
()
=>
({
request=
{
async
()
=>
({
data
:
row
||
{},
data
:
row
||
{},
})
}
})
}
params=
{
{
params=
{
{
id
:
row
?.
name
,
id
:
row
?.
name
,
}
}
}
}
columns=
{
columns
}
columns=
{
columns
}
/
>
/
>
)
}
)
}
</
Drawer
>
</
Drawer
>
</
PageContainer
>
</
PageContainer
>
);
);
};
};
export default ClusterConfigurationTableList;
export default ClusterConfigurationTableList;
dlink-web/src/pages/DataBase/components/DBForm.tsx
View file @
02e300f0
...
@@ -35,7 +35,7 @@ export type UpdateFormProps = {
...
@@ -35,7 +35,7 @@ export type UpdateFormProps = {
values
:
Partial
<
DataBaseItem
>
;
values
:
Partial
<
DataBaseItem
>
;
};
};
const
data
:
any
=
[
const
data
:
any
=
[
{
{
type
:
'MySql'
,
type
:
'MySql'
,
},
},
...
@@ -76,11 +76,11 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -76,11 +76,11 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
const
[
dbType
,
setDbType
]
=
useState
<
string
>
();
const
[
dbType
,
setDbType
]
=
useState
<
string
>
();
const
chooseOne
=
(
item
:
DataBaseItem
)
=>
{
const
chooseOne
=
(
item
:
DataBaseItem
)
=>
{
setDbType
(
item
.
type
);
setDbType
(
item
.
type
);
};
};
const
onSubmit
=
async
(
value
:
any
)
=>
{
const
onSubmit
=
async
(
value
:
any
)
=>
{
const
success
=
await
createOrModifyDatabase
(
value
);
const
success
=
await
createOrModifyDatabase
(
value
);
if
(
success
)
{
if
(
success
)
{
handleChooseDBModalVisible
();
handleChooseDBModalVisible
();
...
@@ -89,25 +89,25 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -89,25 +89,25 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
}
}
};
};
const
onTest
=
async
(
value
:
any
)
=>
{
const
onTest
=
async
(
value
:
any
)
=>
{
await
testDatabaseConnect
(
value
);
await
testDatabaseConnect
(
value
);
};
};
return
(
return
(
<
Modal
<
Modal
width=
{
800
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
title=
{
values
.
id
?
'编辑数据源'
:
'创建数据源'
}
title=
{
values
.
id
?
'编辑数据源'
:
'创建数据源'
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setDbType
(
undefined
);
setDbType
(
undefined
);
handleChooseDBModalVisible
();
handleChooseDBModalVisible
();
}
}
}
}
maskClosable
=
{
false
}
maskClosable
=
{
false
}
destroyOnClose
=
{
true
}
destroyOnClose
=
{
true
}
footer=
{
null
}
footer=
{
null
}
>
{
>
{
(
!
dbType
&&!
values
.
id
)
&&
(<
List
(
!
dbType
&&
!
values
.
id
)
&&
(<
List
grid=
{
{
grid=
{
{
gutter
:
16
,
gutter
:
16
,
xs
:
1
,
xs
:
1
,
...
@@ -118,8 +118,10 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -118,8 +118,10 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
xxl
:
4
,
xxl
:
4
,
}
}
}
}
dataSource=
{
data
}
dataSource=
{
data
}
renderItem=
{
(
item
:
DataBaseItem
)
=>
(
renderItem=
{
(
item
:
DataBaseItem
)
=>
(
<
List
.
Item
onClick=
{
()
=>
{
chooseOne
(
item
)}
}
>
<
List
.
Item
onClick=
{
()
=>
{
chooseOne
(
item
)
}
}
>
<
Card
>
<
Card
>
<
Image
<
Image
height=
{
80
}
height=
{
80
}
...
@@ -134,8 +136,8 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -134,8 +136,8 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
}
}
<
DataBaseForm
<
DataBaseForm
onCancel=
{
()
=>
setDbType
(
undefined
)
}
onCancel=
{
()
=>
setDbType
(
undefined
)
}
modalVisible=
{
!!
values
.
type
||
!!
dbType
}
modalVisible=
{
!!
values
.
type
||
!!
dbType
}
type=
{
(
!
values
.
type
)
?
dbType
:
values
.
type
}
type=
{
(
!
values
.
type
)
?
dbType
:
values
.
type
}
values=
{
values
}
values=
{
values
}
onSubmit=
{
(
value
)
=>
{
onSubmit=
{
(
value
)
=>
{
onSubmit
(
value
);
onSubmit
(
value
);
...
...
dlink-web/src/pages/DataBase/index.tsx
View file @
02e300f0
...
@@ -86,7 +86,7 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
...
@@ -86,7 +86,7 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
};
};
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProList
<
ProList
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
toolBarRender=
{
()
=>
{
toolBarRender=
{
()
=>
{
...
...
dlink-web/src/pages/Document/components/DocumentForm.tsx
View file @
02e300f0
...
@@ -24,7 +24,7 @@ import {DocumentTableListItem} from "@/pages/Document/data";
...
@@ -24,7 +24,7 @@ import {DocumentTableListItem} from "@/pages/Document/data";
import
TextArea
from
"antd/es/input/TextArea"
;
import
TextArea
from
"antd/es/input/TextArea"
;
import
{
getDocumentFormData
,}
from
"@/pages/Document/function"
;
import
{
getDocumentFormData
,}
from
"@/pages/Document/function"
;
export
type
DocumentFormProps
=
{
export
type
DocumentFormProps
=
{
onCancel
:
(
flag
?:
boolean
)
=>
void
;
onCancel
:
(
flag
?:
boolean
)
=>
void
;
onSubmit
:
(
values
:
Partial
<
DocumentTableListItem
>
)
=>
void
;
onSubmit
:
(
values
:
Partial
<
DocumentTableListItem
>
)
=>
void
;
modalVisible
:
boolean
;
modalVisible
:
boolean
;
...
@@ -54,7 +54,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
...
@@ -54,7 +54,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
fillValue
:
props
.
values
.
fillValue
,
fillValue
:
props
.
values
.
fillValue
,
version
:
props
.
values
.
version
,
version
:
props
.
values
.
version
,
likeNum
:
props
.
values
.
likeNum
,
likeNum
:
props
.
values
.
likeNum
,
enabled
:
props
.
values
.
enabled
?
props
.
values
.
enabled
:
true
,
enabled
:
props
.
values
.
enabled
?
props
.
values
.
enabled
:
true
,
});
});
const
{
const
{
...
@@ -66,8 +66,8 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
...
@@ -66,8 +66,8 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
setFormVals
({...
formVals
,...
fieldsValue
});
setFormVals
({...
formVals
,
...
fieldsValue
});
handleSubmit
({...
formVals
,...
fieldsValue
});
handleSubmit
({...
formVals
,
...
fieldsValue
});
};
};
const
renderContent
=
(
formVals
)
=>
{
const
renderContent
=
(
formVals
)
=>
{
...
@@ -84,7 +84,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
...
@@ -84,7 +84,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
label=
"文档类型"
label=
"文档类型"
rules=
{
[{
required
:
true
,
message
:
'请选择该文档所属类型!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择该文档所属类型!'
}]
}
>
>
<
Select
allowClear
>
<
Select
allowClear
>
<
Option
value=
"Method"
>
Method
</
Option
>
<
Option
value=
"Method"
>
Method
</
Option
>
<
Option
value=
"Function"
>
Function
</
Option
>
<
Option
value=
"Function"
>
Function
</
Option
>
<
Option
value=
"Constructor"
>
Constructor
</
Option
>
<
Option
value=
"Constructor"
>
Constructor
</
Option
>
...
@@ -120,7 +120,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
...
@@ -120,7 +120,7 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
label=
"类型"
label=
"类型"
rules=
{
[{
required
:
true
,
message
:
'请选择该文档所属函数类型!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择该文档所属函数类型!'
}]
}
>
>
<
Select
allowClear
>
<
Select
allowClear
>
<
Option
value=
"优化参数"
>
优化参数
</
Option
>
<
Option
value=
"优化参数"
>
优化参数
</
Option
>
<
Option
value=
"建表语句"
>
建表语句
</
Option
>
<
Option
value=
"建表语句"
>
建表语句
</
Option
>
<
Option
value=
"CataLog"
>
CataLog
</
Option
>
<
Option
value=
"CataLog"
>
CataLog
</
Option
>
...
@@ -165,22 +165,23 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
...
@@ -165,22 +165,23 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
label=
"填充值"
label=
"填充值"
rules=
{
[{
required
:
true
,
message
:
'请输入填充值!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入填充值!'
}]
}
>
>
<
TextArea
placeholder=
"请输入填充值,编辑器内使用名称触发提示 eg: 如果希望在函数LTRIM(parms)中输入参数 则语法为: LTRIM(${1:}) 此时的1代表第一个光标 如需多个 数字+1即可 tab键切换光标 ; 如不需要参数则直接输入期望填充值"
<
TextArea
allowClear
placeholder=
"请输入填充值,编辑器内使用名称触发提示 eg: 如果希望在函数LTRIM(parms)中输入参数 则语法为: LTRIM(${1:}) 此时的1代表第一个光标 如需多个 数字+1即可 tab键切换光标 ; 如不需要参数则直接输入期望填充值"
autoSize=
{
{
minRows
:
3
,
maxRows
:
10
}
}
/>
allowClear
autoSize=
{
{
minRows
:
3
,
maxRows
:
10
}
}
/>
</
FormItem
>
</
FormItem
>
<
FormItem
<
FormItem
name=
"version"
name=
"version"
label=
"版本"
label=
"版本"
rules=
{
[{
required
:
true
,
message
:
'请选择该文档所属版本!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择该文档所属版本!'
}]
}
>
>
<
Select
allowClear
>
<
Select
allowClear
>
<
Option
value=
"1.11"
>
Flink-1.11
</
Option
>
<
Option
value=
"1.11"
>
Flink-1.11
</
Option
>
<
Option
value=
"1.12"
>
Flink-1.12
</
Option
>
<
Option
value=
"1.12"
>
Flink-1.12
</
Option
>
<
Option
value=
"1.13"
>
Flink-1.13
</
Option
>
<
Option
value=
"1.13"
>
Flink-1.13
</
Option
>
<
Option
value=
"1.14"
>
Flink-1.14
</
Option
>
<
Option
value=
"1.14"
>
Flink-1.14
</
Option
>
<
Option
value=
"1.15"
>
Flink-1.15
</
Option
>
<
Option
value=
"1.15"
>
Flink-1.15
</
Option
>
<
Option
value=
"ALL Version"
>
ALL Version
</
Option
>
<
Option
value=
"ALL Version"
>
ALL Version
</
Option
>
</
Select
>
</
Select
>
</
FormItem
>
</
FormItem
>
<
FormItem
<
FormItem
...
@@ -207,10 +208,10 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
...
@@ -207,10 +208,10 @@ const DocumentForm: React.FC<DocumentFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护文档"
:
"创建文档"
}
title=
{
formVals
.
id
?
"维护文档"
:
"创建文档"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/Document/index.tsx
View file @
02e300f0
...
@@ -140,58 +140,58 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
...
@@ -140,58 +140,58 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
},
{
},
{
text
:
'Property'
,
text
:
'Property'
,
value
:
'Property'
,
value
:
'Property'
,
},{
},
{
text
:
'Event'
,
text
:
'Event'
,
value
:
'Event'
,
value
:
'Event'
,
},{
},
{
text
:
'Operator'
,
text
:
'Operator'
,
value
:
'Operator'
,
value
:
'Operator'
,
},{
},
{
text
:
'Unit'
,
text
:
'Unit'
,
value
:
'Unit'
,
value
:
'Unit'
,
},{
},
{
text
:
'Value'
,
text
:
'Value'
,
value
:
'Value'
,
value
:
'Value'
,
},{
},
{
text
:
'Constant'
,
text
:
'Constant'
,
value
:
'Constant'
,
value
:
'Constant'
,
},{
},
{
text
:
'Enum'
,
text
:
'Enum'
,
value
:
'Enum'
,
value
:
'Enum'
,
},{
},
{
text
:
'EnumMember'
,
text
:
'EnumMember'
,
value
:
'EnumMember'
,
value
:
'EnumMember'
,
},{
},
{
text
:
'Keyword'
,
text
:
'Keyword'
,
value
:
'Keyword'
,
value
:
'Keyword'
,
},{
},
{
text
:
'Text'
,
text
:
'Text'
,
value
:
'Text'
,
value
:
'Text'
,
},{
},
{
text
:
'Color'
,
text
:
'Color'
,
value
:
'Color'
,
value
:
'Color'
,
},{
},
{
text
:
'File'
,
text
:
'File'
,
value
:
'File'
,
value
:
'File'
,
},{
},
{
text
:
'Reference'
,
text
:
'Reference'
,
value
:
'Reference'
,
value
:
'Reference'
,
},{
},
{
text
:
'Customcolor'
,
text
:
'Customcolor'
,
value
:
'Customcolor'
,
value
:
'Customcolor'
,
},{
},
{
text
:
'Folder'
,
text
:
'Folder'
,
value
:
'Folder'
,
value
:
'Folder'
,
},{
},
{
text
:
'TypeParameter'
,
text
:
'TypeParameter'
,
value
:
'TypeParameter'
,
value
:
'TypeParameter'
,
},{
},
{
text
:
'User'
,
text
:
'User'
,
value
:
'User'
,
value
:
'User'
,
},{
},
{
text
:
'Issue'
,
text
:
'Issue'
,
value
:
'Issue'
,
value
:
'Issue'
,
},{
},
{
text
:
'Snippet'
,
text
:
'Snippet'
,
value
:
'Snippet'
,
value
:
'Snippet'
,
},
},
...
@@ -288,87 +288,87 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
...
@@ -288,87 +288,87 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
{
{
text
:
'Batch/Streaming'
,
text
:
'Batch/Streaming'
,
value
:
'Batch/Streaming'
,
value
:
'Batch/Streaming'
,
},{
},
{
text
:
'Batch'
,
text
:
'Batch'
,
value
:
'Batch'
,
value
:
'Batch'
,
},{
},
{
text
:
'Streaming'
,
text
:
'Streaming'
,
value
:
'Streaming'
,
value
:
'Streaming'
,
},{
},
{
text
:
'Other'
,
text
:
'Other'
,
value
:
'Other'
,
value
:
'Other'
,
},{
},
{
text
:
'比较函数'
,
text
:
'比较函数'
,
value
:
'比较函数'
,
value
:
'比较函数'
,
},{
},
{
text
:
'逻辑函数'
,
text
:
'逻辑函数'
,
value
:
'逻辑函数'
,
value
:
'逻辑函数'
,
},{
},
{
text
:
'算术函数'
,
text
:
'算术函数'
,
value
:
'算术函数'
,
value
:
'算术函数'
,
},{
},
{
text
:
'字符串函数'
,
text
:
'字符串函数'
,
value
:
'字符串函数'
,
value
:
'字符串函数'
,
},{
},
{
text
:
'时间函数'
,
text
:
'时间函数'
,
value
:
'时间函数'
,
value
:
'时间函数'
,
},{
},
{
text
:
'类型转换函数功能'
,
text
:
'类型转换函数功能'
,
value
:
'类型转换函数功能'
,
value
:
'类型转换函数功能'
,
},{
},
{
text
:
'条件函数'
,
text
:
'条件函数'
,
value
:
'条件函数'
,
value
:
'条件函数'
,
},{
},
{
text
:
'Collection 函数'
,
text
:
'Collection 函数'
,
value
:
'Collection 函数'
,
value
:
'Collection 函数'
,
},{
},
{
text
:
'Value Construction函数'
,
text
:
'Value Construction函数'
,
value
:
'Value Construction函数'
,
value
:
'Value Construction函数'
,
},{
},
{
text
:
'Value Access函数'
,
text
:
'Value Access函数'
,
value
:
'Value Access函数'
,
value
:
'Value Access函数'
,
},{
},
{
text
:
'分组函数'
,
text
:
'分组函数'
,
value
:
'分组函数'
,
value
:
'分组函数'
,
},{
},
{
text
:
'hash函数'
,
text
:
'hash函数'
,
value
:
'hash函数'
,
value
:
'hash函数'
,
},{
},
{
text
:
'聚合函数'
,
text
:
'聚合函数'
,
value
:
'聚合函数'
,
value
:
'聚合函数'
,
},{
},
{
text
:
'列函数'
,
text
:
'列函数'
,
value
:
'列函数'
,
value
:
'列函数'
,
},{
},
{
text
:
'表值聚合函数'
,
text
:
'表值聚合函数'
,
value
:
'表值聚合函数'
,
value
:
'表值聚合函数'
,
},{
},
{
text
:
'其他函数'
,
text
:
'其他函数'
,
value
:
'其他函数'
,
value
:
'其他函数'
,
},
},
],
],
filterMultiple
:
false
,
filterMultiple
:
false
,
valueEnum
:
{
valueEnum
:
{
'Batch/Streaming'
:
{
text
:
'Batch/Streaming'
},
'Batch/Streaming'
:
{
text
:
'Batch/Streaming'
},
'Batch'
:
{
text
:
'Batch'
},
'Batch'
:
{
text
:
'Batch'
},
'Streaming'
:
{
text
:
'Streaming'
},
'Streaming'
:
{
text
:
'Streaming'
},
'Other'
:
{
text
:
'Other'
},
'Other'
:
{
text
:
'Other'
},
'比较函数'
:
{
text
:
'比较函数'
},
'比较函数'
:
{
text
:
'比较函数'
},
'逻辑函数'
:
{
text
:
'逻辑函数'
},
'逻辑函数'
:
{
text
:
'逻辑函数'
},
'算术函数'
:
{
text
:
'算术函数'
},
'算术函数'
:
{
text
:
'算术函数'
},
'字符串函数'
:
{
text
:
'字符串函数'
},
'字符串函数'
:
{
text
:
'字符串函数'
},
'时间函数'
:
{
text
:
'时间函数'
},
'时间函数'
:
{
text
:
'时间函数'
},
'条件函数'
:
{
text
:
'条件函数'
},
'条件函数'
:
{
text
:
'条件函数'
},
'类型转换函数功能'
:
{
text
:
'类型转换函数功能'
},
'类型转换函数功能'
:
{
text
:
'类型转换函数功能'
},
'Collection 函数'
:
{
text
:
'Collection 函数'
},
'Collection 函数'
:
{
text
:
'Collection 函数'
},
'Value Construction函数'
:
{
text
:
'Value Construction函数'
},
'Value Construction函数'
:
{
text
:
'Value Construction函数'
},
'Value Access函数'
:
{
text
:
'Value Access函数'
},
'Value Access函数'
:
{
text
:
'Value Access函数'
},
'分组函数'
:
{
text
:
'分组函数'
},
'分组函数'
:
{
text
:
'分组函数'
},
'hash函数'
:
{
text
:
'hash函数'
},
'hash函数'
:
{
text
:
'hash函数'
},
'聚合函数'
:
{
text
:
'聚合函数'
},
'聚合函数'
:
{
text
:
'聚合函数'
},
'列函数'
:
{
text
:
'列函数'
},
'列函数'
:
{
text
:
'列函数'
},
'表值聚合函数'
:
{
text
:
'表值聚合函数'
},
'表值聚合函数'
:
{
text
:
'表值聚合函数'
},
'其他函数'
:
{
text
:
'其他函数'
},
'其他函数'
:
{
text
:
'其他函数'
},
},
},
},
},
{
{
...
@@ -473,7 +473,7 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
...
@@ -473,7 +473,7 @@ const DocumentTableList: React.FC<{}> = (props: any) => {
];
];
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProTable
<
DocumentTableListItem
>
<
ProTable
<
DocumentTableListItem
>
headerTitle="文档管理"
headerTitle="文档管理"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
...
...
dlink-web/src/pages/FragmentVariable/components/FragmentForm.tsx
View file @
02e300f0
...
@@ -22,7 +22,7 @@ import {Button, Form, Input, Modal, Switch} from 'antd';
...
@@ -22,7 +22,7 @@ import {Button, Form, Input, Modal, Switch} from 'antd';
import
TextArea
from
"antd/es/input/TextArea"
;
import
TextArea
from
"antd/es/input/TextArea"
;
import
{
FragmentVariableTableListItem
}
from
"@/pages/FragmentVariable/data"
;
import
{
FragmentVariableTableListItem
}
from
"@/pages/FragmentVariable/data"
;
export
type
FragmentFormProps
=
{
export
type
FragmentFormProps
=
{
onCancel
:
(
flag
?:
boolean
)
=>
void
;
onCancel
:
(
flag
?:
boolean
)
=>
void
;
onSubmit
:
(
values
:
Partial
<
FragmentVariableTableListItem
>
)
=>
void
;
onSubmit
:
(
values
:
Partial
<
FragmentVariableTableListItem
>
)
=>
void
;
modalVisible
:
boolean
;
modalVisible
:
boolean
;
...
@@ -38,7 +38,7 @@ const formLayout = {
...
@@ -38,7 +38,7 @@ const formLayout = {
wrapperCol
:
{
span
:
13
},
wrapperCol
:
{
span
:
13
},
};
};
const
FragmentForm
:
React
.
FC
<
FragmentFormProps
>
=
(
props
:
any
)
=>
{
const
FragmentForm
:
React
.
FC
<
FragmentFormProps
>
=
(
props
:
any
)
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
formVals
,
setFormVals
]
=
useState
<
Partial
<
FragmentVariableTableListItem
>>
({
const
[
formVals
,
setFormVals
]
=
useState
<
Partial
<
FragmentVariableTableListItem
>>
({
...
@@ -62,11 +62,11 @@ const FragmentForm : React.FC<FragmentFormProps> = (props:any) => {
...
@@ -62,11 +62,11 @@ const FragmentForm : React.FC<FragmentFormProps> = (props:any) => {
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
fieldsValue
.
id
=
formVals
.
id
;
fieldsValue
.
id
=
formVals
.
id
;
setFormVals
({...
formVals
,...
fieldsValue
});
setFormVals
({...
formVals
,
...
fieldsValue
});
handleSubmit
({...
formVals
,...
fieldsValue
});
handleSubmit
({...
formVals
,
...
fieldsValue
});
};
};
const
renderContent
=
(
formVals
:
FragmentVariableTableListItem
)
=>
{
const
renderContent
=
(
formVals
:
FragmentVariableTableListItem
)
=>
{
return
(
return
(
<>
<>
<
FormItem
<
FormItem
...
@@ -120,10 +120,10 @@ const FragmentForm : React.FC<FragmentFormProps> = (props:any) => {
...
@@ -120,10 +120,10 @@ const FragmentForm : React.FC<FragmentFormProps> = (props:any) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护全局变量"
:
"新建全局变量"
}
title=
{
formVals
.
id
?
"维护全局变量"
:
"新建全局变量"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/FragmentVariable/index.tsx
View file @
02e300f0
...
@@ -183,7 +183,7 @@ const FragmentTableList: React.FC<{}> = (props: any) => {
...
@@ -183,7 +183,7 @@ const FragmentTableList: React.FC<{}> = (props: any) => {
];
];
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProTable
<
FragmentVariableTableListItem
>
<
ProTable
<
FragmentVariableTableListItem
>
headerTitle="全局变量列表"
headerTitle="全局变量列表"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
...
...
dlink-web/src/pages/Jar/components/JarForm.tsx
View file @
02e300f0
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
*/
*/
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Form
,
Button
,
Input
,
Modal
,
Select
,
Divider
,
Switch
}
from
'antd'
;
import
{
Button
,
Divider
,
Form
,
Input
,
Modal
,
Select
,
Switch
}
from
'antd'
;
import
{
JarTableListItem
}
from
"@/pages/Jar/data"
;
import
{
JarTableListItem
}
from
"@/pages/Jar/data"
;
export
type
JarFormProps
=
{
export
type
JarFormProps
=
{
...
@@ -42,12 +42,12 @@ const JarForm: React.FC<JarFormProps> = (props) => {
...
@@ -42,12 +42,12 @@ const JarForm: React.FC<JarFormProps> = (props) => {
id
:
props
.
values
.
id
,
id
:
props
.
values
.
id
,
name
:
props
.
values
.
name
,
name
:
props
.
values
.
name
,
alias
:
props
.
values
.
alias
,
alias
:
props
.
values
.
alias
,
type
:
props
.
values
.
type
?
props
.
values
.
type
:
'UserApp'
,
type
:
props
.
values
.
type
?
props
.
values
.
type
:
'UserApp'
,
path
:
props
.
values
.
path
,
path
:
props
.
values
.
path
,
mainClass
:
props
.
values
.
mainClass
,
mainClass
:
props
.
values
.
mainClass
,
paras
:
props
.
values
.
paras
,
paras
:
props
.
values
.
paras
,
note
:
props
.
values
.
note
,
note
:
props
.
values
.
note
,
enabled
:
props
.
values
.
enabled
?
props
.
values
.
enabled
:
true
,
enabled
:
props
.
values
.
enabled
?
props
.
values
.
enabled
:
true
,
});
});
const
{
const
{
...
@@ -139,10 +139,10 @@ const JarForm: React.FC<JarFormProps> = (props) => {
...
@@ -139,10 +139,10 @@ const JarForm: React.FC<JarFormProps> = (props) => {
return
(
return
(
<
Modal
<
Modal
width=
{
1200
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
}
}
destroyOnClose
destroyOnClose
title=
{
formVals
.
id
?
"维护Jar配置"
:
"创建Jar配置"
}
title=
{
formVals
.
id
?
"维护Jar配置"
:
"创建Jar配置"
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
footer=
{
renderFooter
()
}
footer=
{
renderFooter
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
onCancel=
{
()
=>
handleModalVisible
()
}
...
...
dlink-web/src/pages/Jar/index.tsx
View file @
02e300f0
...
@@ -228,7 +228,7 @@ const JarTableList: React.FC<{}> = (props: any) => {
...
@@ -228,7 +228,7 @@ const JarTableList: React.FC<{}> = (props: any) => {
];
];
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
ProTable
<
JarTableListItem
>
<
ProTable
<
JarTableListItem
>
headerTitle="Jar 配置管理"
headerTitle="Jar 配置管理"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
...
...
dlink-web/src/pages/SettingCenter/FlinkSettings/index.tsx
View file @
02e300f0
...
@@ -27,7 +27,7 @@ import {loadSettings} from "@/pages/SettingCenter/FlinkSettings/function";
...
@@ -27,7 +27,7 @@ import {loadSettings} from "@/pages/SettingCenter/FlinkSettings/function";
type
SettingsProps
=
{
type
SettingsProps
=
{
dispatch
:
any
;
dispatch
:
any
;
};
};
const
Settings
:
React
.
FC
<
SettingsProps
>
=
(
props
)
=>
{
const
Settings
:
React
.
FC
<
SettingsProps
>
=
(
props
)
=>
{
...
@@ -37,9 +37,9 @@ const Settings: React.FC<SettingsProps> = (props) => {
...
@@ -37,9 +37,9 @@ const Settings: React.FC<SettingsProps> = (props) => {
return
(
return
(
<
PageContainer
>
<
PageContainer
title=
{
false
}
>
<
FlinkConfigView
/>
<
FlinkConfigView
/>
</
PageContainer
>
</
PageContainer
>
);
);
};
};
export
default
connect
(({
Settings
}:
{
Settings
:
SettingsStateType
})
=>
({
export
default
connect
(({
Settings
}:
{
Settings
:
SettingsStateType
})
=>
({
...
...
dlink-web/src/pages/user/Login/index.tsx
View file @
02e300f0
...
@@ -123,7 +123,7 @@ const Login: React.FC = () => {
...
@@ -123,7 +123,7 @@ const Login: React.FC = () => {
//const {code } = userLoginState;
//const {code } = userLoginState;
const
handleShowTenant
=
(
item
:
API
.
LoginParams
)
=>
{
const
handleShowTenant
=
()
=>
{
return
<>
return
<>
<
Modal
title=
{
intl
.
formatMessage
({
id
:
'pages.login.chooseTenant'
})
}
visible=
{
chooseTenant
}
destroyOnClose=
{
true
}
<
Modal
title=
{
intl
.
formatMessage
({
id
:
'pages.login.chooseTenant'
})
}
visible=
{
chooseTenant
}
destroyOnClose=
{
true
}
...
@@ -291,7 +291,7 @@ const Login: React.FC = () => {
...
@@ -291,7 +291,7 @@ const Login: React.FC = () => {
</
div
>
</
div
>
</
div
>
</
div
>
<
Footer
/>
<
Footer
/>
{
handleShowTenant
(
userParamsState
)
}
{
handleShowTenant
()
}
</
div
>
</
div
>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment