Complete platform management workflows
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user