webui: Allow editing and deleting of lapsed alert schedules (#6878)

This commit is contained in:
network-guy
2017-06-22 14:29:04 -05:00
committed by Neil Lathwood
parent 2f4efb2a43
commit b3c88925d4

View File

@@ -53,18 +53,18 @@ var grid = $("#alert-schedule").bootgrid({
formatters: {
"commands": function(column, row)
{
var response = "<button type=\"button\" class=\"btn btn-xs btn-primary command-edit\" data-toggle='modal' data-target='#schedule-maintenance' data-schedule_id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-danger command-delete\" data-schedule_id=\"" + row.id + "\"><span class=\"fa fa-trash-o\"></span></button>";
if (row.status == 1) {
return '<button type="button" class="btn btn-xs btn-danger" disabled>Lapsed</button>';
} else {
var response = "<button type=\"button\" class=\"btn btn-xs btn-primary command-edit\" data-toggle='modal' data-target='#schedule-maintenance' data-schedule_id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-danger command-delete\" data-schedule_id=\"" + row.id + "\"><span class=\"fa fa-trash-o\"></span></button>";
if (row.status == 2) {
response = response + ' <button type="button" class="btn btn-xs btn-success" disabled>Current</button>';
}
return response;
}
response = response + '<button type="button" class="btn btn-xs btn-danger" disabled>Lapsed</button>';
} else if (row.status == 2) {
response = response + '<button type="button" class="btn btn-xs btn-success" disabled>Current</button>';
}
return response;
}
},
},
templates: {
header: "<div id=\"{{ctx.id}}\" class=\"{{css.header}}\"><div class=\"row\">"+
"<div class=\"col-sm-8 actionBar\"><span class=\"pull-left\">"+