Skip to content

Commit 717e65c

Browse files
authored
chore: rename cdn to seed peer, change ui and apis. (#36)
1 parent bb9e983 commit 717e65c

File tree

13 files changed

+170
-178
lines changed

13 files changed

+170
-178
lines changed

.umirc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default defineConfig({
4343
},
4444
{
4545
exact: true,
46-
path: '/configuration/cdn-cluster',
46+
path: '/configuration/seed-peer-cluster',
4747
component: '@/pages/cdn',
4848
},
4949
{

mock/data.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export const info = [
5151
en_US: 'Description',
5252
},
5353
{
54-
key: 'cdn_cluster_id',
55-
label: '关联CDN集群',
54+
key: 'seed_peer_cluster_id',
55+
label: '关联 seed peer 集群',
5656
type: 'select',
5757
tab: '1',
5858
props: {
59-
placeholder: 'Please enter CDN cluster ID',
59+
placeholder: 'Please enter seed peer cluster ID',
6060
},
61-
en_US: 'CDN Cluster',
61+
en_US: 'Seed Peer Cluster',
6262
},
6363
{
6464
key: 'security_group_id',
@@ -206,8 +206,8 @@ export const info = [
206206

207207
export const updateOptions = [
208208
{
209-
label: 'CDN Clusters',
210-
value: 'cdn_clusters',
209+
label: 'Seed Peer Clusters',
210+
value: 'seed_peer_clusters',
211211
type: 'select',
212212
},
213213
{
@@ -232,7 +232,7 @@ export const updateOptions = [
232232
},
233233
];
234234

235-
export const cdnOptions = [
235+
export const seedPeerOptions = [
236236
{
237237
label: 'Load Limit',
238238
value: 'load_limit',
@@ -244,7 +244,7 @@ export const cdnOptions = [
244244
},
245245
];
246246

247-
export const cdnInfo = [
247+
export const seedPeerInfo = [
248248
{
249249
key: 'id',
250250
label: '集群ID',
@@ -304,15 +304,15 @@ export const cdnInfo = [
304304
},
305305
en_US: 'Load Limit',
306306
},
307-
{
308-
key: 'net_topology',
309-
label: '',
310-
tab: '1',
311-
props: {
312-
placeholder: 'Please enter Net Topology, separated by "|" characters',
313-
},
314-
en_US: 'Net Topology',
315-
},
307+
// {
308+
// key: 'net_topology',
309+
// label: '',
310+
// tab: '1',
311+
// props: {
312+
// placeholder: 'Please enter Net Topology, separated by "|" characters',
313+
// },
314+
// en_US: 'Net Topology',
315+
// },
316316
{
317317
key: 'created_at',
318318
label: '创建时间',

src/layouts/index.jsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ export default function BasicLayout({
175175
Scheduler Cluster
176176
</Link>
177177
</Menu.Item>
178-
<Menu.Item key="cdn-cluster">
179-
<Link to="/configuration/cdn-cluster">CDN Cluster</Link>
178+
<Menu.Item key="seed-peer-cluster">
179+
<Link to="/configuration/seed-peer-cluster">Seed Peer Cluster</Link>
180180
</Menu.Item>
181181
{/* <Menu.Item key="application">
182182
<Link to="/configuration/application">Application</Link>
@@ -219,15 +219,12 @@ export default function BasicLayout({
219219
.replace(/^\S/, (s) => s.toUpperCase())}
220220
</Breadcrumb.Item>
221221
<Breadcrumb.Item key="bread_1">
222-
{key[0]
222+
{
223+
key[0]
223224
.split('-')
224-
.map((e) =>
225-
e.includes('cdn')
226-
? e.toUpperCase()
227-
: e.replace(/^\S/, (s) => s.toUpperCase()),
228-
)
229-
.toString()
230-
.replace(/,/, ' ')}
225+
.map((e) => e.replace(/^\S/, (s) => s.toUpperCase()))
226+
.join(' ')
227+
}
231228
</Breadcrumb.Item>
232229
</Breadcrumb>
233230
<Content

src/pages/application/index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export default function Application() {
2929
data: {},
3030
}); // infos
3131
const [schedulerClusters, setSchedulerClusters] = useState([]);
32-
const [cdnClusters, setCDNClusters] = useState([]);
32+
const [seedPeerClusters, setSeedPeerClusters] = useState([]);
3333

3434
useEffect(() => {
3535
getApps(1);
3636
const userInfo = decode(Cookies.get('jwt'), 'jwt') || {};
3737
setUserId(userInfo.id);
3838
getSchedulerClusters();
39-
getCDNClusters();
39+
getSeedPeerClusters();
4040
}, []);
4141

4242
const [form] = Form.useForm();
@@ -131,10 +131,10 @@ export default function Application() {
131131
}
132132
};
133133

134-
const getCDNClusters = async () => {
135-
const res = await request('/api/v1/cdn-clusters');
134+
const getSeedPeerClusters = async () => {
135+
const res = await request('/api/v1/seed-peer-clusters');
136136
if (res && res.length > 0) {
137-
setCDNClusters(
137+
setSeedPeerClusters(
138138
res.map((el) => {
139139
return {
140140
label: el.name,
@@ -187,10 +187,10 @@ export default function Application() {
187187
},
188188
},
189189
// {
190-
// title: 'CDN Clusters',
191-
// dataIndex: 'cdn_clusters',
190+
// title: 'Seed Peer Clusters',
191+
// dataIndex: 'seed_peer_clusters',
192192
// align: 'left',
193-
// key: 'cdn_clusters',
193+
// key: 'seed_peer_clusters',
194194
// width: 130,
195195
// ellipsis: true,
196196
// render: (v: any, r: any) => {
@@ -397,18 +397,18 @@ export default function Application() {
397397
/>
398398
</Form.Item>
399399
{/* <Form.Item
400-
name="cdn_clusters"
400+
name="seed_peer_clusters"
401401
style={{ marginBottom: 0 }}
402-
label="CDN Cluster"
402+
label="Seed Peer Cluster"
403403
>
404404
<Select
405405
mode="multiple"
406406
allowClear
407407
showArrow
408-
options={cdnClusters}
408+
options={seedPeerClusters}
409409
// onChange={(v: any) => {
410410
// form.setFieldsValue({
411-
// cdn_clusters: v,
411+
// seed_peer_clusters: v,
412412
// });
413413
// }}
414414
/>

0 commit comments

Comments
 (0)