Requesting user to update

This commit is contained in:
2025-11-18 21:36:31 +00:00
parent e81f4b9d64
commit 60c207ffc5
15 changed files with 332 additions and 186 deletions

View File

@@ -4,7 +4,7 @@
<div class="header-column">
<ion-card-title>HOME</ion-card-title>
<ion-card-title>Board</ion-card-title>
<ion-card-subtitle>v1.1.1</ion-card-subtitle>
<ion-card-subtitle>{{ version }}</ion-card-subtitle>
</div>
<div style="flex-grow: 1"></div>
<div>
@@ -13,24 +13,33 @@
</ion-card-header>
<ion-card-content>
<ion-button @click="update">Update</ion-button>
<ion-button @click="update" v-if="showUpdater">Update</ion-button>
<br>
<ion-button @click="archive">View older versions</ion-button>
<ion-button @click="openArchive">View older versions</ion-button>
<br>
<ion-button @click="settings">Settings</ion-button>
</ion-card-content>
</ion-card>
</template>
<script setup lang="ts">
import useArchiveStore from "@/stores/archive";
import updater from "@/utils/updater";
import {IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle} from "@ionic/vue";
import { onBeforeMount, ref } from "vue";
const emit = defineEmits<{(e: 'update'): void, (e: 'archive'): void, (e: "disconnect"): void, (e: "settings"): void}>();
const archive = useArchiveStore();
const showUpdater = ref<boolean>(false);
const version = ref<string>("");
const update = () => {
archive.setShownI(0);
emit("update");
};
const archive = () => {
const openArchive = () => {
emit("archive");
};
@@ -42,6 +51,10 @@ const settings = () => {
emit("settings")
}
onBeforeMount(async () => {
version.value = await updater.obj.getBoardVersion();
showUpdater.value = await updater.obj.checkForUpdate();
});
</script>
<style scoped>