From 1fa96e6b953f944737a63ad22665cf8cc13a4923 Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Fri, 13 Oct 2023 22:34:56 +0300 Subject: [PATCH 1/2] Add and --- webif/src/routes/Characteristics.svelte | 28 ++++++++++++---------- webif/src/routes/Circuits.svelte | 32 ++++++++++++++----------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/webif/src/routes/Characteristics.svelte b/webif/src/routes/Characteristics.svelte index 2209060..afa6535 100644 --- a/webif/src/routes/Characteristics.svelte +++ b/webif/src/routes/Characteristics.svelte @@ -4,18 +4,22 @@

Characteristics

- - - - - - - {#each sensorData as data} + - - - - + + + + - {/each} + + + {#each sensorData as data} + + + + + + + {/each} +
NamePhaseVoltageFrequency
{data.characteristics.name}{data.characteristics.phase}{data.voltage}V{data.frequency}HzNamePhaseVoltageFrequency
{data.characteristics.name}{data.characteristics.phase}{data.voltage}V{data.frequency}Hz
diff --git a/webif/src/routes/Circuits.svelte b/webif/src/routes/Circuits.svelte index e6c5bed..2302597 100644 --- a/webif/src/routes/Circuits.svelte +++ b/webif/src/routes/Circuits.svelte @@ -4,20 +4,24 @@

All circuits

- - - - - - - - {#each sensorData as data} + - - - - - + + + + + - {/each} + + + {#each sensorData as data} + + + + + + + + {/each} +
CircuitGroupCircuit typeSensor typePower
{data.circuit.name}{data.circuit.group ?? ''}{data.circuit.type}{data.circuit.sensor.type}{data.watts}WCircuitGroupCircuit typeSensor typePower
{data.circuit.name}{data.circuit.group ?? ''}{data.circuit.type}{data.circuit.sensor.type}{data.watts}W
From 793cd985e0d1318a52e1790ac19452d7bbf9af6f Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Fri, 13 Oct 2023 22:35:43 +0300 Subject: [PATCH 2/2] Add Pure.css, remove some boilerplate Better base to build on now --- webif/package-lock.json | 7 +++ webif/package.json | 1 + webif/src/routes/+layout.svelte | 75 +++++++++---------------- webif/src/routes/+page.svelte | 50 +++++++---------- webif/src/routes/Characteristics.svelte | 2 +- webif/src/routes/Circuits.svelte | 2 +- 6 files changed, 57 insertions(+), 80 deletions(-) diff --git a/webif/package-lock.json b/webif/package-lock.json index aa4e815..f283877 100644 --- a/webif/package-lock.json +++ b/webif/package-lock.json @@ -16,6 +16,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-svelte": "^2.30.0", "prettier": "^2.8.0", + "purecss": "^3.0.0", "svelte": "^4.0.5", "svelte-check": "^3.4.3", "tslib": "^2.4.1", @@ -2417,6 +2418,12 @@ "node": ">=6" } }, + "node_modules/purecss": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/purecss/-/purecss-3.0.0.tgz", + "integrity": "sha512-IdYbGwbmuA7Hy9ACIO1q7ks4xGLcJSVHxJT2BXIz2c4Ve1aSrNU5bAzA1ILT4Gmdy5K59ruWoRPf9WvJZU5fbA==", + "dev": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", diff --git a/webif/package.json b/webif/package.json index cec9fa9..1b9f539 100644 --- a/webif/package.json +++ b/webif/package.json @@ -21,6 +21,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-svelte": "^2.30.0", "prettier": "^2.8.0", + "purecss": "^3.0.0", "svelte": "^4.0.5", "svelte-check": "^3.4.3", "tslib": "^2.4.1", diff --git a/webif/src/routes/+layout.svelte b/webif/src/routes/+layout.svelte index 35ee54f..7546cd9 100644 --- a/webif/src/routes/+layout.svelte +++ b/webif/src/routes/+layout.svelte @@ -1,57 +1,34 @@ + EachWatt + -
+
diff --git a/webif/src/routes/+page.svelte b/webif/src/routes/+page.svelte index a397278..e3fb110 100644 --- a/webif/src/routes/+page.svelte +++ b/webif/src/routes/+page.svelte @@ -66,33 +66,25 @@ }) -
- - -
-
- {#if webSocketUrl === undefined} -

Please add ?ws=ws://x.x.x.x:yyyy to your URL to connect to a server

- {:else} +{#if webSocketUrl === undefined} +

Please add ?ws=ws://x.x.x.x:yyyy to your URL to connect to a server

+{:else} +
- - - - {/if} -
- - +
+
+ + +
+
+
+ +
+
+ +
+
+ +
+
+{/if} diff --git a/webif/src/routes/Characteristics.svelte b/webif/src/routes/Characteristics.svelte index afa6535..7fbf4bd 100644 --- a/webif/src/routes/Characteristics.svelte +++ b/webif/src/routes/Characteristics.svelte @@ -3,7 +3,7 @@

Characteristics

- +
diff --git a/webif/src/routes/Circuits.svelte b/webif/src/routes/Circuits.svelte index 2302597..d2c62fe 100644 --- a/webif/src/routes/Circuits.svelte +++ b/webif/src/routes/Circuits.svelte @@ -3,7 +3,7 @@

All circuits

-
Name
+
Circuit