iobroker.eos-admin 9.0.20 → 9.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NEXOWATT_EOS_BUILD_INFO.json +3 -3
- package/README.md +5 -3
- package/adminWww/.vite/manifest.json +39 -39
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
- package/adminWww/assets/{AdapterUpdateDialog-CRD3XVom.js → AdapterUpdateDialog-Dxl_b7Op.js} +1 -1
- package/adminWww/assets/{Adapters-Cuf0X0CU.js → Adapters-CVKKhXmI.js} +1 -1
- package/adminWww/assets/{ConfigManager-B8ycQt1C.js → ConfigManager-Bf6nTAkL.js} +1 -1
- package/adminWww/assets/{Enums-CctVCgZX.js → Enums-CJHVJY7t.js} +1 -1
- package/adminWww/assets/{Fields-onm4DfoO.js → Fields-DWHbZKvm.js} +1 -1
- package/adminWww/assets/{Files-OLP3Rwc7.js → Files-a6owMTXA.js} +1 -1
- package/adminWww/assets/{Hosts-C31oqMcW.js → Hosts-LtEMeXpV.js} +1 -1
- package/adminWww/assets/{Instances-DFdvJ9pa.js → Instances-DhChziA1.js} +1 -1
- package/adminWww/assets/{Intro-DvsFJxU0.js → Intro-Cyq9gVDC.js} +1 -1
- package/adminWww/assets/{Logs-Zqg2Bqv6.js → Logs-wcramXsg.js} +1 -1
- package/adminWww/assets/{Objects-CpWZp6yp.js → Objects-DINVHd_e.js} +1 -1
- package/adminWww/assets/{Overview-BsKUo298.js → Overview-DK4R41zR.js} +1 -1
- package/adminWww/assets/{State-D_xwlhhb.js → State-DcEACXzL.js} +1 -1
- package/adminWww/assets/{UsedResources-C79N6yZx.js → UsedResources-C1LcM0Rb.js} +1 -1
- package/adminWww/assets/{Users-WgC0O8P0.js → Users-DvDdSyDY.js} +1 -1
- package/adminWww/assets/{bootstrap-BcfBoIoa.js → bootstrap-Dbj_GbnP.js} +3 -3
- package/adminWww/assets/{hostInit-B7bBV7cH.js → hostInit-BNFIx0-f.js} +1 -1
- package/adminWww/assets/{icons-material-D1JYmRTj.js → icons-material-DVbdXNgr.js} +1 -1
- package/adminWww/assets/{index-DbiuoDjo.js → index-CoKP1NSA.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-BAY-Pzp-.js → installSVGRenderer-CMvku1F1.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-33384c20.js → mf-entry-bootstrap-0-ac330bce.js} +2 -2
- package/adminWww/index.html +23 -23
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/remoteEntry-eos-9.0.21.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosCustomerUpdateHttp.js +203 -0
- package/build/lib/eosCustomerUpdateHttp.js.map +1 -0
- package/build/lib/eosCustomerUpdateTransport.js +472 -0
- package/build/lib/eosCustomerUpdateTransport.js.map +1 -0
- package/build/lib/eosCustomerUpdateWorker.js +567 -0
- package/build/lib/eosCustomerUpdateWorker.js.map +1 -0
- package/build/lib/eosCustomerUpdates.js +631 -0
- package/build/lib/eosCustomerUpdates.js.map +1 -0
- package/build/lib/eosModuleConfigStore.js +12 -1
- package/build/lib/eosModuleConfigStore.js.map +1 -1
- package/build/lib/eosModuleHost.js +41 -26
- package/build/lib/eosModuleHost.js.map +1 -1
- package/build/lib/eosModuleHttp.js +8 -2
- package/build/lib/eosModuleHttp.js.map +1 -1
- package/build/lib/eosUpdateSnapshot.js +290 -0
- package/build/lib/eosUpdateSnapshot.js.map +1 -0
- package/build/lib/eosUploadGuard.js +124 -81
- package/build/lib/eosUploadGuard.js.map +1 -1
- package/build/lib/web.js +80 -0
- package/build/lib/web.js.map +1 -1
- package/io-package.json +8 -8
- package/modules/backup/admin/index.js +4 -1
- package/modules/devices/admin/host-bridge.js +5 -1
- package/modules/devices/lib/deviceRuntime.js +27 -4
- package/modules/devices/lib/drivers/mqtt.js +204 -82
- package/modules/devices/lib/drivers/mqttPendingOperations.js +119 -0
- package/modules/devices/test/mqttCommandLifecycle.test.js +255 -0
- package/modules/devices/test/mqttResourceBounds.test.js +98 -0
- package/modules/devices/test/mqttRuntimeSession.test.js +109 -0
- package/modules/devices/tsconfig.mqtt-lifecycle.json +20 -0
- package/modules/eebus/admin/index.js +6 -3
- package/package.json +4 -4
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +363 -95
- package/release-manifests/unified/frontend.cdx.json +6 -6
- package/release-manifests/unified/installer.cdx.json +6 -6
- package/release-manifests/unified/obsolete-admin-assets.json +66 -0
- package/release-manifests/unified/runtime.cdx.json +25 -25
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-manifest.cjs +3 -3
- package/ui/docs/security/eslint-reviewed-findings.json +83 -27
- package/ui/ems/engine.js +14 -3
- package/ui/ems/modules/tariff-provider.js +34 -10
- package/ui/ems/services/tariff-provider-registry.js +18 -8
- package/ui/io-package.json +1 -1
- package/ui/main.js +65 -34
- package/ui/package.json +1 -1
- package/ui/www/app.js +3 -2
- package/ui/www/eos-updates.css +15 -0
- package/ui/www/eos-updates.js +351 -0
- package/ui/www/index.html +2 -0
- package/ui/www/manifest.webmanifest +3 -3
- package/ui/www/settings.html +34 -0
- package/adminWww/remoteEntry-eos-9.0.20.js +0 -12
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/services/tariff-provider-registry.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:ec084b73b68e40694711b32e56424a073f187912959dfca649d0962bebb19f5f
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/**
|
|
24
24
|
* NexoWatt Quellcode-Erklärung (DE)
|
|
25
25
|
* Aufgabe: Registriert unterstützte Tarifquellen und deren Aufruf-/Normalisierungsschnittstellen.
|
|
26
|
-
* Daten und Wirkung: Optional konfigurierte Provider liefern EUR/kWh-Zeitreihen; Tarifregelung behält ihre vorhandene Frische-/Ausfallbehandlung. HTTPS-Gesamtabrufe einschließlich OAuth, DNS und Antwortkörper sind auf höchstens 5 s, 64 KiB Request und 2 MiB dekodierte Antwort begrenzt. Keine Redirects. Eine fehlerhafte Preiszeile verwirft die gesamte Antwort vor der Übergabe an ioBroker.
|
|
26
|
+
* Daten und Wirkung: Optional konfigurierte Provider liefern EUR/kWh-Zeitreihen; Tarifregelung behält ihre vorhandene Frische-/Ausfallbehandlung. HTTPS-Gesamtabrufe einschließlich OAuth, DNS und Antwortkörper sind auf höchstens 5 s, 64 KiB Request und 2 MiB dekodierte Antwort begrenzt. Keine Redirects. Ein Lebenszyklus-Abbruch beendet den aktiven Transport und entfernt den Abbruchlistener. Eine fehlerhafte Preiszeile verwirft die gesamte Antwort vor der Übergabe an ioBroker.
|
|
27
27
|
* Bei Änderungen: Einheiten, Vorzeichen, Frische und Aufrufer mitprüfen; Netzwerkvertrag mit scripts/verify-cra-tariff.cjs testen. Anbieter-Fehlertexte nicht protokollieren; keine Zugangsdaten in Fehlermeldungen übernehmen. docs:build nach fachlichen Änderungen aktualisieren.
|
|
28
28
|
* Verknüpfungen: docs/quellcode/src-ts/runtime-executables/ems/services/tariff-provider-registry.md
|
|
29
29
|
* Einstieg: docs/QUELLCODE_WEGWEISER_DE.md; Pflege: docs/DOKUMENTATIONSSTANDARD_DE.md
|
|
@@ -535,20 +535,30 @@ const MAX_PROVIDER_TIMEOUT_MS = 5000;
|
|
|
535
535
|
* Fristen bleiben möglich; lange/ungültige Werte erhöhen niemals das Maximum.
|
|
536
536
|
* Nach dem Parsing wird die monotone Frist erneut geprüft. Node.js-Timer sind
|
|
537
537
|
* keine Echtzeitgarantie bei blockiertem Betriebssystem/Event-Loop. */
|
|
538
|
-
function withTimeout(timeoutMs, fn) {
|
|
538
|
+
function withTimeout(timeoutMs, fn, parentSignal) {
|
|
539
539
|
const requested = Number(timeoutMs);
|
|
540
540
|
const budget = Number.isFinite(requested) && requested > 0 ? Math.min(MAX_PROVIDER_TIMEOUT_MS, requested) : MAX_PROVIDER_TIMEOUT_MS;
|
|
541
541
|
const deadline = performance.now() + budget;
|
|
542
542
|
const ctrl = new AbortController();
|
|
543
543
|
let timer;
|
|
544
|
+
let cancel;
|
|
544
545
|
const timeout = new Promise((_resolve, reject) => {
|
|
545
546
|
timer = setTimeout(() => { ctrl.abort(); reject(new Error('provider_timeout')); }, budget);
|
|
547
|
+
cancel = () => { ctrl.abort(); reject(new Error('provider_cancelled')); };
|
|
548
|
+
if (parentSignal?.aborted) cancel();
|
|
549
|
+
else parentSignal?.addEventListener('abort', cancel, { once: true });
|
|
546
550
|
});
|
|
547
|
-
const operation = Promise.resolve().then(() =>
|
|
551
|
+
const operation = Promise.resolve().then(() => {
|
|
552
|
+
if (ctrl.signal.aborted) throw new Error('provider_cancelled');
|
|
553
|
+
return fn(ctrl.signal);
|
|
554
|
+
}).then(result => {
|
|
548
555
|
if (ctrl.signal.aborted || performance.now() >= deadline) { ctrl.abort(); throw new Error('provider_timeout'); }
|
|
549
556
|
return result;
|
|
550
557
|
});
|
|
551
|
-
return Promise.race([operation, timeout]).finally(() =>
|
|
558
|
+
return Promise.race([operation, timeout]).finally(() => {
|
|
559
|
+
clearTimeout(timer);
|
|
560
|
+
parentSignal?.removeEventListener('abort', cancel);
|
|
561
|
+
});
|
|
552
562
|
}
|
|
553
563
|
|
|
554
564
|
/** Jeder externe Tarifabruf verlangt HTTPS mit der Node.js-Standardprüfung des
|
|
@@ -772,7 +782,7 @@ async function fetchOstrom(config = {}, signal) {
|
|
|
772
782
|
/** Öffentlicher Abrufvertrag: erst die gesamte validierte Antwort zurückgeben;
|
|
773
783
|
* nie States schreiben. Alle Fehler sind feste Codes ohne URLs/Token/Antworttext.
|
|
774
784
|
* Tarifmodul und Installer-API fangen diese Rejection bereits asynchron ab. */
|
|
775
|
-
async function fetchProvider(config = {}) {
|
|
785
|
+
async function fetchProvider(config = {}, signal) {
|
|
776
786
|
return withTimeout(config.timeoutMs, async signal => {
|
|
777
787
|
let providerId = String(config.providerId || 'manual-dp');
|
|
778
788
|
if (providerId === 'market-profile') providerId = String(config.sourceId || (config.country === 'NL' ? 'energyzero' : 'entsoe'));
|
|
@@ -783,9 +793,9 @@ async function fetchProvider(config = {}) {
|
|
|
783
793
|
if (providerId === 'ostrom') return fetchOstrom(resolvedConfig, signal);
|
|
784
794
|
if (providerId === 'custom-rest') return fetchCustomRest(resolvedConfig, '', signal);
|
|
785
795
|
throw new Error(providerId === 'manual-dp' ? 'manual_dp_has_no_fetch' : 'unknown_provider');
|
|
786
|
-
}).catch(error => {
|
|
796
|
+
}, signal).catch(error => {
|
|
787
797
|
const message = String(error && error.message || '');
|
|
788
|
-
if (/^(?:provider_(?:timeout|https_required|url_invalid|request_too_large|response_too_large|request_failed|prices_invalid|http_\d{3})|invalid_json_response|tibber_(?:token_missing|graphql_error|invalid_response|no_homes|home_invalid|no_price_info)|energyzero_no_prices|entsoe_(?:token_missing|invalid_response|no_prices)|oauth_(?:credentials_missing|token_invalid)|custom_rest_(?:url_missing|no_prices)|manual_dp_has_no_fetch|unknown_provider)$/.test(message)) throw error;
|
|
798
|
+
if (/^(?:provider_(?:timeout|cancelled|https_required|url_invalid|request_too_large|response_too_large|request_failed|prices_invalid|http_\d{3})|invalid_json_response|tibber_(?:token_missing|graphql_error|invalid_response|no_homes|home_invalid|no_price_info)|energyzero_no_prices|entsoe_(?:token_missing|invalid_response|no_prices)|oauth_(?:credentials_missing|token_invalid)|custom_rest_(?:url_missing|no_prices)|manual_dp_has_no_fetch|unknown_provider)$/.test(message)) throw error;
|
|
789
799
|
throw new Error('provider_request_failed');
|
|
790
800
|
});
|
|
791
801
|
}
|
package/ui/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "nexowatt-ui",
|
|
4
|
-
"version": "9.0.
|
|
4
|
+
"version": "9.0.21",
|
|
5
5
|
"news": {
|
|
6
6
|
"9.0.18": {
|
|
7
7
|
"en": "Automatic supported-device commissioning and explicit EMS/energy-flow roles. Existing mappings and data points are preserved; new control targets require commissioning.",
|
package/ui/main.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/main.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:f61d808e29a1884d6fe6d80783d784beef53f7053fedd14fd49a0b661e04dd52
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -6373,11 +6373,40 @@ class NexoWattVis extends HostedAdapter {
|
|
|
6373
6373
|
* TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
|
|
6374
6374
|
*/
|
|
6375
6375
|
async updateStorageFarmDerived(reason = 'timer') {
|
|
6376
|
+
if (this._nwShuttingDown) return;
|
|
6377
|
+
// Timerläufe werden bei laufendem Snapshot verworfen: kein wachsender
|
|
6378
|
+
// Rückstau bei langsamer Datenbank. Explizite Übernahmen/Preflights lesen
|
|
6379
|
+
// anschließend neu, damit sie keinen älteren Snapshot als Ergebnis erben.
|
|
6380
|
+
while (this._nwStorageFarmDerivePromise) {
|
|
6381
|
+
if (reason === 'timer') return;
|
|
6382
|
+
await this._nwStorageFarmDerivePromise;
|
|
6383
|
+
if (this._nwShuttingDown) return;
|
|
6384
|
+
}
|
|
6385
|
+
const pending = this._nwUpdateStorageFarmDerivedSnapshot(reason);
|
|
6386
|
+
this._nwStorageFarmDerivePromise = pending;
|
|
6387
|
+
try { await pending; }
|
|
6388
|
+
finally {
|
|
6389
|
+
if (this._nwStorageFarmDerivePromise === pending) this._nwStorageFarmDerivePromise = null;
|
|
6390
|
+
}
|
|
6391
|
+
}
|
|
6392
|
+
|
|
6393
|
+
/** Liest genau einen Farm-Snapshot. Nach Stop oder Konfigurationswechsel
|
|
6394
|
+
* dürfen dessen verzögerte Antworten keine neuen aktuellen Summen erzeugen. */
|
|
6395
|
+
async _nwUpdateStorageFarmDerivedSnapshot(reason) {
|
|
6376
6396
|
try {
|
|
6377
6397
|
// Die Farm-Aggregation folgt derselben autoritativen Aktivierung wie AppCenter,
|
|
6378
6398
|
// Navigation, Dispatcher und Energiefluss. Ein reines Legacy-Flag darf weder eine
|
|
6379
6399
|
// aktive App abschalten noch eine inaktive Farm heimlich wieder einschalten.
|
|
6380
6400
|
const cfg = this.config || {};
|
|
6401
|
+
const assertCurrent = () => {
|
|
6402
|
+
if (this._nwShuttingDown || this.config !== cfg) throw new Error('EOS_FARM_SNAPSHOT_CANCELLED');
|
|
6403
|
+
};
|
|
6404
|
+
/** @param {string} id @param {{ val: string | number | boolean | null, ack: true }} state */
|
|
6405
|
+
const writeDerived = async (id, state) => {
|
|
6406
|
+
assertCurrent();
|
|
6407
|
+
await this.setStateAsync(id, state);
|
|
6408
|
+
assertCurrent();
|
|
6409
|
+
};
|
|
6381
6410
|
const runtimeInfo = (typeof this._nwGetStorageFarmRuntimeInfo === 'function')
|
|
6382
6411
|
? this._nwGetStorageFarmRuntimeInfo()
|
|
6383
6412
|
: { active: !!cfg.enableStorageFarm };
|
|
@@ -6413,6 +6442,7 @@ class NexoWattVis extends HostedAdapter {
|
|
|
6413
6442
|
if (!sid) return null;
|
|
6414
6443
|
if (_stCache.has(sid)) return _stCache.get(sid);
|
|
6415
6444
|
const st = await this.getForeignStateAsync(sid).catch(() => null);
|
|
6445
|
+
assertCurrent();
|
|
6416
6446
|
_stCache.set(sid, st);
|
|
6417
6447
|
return st;
|
|
6418
6448
|
};
|
|
@@ -6536,6 +6566,7 @@ class NexoWattVis extends HostedAdapter {
|
|
|
6536
6566
|
} catch (_e) {
|
|
6537
6567
|
unit = '';
|
|
6538
6568
|
}
|
|
6569
|
+
assertCurrent();
|
|
6539
6570
|
_unitCache.set(sid, unit);
|
|
6540
6571
|
return unit;
|
|
6541
6572
|
};
|
|
@@ -7386,42 +7417,42 @@ class NexoWattVis extends HostedAdapter {
|
|
|
7386
7417
|
const totalPvUnknownState = Math.round(totalPvUnknown);
|
|
7387
7418
|
const pvSourcesJson = JSON.stringify(pvSourceRows);
|
|
7388
7419
|
|
|
7389
|
-
await
|
|
7390
|
-
await
|
|
7391
|
-
await
|
|
7392
|
-
await
|
|
7393
|
-
await
|
|
7394
|
-
await
|
|
7395
|
-
await
|
|
7396
|
-
await
|
|
7397
|
-
await
|
|
7398
|
-
await
|
|
7399
|
-
await
|
|
7400
|
-
await
|
|
7401
|
-
await
|
|
7402
|
-
await
|
|
7403
|
-
await
|
|
7404
|
-
await
|
|
7405
|
-
await
|
|
7406
|
-
await
|
|
7407
|
-
await
|
|
7408
|
-
await
|
|
7409
|
-
await
|
|
7410
|
-
await
|
|
7411
|
-
await
|
|
7412
|
-
await
|
|
7413
|
-
await
|
|
7414
|
-
await
|
|
7415
|
-
await
|
|
7416
|
-
await
|
|
7420
|
+
await writeDerived('storageFarm.totalSoc', { val: totalSocState, ack: true });
|
|
7421
|
+
await writeDerived('storageFarm.medianSoc', { val: Math.round(medianSoc * 10) / 10, ack: true });
|
|
7422
|
+
await writeDerived('storageFarm.totalSocOnline', { val: totalSocOnlineState, ack: true });
|
|
7423
|
+
await writeDerived('storageFarm.capacityWeightedSoc', { val: capacityWeightedSocState, ack: true });
|
|
7424
|
+
await writeDerived('storageFarm.capacityWeightedSocOnline', { val: capacityWeightedSocOnlineState, ack: true });
|
|
7425
|
+
await writeDerived('storageFarm.socSourcesTotal', { val: socSourcesTotal, ack: true });
|
|
7426
|
+
await writeDerived('storageFarm.socSourcesOnline', { val: socSourcesOnline, ack: true });
|
|
7427
|
+
await writeDerived('storageFarm.socDegraded', { val: !!socDegraded, ack: true });
|
|
7428
|
+
await writeDerived('storageFarm.totalPowerW', { val: totalPowerState, ack: true });
|
|
7429
|
+
await writeDerived('storageFarm.totalBatteryPowerW', { val: totalBatteryPowerState, ack: true });
|
|
7430
|
+
await writeDerived('storageFarm.totalBatteryChargePowerW', { val: farmOverview.battery.chargeW, ack: true });
|
|
7431
|
+
await writeDerived('storageFarm.totalBatteryDischargePowerW', { val: farmOverview.battery.dischargeW, ack: true });
|
|
7432
|
+
await writeDerived('storageFarm.displayMeanSoc', { val: farmOverview.soc.meanPct, ack: true });
|
|
7433
|
+
await writeDerived('storageFarm.totalCapacityKWh', { val: farmOverview.capacity.totalKWh, ack: true });
|
|
7434
|
+
await writeDerived('storageFarm.overviewJson', { val: farmOverviewJson, ack: true });
|
|
7435
|
+
await writeDerived('storageFarm.powerSourcesTotal', { val: seenPowerSourceKeys.size, ack: true });
|
|
7436
|
+
await writeDerived('storageFarm.powerSourcesOnline', { val: powerSourcesOnline, ack: true });
|
|
7437
|
+
await writeDerived('storageFarm.totalChargePowerW', { val: totalChargeState, ack: true });
|
|
7438
|
+
await writeDerived('storageFarm.totalDischargePowerW', { val: totalDischargeState, ack: true });
|
|
7439
|
+
await writeDerived('storageFarm.totalPvPowerW', { val: totalPvState, ack: true });
|
|
7440
|
+
await writeDerived('storageFarm.totalPvAcPowerW', { val: totalPvAcState, ack: true });
|
|
7441
|
+
await writeDerived('storageFarm.totalPvDcPowerW', { val: totalPvDcState, ack: true });
|
|
7442
|
+
await writeDerived('storageFarm.totalPvUnknownPowerW', { val: totalPvUnknownState, ack: true });
|
|
7443
|
+
await writeDerived('storageFarm.pvSourcesTotal', { val: pvSourceRows.length, ack: true });
|
|
7444
|
+
await writeDerived('storageFarm.pvSourcesOnline', { val: pvSourcesOnline, ack: true });
|
|
7445
|
+
await writeDerived('storageFarm.pvSourcesJson', { val: pvSourcesJson, ack: true });
|
|
7446
|
+
await writeDerived('storageFarm.storagesOnline', { val: available, ack: true });
|
|
7447
|
+
await writeDerived('storageFarm.storagesDegraded', { val: degraded, ack: true });
|
|
7417
7448
|
const availableChargePowerState = availableChargePowerUnbounded ? null : Math.round(availableChargePowerW);
|
|
7418
7449
|
const availableDischargePowerState = availableDischargePowerUnbounded ? null : Math.round(availableDischargePowerW);
|
|
7419
7450
|
|
|
7420
|
-
await
|
|
7421
|
-
await
|
|
7422
|
-
await
|
|
7423
|
-
await
|
|
7424
|
-
await
|
|
7451
|
+
await writeDerived('storageFarm.storagesDispatchAvailable', { val: dispatchAvailableCount, ack: true });
|
|
7452
|
+
await writeDerived('storageFarm.availableChargePowerW', { val: availableChargePowerState, ack: true });
|
|
7453
|
+
await writeDerived('storageFarm.availableDischargePowerW', { val: availableDischargePowerState, ack: true });
|
|
7454
|
+
await writeDerived('storageFarm.storagesTotal', { val: configured, ack: true });
|
|
7455
|
+
await writeDerived('storageFarm.storagesStatusJson', { val: JSON.stringify(statusRows), ack: true });
|
|
7425
7456
|
|
|
7426
7457
|
// keep stateCache fresh for the UI
|
|
7427
7458
|
try {
|
package/ui/package.json
CHANGED
package/ui/www/app.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/www/app.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:d5eb4cd56ae843c0fada1f08e218447907600b2ba32413ae275ceb3595302282
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -4781,7 +4781,8 @@ function initSettingsPageTabs(){
|
|
|
4781
4781
|
});
|
|
4782
4782
|
|
|
4783
4783
|
try { window.__nwActivateSettingsPage = activatePage; } catch (_e) {}
|
|
4784
|
-
|
|
4784
|
+
window.addEventListener('hashchange', () => { if (window.location.hash === '#updates') activatePage('updates'); });
|
|
4785
|
+
activatePage(window.location.hash === '#updates' ? 'updates' : wrap.dataset.settingsPage || (() => {
|
|
4785
4786
|
try { return sessionStorage.getItem('nexowatt.settings.page') || 'general'; } catch (_e) { return 'general'; }
|
|
4786
4787
|
})());
|
|
4787
4788
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* EOS-Updates: eigener Einstellungsbereich im vorhandenen Kundendesign. */
|
|
2
|
+
.topbar-gear { position: relative; }
|
|
3
|
+
.nw-update-badge { position: absolute; top: -8px; right: -4px; color: #00e5aa; font-size: 26px; line-height: 1; }
|
|
4
|
+
.nw-update-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
|
|
5
|
+
.nw-update-values div { min-width: 0; padding: 14px; border: 1px solid #294354; border-radius: 12px; background: rgba(11, 35, 46, .65); }
|
|
6
|
+
.nw-update-values dt { color: #afc9d0; font-size: 12px; }
|
|
7
|
+
.nw-update-values dd { margin: 8px 0 0; font-size: 18px; font-weight: 650; overflow-wrap: anywhere; }
|
|
8
|
+
.nw-update-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
|
|
9
|
+
#eosUpdateStatus { line-height: 1.5; overflow-wrap: anywhere; }
|
|
10
|
+
#eosUpdateStatus[data-error="true"] { color: #ffb5a6; }
|
|
11
|
+
#eosUpdateConfirm { color: #ecf7f8; background: #081f2c; border: 1px solid #00896e; border-radius: 18px; max-width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 24px; box-sizing: border-box; }
|
|
12
|
+
#eosUpdateConfirm::backdrop { background: rgba(0, 8, 15, .8); }
|
|
13
|
+
#eosUpdateConfirm p { line-height: 1.6; }
|
|
14
|
+
#eosUpdatesPanel [hidden] { display: none !important; }
|
|
15
|
+
@media (max-width: 640px) { .nw-update-values { grid-template-columns: 1fr; } .nw-update-actions .btn { flex: 1 1 100%; } }
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 NexoWatt. All rights reserved.
|
|
3
|
+
* Confidential and Proprietary.
|
|
4
|
+
* Use, modification or distribution without express written permission is prohibited.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
|
+
*
|
|
9
|
+
* Quelle: src-ts/runtime-executables/www/eos-updates.ts
|
|
10
|
+
* Quell-Hash: sha256:16ab556c7e39a93cc782f2d78a7d8fd74f30d864ef0e7aa375bccc710516db84
|
|
11
|
+
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
|
+
*
|
|
13
|
+
* Zweck:
|
|
14
|
+
* Diese JavaScript-Datei ist das ausführbare Build-Artefakt für www/eos-updates.js.
|
|
15
|
+
* Die fachliche Bearbeitung erfolgt ab 0.7.131 in der TypeScript-Quelle.
|
|
16
|
+
* Ab 0.7.132 sind doppelte Legacy-JS-Bäume wie .nwcore entfernt.
|
|
17
|
+
*
|
|
18
|
+
* Pflege-Regel:
|
|
19
|
+
* 1. Änderung zuerst in src-ts/runtime-executables/ vornehmen.
|
|
20
|
+
* 2. npm run sync:ts-runtime-executables ausführen.
|
|
21
|
+
* 3. npm run test:runtime-executables prüfen.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* NexoWatt Quellcode-Erklärung (DE)
|
|
25
|
+
* Aufgabe: Zeigt verfügbare EOS-Versionen und führt angemeldete Kunden durch Vorbereitung und bestätigten Update-Start.
|
|
26
|
+
* Daten und Wirkung: Liest ausschließlich die begrenzte EOS-Update-API; ein Start benötigt eine aktuelle Sitzung, CSRF und den serverseitig geprüften Plan. Ein unbestätigter Start wird nie automatisch wiederholt.
|
|
27
|
+
* Bei Änderungen: Verbindungsabbruch, abgelaufene Sitzung, verworfene Pläne und bestätigte Zielversion getrennt testen; niemals Browserwerte als Installationsfreigabe behandeln.
|
|
28
|
+
*/
|
|
29
|
+
(() => {
|
|
30
|
+
'use strict';
|
|
31
|
+
const endpoint = '/api/eos-update/';
|
|
32
|
+
const versionPattern = /^\d{1,6}\.\d{1,6}\.\d{1,6}(?:-[a-zA-Z0-9.-]{1,60})?$/;
|
|
33
|
+
const states = new Set(['current', 'available', 'checking', 'preparing', 'offline', 'incompatible', 'prepared', 'installing', 'installed', 'failed', 'interrupted']);
|
|
34
|
+
const record = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
35
|
+
const safeVersion = (value) => typeof value === 'string' && versionPattern.test(value);
|
|
36
|
+
const epoch = (value) => typeof value === 'number' && Number.isSafeInteger(value) && value > 0 && value < 8640000000000000 ? value : null;
|
|
37
|
+
function decode(value) {
|
|
38
|
+
if (!record(value) || !safeVersion(value.installedVersion) || typeof value.state !== 'string' || !states.has(value.state)
|
|
39
|
+
|| value.source !== 'npm-latest' || typeof value.canStart !== 'boolean')
|
|
40
|
+
throw new Error('UPDATE_RESPONSE');
|
|
41
|
+
const view = {
|
|
42
|
+
installedVersion: value.installedVersion,
|
|
43
|
+
availableVersion: safeVersion(value.availableVersion) ? value.availableVersion : null,
|
|
44
|
+
checkedAt: epoch(value.checkedAt), state: value.state, canStart: value.canStart,
|
|
45
|
+
reason: typeof value.reason === 'string' && /^[A-Z0-9_]{1,100}$/.test(value.reason) ? value.reason : null,
|
|
46
|
+
planId: typeof value.planId === 'string' && /^[a-zA-Z0-9_-]{16,128}$/.test(value.planId) ? value.planId : null,
|
|
47
|
+
expiresAt: epoch(value.expiresAt),
|
|
48
|
+
};
|
|
49
|
+
if (view.canStart && (view.state !== 'prepared' || !view.planId || !view.availableVersion || !view.expiresAt))
|
|
50
|
+
throw new Error('UPDATE_RESPONSE');
|
|
51
|
+
return view;
|
|
52
|
+
}
|
|
53
|
+
async function request(action, signal, body, dispatched) {
|
|
54
|
+
const options = { cache: 'no-store', credentials: 'same-origin', signal };
|
|
55
|
+
if (body) {
|
|
56
|
+
const response = await fetch('/api/auth/status', { ...options });
|
|
57
|
+
if (!response.ok)
|
|
58
|
+
throw new Error('UPDATE_AUTH');
|
|
59
|
+
const access = await response.json();
|
|
60
|
+
if (!record(access) || access.authenticated !== true || access.mustChangePassword === true
|
|
61
|
+
|| typeof access.csrfToken !== 'string' || !/^[a-f0-9]{64}$/.test(access.csrfToken))
|
|
62
|
+
throw new Error('UPDATE_AUTH');
|
|
63
|
+
options.method = 'POST';
|
|
64
|
+
options.headers = { 'Content-Type': 'application/json', 'X-NW-CSRF': access.csrfToken };
|
|
65
|
+
options.body = JSON.stringify(body);
|
|
66
|
+
}
|
|
67
|
+
if (signal.aborted)
|
|
68
|
+
throw new Error('UPDATE_CANCELLED');
|
|
69
|
+
dispatched?.();
|
|
70
|
+
const response = await fetch(endpoint + action, options);
|
|
71
|
+
if (response.status === 401 || response.status === 403)
|
|
72
|
+
throw new Error('UPDATE_AUTH');
|
|
73
|
+
if (response.status === 409)
|
|
74
|
+
throw new Error('UPDATE_CONFLICT');
|
|
75
|
+
if (!response.ok)
|
|
76
|
+
throw new Error('UPDATE_UNAVAILABLE');
|
|
77
|
+
return decode(await response.json());
|
|
78
|
+
}
|
|
79
|
+
function start() {
|
|
80
|
+
const panel = document.getElementById('eosUpdatesPanel');
|
|
81
|
+
const status = document.getElementById('eosUpdateStatus');
|
|
82
|
+
const installed = document.getElementById('eosUpdateInstalled');
|
|
83
|
+
const available = document.getElementById('eosUpdateAvailable');
|
|
84
|
+
const checked = document.getElementById('eosUpdateChecked');
|
|
85
|
+
const check = document.getElementById('eosUpdateCheck');
|
|
86
|
+
const prepare = document.getElementById('eosUpdatePrepare');
|
|
87
|
+
const confirm = document.getElementById('eosUpdateConfirm');
|
|
88
|
+
const confirmVersion = document.getElementById('eosUpdateConfirmVersion');
|
|
89
|
+
const confirmStart = document.getElementById('eosUpdateStart');
|
|
90
|
+
const cancel = document.getElementById('eosUpdateCancel');
|
|
91
|
+
const gear = document.querySelector('a.topbar-gear');
|
|
92
|
+
const originalGearHref = gear?.getAttribute('href') || 'settings.html';
|
|
93
|
+
let badge = null;
|
|
94
|
+
let view = null;
|
|
95
|
+
let busy = false;
|
|
96
|
+
let loading = false;
|
|
97
|
+
let pendingStart = false;
|
|
98
|
+
let authRequired = false;
|
|
99
|
+
let stopped = false;
|
|
100
|
+
let generation = 0;
|
|
101
|
+
let activeRequest = null;
|
|
102
|
+
let requestTimeout = null;
|
|
103
|
+
let poll = null;
|
|
104
|
+
const pendingMessage = 'Die Rückmeldung zum Updateauftrag steht noch aus. Bitte nicht erneut starten; der Status wird geprüft.';
|
|
105
|
+
const labels = {
|
|
106
|
+
current: 'EOS ist auf dem Stand der veröffentlichten stabilen Version.',
|
|
107
|
+
available: 'Eine neue EOS-Version ist verfügbar.', checking: 'Verfügbare Version wird geprüft …',
|
|
108
|
+
preparing: 'Update wird heruntergeladen und geprüft …',
|
|
109
|
+
offline: 'Die Updatequelle ist momentan nicht erreichbar. EOS läuft weiter.',
|
|
110
|
+
incompatible: 'Diese Version benötigt eine gesonderte Prüfung durch den Installateur.',
|
|
111
|
+
prepared: 'Update geprüft und vorbereitet. Zum Installieren bitte den Start bestätigen.',
|
|
112
|
+
installing: 'Update läuft. Die Verbindung kann während des EOS-Neustarts unterbrochen werden.',
|
|
113
|
+
installed: 'Die Installation der neuen EOS-Version wurde bestätigt.',
|
|
114
|
+
failed: 'Das Update konnte nicht erfolgreich abgeschlossen werden. Bitte die Diagnose prüfen.',
|
|
115
|
+
interrupted: 'Der Updateabschluss ist nicht bestätigt. Es wird kein Auftrag automatisch wiederholt.',
|
|
116
|
+
};
|
|
117
|
+
const reasons = {
|
|
118
|
+
EOS_UPDATE_PLAN_EXPIRED: 'Die Vorbereitung ist abgelaufen. Bitte erneut vorbereiten.',
|
|
119
|
+
EOS_UPDATE_CONFIGURATION_CHANGED: 'Die Einstellungen wurden seit der Vorbereitung geändert. Bitte erneut vorbereiten.',
|
|
120
|
+
EOS_UPDATE_VERSION_CHANGED: 'Die angebotene Version hat sich geändert. Bitte erneut prüfen.',
|
|
121
|
+
EOS_UPDATE_BUSY: 'Ein Updateauftrag wird bereits bearbeitet.',
|
|
122
|
+
EOS_UPDATE_PLATFORM_UNSUPPORTED: 'Die automatische Installation ist auf diesem System nicht freigegeben.',
|
|
123
|
+
EOS_UPDATE_NODE_UNSUPPORTED: 'Die neue Version benötigt eine andere Node.js-Version.',
|
|
124
|
+
EOS_UPDATE_CONTROLLER_UNSUPPORTED: 'Die ioBroker-Version muss zuerst vom Installateur geprüft werden.',
|
|
125
|
+
EOS_UPDATE_MULTI_INSTANCE: 'Mehrere EOS-Instanzen benötigen eine koordinierte Aktualisierung durch den Installateur.',
|
|
126
|
+
};
|
|
127
|
+
function show(message, error = false) {
|
|
128
|
+
if (status) {
|
|
129
|
+
status.textContent = message;
|
|
130
|
+
status.dataset.error = String(error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function planReady() {
|
|
134
|
+
return !!view && view.state === 'prepared' && view.canStart && !!view.planId && !!view.expiresAt && view.expiresAt > Date.now();
|
|
135
|
+
}
|
|
136
|
+
function render() {
|
|
137
|
+
const running = !!view && ['checking', 'preparing', 'installing'].includes(view.state) || pendingStart;
|
|
138
|
+
const blocked = busy || loading || running;
|
|
139
|
+
if (check instanceof HTMLButtonElement)
|
|
140
|
+
check.disabled = blocked;
|
|
141
|
+
if (prepare instanceof HTMLButtonElement) {
|
|
142
|
+
prepare.hidden = !view || !['available', 'prepared'].includes(view.state);
|
|
143
|
+
prepare.disabled = blocked || authRequired || (view?.state === 'prepared' && !planReady());
|
|
144
|
+
prepare.textContent = view?.state === 'prepared' ? 'Update starten …' : 'Update vorbereiten';
|
|
145
|
+
}
|
|
146
|
+
if (confirmStart instanceof HTMLButtonElement)
|
|
147
|
+
confirmStart.disabled = blocked || authRequired || !planReady();
|
|
148
|
+
if (!view)
|
|
149
|
+
return;
|
|
150
|
+
if (installed)
|
|
151
|
+
installed.textContent = view.installedVersion;
|
|
152
|
+
if (available)
|
|
153
|
+
available.textContent = view.availableVersion || '—';
|
|
154
|
+
if (checked)
|
|
155
|
+
checked.textContent = view.checkedAt ? new Date(view.checkedAt).toLocaleString('de-DE') : 'Noch nicht geprüft';
|
|
156
|
+
const explanation = view.reason ? reasons[view.reason] || 'Bitte die Update-Diagnose durch den Installateur prüfen lassen.' : '';
|
|
157
|
+
show(pendingStart && view.state !== 'installing' ? pendingMessage
|
|
158
|
+
: (labels[view.state] || 'Updatestatus wird geladen.') + (explanation ? ` ${explanation}` : ''), ['failed', 'interrupted'].includes(view.state));
|
|
159
|
+
const notice = ['available', 'prepared', 'incompatible'].includes(view.state) && !!view.availableVersion;
|
|
160
|
+
if (gear && notice) {
|
|
161
|
+
if (!badge) {
|
|
162
|
+
badge = document.createElement('span');
|
|
163
|
+
badge.className = 'nw-update-badge';
|
|
164
|
+
badge.textContent = '•';
|
|
165
|
+
badge.setAttribute('aria-hidden', 'true');
|
|
166
|
+
gear.appendChild(badge);
|
|
167
|
+
}
|
|
168
|
+
gear.href = 'settings.html#updates';
|
|
169
|
+
gear.title = `Einstellungen · EOS ${view.availableVersion} verfügbar`;
|
|
170
|
+
gear.setAttribute('aria-label', gear.title);
|
|
171
|
+
}
|
|
172
|
+
else if (gear) {
|
|
173
|
+
badge?.remove();
|
|
174
|
+
badge = null;
|
|
175
|
+
gear.setAttribute('href', originalGearHref);
|
|
176
|
+
gear.title = 'Einstellungen';
|
|
177
|
+
gear.setAttribute('aria-label', 'Einstellungen');
|
|
178
|
+
}
|
|
179
|
+
if (confirmVersion)
|
|
180
|
+
confirmVersion.textContent = view.availableVersion || '—';
|
|
181
|
+
}
|
|
182
|
+
function schedule() {
|
|
183
|
+
if (poll !== null)
|
|
184
|
+
clearTimeout(poll);
|
|
185
|
+
poll = null;
|
|
186
|
+
if (stopped || document.hidden)
|
|
187
|
+
return;
|
|
188
|
+
const active = !authRequired && (pendingStart || (view && ['preparing', 'installing', 'checking'].includes(view.state)));
|
|
189
|
+
poll = setTimeout(() => { poll = null; void load(); }, active ? 3000 : panel ? 60000 : 15 * 60000);
|
|
190
|
+
}
|
|
191
|
+
function errorMessage(error) {
|
|
192
|
+
if (error instanceof Error && error.message === 'UPDATE_AUTH') {
|
|
193
|
+
authRequired = true;
|
|
194
|
+
if (view)
|
|
195
|
+
view = { ...view, canStart: false };
|
|
196
|
+
if (confirm instanceof HTMLDialogElement && confirm.open)
|
|
197
|
+
confirm.close();
|
|
198
|
+
render();
|
|
199
|
+
show(pendingStart ? 'Bitte erneut bei EOS anmelden. Der Status des bereits gesendeten Updateauftrags ist noch unbestätigt.'
|
|
200
|
+
: 'Bitte erneut bei EOS anmelden. Es wurde kein neuer Updateauftrag erteilt.', true);
|
|
201
|
+
}
|
|
202
|
+
else if (error instanceof Error && error.message === 'UPDATE_CONFLICT') {
|
|
203
|
+
if (view)
|
|
204
|
+
view = { ...view, canStart: false, planId: null };
|
|
205
|
+
render();
|
|
206
|
+
show('Der Updateplan ist nicht mehr gültig oder ein Update läuft bereits. Status neu prüfen.', true);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
show(pendingStart ? pendingMessage : 'Updatestatus momentan nicht erreichbar. Bitte später erneut prüfen.', true);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async function call(action, body, dispatched) {
|
|
213
|
+
const controller = new AbortController();
|
|
214
|
+
activeRequest = controller;
|
|
215
|
+
const timeout = setTimeout(() => { controller.abort(); }, body ? 20000 : 7000);
|
|
216
|
+
requestTimeout = timeout;
|
|
217
|
+
try {
|
|
218
|
+
return await request(action, controller.signal, body, dispatched);
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
clearTimeout(timeout);
|
|
222
|
+
if (requestTimeout === timeout)
|
|
223
|
+
requestTimeout = null;
|
|
224
|
+
if (activeRequest === controller)
|
|
225
|
+
activeRequest = null;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async function load() {
|
|
229
|
+
if (busy || loading || stopped || document.hidden) {
|
|
230
|
+
schedule();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const current = generation;
|
|
234
|
+
let error;
|
|
235
|
+
loading = true;
|
|
236
|
+
render();
|
|
237
|
+
try {
|
|
238
|
+
const received = await call('status');
|
|
239
|
+
if (stopped || current !== generation)
|
|
240
|
+
return;
|
|
241
|
+
view = received;
|
|
242
|
+
authRequired = false;
|
|
243
|
+
// Only a fresh server status resolves an indeterminate start.
|
|
244
|
+
// It never causes another POST or assumes that installation succeeded.
|
|
245
|
+
if (view.state !== 'installing')
|
|
246
|
+
pendingStart = false;
|
|
247
|
+
if (view.state !== 'prepared' && confirm instanceof HTMLDialogElement && confirm.open)
|
|
248
|
+
confirm.close();
|
|
249
|
+
}
|
|
250
|
+
catch (caught) {
|
|
251
|
+
error = caught;
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
if (!stopped && current === generation) {
|
|
255
|
+
loading = false;
|
|
256
|
+
render();
|
|
257
|
+
if (error !== undefined)
|
|
258
|
+
errorMessage(error);
|
|
259
|
+
schedule();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
async function action(kind) {
|
|
264
|
+
if (busy || loading || stopped || pendingStart)
|
|
265
|
+
return;
|
|
266
|
+
const target = view?.availableVersion;
|
|
267
|
+
const plan = view?.planId;
|
|
268
|
+
if (kind === 'prepare' && (!target || authRequired) || kind === 'start' && (!planReady() || authRequired))
|
|
269
|
+
return;
|
|
270
|
+
const current = generation;
|
|
271
|
+
let error;
|
|
272
|
+
let openConfirmation = false;
|
|
273
|
+
busy = true;
|
|
274
|
+
render();
|
|
275
|
+
if (kind === 'start') {
|
|
276
|
+
if (confirm instanceof HTMLDialogElement && confirm.open)
|
|
277
|
+
confirm.close();
|
|
278
|
+
show('Updateauftrag wird übermittelt …');
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const received = await call(kind, kind === 'prepare' ? { version: target } : kind === 'start' ? { planId: plan, confirm: true } : {}, kind === 'start' ? () => { pendingStart = true; } : undefined);
|
|
282
|
+
if (stopped || current !== generation)
|
|
283
|
+
return;
|
|
284
|
+
view = received;
|
|
285
|
+
authRequired = false;
|
|
286
|
+
if (view.state !== 'installing')
|
|
287
|
+
pendingStart = false;
|
|
288
|
+
openConfirmation = kind === 'prepare' && planReady();
|
|
289
|
+
}
|
|
290
|
+
catch (caught) {
|
|
291
|
+
error = caught;
|
|
292
|
+
// An explicit server refusal is conclusive; a lost response is not.
|
|
293
|
+
if (!stopped && current === generation && kind === 'start' && caught instanceof Error
|
|
294
|
+
&& ['UPDATE_AUTH', 'UPDATE_CONFLICT'].includes(caught.message))
|
|
295
|
+
pendingStart = false;
|
|
296
|
+
}
|
|
297
|
+
finally {
|
|
298
|
+
if (!stopped && current === generation) {
|
|
299
|
+
busy = false;
|
|
300
|
+
render();
|
|
301
|
+
if (error !== undefined)
|
|
302
|
+
errorMessage(error);
|
|
303
|
+
else if (openConfirmation && confirm instanceof HTMLDialogElement && !confirm.open)
|
|
304
|
+
confirm.showModal();
|
|
305
|
+
schedule();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
check?.addEventListener('click', () => { void action('check'); });
|
|
310
|
+
prepare?.addEventListener('click', () => {
|
|
311
|
+
if (busy || loading || pendingStart || authRequired || stopped)
|
|
312
|
+
return;
|
|
313
|
+
if (view?.state === 'prepared') {
|
|
314
|
+
if (planReady() && confirm instanceof HTMLDialogElement && !confirm.open)
|
|
315
|
+
confirm.showModal();
|
|
316
|
+
}
|
|
317
|
+
else
|
|
318
|
+
void action('prepare');
|
|
319
|
+
});
|
|
320
|
+
confirmStart?.addEventListener('click', () => { void action('start'); });
|
|
321
|
+
cancel?.addEventListener('click', () => { if (confirm instanceof HTMLDialogElement && confirm.open)
|
|
322
|
+
confirm.close(); });
|
|
323
|
+
window.addEventListener('pagehide', () => {
|
|
324
|
+
stopped = true;
|
|
325
|
+
generation++;
|
|
326
|
+
activeRequest?.abort();
|
|
327
|
+
activeRequest = null;
|
|
328
|
+
busy = false;
|
|
329
|
+
loading = false;
|
|
330
|
+
if (requestTimeout !== null)
|
|
331
|
+
clearTimeout(requestTimeout);
|
|
332
|
+
requestTimeout = null;
|
|
333
|
+
if (poll !== null)
|
|
334
|
+
clearTimeout(poll);
|
|
335
|
+
poll = null;
|
|
336
|
+
});
|
|
337
|
+
window.addEventListener('pageshow', () => { if (stopped) {
|
|
338
|
+
stopped = false;
|
|
339
|
+
void load();
|
|
340
|
+
} });
|
|
341
|
+
document.addEventListener('visibilitychange', () => { if (!document.hidden)
|
|
342
|
+
void load();
|
|
343
|
+
else
|
|
344
|
+
schedule(); });
|
|
345
|
+
void load();
|
|
346
|
+
}
|
|
347
|
+
if (document.readyState === 'loading')
|
|
348
|
+
document.addEventListener('DOMContentLoaded', start, { once: true });
|
|
349
|
+
else
|
|
350
|
+
start();
|
|
351
|
+
})();
|
package/ui/www/index.html
CHANGED
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
<!-- NexoWatt iOS Icons -->
|
|
42
42
|
<script src="/static/nw-i18n.js" defer></script>
|
|
43
43
|
<script defer src="/eos-session-idle.js"></script>
|
|
44
|
+
<link rel="stylesheet" href="/static/eos-updates.css">
|
|
45
|
+
<script src="/static/eos-updates.js" defer></script>
|
|
44
46
|
</head>
|
|
45
47
|
<!-- NexoWatt Detail-Kommentar (DE) -->
|
|
46
48
|
<!-- Hauptseite des Kunden-Dashboards. IDs und data-tab-content-Werte sind Verträge mit www/app.js; nicht umbenennen ohne JS-Anpassung. -->
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"purpose": "any"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"version": "9.0.
|
|
54
|
-
"appVersion": "9.0.
|
|
53
|
+
"version": "9.0.21",
|
|
54
|
+
"appVersion": "9.0.21",
|
|
55
55
|
"id": "/",
|
|
56
56
|
"lang": "de",
|
|
57
|
-
"description": "NexoWatt EOS
|
|
57
|
+
"description": "NexoWatt EOS \u2013 Energie und SmartHome auf deinem Ger\u00e4t."
|
|
58
58
|
}
|