import { defineStore } from 'pinia' import { ref } from 'vue' import type { ServerConnection, ServerConfig, ServerStats } from '@/types' export const useServerStore = defineStore('server', () => { const connection = ref(null) const config = ref(null) const stats = ref(null) const isLoading = ref(false) async function fetchServerStatus() { // TODO: Fetch from API } async function fetchServerConfig() { // TODO: Fetch from API } async function startServer() { // TODO: POST /api/servers/:id/start } async function stopServer() { // TODO: POST /api/servers/:id/stop } async function restartServer() { // TODO: POST /api/servers/:id/restart } async function sendCommand(command: string) { // TODO: POST /api/servers/:id/command } function updateStats(newStats: ServerStats) { stats.value = newStats } return { connection, config, stats, isLoading, fetchServerStatus, fetchServerConfig, startServer, stopServer, restartServer, sendCommand, updateStats, } })