From 65814dd94235397b6e6d0a5225afafc666500357 Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 18 Oct 2024 19:45:23 +0200 Subject: [PATCH] Show Job Status in Footer --- Website/modules/Footer.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Website/modules/Footer.tsx b/Website/modules/Footer.tsx index 5ac8425..da59da2 100644 --- a/Website/modules/Footer.tsx +++ b/Website/modules/Footer.tsx @@ -1,9 +1,27 @@ import React, {useEffect} from 'react'; import '../styles/footer.css'; +import {Job} from './Job'; export default function Footer(){ + const [MonitoringJobsCount, setMonitoringJobsCount] = React.useState(0); + const [AllJobsCount, setAllJobsCount] = React.useState(0); + const [RunningJobsCount, setRunningJobsCount] = React.useState(0); + + function UpdateBackendState(){ + Job.GetMonitoringJobs().then((jobs) => setMonitoringJobsCount(jobs.length)); + Job.GetAllJobs().then((jobs) => setAllJobsCount(jobs.length)); + Job.GetRunningJobs().then((jobs) => setRunningJobsCount(jobs.length)); + } + + useEffect(() => { + UpdateBackendState(); + }, []); + return ( ) } \ No newline at end of file