|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html> |
|
<html lang="en"> |
|
|
|
<head> |
|
<% include ../common/head %> |
|
</head> |
|
|
|
<body> |
|
<% include ../common/navbar %> |
|
|
|
<% |
|
var guest=true; |
|
if (user!==undefined) { |
|
if (user.username=='admin') { |
|
guest=false; |
|
} |
|
} |
|
var k = Object.keys(repositories); |
|
trepos = []; |
|
for (var ii=0; ii<k.length; ii++) { |
|
trepos.push(k[ii]); |
|
} |
|
var k = Object.keys(globalBot.projectBot.userCommands); |
|
tcommands = []; |
|
for (var ii=0; ii<k.length; ii++) { |
|
tcommands.push(k[ii]); |
|
} |
|
%> |
|
<div class="container" id="formulaire"> |
|
<div class="row"> |
|
<div class="col-md-12"> |
|
<br> |
|
<br> |
|
<center> |
|
<h1>Edit task</h1> |
|
</center> |
|
<br> |
|
</div> |
|
<form action="/bot/saveTask" method="post"> |
|
<div class="col-md-offset-2 col-md-4"> |
|
<input type="hidden" name="taskName" value="<%=task.name%>"> |
|
<div class="form-group"> |
|
<label>Task name</label> |
|
<input type="text" class="form-control" name="taskName1" value="<%=task.name%>" disabled/> |
|
</div> |
|
<div class="form-group"> |
|
<label>Repository</label> |
|
<select class="form-control" name="repository"> |
|
<% for (var ii=0; ii<trepos.length; ii++) { %> |
|
<% if (trepos[ii]===task.repository) { %> |
|
<option selected><%=trepos[ii]%></option> |
|
<% } else { %> |
|
<option><%=trepos[ii]%></option> |
|
<% } %> |
|
<% } %> |
|
</select> |
|
</div> |
|
<div class="form-group"> |
|
<label>Branch</label> |
|
<input type="text" class="form-control" name="branch" value="<%=task.branch%>"/> |
|
</div> |
|
<div class="form-group"> |
|
<label>Command</label> |
|
<select class="form-control" name="command"> |
|
<% for (var ii=0; ii<tcommands.length; ii++) { %> |
|
<% if (tcommands[ii]===task.command) { %> |
|
<option selected><%=tcommands[ii]%></option> |
|
<% } else { %> |
|
<option><%=tcommands[ii]%></option> |
|
<% } %> |
|
<% } %> |
|
</select> |
|
</div> |
|
|
|
<div class="form-group"> |
|
<label>Active</label> |
|
<select class="form-control" name="active"> |
|
<% if (task.active) { %> |
|
<option selected>Yes</option> |
|
<option>No</option> |
|
<% } else { %> |
|
<option>Yes</option> |
|
<option selected>No</option> |
|
<% } %> |
|
</select> |
|
</div> |
|
</div> |
|
<div class="col-md-4"> |
|
<div class="form-group"> |
|
<label>Priority</label> |
|
<select class="form-control" name="priority"> |
|
<% if (task.priority === 1) { %> |
|
<option selected>1</option> |
|
<option>5</option> |
|
<option>9</option> |
|
<% } %> |
|
<% if (task.priority === 5) { %> |
|
<option>1</option> |
|
<option selected>5</option> |
|
<option>9</option> |
|
<% } %> |
|
<% if (task.priority === 9) { %> |
|
<option>1</option> |
|
<option>5</option> |
|
<option selected>9</option> |
|
<% } %> |
|
</select> |
|
</div> |
|
<div class="form-group"> |
|
<label>Monitoring mode</label> |
|
<select class="form-control" name="monitoringMode"> |
|
<% if (task.mode==='patch') { %> |
|
<option selected>Patch level</option> |
|
<option>Patch set level</option> |
|
<% } else { %> |
|
<option>Patch level</option> |
|
<option selected>Patch set level</option> |
|
<% } %> |
|
</select> |
|
</div> |
|
<div class="form-group"> |
|
<label>Activation Mode</label> |
|
<select class="form-control" name="periodMode"> |
|
<% if (task.period.tick!==undefined) { %> |
|
<option selected>Tick</option> |
|
<option>FixedTime</option> |
|
<% } else { %> |
|
<option>Tick</option> |
|
<option selected>FixedTime</option> |
|
<% } %> |
|
|
|
</select> |
|
</div> |
|
<div class="form-group"> |
|
<label>Tick Value</label> |
|
<input type="text" class="form-control" name="periodValue" value="<%=task.period.tick%>"/> |
|
</div> |
|
<div class="form-group"> |
|
<label>Fixed Time Value</label> |
|
<input type="text" class="form-control" name="fixedTimeValue" value="<%=task.period.fixedTime%>"/> |
|
</div> |
|
<div class="form-group"> |
|
<label>Base</label> |
|
<input type="text" class="form-control" name="base" value="<%=task.base%>"/> |
|
</div> |
|
</div> |
|
<div class="col-md-offset-2 col-md-8"> |
|
<div class="form-group"> |
|
<label>Notify</label> |
|
<textarea class="form-control" rows="5" name="notify"><%=task.notify%></textarea> |
|
</div> |
|
<center> |
|
<br> |
|
<button class="btn btn-danger btn-block" type="submit" id="submitButton">Save</button> |
|
</center> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</body> |
|
</html> |
|
|