diff --git a/eNMS/controller/automation.py b/eNMS/controller/automation.py index df2831d99..fda4b178c 100644 --- a/eNMS/controller/automation.py +++ b/eNMS/controller/automation.py @@ -177,11 +177,12 @@ def save_positions(self, workflow_id): workflow.last_modified = now return now - def skip_services(self, service_ids): + def skip_services(self, workflow_id, service_ids): services = [fetch("service", id=id) for id in service_ids.split("-")] skip = not all(service.skip for service in services) for service in services: service.skip = skip + fetch("workflow", id=workflow_id).last_modified = self.get_time() return "skip" if skip else "unskip" def get_service_state(self, service_id, runtime="latest"): diff --git a/eNMS/static/workflowBuilder.js b/eNMS/static/workflowBuilder.js index 8ed833121..bf7a0e089 100644 --- a/eNMS/static/workflowBuilder.js +++ b/eNMS/static/workflowBuilder.js @@ -389,13 +389,9 @@ function stopWorkflow() { // eslint-disable-next-line function skipServices() { const selectedNodes = graph.getSelectedNodes().filter((x) => !isNaN(x)); - call(`/skip_services/${selectedNodes.join("-")}`, (skip) => { - workflow.services - .filter((j) => selectedNodes.includes(j.id)) - .map((j) => { - j.skip = skip == "skip"; - }); - resetDisplay(); + if (!selectedNodes.length) return; + call(`/skip_services/${workflow.id}/${selectedNodes.join("-")}`, (skip) => { + getWorkflowState(); alertify.notify(`Services ${skip}ped.`, "success", 5); }); }