diff --git a/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx b/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx index 9d1be1dc7..023be7bd5 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Overview/overview.tsx @@ -34,6 +34,8 @@ interface OverviewProps { s3Credentials: I_S3Credentials; id: number; device?: number; + connected?: boolean; + loading?: boolean; } const computeLast7Days = (): string[] => { @@ -104,6 +106,12 @@ function Overview(props: OverviewProps) { } }, [isZooming, dailyDataArray]); + useEffect(() => { + if (props.connected === false) { + setErrorDateModalOpen(false); + } + }, [props.connected]); + useEffect(() => { const resultPromise: Promise<{ chartData: chartDataInterface; @@ -121,8 +129,6 @@ function Overview(props: OverviewProps) { resultPromise .then((result) => { if (result.chartData.soc.data.length === 0) { - setDateSelectionError(intl.formatMessage({ id: 'noDataForDateRange' })); - setErrorDateModalOpen(true); setLoading(false); return; } @@ -397,6 +403,23 @@ function Overview(props: OverviewProps) { const renderGraphs = () => { return ( + {!props.connected && !props.loading && ( + + + + )} {isErrorDateModalOpen && ( {}}> )} + {!props.loading && (props.connected !== false || dailyDataArray.length > 0 || aggregatedDataArray.length > 0) && (<> + )} {loading && ( {renderGraphs()}; } diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/Installation.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/Installation.tsx index f165218aa..1afca7643 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/Installation.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/Installation.tsx @@ -276,6 +276,7 @@ function SodioHomeInstallation(props: singleInstallationProps) { currentTab == 'live' || currentTab == 'pvview' || currentTab == 'configuration' || + currentTab == 'overview' || location.includes('batteryview') ) { //Fetch periodically if the tab is live, pvview or batteryview @@ -293,6 +294,13 @@ function SodioHomeInstallation(props: singleInstallationProps) { } } } + // Fetch one time in overview tab to determine connectivity + if (currentTab == 'overview') { + fetchDataForOneTime(); + return () => { + continueFetching.current = false; + }; + } // Fetch periodically in configuration tab to detect S3 config updates if (currentTab == 'configuration') { fetchDataForOneTime(); @@ -462,7 +470,6 @@ function SodioHomeInstallation(props: singleInstallationProps) { {loading && currentTab != 'information' && - currentTab != 'overview' && currentTab != 'manage' && currentTab != 'history' && currentTab != 'log' && @@ -594,6 +601,8 @@ function SodioHomeInstallation(props: singleInstallationProps) { s3Credentials={s3Credentials} id={props.current_installation.id} device={props.current_installation.device} + connected={connected} + loading={loading} /> } /> diff --git a/typescript/frontend-marios2/src/lang/de.json b/typescript/frontend-marios2/src/lang/de.json index 21520c77f..f0b6dbaf7 100644 --- a/typescript/frontend-marios2/src/lang/de.json +++ b/typescript/frontend-marios2/src/lang/de.json @@ -425,6 +425,7 @@ "requiredOrderNumber": "Pflichtbestellnummer", "unableToCommunicate": "Kommunikation mit der Installation nicht möglich", "pleaseWaitOrRefresh": "Bitte warten oder Seite aktualisieren", + "installationOffline": "Die Installation ist derzeit offline. Letzte verfügbare Daten werden angezeigt.", "noDataForDateRange": "Keine Daten für den gewählten Zeitraum verfügbar. Bitte wählen Sie ein neueres Datum.", "loginFailed": "Anmeldung fehlgeschlagen. Bitte versuchen Sie es erneut.", "usernameWrong": "Benutzername ist falsch. Bitte versuchen Sie es erneut.", diff --git a/typescript/frontend-marios2/src/lang/en.json b/typescript/frontend-marios2/src/lang/en.json index 3729d5718..9f93bf9a0 100644 --- a/typescript/frontend-marios2/src/lang/en.json +++ b/typescript/frontend-marios2/src/lang/en.json @@ -173,6 +173,7 @@ "demo_diagnose_button": "Diagnose", "unableToCommunicate": "Unable to communicate with the installation", "pleaseWaitOrRefresh": "Please wait or refresh the page", + "installationOffline": "Installation is currently offline. Showing last available data.", "noDataForDateRange": "No data available for the selected date range. Please choose a more recent date.", "loginFailed": "Login failed. Please try again.", "usernameWrong": "Username is wrong. Please try again.", diff --git a/typescript/frontend-marios2/src/lang/fr.json b/typescript/frontend-marios2/src/lang/fr.json index afd01a19d..f79d753d4 100644 --- a/typescript/frontend-marios2/src/lang/fr.json +++ b/typescript/frontend-marios2/src/lang/fr.json @@ -425,6 +425,7 @@ "navigationTabs": "Navigation", "unableToCommunicate": "Impossible de communiquer avec l'installation", "pleaseWaitOrRefresh": "Veuillez patienter ou actualiser la page", + "installationOffline": "L'installation est actuellement hors ligne. Affichage des dernières données disponibles.", "noDataForDateRange": "Aucune donnée disponible pour la période sélectionnée. Veuillez choisir une date plus récente.", "loginFailed": "Échec de la connexion. Veuillez réessayer.", "usernameWrong": "Nom d'utilisateur incorrect. Veuillez réessayer.", diff --git a/typescript/frontend-marios2/src/lang/it.json b/typescript/frontend-marios2/src/lang/it.json index 7087c6551..372399f7d 100644 --- a/typescript/frontend-marios2/src/lang/it.json +++ b/typescript/frontend-marios2/src/lang/it.json @@ -425,6 +425,7 @@ "alarm_OffGridBusVoltageTooLow": "Tensione Bus Fuori Rete Troppo Bassa", "unableToCommunicate": "Impossibile comunicare con l'installazione", "pleaseWaitOrRefresh": "Attendere o aggiornare la pagina", + "installationOffline": "L'installazione è attualmente offline. Vengono mostrati gli ultimi dati disponibili.", "noDataForDateRange": "Nessun dato disponibile per il periodo selezionato. Scegliere una data più recente.", "loginFailed": "Accesso fallito. Riprovare.", "usernameWrong": "Nome utente errato. Riprovare.",