mirror of
https://github.com/open-webui/open-webui
synced 2025-02-07 13:34:55 +00:00
enh: list valve
This commit is contained in:
parent
0250f69da0
commit
f4a2ae5eac
@ -30,6 +30,14 @@
|
|||||||
const submitHandler = async () => {
|
const submitHandler = async () => {
|
||||||
saving = true;
|
saving = true;
|
||||||
|
|
||||||
|
if (valvesSpec) {
|
||||||
|
// Convert string to array
|
||||||
|
for (const property in valvesSpec.properties) {
|
||||||
|
if (valvesSpec.properties[property]?.type === 'array') {
|
||||||
|
valves[property] = (valves[property] ?? '').split(',').map((v) => v.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let res = null;
|
let res = null;
|
||||||
|
|
||||||
if (type === 'tool') {
|
if (type === 'tool') {
|
||||||
@ -45,6 +53,7 @@
|
|||||||
if (res) {
|
if (res) {
|
||||||
toast.success('Valves updated successfully');
|
toast.success('Valves updated successfully');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
saving = false;
|
saving = false;
|
||||||
};
|
};
|
||||||
@ -66,6 +75,15 @@
|
|||||||
valves = {};
|
valves = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (valvesSpec) {
|
||||||
|
// Convert array to string
|
||||||
|
for (const property in valvesSpec.properties) {
|
||||||
|
if (valvesSpec.properties[property]?.type === 'array') {
|
||||||
|
valves[property] = (valves[property] ?? []).join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
loading = false;
|
loading = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user