diff --git a/controller/overview.go b/controller/overview.go index 2dfa1cd2..b07ff0ee 100644 --- a/controller/overview.go +++ b/controller/overview.go @@ -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, diff --git a/ui/src/Environments.js b/ui/src/Environments.js index 64705e15..cbd7694f 100644 --- a/ui/src/Environments.js +++ b/ui/src/Environments.js @@ -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, }, ] diff --git a/ui/src/Services.js b/ui/src/Services.js index 3b69b039..00d8a53e 100644 --- a/ui/src/Services.js +++ b/ui/src/Services.js @@ -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 =>