From 7bdce37fd3f18e2712e18c4e2c64cac69af0aca1 Mon Sep 17 00:00:00 2001
From: Jakob Stendahl <jakob.stendahl@outlook.com>
Date: Sun, 19 Sep 2021 19:43:11 +0200
Subject: :boom: Introduce new UI based on svelte, and rewrite a lot of the
 node app and the NeoRuntime

---
 src_frontend/Components/Settings/System.svelte | 34 ++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 src_frontend/Components/Settings/System.svelte

(limited to 'src_frontend/Components/Settings/System.svelte')

diff --git a/src_frontend/Components/Settings/System.svelte b/src_frontend/Components/Settings/System.svelte
new file mode 100644
index 0000000..1af4531
--- /dev/null
+++ b/src_frontend/Components/Settings/System.svelte
@@ -0,0 +1,34 @@
+<script>
+    import FloatingButton from "../../ComponentLib/Button/FloatingButton.svelte";
+    import ConfirmActionDialog from "../Dialogs/ConfirmActionDialog.svelte";
+    import { authorizedSocket } from "../../stores/socketStore.js";
+
+    function restartSystem() {
+        authorizedSocket.emit("restart:system");
+    }
+    function restartService() {
+        authorizedSocket.emit("restart:service");
+    }
+
+</script>
+
+<style>
+    h1, p {
+        margin-bottom: 10px;
+    }
+    .button { margin-bottom: 10px; }
+</style>
+
+<div>
+    <h1>System restart</h1>
+    <ConfirmActionDialog title="Are you sure?" text="Are you sure you want to restart the rPI?" action={restartSystem}>
+        <svelte:fragment slot="trigger" let:open>
+            <div class="button"><FloatingButton on:click={open} fullWidth=true>Restart system</FloatingButton></div>
+        </svelte:fragment>
+    </ConfirmActionDialog>
+    <ConfirmActionDialog title="Are you sure?" text="Are you sure you want to restart the Luxcena NEO service?" action={restartService}>
+        <svelte:fragment slot="trigger" let:open>
+            <div class="button"><FloatingButton on:click={open} fullWidth=true>Restart service</FloatingButton></div>
+        </svelte:fragment>
+    </ConfirmActionDialog>
+</div>
\ No newline at end of file
-- 
cgit v1.2.3

