feat(frontend): add Mods page with table view, delete, and cleanup
This commit is contained in:
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user