manage launcher backend runtime env
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-07-06 10:25:02 +09:00
parent 1d182e8fc6
commit 048f39246e
2 changed files with 184 additions and 1 deletions
+35
View File
@@ -314,10 +314,45 @@ export function deleteLauncherCommonSetting(id: string) {
return apiRequest<{ deleted: boolean }>(`/launcher/common-settings/${id}`, { method: 'DELETE' });
}
export type RuntimeWorkloadEnvVariable = {
key: string;
value: string;
editable: boolean;
source: string;
};
export function loadLauncherRuntimeResources(namespace = 'studio-system') {
return apiRequest<RuntimeResourceResponse>(`/apps/runtime-namespaces/${encodeURIComponent(namespace)}/resources`);
}
export function loadRuntimeWorkloadEnv(namespace: string, kind: string, name: string) {
return apiRequest<{
namespace: string;
target: string;
container: string | null;
variables: RuntimeWorkloadEnvVariable[];
}>(`/runtime/workloads/${encodeURIComponent(namespace)}/${encodeURIComponent(kind.toLowerCase())}/${encodeURIComponent(name)}/env`);
}
export function saveRuntimeWorkloadEnv(
namespace: string,
kind: string,
name: string,
variables: Array<{ key: string; value: string }>
) {
return apiRequest<{
namespace: string;
target: string;
container: string | null;
variables: RuntimeWorkloadEnvVariable[];
}>(`/runtime/workloads/${encodeURIComponent(namespace)}/${encodeURIComponent(kind.toLowerCase())}/${encodeURIComponent(name)}/env`, {
method: 'PATCH',
body: JSON.stringify({ variables })
});
}
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}`