add launcher components management page

This commit is contained in:
2026-07-02 14:36:24 +09:00
parent 20ca8d24dc
commit fedf9481f8
5 changed files with 351 additions and 0 deletions
+18
View File
@@ -1,6 +1,7 @@
import { apiRequest } from '../../lib/api';
import type { AppRelease, AppWithComponents } from '../../types/application';
import type { GiteaRepo } from '../../types/application';
import type { RuntimeResourceResponse, RuntimeWorkloadLogResponse } from '../../types/runtime';
export type LauncherVersion = {
id: string;
@@ -250,3 +251,20 @@ export function updateLauncherCommonSetting(
export function deleteLauncherCommonSetting(id: string) {
return apiRequest<{ deleted: boolean }>(`/launcher/common-settings/${id}`, { method: 'DELETE' });
}
export function loadLauncherRuntimeResources(namespace = 'studio-system') {
return apiRequest<RuntimeResourceResponse>(`/apps/runtime-namespaces/${encodeURIComponent(namespace)}/resources`);
}
export function loadLauncherComponentLogs(namespace: string, kind: string, name: string, tail = 120) {
return apiRequest<RuntimeWorkloadLogResponse>(
`/runtime/workloads/${encodeURIComponent(namespace)}/${encodeURIComponent(kind.toLowerCase())}/${encodeURIComponent(name)}/logs?tail=${tail}`
);
}
export function restartLauncherComponent(namespace: string, kind: string, name: string) {
return apiRequest<{ ok: boolean; action: string; target: string; namespace: string }>(
`/runtime/workloads/${encodeURIComponent(namespace)}/${encodeURIComponent(kind.toLowerCase())}/${encodeURIComponent(name)}/restart`,
{ method: 'POST' }
);
}