feat(frontend): add Mods page with table view, delete, and cleanup

This commit is contained in:
MrFastwind
2026-07-06 16:10:32 +02:00
parent c06a9a7981
commit cc7cb0bc56
5 changed files with 151 additions and 1 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
import type { ServerSettings, ServerPaths, ConfigInfo, Modlist, ModlistListItem, ModEntry } from '../types'
import type { ServerSettings, ServerPaths, ConfigInfo, Modlist, ModlistListItem, ModEntry, ModInfo } from '../types'
const BASE = '/api'
@@ -82,6 +82,12 @@ export const steamcmdApi = {
status: () => request<{ running: boolean }>('/server/steamcmd/status'),
}
export const modsApi = {
list: () => request<ModInfo[]>('/mods'),
remove: (path: string) => request<void>('/mods', { method: 'DELETE', body: JSON.stringify({ path }) }),
cleanup: () => request<{ deleted: number }>('/mods/cleanup', { method: 'POST' }),
}
export const logsApi = {
list: () => request<string[]>('/server/logs'),
get: (file: string) => fetch(`${BASE}/server/logs/${file}`).then(r => r.text()),