2019-02-18 09:18:32 +00:00
|
|
|
<template>
|
2019-08-03 19:03:45 +00:00
|
|
|
<div id="settings" class="window" role="tabpanel" aria-label="Settings">
|
2019-02-18 09:18:32 +00:00
|
|
|
<div class="header">
|
2019-04-13 20:44:04 +00:00
|
|
|
<SidebarToggle />
|
2019-02-18 09:18:32 +00:00
|
|
|
</div>
|
2022-02-20 01:05:09 +00:00
|
|
|
|
2022-02-19 00:45:25 +00:00
|
|
|
<div class="container">
|
2022-02-20 01:05:09 +00:00
|
|
|
<h1 class="title">Settings</h1>
|
2022-02-19 00:45:25 +00:00
|
|
|
<Navigation />
|
2019-02-18 09:18:32 +00:00
|
|
|
|
2022-02-19 00:45:25 +00:00
|
|
|
<form ref="settingsForm" autocomplete="off" @change="onChange" @submit.prevent>
|
|
|
|
<router-view></router-view>
|
|
|
|
</form>
|
|
|
|
</div>
|
2019-02-18 09:18:32 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-04-13 20:44:04 +00:00
|
|
|
import SidebarToggle from "../SidebarToggle.vue";
|
2022-02-19 00:45:25 +00:00
|
|
|
import Navigation from "../Settings/Navigation.vue";
|
2019-11-15 19:13:26 +00:00
|
|
|
|
2019-02-18 09:18:32 +00:00
|
|
|
export default {
|
|
|
|
name: "Settings",
|
|
|
|
components: {
|
2019-04-13 20:44:04 +00:00
|
|
|
SidebarToggle,
|
2022-02-19 00:45:25 +00:00
|
|
|
Navigation,
|
2019-03-03 15:19:48 +00:00
|
|
|
},
|
2019-02-18 09:18:32 +00:00
|
|
|
methods: {
|
2019-03-03 15:19:48 +00:00
|
|
|
onChange(event) {
|
2019-08-03 19:03:45 +00:00
|
|
|
const ignore = ["old_password", "new_password", "verify_password"];
|
2019-02-18 09:18:32 +00:00
|
|
|
|
2019-03-03 15:19:48 +00:00
|
|
|
const name = event.target.name;
|
2019-02-18 09:18:32 +00:00
|
|
|
|
2019-03-03 15:19:48 +00:00
|
|
|
if (ignore.includes(name)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let value;
|
|
|
|
|
|
|
|
if (event.target.type === "checkbox") {
|
|
|
|
value = event.target.checked;
|
|
|
|
} else {
|
|
|
|
value = event.target.value;
|
|
|
|
}
|
|
|
|
|
2019-11-05 20:51:55 +00:00
|
|
|
this.$store.dispatch("settings/update", {name, value, sync: true});
|
2019-03-03 15:19:48 +00:00
|
|
|
},
|
2019-02-18 09:18:32 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|