ui_migration refactor(store) use pinia stores in components
This commit is contained in:
parent
694a5a690f
commit
3a5a7488dd
25 changed files with 284 additions and 273 deletions
|
|
@ -29,6 +29,9 @@
|
|||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { useWotStore } from "@/stores/wot.js";
|
||||
import { mapActions } from "pinia";
|
||||
import { useSettingsStore } from "@/stores/settings.js";
|
||||
|
||||
export default {
|
||||
name: "PowerContent",
|
||||
|
|
@ -52,6 +55,8 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
...mapActions(useSettingsStore, ["resetState"]),
|
||||
...mapActions(useWotStore, ["deleteAllThingDescriptions"]),
|
||||
systemRequest: function (action) {
|
||||
let message = "";
|
||||
if (action == "reboot") {
|
||||
|
|
@ -61,8 +66,8 @@ export default {
|
|||
}
|
||||
this.modalConfirm(message).then(
|
||||
() => {
|
||||
this.$store.commit("resetState");
|
||||
this.$store.commit("wot/deleteAllThingDescriptions");
|
||||
this.resetState();
|
||||
this.deleteAllThingDescriptions();
|
||||
// Post and silence errors
|
||||
axios.post(this.thingActionUrl("system", action)).catch(() => {});
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue