mirror of
https://github.com/openziti/zrok.git
synced 2024-11-07 08:44:14 +01:00
lint and polish
This commit is contained in:
parent
17038dc4e7
commit
df59bb7dcf
@ -38,7 +38,6 @@ func overviewHandler(_ metadata.OverviewParams, principal *rest_model_zrok.Princ
|
||||
},
|
||||
}
|
||||
for _, svc := range svcs {
|
||||
logrus.Infof("active = %t", svc.Active)
|
||||
es.Services = append(es.Services, &rest_model_zrok.Service{
|
||||
Active: svc.Active,
|
||||
CreatedAt: svc.CreatedAt.String(),
|
||||
|
@ -24,14 +24,23 @@ const Environments = (props) => {
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'Active',
|
||||
selector: row => row.environment.active ? 'Active' : 'Inactive',
|
||||
name: 'Updated',
|
||||
selector: row => row.environment.updatedAt,
|
||||
sortable: true,
|
||||
},
|
||||
]
|
||||
|
||||
const conditionalRowStyles = [
|
||||
{
|
||||
when: row => !row.environment.active,
|
||||
style: {
|
||||
display: 'none'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
const servicesComponent = ({ data }) => <Services services={data.services} />
|
||||
const servicesExpanded = row => row.services != null && row.services.length > 0
|
||||
const servicesExpanded = row => row.services != null && row.services.length > 0 && row.services.some((row) => row.active)
|
||||
|
||||
return (
|
||||
<div>
|
||||
@ -45,6 +54,7 @@ const Environments = (props) => {
|
||||
expandableRows
|
||||
expandableRowsComponent={servicesComponent}
|
||||
expandableRowExpanded={servicesExpanded}
|
||||
conditionalRowStyles={conditionalRowStyles}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
@ -18,8 +18,8 @@ const Services = (props) => {
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'Active',
|
||||
selector: row => row.active,
|
||||
name: 'Updated',
|
||||
selector: row => row.updatedAt,
|
||||
sortable: true
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user