Repository: evcc-io/evcc
Pull request #13508 (2024-04-19 20:55:27)

UI: optimize for tall screens
fixes https://github.com/evcc-io/evcc/issues/13505

added special layout for portrait screens (e.g. fridges)

2 loadpoints on tall screen -> 2-row layout

[2 lp responsive.webm](https://github.com/evcc-io/evcc/assets/152287/1ef5e8bc-395e-46e2-af8e-d63f6686c413)


2 loadpoints on taller screen -> 3-row layout

[3 lp responsive.webm](https://github.com/evcc-io/evcc/assets/152287/b8aee2d0-d94f-4827-af0c-dd929f0fa664)



Patch:
diff --git a/assets/js/components/Loadpoints.vue b/assets/js/components/Loadpoints.vue
index 5fd999b7..341e0a78 100644
--- a/assets/js/components/Loadpoints.vue
+++ b/assets/js/components/Loadpoints.vue
@@ -2,7 +2,11 @@
 	<div
 		class="container container--loadpoint px-0 mb-md-2 d-flex flex-column justify-content-center"
 	>
-		<div ref="carousel" class="carousel d-lg-flex flex-wrap">
+		<div
+			ref="carousel"
+			class="carousel d-lg-flex flex-wrap"
+			:class="`carousel--${loadpoints.length}`"
+		>
 			<div
 				v-for="(loadpoint, index) in loadpoints"
 				:key="index"
@@ -188,7 +192,7 @@ export default {
 	}
 }
 
-/* breakpoint lg */
+/* breakpoint lg, 2-col grid */
 @media (min-width: 992px) {
 	.carousel {
 		display: grid !important;
@@ -196,4 +200,20 @@ export default {
 		grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
 	}
 }
+
+/* breakpoint lg, tall screen, 2 loadpoints rows */
+@media (min-width: 992px) and (min-height: 1450px) {
+	.carousel--2 {
+		grid-gap: 4rem;
+		grid-template-columns: 1fr;
+	}
+}
+
+/* breakpoint lg, taller screen, 3 loadpoints rows */
+@media (min-width: 992px) and (min-height: 1900px) {
+	.carousel--3 {
+		grid-gap: 4rem;
+		grid-template-columns: 1fr;
+	}
+}
 </style>
diff --git a/assets/js/views/App.vue b/assets/js/views/App.vue
index 20915352..a6bdb162 100644
--- a/assets/js/views/App.vue
+++ b/assets/js/views/App.vue
@@ -64,7 +64,7 @@ export default {
 		offline: function () {
 			updateAuthStatus();
 		},
-		startupErrors: function (now, prev) {
+		startupErrors: function (now) {
 			if (now) {
 				console.log("startup errors detected. redirecting to error page");
 				this.$router.push("/error");
diff --git a/package.json b/package.json
index 6034bb1f..70b97111 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
   "scripts": {
     "build": "vite build",
     "test": "TZ=Europe/Berlin vitest",
-    "lint": "prettier assets './**/*.{yml,yaml}' --write && eslint assets/**/*.js assets/**/*.vue --fix",
+    "lint": "prettier assets './**/*.{yml,yaml}' --write && eslint assets/**/*.js assets/**/*.vue --fix --max-warnings=0",
     "dev": "vite",
     "histoire": "histoire dev",
     "playwright": "playwright test --ui",
diff --git a/provider/script.go b/provider/script.go
index e17b207e..3ade8666 100644
--- a/provider/script.go
+++ b/provider/script.go
@@ -70,6 +70,10 @@ func NewScriptProviderFromConfig(other map[string]interface{}) (Provider, error)
 // NewScriptProvider creates a script provider.
 // Script execution is aborted after given timeout.
 func NewScriptProvider(script string, timeout time.Duration, scale float64, cache time.Duration) (*Script, error) {
+	if strings.TrimSpace(script) == "" {
+		return nil, errors.New("script is required")
+	}
+
 	s := &Script{
 		log:     util.NewLogger("script"),
 		script:  script,
diff --git a/templates/definition/charger/easee.yaml b/templates/definition/charger/easee.yaml
index 38a564ac..bfdc2a46 100644
--- a/templates/definition/charger/easee.yaml
+++ b/templates/definition/charger/easee.yaml
@@ -23,6 +23,7 @@ params:
   - name: timeout
     default: 20s
   - name: authorize
+    type: bool
     help:
       de: Steuert ob evcc die Authentifizierung am Charger vornimmt. Vorteil ist ein kontrollierter Ladestart. Nicht kompatibel mit RFID Identifikation von Fahrzeugen.
       en: Controls wether evcc shall perform authentication against charger. Benefit is a contolled start of charging. Not compatible with RFID identification of vehicles.
diff --git a/util/logstash/log.go b/util/logstash/log.go
index 4e434f07..ed555b09 100644
--- a/util/logstash/log.go
+++ b/util/logstash/log.go
@@ -105,10 +105,10 @@ func (l *logger) All(areas []string, level jww.Threshold, count int) []string {
 
 	res := make([]string, 0, r.Len())
 	for range r.Len() {
-		r = r.Next()
 		if e, ok := r.Value.(element); ok && e != "" && (all || e.match(areas, level)) {
 			res = append(res, string(e))
 		}
+		r = r.Next()
 	}
 
 	if count > 0 && len(res) > count {


Test patch:
diff --git a/util/logstash/log_test.go b/util/logstash/log_test.go
index 53193e02..31caad9e 100644
--- a/util/logstash/log_test.go
+++ b/util/logstash/log_test.go
@@ -14,7 +14,7 @@ var (
 )
 
 func TestLog(t *testing.T) {
-	log := New(10)
+	log := New(3)
 
 	// old to new
 	log.Write([]byte(s1))