Skip to content

Commit 131363d

Browse files
committed
feat: improve site list page, rule list page
1 parent f9ae159 commit 131363d

File tree

13 files changed

+64
-20
lines changed

13 files changed

+64
-20
lines changed

web/src/RuleEditPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class RuleEditPage extends React.Component {
193193
this.state.rule.type !== "WAF" && (this.state.rule.action === "Allow" || this.state.rule.action === "Block") && (
194194
<Row style={{marginTop: "20px"}}>
195195
<Col span={2} style={{marginTop: "5px"}}>
196-
{i18next.t("rule:Status Code")}:
196+
{i18next.t("rule:Status code")}:
197197
</Col>
198198
<Col span={22}>
199199
<InputNumber value={this.state.rule.statusCode} min={100} max={599} onChange={e => {

web/src/RuleListPage.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class RuleListPage extends BaseListPage {
108108
title: i18next.t("general:Owner"),
109109
dataIndex: "owner",
110110
key: "owner",
111-
width: "200px",
111+
width: "150px",
112112
sorter: (a, b) => a.owner.localeCompare(b.owner),
113113
},
114114
{
@@ -145,6 +145,7 @@ class RuleListPage extends BaseListPage {
145145
title: i18next.t("rule:Type"),
146146
dataIndex: "type",
147147
key: "type",
148+
width: "100px",
148149
sorter: (a, b) => a.type.localeCompare(b.type),
149150
render: (text, rule, index) => {
150151
return (
@@ -169,6 +170,27 @@ class RuleListPage extends BaseListPage {
169170
});
170171
},
171172
},
173+
{
174+
title: i18next.t("general:Action"),
175+
dataIndex: "action",
176+
key: "action",
177+
width: "100px",
178+
sorter: (a, b) => a.action.localeCompare(b.action),
179+
},
180+
{
181+
title: i18next.t("rule:Status code"),
182+
dataIndex: "statusCode",
183+
key: "statusCode",
184+
width: "120px",
185+
sorter: (a, b) => a.statusCode.localeCompare(b.statusCode),
186+
},
187+
{
188+
title: i18next.t("rule:Reason"),
189+
dataIndex: "reason",
190+
key: "reason",
191+
width: "300px",
192+
sorter: (a, b) => a.reason.localeCompare(b.reason),
193+
},
172194
{
173195
title: i18next.t("general:Action"),
174196
dataIndex: "",

web/src/SiteListPage.js

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,28 @@ class SiteListPage extends BaseListPage {
199199
});
200200
},
201201
},
202+
{
203+
title: i18next.t("general:Rules"),
204+
dataIndex: "rules",
205+
key: "rules",
206+
width: "120px",
207+
sorter: (a, b) => a.rules.localeCompare(b.rules),
208+
render: (text, record, index) => {
209+
if (!record.rules) {
210+
return null;
211+
}
212+
213+
return record.rules.map(rule => {
214+
return (
215+
<a key={rule} target="_blank" rel="noreferrer" href={`/rules/${rule}`}>
216+
<Tag color={"processing"}>
217+
{rule}
218+
</Tag>
219+
</a>
220+
);
221+
});
222+
},
223+
},
202224
{
203225
title: i18next.t("site:Host"),
204226
dataIndex: "host",
@@ -243,7 +265,7 @@ class SiteListPage extends BaseListPage {
243265
title: i18next.t("site:Nodes"),
244266
dataIndex: "nodes",
245267
key: "nodes",
246-
// width: "200px",
268+
width: "180px",
247269
sorter: (a, b) => a.nodes.length - b.nodes.length,
248270
render: (text, record, index) => {
249271
return record.nodes.map(node => {
@@ -315,13 +337,13 @@ class SiteListPage extends BaseListPage {
315337
// );
316338
// },
317339
// },
318-
{
319-
title: i18next.t("site:Mode"),
320-
dataIndex: "sslMode",
321-
key: "sslMode",
322-
width: "100px",
323-
sorter: (a, b) => a.sslMode.localeCompare(b.sslMode),
324-
},
340+
// {
341+
// title: i18next.t("site:Mode"),
342+
// dataIndex: "sslMode",
343+
// key: "sslMode",
344+
// width: "100px",
345+
// sorter: (a, b) => a.sslMode.localeCompare(b.sslMode),
346+
// },
325347
{
326348
title: i18next.t("site:SSL cert"),
327349
dataIndex: "sslCert",

web/src/components/IpRuleTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class IpRuleTable extends React.Component {
140140
mode="tags"
141141
style={{width: "100%"}}
142142
placeholder="Input IP Addresses"
143-
value={record.value.split(",")}
143+
value={record.value ? record.value.split(",") : []}
144144
onChange={value => this.updateField(table, index, "value", value)}
145145
options={this.state.options[index]}
146146
/>

web/src/locales/de/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"Rate": "Rate",
8484
"Reason": "Reason",
8585
"Rule": "Rule",
86-
"Status Code": "Status Code",
86+
"Status code": "Status code",
8787
"Type": "Type",
8888
"Value": "Value",
8989
"and": "and",

web/src/locales/en/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"Rate": "Rate",
8484
"Reason": "Reason",
8585
"Rule": "Rule",
86-
"Status Code": "Status Code",
86+
"Status code": "Status code",
8787
"Type": "Type",
8888
"Value": "Value",
8989
"and": "and",

web/src/locales/es/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"Rate": "Rate",
8484
"Reason": "Reason",
8585
"Rule": "Rule",
86-
"Status Code": "Status Code",
86+
"Status code": "Status code",
8787
"Type": "Type",
8888
"Value": "Value",
8989
"and": "and",

web/src/locales/fr/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"Rate": "Rate",
8484
"Reason": "Reason",
8585
"Rule": "Rule",
86-
"Status Code": "Status Code",
86+
"Status code": "Status code",
8787
"Type": "Type",
8888
"Value": "Value",
8989
"and": "and",

web/src/locales/id/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"Rate": "Rate",
8484
"Reason": "Reason",
8585
"Rule": "Rule",
86-
"Status Code": "Status Code",
86+
"Status code": "Status code",
8787
"Type": "Type",
8888
"Value": "Value",
8989
"and": "and",

web/src/locales/ja/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"Rate": "Rate",
8484
"Reason": "Reason",
8585
"Rule": "Rule",
86-
"Status Code": "Status Code",
86+
"Status code": "Status code",
8787
"Type": "Type",
8888
"Value": "Value",
8989
"and": "and",

0 commit comments

Comments
 (0)