Skip to content

Commit 2ea541f

Browse files
committed
Adding buttons to delete/add workers groups (dashboard/static/js/views/workergroups.js)
1 parent 99e88b6 commit 2ea541f

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

mrq/dashboard/static/js/views/workergroups.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,34 @@ define(["jquery", "underscore", "models", "views/generic/page", "quicksettings"]
1616
self.$("button")[0].setAttribute('style', 'top:80px;left:10px;');
1717
self.workers_panel = []
1818

19-
self.command_panel = QuickSettings.create(50, 80, "Actions", self.$(_this.el)[0])
19+
self.command_panel = QuickSettings.create(25, 80, "Actions", self.$(_this.el)[0])
20+
.addButton("Add a Worker Group")
2021
.addButton("Save")
2122
.addButton("Reload")
22-
.setWidth(100);
23+
.setDraggable(false)
24+
.setWidth(150);
2325

2426
$.get("/api/workergroups").done(function(data) {
2527
var i = 0;
2628
_.forEach(data["workergroups"], function(workgroup, workgroup_name) {
27-
var worker_panel = QuickSettings.create(200 + i * 350, 80, "Worker group configuration", self.$(_this.el)[0])
29+
var worker_panel = QuickSettings.create(225 + i * 350, 80, "Worker group configuration", self.$(_this.el)[0])
2830
.addText("Workgroup Name", workgroup_name)
2931
.hideTitle("Workgroup Name")
32+
.addButton("Remove this Worker Group")
33+
.addText("Process Termination Timeout", workgroup["process_termination_timeout"])
3034
.setDraggable(false)
3135
.setHeight(850)
3236
.setWidth(300);
3337
_.forEach(workgroup["profiles"], function(profile, profile_name) {
34-
worker_panel.addHTML("separator", "")
35-
.hideTitle("separator")
36-
.addText("Profile Name", profile_name)
37-
.addText("Memory", profile["memory"])
38-
.addRange("MinCount", 0, 100, profile["min_count"], 1)
39-
.addRange("MaxCount", 0, 100, profile["max_count"], 1)
40-
.addRange("CPU", 0, 1000, profile["cpu"], 100)
41-
.addTextArea("Command", profile["command"])
38+
worker_panel.addHTML("separator", "<br>")
39+
.hideTitle("separator")
40+
.addText("Profile Name", profile_name)
41+
.addText("Memory", profile["memory"])
42+
.addText("CPU", profile["cpu"])
43+
.addRange("MinCount", 0, 100, profile["min_count"], 1)
44+
.addRange("MaxCount", 0, 100, profile["max_count"], 1)
45+
.addTextArea("Command", profile["command"])
46+
.addButton("Remove this Profile");
4247
});
4348
self.workers_panel.push(worker_panel);
4449
console.log(workgroup_name, workgroup);

0 commit comments

Comments
 (0)