diff --git a/src/main/angular/src/app/app.html b/src/main/angular/src/app/app.html index a3bbbc4..a79f044 100644 --- a/src/main/angular/src/app/app.html +++ b/src/main/angular/src/app/app.html @@ -9,6 +9,10 @@ {{ menuService.title }} + + diff --git a/src/main/angular/src/app/app.ts b/src/main/angular/src/app/app.ts index 92eb718..d3e79e6 100644 --- a/src/main/angular/src/app/app.ts +++ b/src/main/angular/src/app/app.ts @@ -1,13 +1,12 @@ import {Component, OnDestroy, OnInit} from '@angular/core'; import {Router, RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router'; import {FaIconComponent} from '@fortawesome/angular-fontawesome'; -import {faBars, faBookmark as faBookmarkSolid, faGear, faGears} from '@fortawesome/free-solid-svg-icons'; +import {faBars, faGears} from '@fortawesome/free-solid-svg-icons'; import {MenuService} from './menu-service'; import {Location} from './location/Location'; import {LocationService} from './location/location-service'; import {WebsocketService} from './common'; -import {ConfigService} from './config.service'; -import {faBookmark as faBookmarkRegular} from '@fortawesome/free-regular-svg-icons'; +import {faHome} from '@fortawesome/free-regular-svg-icons'; @Component({ selector: 'app-root', @@ -17,6 +16,8 @@ import {faBookmark as faBookmarkRegular} from '@fortawesome/free-regular-svg-ico }) export class App implements OnInit, OnDestroy { + protected readonly faGears = faGears; + protected readonly faBars = faBars; protected showDrawer: boolean = false; @@ -25,7 +26,6 @@ export class App implements OnInit, OnDestroy { constructor( readonly locationService: LocationService, - readonly configService: ConfigService, readonly menuService: MenuService, readonly router: Router, readonly ws: WebsocketService, @@ -48,11 +48,5 @@ export class App implements OnInit, OnDestroy { }) } - protected readonly faBookmarkRegular = faBookmarkRegular; - - protected readonly faBookmarkSolid = faBookmarkSolid; - - protected readonly faGear = faGear; - - protected readonly faGears = faGears; + protected readonly faHome = faHome; } diff --git a/src/main/angular/src/app/settings/settings-component.html b/src/main/angular/src/app/settings/settings-component.html index b5c156b..1d2c4f2 100644 --- a/src/main/angular/src/app/settings/settings-component.html +++ b/src/main/angular/src/app/settings/settings-component.html @@ -16,17 +16,7 @@
-
- -
-
- -
+ +
diff --git a/src/main/angular/src/app/settings/settings-component.ts b/src/main/angular/src/app/settings/settings-component.ts index 4c71d29..3e267d9 100644 --- a/src/main/angular/src/app/settings/settings-component.ts +++ b/src/main/angular/src/app/settings/settings-component.ts @@ -1,30 +1,36 @@ -import {Component} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {LocationSelect} from '../location/select/location-select'; import {LocationService} from '../location/location-service'; import {Location} from '../location/Location' import {ConfigService} from '../config.service'; -import {config} from 'rxjs'; import {FormsModule} from '@angular/forms'; +import {Checkbox} from '../shared/checkbox/checkbox'; +import {MenuService} from '../menu-service'; @Component({ selector: 'app-settings-component', imports: [ LocationSelect, - FormsModule + FormsModule, + Checkbox ], templateUrl: './settings-component.html', styleUrl: './settings-component.less', }) -export class SettingsComponent { +export class SettingsComponent implements OnInit { protected location: Location | null = null; constructor( readonly locationService: LocationService, readonly configService: ConfigService, + readonly menuService: MenuService, ) { // } - protected readonly config = config; + ngOnInit(): void { + this.menuService.title = "Einstellungen"; + } + } diff --git a/src/main/angular/src/app/shared/checkbox/checkbox.html b/src/main/angular/src/app/shared/checkbox/checkbox.html new file mode 100644 index 0000000..d1930aa --- /dev/null +++ b/src/main/angular/src/app/shared/checkbox/checkbox.html @@ -0,0 +1,12 @@ +
+
+ @if (initial) { +
+   +
+ } +
+
+ {{ label }} +
+
diff --git a/src/main/angular/src/app/shared/checkbox/checkbox.less b/src/main/angular/src/app/shared/checkbox/checkbox.less new file mode 100644 index 0000000..579e76c --- /dev/null +++ b/src/main/angular/src/app/shared/checkbox/checkbox.less @@ -0,0 +1,21 @@ +.all { + display: flex; + + .box { + height: 1em; + aspect-ratio: 1; + border: 1px solid lightgray; + padding: 0.1em; + margin: 0.2em 0.2em 0.2em 0; + + .inside { + width: 100%; + height: 100%; + background-color: steelblue; + } + } + + .label { + flex: 1; + } +} diff --git a/src/main/angular/src/app/shared/checkbox/checkbox.ts b/src/main/angular/src/app/shared/checkbox/checkbox.ts new file mode 100644 index 0000000..082c04b --- /dev/null +++ b/src/main/angular/src/app/shared/checkbox/checkbox.ts @@ -0,0 +1,20 @@ +import {Component, EventEmitter, Input, Output} from '@angular/core'; + +@Component({ + selector: 'app-checkbox', + imports: [], + templateUrl: './checkbox.html', + styleUrl: './checkbox.less', +}) +export class Checkbox { + + @Input() + initial: boolean = false; + + @Input() + label: string = ""; + + @Output() + readonly onChange: EventEmitter = new EventEmitter(); + +}