hide inactive services

This commit is contained in:
Michael Quigley 2022-08-05 14:28:21 -04:00
parent 347df266e9
commit 17038dc4e7
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 21 additions and 1 deletions

View File

@ -38,6 +38,7 @@ func overviewHandler(_ metadata.OverviewParams, principal *rest_model_zrok.Princ
}, },
} }
for _, svc := range svcs { for _, svc := range svcs {
logrus.Infof("active = %t", svc.Active)
es.Services = append(es.Services, &rest_model_zrok.Service{ es.Services = append(es.Services, &rest_model_zrok.Service{
Active: svc.Active, Active: svc.Active,
CreatedAt: svc.CreatedAt.String(), CreatedAt: svc.CreatedAt.String(),

View File

@ -16,13 +16,32 @@ const Services = (props) => {
name: 'Service Id', name: 'Service Id',
selector: row => row.zitiServiceId, selector: row => row.zitiServiceId,
sortable: true, sortable: true,
},
{
name: 'Active',
selector: row => row.active,
sortable: true
}
]
const conditionalRowStyles = [
{
when: row => !row.active,
style: {
display: 'none'
}
} }
] ]
return ( return (
<div className={"nested-services"}> <div className={"nested-services"}>
{ props.services && props.services.length > 0 && ( { props.services && props.services.length > 0 && (
<DataTable columns={columns} data={props.services} defaultSortFieldId={1}/> <DataTable
columns={columns}
data={props.services}
defaultSortFieldId={1}
conditionalRowStyles={conditionalRowStyles}
/>
)} )}
</div> </div>
) )