Skip to content

Commit d1cc68c

Browse files
authored
feat: create preheat remove Content For Calculating Task ID (#555)
Signed-off-by: zhaoxinxin <1186037180@qq.com>
1 parent 365b638 commit d1cc68c

File tree

14 files changed

+2061
-1011
lines changed

14 files changed

+2061
-1011
lines changed

cypress/e2e/job/preheats/create-preheat.cy.ts

Lines changed: 282 additions & 65 deletions
Large diffs are not rendered by default.

cypress/e2e/job/preheats/preheat.cy.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ describe('Preheat', () => {
114114
cy.get('#url-1').should('have.text', 'https://example.com/path/to/file/url-1');
115115
cy.get('#url-2').should('have.text', 'https://example.com/path/to/file/url-2');
116116

117-
// Show preheat content for calculating task id
118-
cy.get('#content-for-calculating-task-id').should('have.text', '-');
119-
120117
cy.get('#piece-length').should('have.text', '4 MiB');
121118

122119
// Show preheat tag.
@@ -292,9 +289,6 @@ describe('Preheat', () => {
292289
// Show preheat url.
293290
cy.get('#url').should('have.text', '-');
294291

295-
// Show preheat content for calculating task id
296-
cy.get('#content-for-calculating-task-id').should('have.text', '-');
297-
298292
// Show preheat piece length.
299293
cy.get('#piece-length').should('have.text', '-');
300294

@@ -307,6 +301,9 @@ describe('Preheat', () => {
307301
// Show preheat application.
308302
cy.get('#application').should('have.text', '-');
309303

304+
// Show preheat ips.
305+
cy.get('#ips').should('have.text', '-');
306+
310307
// Show preheat headers.
311308
cy.get('#headers').should('have.text', '-');
312309

@@ -363,15 +360,15 @@ describe('Preheat', () => {
363360
// Show preheat url.
364361
cy.get('#url').should('have.text', '-');
365362

366-
// Show preheat content for calculating task id
367-
cy.get('#content-for-calculating-task-id').should('have.text', '-');
368-
369363
// Show preheat piece length.
370364
cy.get('#piece-length').should('have.text', '-');
371365

372366
// Show preheat tag.
373367
cy.get('#tag').should('have.text', '-').should('have.text', '-');
374368

369+
// Show preheat ips.
370+
cy.get('#ips').should('have.text', '-');
371+
375372
// Show preheat headers.
376373
cy.get('#headers').should('have.text', '-');
377374

cypress/fixtures/job/preheats/create-preheat-content-for-calculating-task-id.json

Lines changed: 0 additions & 81 deletions
This file was deleted.

cypress/fixtures/job/preheats/create-preheat.json renamed to cypress/fixtures/job/preheats/create-preheat-file.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,6 @@
3333
"state": "PENDING",
3434
"updated_at": "2025-05-28T08:45:52.849258668Z"
3535
},
36-
"user_id": 0,
37-
"user": {
38-
"id": 0,
39-
"created_at": "0001-01-01T00:00:00Z",
40-
"updated_at": "0001-01-01T00:00:00Z",
41-
"is_del": 0,
42-
"email": "",
43-
"name": "",
44-
"avatar": "",
45-
"phone": "",
46-
"state": "",
47-
"location": "",
48-
"bio": "",
49-
"configs": null
50-
},
5136
"seed_peer_clusters": null,
5237
"scheduler_clusters": [
5338
{
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"id": 13,
3+
"created_at": "2025-07-08T12:22:42.892Z",
4+
"updated_at": "2025-07-08T12:22:42.892Z",
5+
"is_del": 0,
6+
"task_id": "group_152f6ada-efea-4cd6-a269-5ebb784a633a",
7+
"bio": "create preheat",
8+
"type": "preheat",
9+
"state": "PENDING",
10+
"args": {
11+
"application": "application-1",
12+
"concurrent_count": 1000,
13+
"count": null,
14+
"filtered_query_params": "X-Amz-Algorithm\u0026X-Amz-Credential\u0026X-Amz-Date\u0026X-Amz-Expires\u0026X-Amz-SignedHeaders\u0026X-Amz-Signature\u0026X-Amz-Security-Token\u0026X-Amz-User-Agent\u0026X-Goog-Algorithm\u0026X-Goog-Credential\u0026X-Goog-Date\u0026X-Goog-Expires\u0026X-Goog-SignedHeaders\u0026X-Goog-Signature\u0026OSSAccessKeyId\u0026Expires\u0026Signature\u0026SecurityToken\u0026AccessKeyId\u0026Signature\u0026Expires\u0026X-Obs-Date\u0026X-Obs-Security-Token\u0026q-sign-algorithm\u0026q-ak\u0026q-sign-time\u0026q-key-time\u0026q-header-list\u0026q-url-param-list\u0026q-signature\u0026x-cos-security-token\u0026ns",
15+
"headers": {},
16+
"ips": [
17+
"10.244.4.5",
18+
"10.244.4.3",
19+
"10.244.4.61",
20+
"10.244.4.62",
21+
"10.244.4.63",
22+
"10.244.4.64",
23+
"10.244.4.65",
24+
"10.244.4.66",
25+
"10.244.4.67",
26+
"10.244.4.68",
27+
"10.244.4.69",
28+
"10.244.4.70",
29+
"10.244.4.71"
30+
],
31+
"load_to_cache": false,
32+
"password": "root",
33+
"percentage": null,
34+
"piece_length": null,
35+
"platform": "linux/amd64",
36+
"scope": "single_seed_peer",
37+
"tag": "tag-1",
38+
"timeout": 3600000000000,
39+
"type": "image",
40+
"url": "https://ghcr.io/v2/dragonflyoss/scheduler/manifests/v2.1.0",
41+
"urls": null,
42+
"username": ""
43+
},
44+
"result": {
45+
"created_at": "2025-05-28T08:43:48.634389458Z",
46+
"group_uuid": "group_2d9ef907-744e-40c9-9943-3d14fd8cb389",
47+
"job_states": null,
48+
"state": "PENDING",
49+
"updated_at": "2025-05-28T08:45:52.849258668Z"
50+
},
51+
"scheduler_clusters": [
52+
{
53+
"id": 1
54+
}
55+
]
56+
}

src/assets/images/job/preheat/args.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading

src/components/job/preheats/index.tsx

Lines changed: 19 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export default function Preheats() {
338338
<Box id="preheats-list">
339339
{Array.isArray(allPreheats) &&
340340
allPreheats.map((item, index) => {
341-
return index !== allPreheats.length - 1 ? (
341+
return (
342342
<Box key={item.id} id={`list-${item.id}`}>
343343
<Box sx={{ display: 'flex', p: '0.8rem', alignItems: 'center' }}>
344344
<Box className={styles.information}>
@@ -350,9 +350,16 @@ export default function Preheats() {
350350
<Pending id={`PENDING-${item.id}`} className={styles.pendingIcon} />
351351
)}
352352
<Box className={styles.informationContent}>
353-
<Typography id={`id-${item?.id}`} variant="body1" fontFamily="mabry-bold">
354-
{item.id}
355-
</Typography>
353+
<RouterLink
354+
component={Link}
355+
id={`preheat-${item?.id}`}
356+
to={`/jobs/preheats/${item?.id}`}
357+
underline="hover"
358+
>
359+
<Typography id={`id-${item?.id}`} variant="body1" fontFamily="mabry-bold">
360+
{item.id}
361+
</Typography>
362+
</RouterLink>
356363
<Tooltip title={item.bio || '-'} placement="top" arrow>
357364
<Typography
358365
id={`description-${item?.id || 0}`}
@@ -385,59 +392,15 @@ export default function Preheats() {
385392
</RouterLink>
386393
</Box>
387394
</Box>
388-
<Divider
389-
sx={{
390-
borderStyle: 'dashed',
391-
borderColor: 'var(--palette-palette-divider)',
392-
borderWidth: '0px 0px thin',
393-
}}
394-
/>
395-
</Box>
396-
) : (
397-
<Box key={item.id} id={`list-${item.id}`} sx={{ display: 'flex', p: '0.8rem', alignItems: 'center' }}>
398-
<Box className={styles.information}>
399-
{item?.result?.state === 'SUCCESS' ? (
400-
<Success id={`SUCCESS-${item.id}`} className={styles.statusIcon} />
401-
) : item?.result?.state === 'FAILURE' ? (
402-
<Failure id={`FAILURE-${item.id}`} className={styles.statusIcon} />
403-
) : (
404-
<Pending id={`PENDING-${item.id}`} className={styles.pendingIcon} />
405-
)}
406-
<Box className={styles.informationContent}>
407-
<Typography id={`id-${item?.id}`} variant="body1" fontFamily="mabry-bold">
408-
{item.id}
409-
</Typography>
410-
<Tooltip title={item.bio || '-'} placement="top" arrow>
411-
<Typography
412-
id={`description-${item?.id || 0}`}
413-
variant="body2"
414-
className={styles.description}
415-
>
416-
{item.bio || '-'}
417-
</Typography>
418-
</Tooltip>
419-
</Box>
420-
</Box>
421-
<Box width="30%">
422-
<Chip
423-
id={`created_at-${item?.id}`}
424-
avatar={<MoreTimeIcon />}
425-
label={getDatetime(item.created_at) || '-'}
426-
variant="outlined"
427-
size="small"
395+
{index !== allPreheats.length - 1 && (
396+
<Divider
397+
sx={{
398+
borderStyle: 'dashed',
399+
borderColor: 'var(--palette-palette-divider)',
400+
borderWidth: '0px 0px thin',
401+
}}
428402
/>
429-
</Box>
430-
<Box width="10%" sx={{ display: 'flex', justifyContent: 'center' }}>
431-
<RouterLink
432-
component={Link}
433-
id={`preheat-${item?.id}`}
434-
to={`/jobs/preheats/${item?.id}`}
435-
underline="hover"
436-
sx={{ color: 'var(--palette-description-color)' }}
437-
>
438-
<Detail className={styles.detailIcon} />
439-
</RouterLink>
440-
</Box>
403+
)}
441404
</Box>
442405
);
443406
})}

src/components/job/preheats/new.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
margin: 0.8rem 0 !important;
7373
}
7474

75-
.contentForCalculatingTaskIDIcon {
75+
.fileIcon {
7676
width: 1.25rem;
7777
height: 1.25rem;
7878
margin-right: 0.4rem;

0 commit comments

Comments
 (0)