mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
fix: saving an orchestrator terminal connection wipes policy settings made in Terminals (#33617)
Opening an orchestrator terminal connection in Admin Settings > Integrations and clicking Save overwrote its policy in Terminals with only the fields the dialog shows (image, CPU, memory, storage, idle timeout and environment variables). Everything else set in Terminals, like restricted mode or the pod and container security settings, was lost, so new terminals started without it. Saving now keeps the policy settings the dialog does not show and only updates the ones it shows. Fixes #33580
This commit is contained in:
parent
dd6720c528
commit
47934d1cc2
1 changed files with 16 additions and 1 deletions
|
|
@ -63,6 +63,7 @@
|
|||
let policyStorage = 'ephemeral';
|
||||
let policyStorageSize = '5Gi';
|
||||
let policyIdleTimeout = 30;
|
||||
let loadedPolicyData: Record<string, any> = {};
|
||||
let lifecycleJson = '{}';
|
||||
let refreshOnlyIdle = true;
|
||||
let refreshReset = false;
|
||||
|
|
@ -123,6 +124,7 @@
|
|||
// Restore resources
|
||||
policyCpu = p.cpu_limit ?? '1';
|
||||
policyMemory = p.memory_limit ?? '1Gi';
|
||||
loadedPolicyData = {};
|
||||
lifecycleJson = stringifyJson({});
|
||||
refreshOnlyIdle = true;
|
||||
refreshReset = false;
|
||||
|
|
@ -151,6 +153,7 @@
|
|||
policyStorage = 'ephemeral';
|
||||
policyStorageSize = '5Gi';
|
||||
policyIdleTimeout = 30;
|
||||
loadedPolicyData = {};
|
||||
lifecycleJson = '{}';
|
||||
refreshOnlyIdle = true;
|
||||
refreshReset = false;
|
||||
|
|
@ -180,6 +183,7 @@
|
|||
auth_type
|
||||
);
|
||||
const data = policy?.data ?? {};
|
||||
loadedPolicyData = data;
|
||||
policyImage = data.image ?? '';
|
||||
policyIdleTimeout = data.idle_timeout_minutes ?? 30;
|
||||
policyStorage = data.storage ? 'persistent' : 'ephemeral';
|
||||
|
|
@ -275,7 +279,18 @@
|
|||
};
|
||||
|
||||
const buildPolicyData = (): object => {
|
||||
const data: Record<string, any> = {};
|
||||
// Keep fields the form does not edit; the orchestrator replaces the whole policy
|
||||
const data: Record<string, any> = { ...loadedPolicyData };
|
||||
for (const key of [
|
||||
'image',
|
||||
'cpu_limit',
|
||||
'memory_limit',
|
||||
'storage',
|
||||
'idle_timeout_minutes',
|
||||
'env'
|
||||
]) {
|
||||
delete data[key];
|
||||
}
|
||||
|
||||
if (policyImage) data.image = policyImage;
|
||||
if (policyCpu) data.cpu_limit = policyCpu;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue