aboutsummaryrefslogtreecommitdiff
path: root/src_frontend/Components/Settings/System.svelte
diff options
context:
space:
mode:
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