mirror of
https://github.com/openziti/zrok.git
synced 2025-02-02 03:20:26 +01:00
uptime for services (#33)
This commit is contained in:
parent
95b4143a85
commit
477ff0f031
@ -8,7 +8,6 @@ import (
|
||||
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
|
||||
"github.com/openziti-test-kitchen/zrok/rest_server_zrok/operations/metadata"
|
||||
"github.com/sirupsen/logrus"
|
||||
"time"
|
||||
)
|
||||
|
||||
func overviewHandler(_ metadata.OverviewParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
||||
@ -30,7 +29,6 @@ func overviewHandler(_ metadata.OverviewParams, principal *rest_model_zrok.Princ
|
||||
logrus.Errorf("error finding services for environment '%v': %v", env.ZId, err)
|
||||
return metadata.NewOverviewInternalServerError()
|
||||
}
|
||||
logrus.Infof("updatedAt: %v", time.Since(env.UpdatedAt.UTC()))
|
||||
es := &rest_model_zrok.EnvironmentServices{
|
||||
Environment: &rest_model_zrok.Environment{
|
||||
Address: env.Address,
|
||||
|
@ -27,7 +27,7 @@ const Environments = (props) => {
|
||||
},
|
||||
{
|
||||
name: 'Uptime',
|
||||
selector: row => humanizeDuration(new Date().getTime() - row.environment.updatedAt),
|
||||
selector: row => humanizeDuration(Date.now() - row.environment.updatedAt),
|
||||
sortable: true,
|
||||
},
|
||||
]
|
||||
|
@ -2,6 +2,8 @@ import DataTable from 'react-data-table-component';
|
||||
import {Sparklines, SparklinesLine, SparklinesSpots} from 'react-sparklines';
|
||||
|
||||
const Services = (props) => {
|
||||
const humanizeDuration = require("humanize-duration")
|
||||
|
||||
const columns = [
|
||||
{
|
||||
name: 'Frontend',
|
||||
@ -13,6 +15,10 @@ const Services = (props) => {
|
||||
selector: row => row.backend,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'Uptime',
|
||||
selector: row => humanizeDuration(Date.now() - row.updatedAt),
|
||||
},
|
||||
{
|
||||
name: 'Activity',
|
||||
cell: row => <Sparklines data={row.metrics} height={20} limit={60}><SparklinesLine color={"#3b2693"}/><SparklinesSpots/></Sparklines>
|
||||
|
Loading…
Reference in New Issue
Block a user