From 984455e815ae6c32dd1ee2e7ebfa408cc3c6fff7 Mon Sep 17 00:00:00 2001 From: Noe Date: Tue, 13 Feb 2024 15:20:58 +0100 Subject: [PATCH] V2 of front-end is ready --- .../dashboards/Installations/index.tsx | 12 +- .../src/content/dashboards/Log/Log.tsx | 11 +- .../dashboards/Overview/chartOptions.tsx | 11 + .../content/dashboards/Overview/overview.tsx | 518 ++++++++++-------- .../frontend-marios2/src/interfaces/Chart.tsx | 24 +- 5 files changed, 329 insertions(+), 247 deletions(-) diff --git a/typescript/frontend-marios2/src/content/dashboards/Installations/index.tsx b/typescript/frontend-marios2/src/content/dashboards/Installations/index.tsx index 42f8ba4ac..376a2d256 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Installations/index.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Installations/index.tsx @@ -104,7 +104,10 @@ function InstallationTabs() { value: 'live', label: }, - + { + value: 'overview', + label: + }, { value: 'batteryview', label: ( @@ -148,12 +151,7 @@ function InstallationTabs() { value: 'overview', label: }, - { - value: 'batteryview', - label: ( - - ) - }, + { value: 'log', label: diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx index cd9823a17..559c9debc 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx @@ -29,10 +29,17 @@ interface LogProps { function Log(props: LogProps) { const theme = useTheme(); + const searchParams = new URLSearchParams(location.search); + const openModal = searchParams.get('open'); + const [warnings, setWarnings] = useState([]); const [errors, setErrors] = useState([]); - const [errorButtonPressed, setErrorButtonPressed] = useState(false); - const [warningButtonPressed, setWarningButtonPressed] = useState(false); + const [errorButtonPressed, setErrorButtonPressed] = useState( + openModal === 'error' ? true : false + ); + const [warningButtonPressed, setWarningButtonPressed] = useState( + openModal === 'warning' ? true : false + ); const [updateCount, setUpdateCount] = useState(0); const navigate = useNavigate(); const tokencontext = useContext(TokenContext); diff --git a/typescript/frontend-marios2/src/content/dashboards/Overview/chartOptions.tsx b/typescript/frontend-marios2/src/content/dashboards/Overview/chartOptions.tsx index ccb93510b..037f835b8 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Overview/chartOptions.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Overview/chartOptions.tsx @@ -306,6 +306,17 @@ export const getChartOptions = ( } } }, + annotations: { + yaxis: [ + { + y: 0, + strokeDashArray: 0, + borderColor: '#d3d3d3', + borderWidth: 1, + yAxisIndex: 0 + } + ] + }, tooltip: { y: { formatter: function (val) { diff --git a/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx b/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx index 4f5061b72..39a5af4d5 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx @@ -444,20 +444,20 @@ function Overview(props: OverviewProps) { > - + {/**/} + {/* */} + {/**/} {dailyData && ( <>