mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 21:42:58 +00:00
feat: allow valve pipelines edit
This commit is contained in:
parent
2bdfd85137
commit
943baad689
@ -250,8 +250,8 @@ class PipelineMiddleware(BaseHTTPMiddleware):
|
|||||||
and (
|
and (
|
||||||
model["pipeline"]["pipelines"] == ["*"]
|
model["pipeline"]["pipelines"] == ["*"]
|
||||||
or any(
|
or any(
|
||||||
model_id == target_model["id"]
|
model_id == target_model_id
|
||||||
for target_model in model["pipeline"]["pipelines"]
|
for target_model_id in model["pipeline"]["pipelines"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
const pipeline = pipelines[selectedPipelineIdx];
|
const pipeline = pipelines[selectedPipelineIdx];
|
||||||
|
|
||||||
if (pipeline && (pipeline?.pipeline?.valves ?? false)) {
|
if (pipeline && (pipeline?.pipeline?.valves ?? false)) {
|
||||||
|
if (valves?.pipelines ?? false) {
|
||||||
|
valves.pipelines = valves.pipelines.split(',').map((v) => v.trim());
|
||||||
|
}
|
||||||
|
|
||||||
const res = await updatePipelineValves(localStorage.token, pipeline.id, valves).catch(
|
const res = await updatePipelineValves(localStorage.token, pipeline.id, valves).catch(
|
||||||
(error) => {
|
(error) => {
|
||||||
toast.error(error);
|
toast.error(error);
|
||||||
@ -52,6 +56,10 @@
|
|||||||
const getValves = async (idx) => {
|
const getValves = async (idx) => {
|
||||||
valves_spec = await getPipelineValvesSpec(localStorage.token, pipelines[idx].id);
|
valves_spec = await getPipelineValvesSpec(localStorage.token, pipelines[idx].id);
|
||||||
valves = await getPipelineValves(localStorage.token, pipelines[idx].id);
|
valves = await getPipelineValves(localStorage.token, pipelines[idx].id);
|
||||||
|
|
||||||
|
if (valves?.pipelines ?? false) {
|
||||||
|
valves.pipelines = valves.pipelines.join(',');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const setPipelines = async () => {
|
const setPipelines = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user