mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-11-03 09:05:07 +01:00
initial branch commit, improve countstate backend logic
- stacked component rough sketch - gql data request pipeline layed out
This commit is contained in:
@@ -35,7 +35,7 @@ export function scaleNumbers(x, y , p = '') {
|
||||
return Math.abs(rawYValue) >= 1000 ? `${rawXValue.toExponential()} / ${rawYValue.toExponential()}` : `${rawYValue.toString()} / ${rawYValue.toString()}`
|
||||
}
|
||||
|
||||
export function formatTime(t, forNode = false) {
|
||||
export function formatDurationTime(t, forNode = false) {
|
||||
if (t !== null) {
|
||||
if (isNaN(t)) {
|
||||
return t;
|
||||
@@ -51,6 +51,16 @@ export function formatTime(t, forNode = false) {
|
||||
}
|
||||
}
|
||||
|
||||
export function formatUnixTime(t) {
|
||||
if (t !== null) {
|
||||
if (isNaN(t)) {
|
||||
return t;
|
||||
} else {
|
||||
return new Date(t * 1000).toLocaleString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// const equalsCheck = (a, b) => {
|
||||
// return JSON.stringify(a) === JSON.stringify(b);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user