bug fixing and deploy and build diagnostics

This commit is contained in:
Dorian
2026-03-22 03:30:21 +00:00
parent 1f8287c4c3
commit e4e0ef4f11
198 changed files with 21703 additions and 19587 deletions
+86
View File
@@ -0,0 +1,86 @@
// Server store — computed server state and RPC action proxies
import { defineStore } from 'pinia'
import { computed } from 'vue'
import { rpcClient } from '../api/rpc-client'
import { useSyncStore } from './sync'
export const useServerStore = defineStore('server', () => {
const sync = useSyncStore()
// Computed — derived from sync store's data
const serverName = computed(() => sync.serverInfo?.name || 'Archipelago')
const isRestarting = computed(() => sync.serverInfo?.['status-info']?.restarting || false)
const isShuttingDown = computed(() => sync.serverInfo?.['status-info']?.['shutting-down'] || false)
const isOffline = computed(() => !sync.isConnected || isRestarting.value || isShuttingDown.value)
// Package actions
async function installPackage(id: string, marketplaceUrl: string, version: string): Promise<string> {
return rpcClient.installPackage(id, marketplaceUrl, version)
}
async function uninstallPackage(id: string): Promise<void> {
return rpcClient.uninstallPackage(id)
}
async function startPackage(id: string): Promise<void> {
return rpcClient.startPackage(id)
}
async function stopPackage(id: string): Promise<void> {
return rpcClient.stopPackage(id)
}
async function restartPackage(id: string): Promise<void> {
return rpcClient.restartPackage(id)
}
// Server actions
async function updateServer(marketplaceUrl: string): Promise<'updating' | 'no-updates'> {
return rpcClient.updateServer(marketplaceUrl)
}
async function restartServer(): Promise<void> {
return rpcClient.restartServer()
}
async function shutdownServer(): Promise<void> {
return rpcClient.shutdownServer()
}
async function getMetrics(): Promise<Record<string, unknown>> {
return rpcClient.getMetrics()
}
// Marketplace actions
async function getMarketplace(url: string): Promise<Record<string, unknown>> {
return rpcClient.getMarketplace(url)
}
function updateServerName(name: string) {
if (sync.data?.['server-info']) {
sync.data['server-info'].name = name
}
}
return {
// Computed
serverName,
isRestarting,
isShuttingDown,
isOffline,
// Actions
installPackage,
uninstallPackage,
startPackage,
stopPackage,
restartPackage,
updateServer,
restartServer,
shutdownServer,
getMetrics,
getMarketplace,
updateServerName,
}
})