<th></th>
<th><%[ Status ]%></th>
<th><%[ Name ]%></th>
- <th><%[ Director ]%></th>
+ <th><%[ Type ]%></th>
+ <th><%[ Enabled ]%></th>
+ <th>Max. concur. jobs</th>
+ <th><%[ Priority ]%></th>
<th><%[ Actions ]%></th>
</tr>
</thead>
<th></th>
<th><%[ Status ]%></th>
<th><%[ Name ]%></th>
- <th><%[ Director ]%></th>
+ <th><%[ Type ]%></th>
+ <th><%[ Enabled ]%></th>
+ <th>Max. concur. jobs</th>
+ <th><%[ Priority ]%></th>
<th><%[ Actions ]%></th>
</tr>
</tfoot>
}.bind(this)
},
{data: 'job'},
- {data: 'director'},
+ {
+ data: 'type',
+ render: function(data, type, row) {
+ return JobType.get_type(data);
+ }
+ },
+ {
+ data: 'enabled',
+ render: function(data, type, row) {
+ return (data == 1 ? '<%[ Yes ]%>' : '<%[ No ]%>');
+ }
+ },
+ {data: 'maxjobs'},
+ {
+ data: 'priority',
+ visible: false
+ },
{
data: 'job',
render: function(data, type, row) {
},
{
className: "dt-center",
- targets: [ 1, 4 ]
+ targets: [ 1, 3, 4, 5, 6, 7 ]
}],
order: [2, 'asc'],
initComplete: function () {
- this.api().columns([2, 3]).every(function () {
+ this.api().columns([2, 3, 4, 5, 6]).every(function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo($(column.footer()).empty())
.search(val ? '^' + val + '$' : '', true, false)
.draw();
});
- column.data().unique().sort().each(function (d, j) {
+ column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
if (column.search() == '^' + dtEscapeRegex(d) + '$') {
select.append('<option value="' + d + '" selected>' + d + '</option>');
} else {
return;
}
$result = $this->getModule('api')->get(
- array('jobs', 'resnames'), null, true, self::USE_CACHE
- )->output;
- $jobs = array();
- foreach ($result as $director => $job_list) {
- for ($i = 0; $i < count($job_list); $i++) {
- $jobs[] = array('director' => $director, 'job' => $job_list[$i]);
+ ['jobs', 'show', '?output=json'], null, true, self::USE_CACHE
+ );
+ $jobs = [];
+ if ($result->error === 0) {
+ for ($i = 0; $i < count($result->output); $i++) {
+ $jobs[] = [
+ 'job' => $result->output[$i]->name,
+ 'enabled' => $result->output[$i]->enabled,
+ 'priority' => $result->output[$i]->priority,
+ 'type' => chr($result->output[$i]->jobtype),
+ 'maxjobs' => $result->output[$i]->maxjobs
+ ];
}
}
$this->jobs = $jobs;