trying something with the library

This commit is contained in:
2025-10-27 11:49:17 +00:00
parent 2b742cbeb7
commit 140105f6cb
7 changed files with 184 additions and 13 deletions

View File

@@ -1,8 +1,12 @@
<script setup lang="ts">
import {IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonInput, IonToggle} from "@ionic/vue";
import {IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonInput} from "@ionic/vue";
import useArchiveStore from "@/stores/archive";
import {ref} from "vue";
const emit = defineEmits<{(e: "disconnect"): void, (e: "back"): void}>();
const archive = useArchiveStore();
const url = ref<string>("");
const disconnect = () => {
emit("disconnect")
@@ -11,6 +15,11 @@ const disconnect = () => {
const back = () => {
emit("back")
}
const setSource = () => {
archive.setUrl(url.value);
}
</script>
<template>
@@ -28,12 +37,8 @@ const back = () => {
</ion-card-header>
<ion-card-content>
<ion-input label="Source" placeholder="https://git.example.com/user/repo/releases.rss"></ion-input>
<ion-button>Set source</ion-button>
<br>
<br>
<ion-toggle>Allow pre-release versions</ion-toggle>
<br>
<ion-input label="Source" placeholder="https://git.example.com/user/repo/releases" v-model="url"></ion-input>
<ion-button @click="setSource">Set source</ion-button>
<br>
<ion-button @click="back">Back</ion-button>
</ion-card-content>

View File

@@ -1,8 +1,8 @@
import { createApp } from 'vue'
import {createApp} from 'vue'
import App from './App.vue'
import router from './router';
import { IonicVue } from '@ionic/vue';
import {IonicVue} from '@ionic/vue';
/* Core CSS required for Ionic components to work properly */
import '@ionic/vue/css/core.css';
@@ -33,11 +33,13 @@ import '@ionic/vue/css/palettes/dark.system.css';
/* Theme variables */
import './theme/variables.css';
import {createPinia} from "pinia";
const app = createApp(App)
.use(IonicVue)
.use(router);
.use(IonicVue)
.use(router)
.use(createPinia());
router.isReady().then(() => {
app.mount('#app');
app.mount('#app');
});

24
src/stores/archive.ts Normal file
View File

@@ -0,0 +1,24 @@
import { defineStore } from "pinia";
import Updater from "updaterweblibrary";
const useArchiveStore = defineStore("archive", {
state: () => (
{updater: new Updater()}
),
getters: {
getUrl(): string {
return this.updater.archiveURL;
}
},
actions: {
setUrl(value: string): void {
this.updater = new Updater(value, "rss");
},
async testArchive(): Promise<void> {
this.updater.getArchive();
}
}
});
export default useArchiveStore;