FreeDATA/gui/src/components/settings_web.vue

54 lines
1.6 KiB
Vue
Raw Normal View History

2023-09-06 10:23:20 +00:00
<script setup lang="ts">
2023-10-03 19:04:37 +00:00
import { saveSettingsToFile } from "../js/settingsHandler";
2023-10-03 13:15:17 +00:00
import { setActivePinia } from "pinia";
import pinia from "../store/index";
2023-09-06 10:23:20 +00:00
setActivePinia(pinia);
2023-10-03 13:15:17 +00:00
import { useSettingsStore } from "../store/settingsStore.js";
2023-09-06 10:23:20 +00:00
const settings = useSettingsStore(pinia);
2023-10-03 13:15:17 +00:00
function saveSettings() {
saveSettingsToFile();
2023-09-06 19:03:23 +00:00
}
2023-09-06 10:23:20 +00:00
</script>
<template>
2023-10-03 13:15:17 +00:00
<div class="input-group input-group-sm mb-1">
<label class="input-group-text w-50">Explorer publishing</label>
<label class="input-group-text w-50">
<div class="form-check form-switch form-check-inline">
<input
class="form-check-input"
type="checkbox"
id="ExplorerSwitch"
@change="saveSettings"
v-model="settings.enable_explorer"
true-value="True"
false-value="False"
/>
<label class="form-check-label" for="ExplorerSwitch">Publish</label>
</div>
</label>
</div>
<div class="input-group input-group-sm mb-1">
<label class="input-group-text w-50">Explorer stats publishing</label>
<label class="input-group-text w-50">
<div class="form-check form-switch form-check-inline">
<input
class="form-check-input"
type="checkbox"
id="ExplorerStatsSwitch"
@change="saveSettings"
2023-10-03 19:04:37 +00:00
v-model="settings.explorer_stats"
2023-10-03 13:15:17 +00:00
true-value="True"
false-value="False"
/>
<label class="form-check-label" for="ExplorerStatsSwitch"
>Publish stats</label
>
</div>
</label>
</div>
2023-09-06 10:23:20 +00:00
</template>