ui_migration refactor(store) use pinia stores in components

This commit is contained in:
Antonio Anaya 2026-04-21 23:29:24 -06:00
parent 694a5a690f
commit 3a5a7488dd
25 changed files with 284 additions and 273 deletions

View file

@ -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(() => {});
},