Complete frontend skeleton: Vite + Vue 3 + TypeScript + Tailwind CSS, Pinia stores (auth, server, wipe, plugins), authenticated API composable, full route tree with auth guards, DashboardLayout with sidebar nav, 23 view stubs across auth/admin/public, all TypeScript interfaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
979 B
TypeScript
43 lines
979 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
import type { WipeProfile, WipeSchedule, WipeHistory } from '@/types'
|
|
|
|
export const useWipeStore = defineStore('wipe', () => {
|
|
const profiles = ref<WipeProfile[]>([])
|
|
const schedules = ref<WipeSchedule[]>([])
|
|
const history = ref<WipeHistory[]>([])
|
|
const isLoading = ref(false)
|
|
|
|
async function fetchProfiles() {
|
|
// TODO: GET /api/profiles
|
|
}
|
|
|
|
async function fetchSchedules() {
|
|
// TODO: GET /api/schedules
|
|
}
|
|
|
|
async function fetchHistory() {
|
|
// TODO: GET /api/wipes/history
|
|
}
|
|
|
|
async function triggerWipe(wipeType: string, profileId: string) {
|
|
// TODO: POST /api/wipes/:server_id/trigger
|
|
}
|
|
|
|
async function triggerDryRun(wipeType: string, profileId: string) {
|
|
// TODO: POST /api/wipes/:server_id/dry-run
|
|
}
|
|
|
|
return {
|
|
profiles,
|
|
schedules,
|
|
history,
|
|
isLoading,
|
|
fetchProfiles,
|
|
fetchSchedules,
|
|
fetchHistory,
|
|
triggerWipe,
|
|
triggerDryRun,
|
|
}
|
|
})
|