Skip to content

Commit

Permalink
fix skip services real-time display
Browse files Browse the repository at this point in the history
  • Loading branch information
afourmy committed Nov 7, 2019
1 parent 17f9233 commit bf602c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion eNMS/controller/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
10 changes: 3 additions & 7 deletions eNMS/static/workflowBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit bf602c5

Please sign in to comment.