@@ -414,49 +414,43 @@ export default class WMWorkerPoolEditor extends Component {
414
414
joinWorkerPoolId ( workerPool . workerPoolId1 , workerPool . workerPoolId2 ) !==
415
415
workerPoolId ;
416
416
const { provisionerId, workerType } = splitWorkerPoolId ( workerPoolId ) ;
417
+ const workerTypeUrl = `/provisioners/${ provisionerId } /worker-types/${ workerType } ` ;
418
+ const workerPoolUrl = `/worker-manager/${ encodeURIComponent ( workerPoolId ) } ` ;
417
419
const workerPoolStats = [
418
420
{
419
421
label : 'Pending Tasks' ,
420
422
value : pendingTasks ,
421
423
className : 'pendingTasks' ,
422
424
Icon : ClockOutlineIcon ,
423
- href : `/worker-manager/${ encodeURIComponent (
424
- workerPoolId
425
- ) } /pending-tasks`,
425
+ href : `${ workerTypeUrl } /pending-tasks` ,
426
426
} ,
427
427
{
428
428
label : 'Requested Capacity' ,
429
429
value : requestedCapacity ,
430
430
className : 'requestedCapacity' ,
431
431
Icon : TimerSandIcon ,
432
- href : `/provisioners/${ encodeURIComponent (
433
- provisionerId
434
- ) } /worker-types/${ encodeURIComponent ( workerType ) } ?filterBy=requested`,
432
+ href : `${ workerTypeUrl } ?filterBy=requested` ,
435
433
} ,
436
434
{
437
435
label : 'Running Capacity' ,
438
436
value : runningCapacity ,
439
437
className : 'runningCapacity' ,
440
438
Icon : RunIcon ,
441
- href : `/provisioners/${ encodeURIComponent (
442
- provisionerId
443
- ) } /worker-types/${ encodeURIComponent ( workerType ) } ?filterBy=running`,
439
+ href : `${ workerTypeUrl } ?filterBy=running` ,
444
440
} ,
445
441
{
446
442
label : 'Stopping Capacity' ,
447
443
value : stoppingCapacity ,
448
444
className : 'stoppingCapacity' ,
449
445
Icon : CloseIcon ,
450
- href : `/provisioners/${ encodeURIComponent (
451
- provisionerId
452
- ) } /worker-types/${ encodeURIComponent ( workerType ) } ?filterBy=stopping`,
446
+ href : `${ workerTypeUrl } ?filterBy=stopping` ,
453
447
} ,
454
448
{
455
449
label : 'Errors' ,
456
450
value : errorStats ?. totals ?. total ,
457
451
className : 'errorsTile' ,
458
452
Icon : MessageAlertIcon ,
459
- href : `/worker-manager/ ${ encodeURIComponent ( workerPoolId ) } /errors` ,
453
+ href : `${ workerPoolUrl } /errors` ,
460
454
} ,
461
455
] ;
462
456
@@ -515,9 +509,7 @@ export default class WMWorkerPoolEditor extends Component {
515
509
label = "Workers (Queue View)"
516
510
component = { Link }
517
511
clickable
518
- to = { `/provisioners/${ encodeURIComponent (
519
- provisionerId
520
- ) } /worker-types/${ encodeURIComponent ( workerType ) } `}
512
+ to = { workerTypeUrl }
521
513
/>
522
514
< Chip
523
515
size = "medium"
@@ -526,9 +518,7 @@ export default class WMWorkerPoolEditor extends Component {
526
518
label = "Workers (Worker Manager View)"
527
519
component = { Link }
528
520
clickable
529
- to = { `/worker-manager/${ encodeURIComponent (
530
- workerPoolId
531
- ) } /workers`}
521
+ to = { `${ workerPoolUrl } /workers` }
532
522
/>
533
523
</ div >
534
524
</ Fragment >
0 commit comments