mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 01:37:52 +02: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 {
|
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(),
|
||||||
|
@ -24,14 +24,23 @@ const Environments = (props) => {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Active',
|
name: 'Updated',
|
||||||
selector: row => row.environment.active ? 'Active' : 'Inactive',
|
selector: row => row.environment.updatedAt,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const conditionalRowStyles = [
|
||||||
|
{
|
||||||
|
when: row => !row.environment.active,
|
||||||
|
style: {
|
||||||
|
display: 'none'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const servicesComponent = ({ data }) => <Services services={data.services} />
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -45,6 +54,7 @@ const Environments = (props) => {
|
|||||||
expandableRows
|
expandableRows
|
||||||
expandableRowsComponent={servicesComponent}
|
expandableRowsComponent={servicesComponent}
|
||||||
expandableRowExpanded={servicesExpanded}
|
expandableRowExpanded={servicesExpanded}
|
||||||
|
conditionalRowStyles={conditionalRowStyles}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -18,8 +18,8 @@ const Services = (props) => {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Active',
|
name: 'Updated',
|
||||||
selector: row => row.active,
|
selector: row => row.updatedAt,
|
||||||
sortable: true
|
sortable: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user