diff --git a/application.properties b/application.properties index d5d609b..0412072 100644 --- a/application.properties +++ b/application.properties @@ -5,6 +5,8 @@ spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password=password #- +spring.jackson.serialization.indent_output=true +#- spring.jpa.hibernate.ddl-auto=create #- de.ph87.homeautomation.insert-demo-data=true \ No newline at end of file diff --git a/src/main/angular/src/app/app.component.html b/src/main/angular/src/app/app.component.html index 6c27e95..486bdc9 100644 --- a/src/main/angular/src/app/app.component.html +++ b/src/main/angular/src/app/app.component.html @@ -8,10 +8,6 @@ Rollläden - - - -
Stapel
@@ -21,11 +17,11 @@
- Eigenschaften + P
- Kanäle + C
diff --git a/src/main/angular/src/app/app.component.less b/src/main/angular/src/app/app.component.less index f5129a4..1cf00c0 100644 --- a/src/main/angular/src/app/app.component.less +++ b/src/main/angular/src/app/app.component.less @@ -1,15 +1,17 @@ +@import "../config"; + .menubar { - border-bottom: 1px solid black; + border-bottom: @border solid black; .item { float: left; - padding: 10px; - border-right: 1px solid black; + padding: @padding; + border-right: @border solid black; } .itemSecondary { float: right; - border-left: 1px solid black; + border-left: @border solid black; border-right: none; } diff --git a/src/main/angular/src/app/pages/device/list/device-list.component.html b/src/main/angular/src/app/pages/device/list/device-list.component.html index 51fc937..4f538b6 100644 --- a/src/main/angular/src/app/pages/device/list/device-list.component.html +++ b/src/main/angular/src/app/pages/device/list/device-list.component.html @@ -1,76 +1,84 @@ - - +
-
-
- + + +
+
+
+ +
+
+ +
-
- -
-
- An - Aus +
+ An + Aus
-
-
- +
+
+
+ +
+
+ +
-
- -
-
-
- {{scene.title}} +
+
+ {{ scene.title }}
-
-
- +
+
+
+ +
+
+ +
-
- -
-
-
- Auf +
+
+ Auf
-
- 20% +
+ 20%
-
- 30% +
+ 30%
-
- 40% +
+ 40%
-
- 50% +
+ 50%
-
- 60% +
+ 60%
-
- 70% +
+ 70%
-
- 80% +
+ 80%
-
- 90% +
+ 90%
-
- Zu +
+ Zu
- + +
diff --git a/src/main/angular/src/app/pages/device/list/device-list.component.less b/src/main/angular/src/app/pages/device/list/device-list.component.less index 3914e6b..8727536 100644 --- a/src/main/angular/src/app/pages/device/list/device-list.component.less +++ b/src/main/angular/src/app/pages/device/list/device-list.component.less @@ -1,71 +1,17 @@ -.device { - padding: 5px; - margin-bottom: 5px; - border-radius: 10px; +@import "../../../../config"; - @media (min-width: 1000px) { - float: left; - width: 400px; - margin-right: 5px; - } - - .tileHeadTitle { - float: left; - font-weight: bold; - } - - .edit { - float: right; - } - - .controls { - clear: both; - - .control { - position: relative; - float: left; - width: 60px; - height: 60px; - padding: 5px; - margin: 5px; - border-radius: 25%; - } - - .button { - background-color: lightblue; - } - - .control:hover { - background-color: lightskyblue; - } - - } +.control { + float: left; + width: 4em; + aspect-ratio: 1; + margin: @margin; + border-radius: 25%; } -.switchOn { - background-color: palegreen; -} - -.switchOff { - background-color: indianred; -} - -.switchUnknown { - background-color: gray; -} - -.shutterOpen { - background-color: palegreen; -} - -.shutterBetween { - background-color: yellow; -} - -.shutterClosed { - background-color: indianred; -} - -.shutterUnknown { - background-color: gray; +.controlShutter { + width: 17.3%; + padding-top: 1.1em; + text-align: center; + margin: calc(@margin / 2); + background-color: lightsteelblue; } diff --git a/src/main/angular/src/app/pages/device/list/device-list.component.ts b/src/main/angular/src/app/pages/device/list/device-list.component.ts index ab3e7fe..e692885 100644 --- a/src/main/angular/src/app/pages/device/list/device-list.component.ts +++ b/src/main/angular/src/app/pages/device/list/device-list.component.ts @@ -81,9 +81,9 @@ export class DeviceListComponent implements OnInit { getSwitchClassList(device: Device): object { const value: number | null | undefined = (device as DeviceSwitch).stateProperty?.readChannel?.value; return { - switchOn: value === 1, - switchOff: value === 0, - switchUnknown: value === null || value === undefined, + deviceSwitchOnBack: value === 1, + deviceSwitchOffBack: value === 0, + disabledBack: value === null || value === undefined, }; } @@ -94,10 +94,10 @@ export class DeviceListComponent implements OnInit { getShutterClassList(device: Device): object { const value: number | null | undefined = (device as DeviceShutter).positionProperty?.readChannel?.value; return { - shutterOpen: value === 0, - shutterBetween: value !== null && value !== undefined && value > 0 && value < 100, - shutterClosed: value === 100, - shutterUnknown: value === null || value === undefined, + deviceShutterOpenBack: value === 0, + deviceShutterIntermediateBack: value !== null && value !== undefined && value > 0 && value < 100, + deviceShutterClosedBack: value === 100, + disabledBack: value === null || value === undefined, }; } diff --git a/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.html b/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.html index 0d0a181..ff0760a 100644 --- a/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.html +++ b/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.html @@ -13,12 +13,15 @@
-
+
+
+ +
@@ -116,4 +119,8 @@
+
+ +
+ diff --git a/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.ts b/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.ts index 6604a98..0c969f3 100644 --- a/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.ts +++ b/src/main/angular/src/app/pages/schedule/editor/schedule-editor.component.ts @@ -12,7 +12,7 @@ import {Bulk} from "../../../api/bulk/Bulk"; import {BulkService} from "../../../api/bulk/BulkService"; import {Zenith} from "../../../api/schedule/entry/Zenith"; import {TimeService} from "../../../api/time.service"; -import {faCheckCircle, faCircle} from "@fortawesome/free-regular-svg-icons"; +import {faCheckCircle, faCircle, faTimesCircle} from "@fortawesome/free-regular-svg-icons"; const DAY_MINUTES: number = 24 * 60; @@ -134,4 +134,6 @@ export class ScheduleEditorComponent implements OnInit { protected readonly faCheckCircle = faCheckCircle; protected readonly faCircle = faCircle; + + protected readonly faTimesCircle = faTimesCircle; } diff --git a/src/main/angular/src/app/pages/schedule/list/schedule-list.component.html b/src/main/angular/src/app/pages/schedule/list/schedule-list.component.html index 6657aa2..dca8cb6 100644 --- a/src/main/angular/src/app/pages/schedule/list/schedule-list.component.html +++ b/src/main/angular/src/app/pages/schedule/list/schedule-list.component.html @@ -9,7 +9,7 @@
-
+
{{ schedule.title }}
diff --git a/src/main/angular/src/app/shared/number/number.component.less b/src/main/angular/src/app/shared/number/number.component.less index c4c439c..a56448a 100644 --- a/src/main/angular/src/app/shared/number/number.component.less +++ b/src/main/angular/src/app/shared/number/number.component.less @@ -1,7 +1,9 @@ +@import "../../../config"; + input { outline: none; border: none; - padding: 5px; + padding: @padding; margin: 0; width: 100%; background-color: transparent; diff --git a/src/main/angular/src/app/shared/search/search.component.less b/src/main/angular/src/app/shared/search/search.component.less index 30e4f3a..1465331 100644 --- a/src/main/angular/src/app/shared/search/search.component.less +++ b/src/main/angular/src/app/shared/search/search.component.less @@ -1,22 +1,24 @@ +@import "../../../config"; + .all { .initial { - padding: 5px; + padding: @padding; height: 100%; } .selected { font-weight: bold; - border-bottom: 1px solid black; + border-bottom: @border solid black; } .resultList { position: absolute; background-color: lightgray; - min-width: 200px; - border: 1px solid black; + min-width: 10em; + border: @border solid black; .result { - padding: 5px; + padding: @padding; } .result:hover { diff --git a/src/main/angular/src/config.less b/src/main/angular/src/config.less index 2fef0e6..4960a7e 100644 --- a/src/main/angular/src/config.less +++ b/src/main/angular/src/config.less @@ -3,18 +3,10 @@ @border: 0.05em; @border-radius: 0.2em; -.disabledFont { - color: gray; -} - .disabledBack { background-color: gray; } -.enabledFont { - color: #8fbc8f; -} - .enabledBack { background-color: #8fbc8f; } @@ -34,3 +26,23 @@ .fuzzyBack { background-color: #88c0ff; } + +.deviceSwitchOnBack { + background-color: #8fbc8f; +} + +.deviceSwitchOffBack { + background-color: #bc8f8f; +} + +.deviceShutterOpenBack { + background-color: #8fbc8f; +} + +.deviceShutterIntermediateBack { + background-color: #e4db9c; +} + +.deviceShutterClosedBack { + background-color: #bc8f8f; +} diff --git a/src/main/angular/src/styles.less b/src/main/angular/src/styles.less index e1f15f9..fe71f9f 100644 --- a/src/main/angular/src/styles.less +++ b/src/main/angular/src/styles.less @@ -1,3 +1,5 @@ +@import "config"; + * { box-sizing: border-box; } @@ -54,11 +56,11 @@ table { td, th { height: 0; // (=> auto growth) enables use of height percent for children - padding: 5px; - border: 1px solid black; + padding: @padding; + border: @border solid black; img.fullCell { - margin: -5px; + margin: calc(-@margin); } } @@ -70,14 +72,6 @@ table.vertical { } } -.center { - position: absolute; - margin: 0; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - .empty { text-align: center; color: gray; diff --git a/src/main/java/de/ph87/homeautomation/web/WebConfig.java b/src/main/java/de/ph87/homeautomation/web/WebConfig.java index bf1c8f8..307b09b 100644 --- a/src/main/java/de/ph87/homeautomation/web/WebConfig.java +++ b/src/main/java/de/ph87/homeautomation/web/WebConfig.java @@ -1,5 +1,6 @@ package de.ph87.homeautomation.web; +import lombok.NonNull; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; @@ -27,7 +28,7 @@ public class WebConfig implements WebMvcConfigurer { .addResourceLocations("classpath:/resources/") .resourceChain(true) .addResolver(new PathResourceResolver() { - protected Resource getResource(String resourcePath, Resource roomLocation) throws IOException { + protected Resource getResource(@NonNull String resourcePath, @NonNull Resource roomLocation) throws IOException { Resource requestedResource = roomLocation.createRelative(resourcePath); return requestedResource.exists() && requestedResource.isReadable() ? requestedResource : new ClassPathResource("/resources/index.html"); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f9fffb6..492b37b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,6 +5,4 @@ spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.Im spring.jpa.hibernate.ddl-auto=update spring.jpa.open-in-view=false #- -spring.jackson.serialization.indent_output=true -#- spring.main.banner-mode=off