- Relative Luftfeuchte
+
-
-
-
- Absolute Luftfeuchte
+
+
+
+ Relative Luftfeuchte
+
+
+
-
-
+
+
+
+ Absolute Luftfeuchte
+
+
+
-
+
+ }
}
diff --git a/src/main/angular/src/app/location/detail/location-detail.ts b/src/main/angular/src/app/location/detail/location-detail.ts
index 98c6ad6..923c958 100644
--- a/src/main/angular/src/app/location/detail/location-detail.ts
+++ b/src/main/angular/src/app/location/detail/location-detail.ts
@@ -1,6 +1,6 @@
import {Component, Inject, LOCALE_ID, OnDestroy, OnInit} from '@angular/core';
import {LocationService} from '../location-service';
-import {ActivatedRoute} from '@angular/router';
+import {ActivatedRoute, Params, Router} from '@angular/router';
import {Location} from '../Location';
import {Text} from '../../shared/text/text';
import {Number} from '../../shared/number/number';
@@ -14,6 +14,19 @@ import {Series} from '../../series/Series';
import {SeriesType} from '../../series/SeriesType';
import {DateService} from '../../date.service';
import {LocationPower} from '../power/location-power';
+import {ConfigService} from '../../config.service';
+
+export function paramNumberOrNull(params: Params, key: string): number | null {
+ const param = params[key];
+ if (param === null || param === undefined) {
+ return null;
+ }
+ const value = parseInt(param);
+ if (isNaN(value)) {
+ return null;
+ }
+ return value;
+}
@Component({
selector: 'app-location-detail',
@@ -58,6 +71,8 @@ export class LocationDetail implements OnInit, OnDestroy {
readonly activatedRoute: ActivatedRoute,
readonly menuService: MenuService,
readonly dateService: DateService,
+ readonly configService: ConfigService,
+ readonly router: Router,
@Inject(LOCALE_ID) readonly locale: string,
) {
this.datePipe = new DatePipe(locale);
@@ -65,7 +80,14 @@ export class LocationDetail implements OnInit, OnDestroy {
ngOnInit(): void {
this.locationService.id = null;
- this.subs.push(this.activatedRoute.params.subscribe(params => this.locationService.id = params['id'] || null));
+ this.subs.push(this.activatedRoute.params.subscribe(params => {
+ const id = paramNumberOrNull(params, "id");
+ if (id === null && this.configService.locationId !== null) {
+ this.router.navigate(["Location/" + this.configService.locationId]);
+ return;
+ }
+ this.locationService.id = id;
+ }));
this.subs.push(this.locationService.location$.subscribe(this.onLocationChange));
}
diff --git a/src/main/angular/src/app/location/energy/location-energy.html b/src/main/angular/src/app/location/energy/location-energy.html
index 2fa6d6a..66c175a 100644
--- a/src/main/angular/src/app/location/energy/location-energy.html
+++ b/src/main/angular/src/app/location/energy/location-energy.html
@@ -14,10 +14,12 @@
{{ purchase.toValueString(null) }}
-
- {{ purchasePercentConsume.toValueString(null) }}
- Verbrauch
-
+ @if (configService.energyPercent) {
+
+ {{ purchasePercentConsume.toValueString(null) }}
+ Verbrauch
+
+ }
@@ -27,10 +29,12 @@
{{ produce.toValueString(null) }}
-
- {{ producePercentConsume.toValueString(null) }}
- Verbrauch
-
+ @if (configService.energyPercent) {
+
+ {{ producePercentConsume.toValueString(null) }}
+ Verbrauch
+
+ }
@@ -40,14 +44,16 @@
{{ self.toValueString(null) }}
-
- {{ selfPercentConsume.toValueString(null) }}
- Verbrauch
-
-
- {{ selfPercentProduce.toValueString(null) }}
- Produktion
-
+ @if (configService.energyPercent) {
+
+ {{ selfPercentConsume.toValueString(null) }}
+ Verbrauch
+
+
+ {{ selfPercentProduce.toValueString(null) }}
+ Produktion
+
+ }
@@ -66,14 +72,16 @@
{{ deliver.toValueString(null) }}
-
- {{ deliveryPercentConsume.toValueString(null) }}
- Verbrauch
-
-
- {{ deliveryPercentProduce.toValueString(null) }}
- Produktion
-
+ @if (configService.energyPercent) {
+
+ {{ deliveryPercentConsume.toValueString(null) }}
+ Verbrauch
+
+
+ {{ deliveryPercentProduce.toValueString(null) }}
+ Produktion
+
+ }
diff --git a/src/main/angular/src/app/location/energy/location-energy.ts b/src/main/angular/src/app/location/energy/location-energy.ts
index f595d31..9e5679b 100644
--- a/src/main/angular/src/app/location/energy/location-energy.ts
+++ b/src/main/angular/src/app/location/energy/location-energy.ts
@@ -1,4 +1,4 @@
-import {AfterViewInit, Component, Input, OnDestroy, OnInit, signal} from '@angular/core';
+import {AfterViewInit, Component, Input, OnDestroy, OnInit} from '@angular/core';
import {Location} from '../Location';
import {Series} from '../../series/Series';
import {Next} from '../../common';
@@ -8,6 +8,7 @@ import {SeriesService} from '../../series/series-service';
import {Subscription} from 'rxjs';
import {Value} from '../../series/Value';
import EnergyCharts from './charts/energy-charts';
+import {ConfigService} from '../../config.service';
@Component({
selector: 'app-location-energy',
@@ -20,8 +21,6 @@ import EnergyCharts from './charts/energy-charts';
})
export class LocationEnergy implements OnInit, AfterViewInit, OnDestroy {
- protected readonly signal = signal;
-
protected readonly Interval = Interval;
private readonly subs: Subscription[] = [];
@@ -75,6 +74,7 @@ export class LocationEnergy implements OnInit, AfterViewInit, OnDestroy {
constructor(
readonly pointService: PointService,
readonly serieService: SeriesService,
+ readonly configService: ConfigService,
) {
//
}
diff --git a/src/main/angular/src/app/location/list/location-list.html b/src/main/angular/src/app/location/list/location-list.html
deleted file mode 100644
index 15405e3..0000000
--- a/src/main/angular/src/app/location/list/location-list.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/src/main/angular/src/app/location/list/location-list.ts b/src/main/angular/src/app/location/list/location-list.ts
deleted file mode 100644
index c84b987..0000000
--- a/src/main/angular/src/app/location/list/location-list.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import {Component, OnDestroy, OnInit} from '@angular/core';
-import {LocationService} from '../location-service';
-import {Location} from '../Location';
-import {RouterLink} from '@angular/router';
-import {MenuService} from '../../menu-service';
-
-@Component({
- selector: 'app-location-list',
- imports: [
- RouterLink
- ],
- templateUrl: './location-list.html',
- styleUrl: './location-list.less',
-})
-export class LocationList implements OnInit, OnDestroy {
-
- protected list: Location[] = [];
-
- constructor(
- readonly locationService: LocationService,
- readonly menuService: MenuService,
- ) {
- //
- }
-
- ngOnInit(): void {
- this.locationService.findAll(list => this.list = list);
- this.menuService.title = "Orte";
- }
-
- ngOnDestroy(): void {
- this.menuService.title = "";
- }
-
-}
diff --git a/src/main/angular/src/app/location/location-service.ts b/src/main/angular/src/app/location/location-service.ts
index 5786155..b4f23ca 100644
--- a/src/main/angular/src/app/location/location-service.ts
+++ b/src/main/angular/src/app/location/location-service.ts
@@ -25,8 +25,14 @@ export class LocationService extends CrudService