Complete platform management workflows

This commit is contained in:
npc0-hue
2026-07-14 16:39:37 +08:00
parent 7e05d0a4e7
commit 4f33f761a3
106 changed files with 11313 additions and 460 deletions
@@ -8,6 +8,7 @@ import type {
export type ServerWorkflowViewState = "api" | "local" | "saving";
export type ServerLifecycleActionLabel = "create" | "start" | "stop" | "refresh";
export type ServerRemovalAction = "archive";
export interface ServerCreateFormState {
id: string;
@@ -23,6 +24,17 @@ export interface ServerWorkflowActionState {
message: string;
}
export interface ServerMetadataFormState {
name: string;
}
export interface ServerRemovalConfirmationState {
action: ServerRemovalAction;
serverInstanceId: string;
name: string;
state: ServerInstanceState;
}
export interface ServerManagementSummary {
total: number;
running: number;
@@ -83,3 +95,11 @@ export function defaultServerCreateForm(plugins: GamePluginResponse[], endpoints
runEndpointId: endpoints[0]?.id ?? ""
};
}
export function serverMetadataFormFromInstance(instance: ServerInstanceResponse): ServerMetadataFormState {
return { name: instance.name };
}
export function canArchiveServer(state: ServerInstanceState): boolean {
return state !== "running" && state !== "installing" && state !== "deleted";
}