feat: allow valve pipelines edit

This commit is contained in:
Timothy J. Baek 2024-05-28 18:24:39 -07:00
parent 2bdfd85137
commit 943baad689
2 changed files with 10 additions and 2 deletions

View File

@ -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"]
) )
) )
] ]

View File

@ -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 () => {