Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Add change button in job setting #264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions hydra-main/web/spawn2/build/1.main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-main/web/spawn2/build/1.main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions hydra-main/web/spawn2/build/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-main/web/spawn2/build/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-main/web/spawn2/build/search-results.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-main/web/spawn2/build/search-results.js.map

Large diffs are not rendered by default.

47 changes: 44 additions & 3 deletions hydra-web/src/js/modules/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ function(
diskUsed+=hostModel.get("diskUsed");
diskMax+=hostModel.get("diskMax");
if (!hostModel.get("dead")) {
avail+=hostModel.get("availableTaskSlots");
avail+=hostModel.get("availableTaskSlots");
}
});
if(diskMax>0){
Expand Down Expand Up @@ -1688,7 +1688,8 @@ function(
"click #validateLink":"handleValidateClick",
"click li.disabled > a":"handleDisabledTabClick",
"click #cloneJobButton":"handleCloneClick",
"click #browseDataButton":"handleBrowseClick"
"click #browseDataButton":"handleBrowseClick",
"click #minionTypeRelease":"handleminionTypeReleaseClick",
},
initialize:function(options){
options = options || {};
Expand Down Expand Up @@ -1874,6 +1875,46 @@ function(
event.preventDefault();
app.router.trigger("route:showJobBackups",this.model.id);
},
handleminionTypeReleaseClick:function(event){
event.preventDefault();
event.stopImmediatePropagation();
var self=this;
alertify.prompt("Enter New minionType:","",function(evt, str){
self.model.minionType=str;
self.handleminionTypeReleaseSave(event);
});

},
handleminionTypeReleaseSave:function(event){
var parameters = {};
var miniontypeinput = this.$el.find("#miniontypeinput");
var newminiontype = this.model.minionType;
parameters["job"] = this.model.id;
parameters["minionType"] = newminiontype;
parameters["user"] = app.user.get("username");
parameters["token"] = app.user.get("token");
parameters["sudo"] = app.user.get("cansudo");
app.authQueryParameters(parameters);
$.ajax({
url: "/job/updateMinionType",
type: "GET",
data: parameters,
dataType: "json",
statusCode: {
400: function(e) {
alertify.error("Error: " + e.responseText);
},
500: function(e){
alertify.error("Error: " + e.responseText);
},
200: function(){
miniontypeinput.val(newminiontype);
alertify.success("Success");
}
}
});

},
handleSettingsChangePermissionClick:function(event){
var parameters = {};
parameters["jobs"] = this.model.id;
Expand Down Expand Up @@ -2136,7 +2177,7 @@ function(
app.router.navigate("#alerts/create/" + this.model.id, {trigger: true});
},
handleViewAlertsButtonClick:function(event){
app.router.navigate("#alertsFiltered/" + this.model.id, {trigger: true});
app.router.navigate("#alertsFiltered/" + this.model.id, {trigger: true});
},
handleEmailKeyUp:function(event){
var input = $(event.currentTarget);
Expand Down
4 changes: 2 additions & 2 deletions hydra-web/src/templates/job.setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
</td>
</tr>
<tr class="row">
<td width="30%">Minion Type</td>
<td width="30%">Minion Type&nbsp;&nbsp;<button type="button" id="minionTypeRelease" class="btn btn-default" >Change</button></td>
<td width="70%">
<input name="minionType" type='text' class="form-control trackable" style="margin:0px;" type="text" value="<%-job.minionType%>" <%-(_.isUndefined(job.id)? '' : 'disabled')%> ></input>
<input id="miniontypeinput" name="minionType" type='text' class="form-control trackable" style="margin:0px;" type="text" value="<%-job.minionType%>" <%-(_.isUndefined(job.id)? '' : 'disabled')%> ></input>
</td>
</tr>
<tr class="row">
Expand Down