beta-0.8
This commit is contained in:
+39
-2
@@ -1,7 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
import { onMounted, ref } from "vue";
|
||||
import { enable, disable, isEnabled } from "@tauri-apps/plugin-autostart";
|
||||
import ProjectList from "./components/ProjectList.vue";
|
||||
import PoolList from "./components/PoolList.vue";
|
||||
|
||||
const tab = ref<"projects" | "pools">("projects");
|
||||
const autostart = ref(false);
|
||||
|
||||
onMounted(async () => {
|
||||
autostart.value = await isEnabled();
|
||||
});
|
||||
|
||||
async function toggleAutostart() {
|
||||
if (autostart.value) {
|
||||
await disable();
|
||||
} else {
|
||||
await enable();
|
||||
}
|
||||
autostart.value = await isEnabled();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<HelloWorld />
|
||||
<header>
|
||||
<h1>AI Control</h1>
|
||||
<nav>
|
||||
<button :class="{ active: tab === 'projects' }" @click="tab = 'projects'">
|
||||
Projekte
|
||||
</button>
|
||||
<button :class="{ active: tab === 'pools' }" @click="tab = 'pools'">
|
||||
Pools
|
||||
</button>
|
||||
</nav>
|
||||
<label class="autostart">
|
||||
<input type="checkbox" :checked="autostart" @change="toggleAutostart" />
|
||||
Autostart
|
||||
</label>
|
||||
</header>
|
||||
<main>
|
||||
<ProjectList v-if="tab === 'projects'" />
|
||||
<PoolList v-else />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user