From 6310dc84416ed3159804ccdc6855aa71045396b4 Mon Sep 17 00:00:00 2001
From: Alexander Klein
Date: Thu, 27 Jul 2023 23:00:03 +0200
Subject: [PATCH] half sidebat, half quickControl
---
src/App.vue | 1 +
src/components/AreaControlCard.vue | 147 ++++++++++++++++++++++++
src/components/siteElements/Nav.vue | 5 +-
src/components/siteElements/Sidebar.vue | 118 ++++++++++++++++++-
src/helper/irrigationApi.js | 31 +----
src/router/index.js | 7 ++
src/views/AboutView.vue | 25 +++-
src/views/QuickAreaControlView.vue | 27 +++++
8 files changed, 325 insertions(+), 36 deletions(-)
create mode 100644 src/components/AreaControlCard.vue
diff --git a/src/App.vue b/src/App.vue
index 9e321b2..b7df79c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -37,5 +37,6 @@ main {
.sidebar {
width: auto;
+ min-width: 200px;
}
diff --git a/src/components/AreaControlCard.vue b/src/components/AreaControlCard.vue
new file mode 100644
index 0000000..0e67efc
--- /dev/null
+++ b/src/components/AreaControlCard.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
{{ area.name }}
+
+
Status: Offen
+
Verbleibenede Zeit: {{ valve.remainingTime / 60 }} Min
+
+
+
+
+
+
{{ area.name }}
+
+
Status: Geschlossen
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/siteElements/Nav.vue b/src/components/siteElements/Nav.vue
index 4bbf847..dc9478b 100644
--- a/src/components/siteElements/Nav.vue
+++ b/src/components/siteElements/Nav.vue
@@ -6,11 +6,14 @@ import { RouterLink } from 'vue-router'
diff --git a/src/components/siteElements/Sidebar.vue b/src/components/siteElements/Sidebar.vue
index 349a0f7..5fed348 100644
--- a/src/components/siteElements/Sidebar.vue
+++ b/src/components/siteElements/Sidebar.vue
@@ -1,3 +1,117 @@
+
+
- Sidebar
-
\ No newline at end of file
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/helper/irrigationApi.js b/src/helper/irrigationApi.js
index 7a4d8e6..438f200 100644
--- a/src/helper/irrigationApi.js
+++ b/src/helper/irrigationApi.js
@@ -1,4 +1,4 @@
-const address = "http://127.0.0.1:8040/api/";
+const address = "http://garten.home.kleiax.de/api/";
class IrrigationApi {
constructor() {
@@ -13,10 +13,6 @@ class IrrigationApi {
httpGet('valve', callback);
}
- patchValve(id, valve, callback) {
- httpPatch('valve/' + id, valve, callback);
- }
-
getArea(id, callback) {
httpGet('area/' + id, callback);
@@ -26,10 +22,6 @@ class IrrigationApi {
httpGet('area', callback);
}
- saveAll(callback) {
- httpGet('area/saveAll', callback);
- }
-
createArea(area, callback) {
httpPost('area', area, callback);
}
@@ -42,6 +34,7 @@ class IrrigationApi {
httpPatch('area/' + id, area, callback);
}
+
getAreaConf(id, callback) {
httpGet('areaConf/specific/' + id, callback);
}
@@ -83,26 +76,6 @@ class IrrigationApi {
httpPatch('irrigationEvent/' + id, irrigationEvent, callback);
}
-
- commandManualControlPause(id, duration, callback) {
- httpPost('manualControl/pause/' + id, { duration: duration}, callback);
- }
-
- commandManualControlPauseAll(callback) {
- httpPost('manualControl/pauseAll/', {}, callback);
- }
-
- commandManualControlUniqueIrrigationEvent(id, duration, callback) {
- httpPost('manualControl/uniqueIrrigationEvent/' + id, {duration: duration}, callback);
- }
-
- commandManualControlStop(id, callback) {
- httpPost('manualControl/stop/' + id, {}, callback);
- }
-
- commandManualControlStopAll(duration, callback) {
- httpPost('manualControl/stopAll/', {duration: duration}, callback);
- }
}
function httpGet(apiCall, callback) {
diff --git a/src/router/index.js b/src/router/index.js
index 4af64d0..75da481 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
+import QuickAreaControlView from '../views/QuickAreaControlView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -27,6 +28,12 @@ const router = createRouter({
name: 'api',
component: HomeView
},
+ {
+ path: '/quickControl',
+ name: 'quickControl',
+ component: QuickAreaControlView
+ },
+
]
});
diff --git a/src/views/AboutView.vue b/src/views/AboutView.vue
index 36423e0..ea4f6dc 100644
--- a/src/views/AboutView.vue
+++ b/src/views/AboutView.vue
@@ -1,7 +1,24 @@
+
+
- Seite About
+
+
Seite About
+
+ {{ area.name }}
+
+
-
+
diff --git a/src/views/QuickAreaControlView.vue b/src/views/QuickAreaControlView.vue
index e69de29..108a8b7 100644
--- a/src/views/QuickAreaControlView.vue
+++ b/src/views/QuickAreaControlView.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
+
\ No newline at end of file