aboutsummaryrefslogtreecommitdiff
path: root/src_frontend/Components/Settings/System.svelte
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-09-19 19:43:11 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-09-19 19:43:11 +0200
commit7bdce37fd3f18e2712e18c4e2c64cac69af0aca1 (patch)
treeb7ad3f1cca92e2dfd2664ae9e65652bd03ff58b2 /src_frontend/Components/Settings/System.svelte
parente6880cd8ccf82d993f222cb14b4860581654acb8 (diff)
downloadLuxcena-Neo-7bdce37fd3f18e2712e18c4e2c64cac69af0aca1.tar.gz
Luxcena-Neo-7bdce37fd3f18e2712e18c4e2c64cac69af0aca1.zip
:boom: Introduce new UI based on svelte, and rewrite a lot of the node app and the NeoRuntime
Diffstat (limited to 'src_frontend/Components/Settings/System.svelte')
-rw-r--r--src_frontend/Components/Settings/System.svelte34
1 files changed, 34 insertions, 0 deletions
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