diff --git a/changelog.md b/changelog.md index 0269b49..a1e7bfc 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ - Added lazyloading to URL and Servapp pages images - Added a dangerous IP detector that stops sending HTTP response to IPs that are abusing various shields features - Added a button in the servapp page to easily download the docker backup + - Redirect static folder to host if possible - Improve display or icons [fixes #121] - Refactored Mongo connection code [fixes #111] - Forward simultaneously TCP and UDP [fixes #122] diff --git a/client/src/pages/config/routes/routeoverview.jsx b/client/src/pages/config/routes/routeoverview.jsx index cceb7e5..f4a0ee2 100644 --- a/client/src/pages/config/routes/routeoverview.jsx +++ b/client/src/pages/config/routes/routeoverview.jsx @@ -52,14 +52,14 @@ const RouteOverview = ({ routeConfig }) => {
Monitoring
- - { +const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground, agglo}) => { const theme = useTheme(); const { primary, secondary } = theme.palette.text; const [dataMetrics, setDataMetrics] = useState([]); @@ -168,6 +168,35 @@ const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground}) => { }; const formaters = dataMetrics.map((data) => FormaterForMetric(data)); + + const getShowValue = (agglo, dataMetric, di) => { + let showValue; + + if(dataMetric.Values.length) { + if(agglo) { + let now = new Date(); + now.setHours(now.getHours()); + now.setMinutes(0); + now.setSeconds(0); + let key = "hour_" + toUTC(now, true); + + if(key in dataMetric.ValuesAggl) { + showValue = dataMetric.ValuesAggl[key].Value + } else { + showValue = 0; + } + + } else { + showValue = dataMetric.Values[dataMetric.Values.length - 1].Value + } + + return formaters[di](showValue); + } else { + showValue = formaters[di](0) + } + + return showValue; + } return { - {dataMetric.Values.length ?
{formaters[di](dataMetric.Values[dataMetric.Values.length - 1].Value)}
: formaters[di](0) + }}>{getShowValue(agglo, dataMetric, di)}
}
{ } -const MiniPlotComponent = ({ metrics, labels, noLabels, noBackground }) => { - const memoizedComponent = useMemo(() => <_MiniPlotComponent noBackground={noBackground} noLabels={noLabels} metrics={metrics} labels={labels} />, [metrics]); +const MiniPlotComponent = ({ metrics, labels, noLabels, noBackground, agglo }) => { + const memoizedComponent = useMemo(() => <_MiniPlotComponent noBackground={noBackground} agglo={agglo} noLabels={noLabels} metrics={metrics} labels={labels} />, [metrics]); return memoizedComponent; }; diff --git a/client/src/pages/home/index.jsx b/client/src/pages/home/index.jsx index da3113c..d15ebee 100644 --- a/client/src/pages/home/index.jsx +++ b/client/src/pages/home/index.jsx @@ -254,7 +254,7 @@ const HomePage = () => { }; const bigNb = { - fontSize: '24px', + fontSize: '23px', fontWeight: "bold", textAlign: "center", color: isDark ? "white" : "black", diff --git a/client/src/pages/servapps/containers/overview.jsx b/client/src/pages/servapps/containers/overview.jsx index c8d0c34..fed1c31 100644 --- a/client/src/pages/servapps/containers/overview.jsx +++ b/client/src/pages/servapps/containers/overview.jsx @@ -171,14 +171,14 @@ const ContainerOverview = ({ containerInfo, config, refresh, updatesAvailable, s
Monitoring
- - {
-