Skip to content

Commit 49c85e7

Browse files
authored
优化证书监控页 (#64)
1 parent 5acaf96 commit 49c85e7

File tree

2 files changed

+10
-45
lines changed

2 files changed

+10
-45
lines changed

src/pages/monitor/ssl/create.jsx

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export const CreateMonitorSSLRule = ({ type, handleList }) => {
5252

5353
const initBasicInfo =(selectedRow)=>{
5454
form.setFieldsValue({
55-
name: selectedRow.name,
5655
domain: selectedRow.domain,
5756
expectTime: selectedRow.expectTime,
5857
description: selectedRow.description,
@@ -168,38 +167,6 @@ export const CreateMonitorSSLRule = ({ type, handleList }) => {
168167
overflowY: 'auto',
169168
}}>
170169
<Form form={form} name="form_item_path" layout="vertical" onFinish={handleFormSubmit}>
171-
172-
<div>
173-
<strong style={{ fontSize: '20px' }}>基础配置</strong>
174-
<div style={{ display: 'flex' }}>
175-
<MyFormItem
176-
name="name"
177-
label="规则名称"
178-
style={{
179-
marginRight: '10px',
180-
width: '50%',
181-
}}
182-
rules={[
183-
{
184-
required: true,
185-
},
186-
]}
187-
>
188-
<Input
189-
value={spaceValue}
190-
onChange={handleInputChange}
191-
onKeyPress={handleKeyPress}
192-
disabled={type === 'update'} />
193-
</MyFormItem>
194-
195-
<MyFormItem name="description" label="描述" style={{width: '50%',}}>
196-
<Input />
197-
</MyFormItem>
198-
</div>
199-
</div>
200-
201-
<Divider />
202-
203170
<div>
204171
<strong style={{fontSize: '20px'}}>规则配置</strong>
205172
<div style={{display: 'flex', gap:'10px'}}>
@@ -230,9 +197,11 @@ export const CreateMonitorSSLRule = ({ type, handleList }) => {
230197
required: true,
231198
},
232199
]}>
233-
<InputNumber placeholder="输入阈值" addonBefore={
234-
"当证书有效期 <"
235-
}addonAfter={"天时, 触发告警"}/>
200+
<InputNumber
201+
style={{width: '100%'}}
202+
placeholder="输入阈值"
203+
addonBefore={"当证书有效期 <"}
204+
addonAfter={"天时, 触发告警"}/>
236205
</MyFormItem>
237206
</div>
238207

src/pages/monitor/ssl/index.jsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ export const MonitorSSL = () => {
88
const [selectedRow, setSelectedRow] = useState(null);
99
const [list, setList] = useState([]);
1010
const columns = [
11-
{
12-
title: '名称',
13-
dataIndex: 'name',
14-
key: 'name',
15-
width: 'auto',
16-
},
1711
{
1812
title: '域名',
1913
dataIndex: 'domain',
@@ -33,15 +27,17 @@ export const MonitorSSL = () => {
3327
},
3428
},
3529
{
36-
title: '证书剩余时间',
30+
title: '证书有效天数',
3731
dataIndex: 'timeRemaining',
3832
key: 'timeRemaining',
3933
width: 'auto',
4034
render: (text) => {
41-
if (!text) {
35+
if (text === undefined || text === null) {
4236
return '-';
4337
}
44-
return text+"天";
38+
return text < 0
39+
? <span style={{ color: 'red' }}>{`-${Math.abs(text)}天 (已过期)`}</span>
40+
: `${text}天`;
4541
},
4642
},
4743
{

0 commit comments

Comments
 (0)