@@ -18,24 +18,23 @@ import React from "react"
18
18
import { diff } from "json-diff"
19
19
import { Icons , Loading , Tooltip } from "@kui-shell/plugin-client-common"
20
20
import {
21
+ Button ,
21
22
Card ,
22
23
CardActions ,
23
24
CardBody ,
24
25
CardHeader ,
25
26
CardTitle ,
26
- KebabToggle ,
27
+ Chip ,
28
+ ChipGroup ,
27
29
Dropdown ,
28
30
DropdownItem ,
29
31
DropdownSeparator ,
30
- Title ,
31
- Button ,
32
+ KebabToggle ,
32
33
Select ,
33
- SelectVariant ,
34
34
SelectOption ,
35
+ Title ,
35
36
TreeView ,
36
37
TreeViewDataItem ,
37
- Chip ,
38
- ChipGroup ,
39
38
} from "@patternfly/react-core"
40
39
41
40
import ProfileSelect from "./ProfileSelect"
@@ -329,7 +328,7 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
329
328
return (
330
329
< Select
331
330
className = "codeflare--profile-explorer--select-status"
332
- variant = { SelectVariant . single }
331
+ variant = " single"
333
332
placeholderText = { < StatusTitle readiness = { this . props . profileStatus ?. readiness } /> }
334
333
label = "Status select"
335
334
onToggle = { this . _onToggle }
@@ -408,12 +407,20 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
408
407
} ,
409
408
}
410
409
411
- private form ( form : Record < string , string > ) {
410
+ /** Present a form using <Chip/> components */
411
+ private chips ( form : Record < string , string > ) {
412
412
return (
413
413
< ChipGroup numChips = { 10 } >
414
414
{ Object . entries ( form ) . map ( ( [ title , name ] ) => (
415
415
< Chip key = { title } isReadOnly textMaxWidth = "25ch" >
416
- < span className = "slightly-deemphasize" > { title } </ span > < span className = "semi-bold color-base0D" > { name } </ span >
416
+ < span className = "slightly-deemphasize" >
417
+ { title
418
+ . replace ( / ^ N u m b e r o f / , "" )
419
+ . replace ( / ( G P U | C P U ) s / , "$1" )
420
+ . replace ( / p e r W o r k e r $ / , "" )
421
+ . replace ( / M e m o r y / , "Mem" ) }
422
+ </ span > { " " }
423
+ < span className = "semi-bold color-base0D" > { name } </ span >
417
424
</ Chip >
418
425
) ) }
419
426
</ ChipGroup >
@@ -444,11 +451,11 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
444
451
return {
445
452
id,
446
453
title,
447
- //name: this.form(form),
448
- name : Array . isArray ( form ) ? form . join ( " ║ " ) : "" ,
449
- children : Array . isArray ( form )
454
+ // name: this.form(form),
455
+ name : Array . isArray ( form ) ? form . join ( " ║ " ) : this . chips ( form ) ,
456
+ /* children: Array.isArray(form)
450
457
? undefined
451
- : Object . entries ( form ) . map ( ( [ title , name ] ) => ( { title, name : this . leafFor ( name ) } ) ) ,
458
+ : Object.entries(form).map(([title, name]) => ({ title, name: this.leafFor(name) })),*/
452
459
}
453
460
} catch ( err ) {
454
461
return {
0 commit comments