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