add launcher components management page
This commit is contained in:
@@ -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' }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user