2013-03-06 13:38:40 -05:00
|
|
|
// requires tableHelper
|
|
|
|
|
|
|
|
var oTable = [];
|
|
|
|
|
2017-02-25 04:28:16 -05:00
|
|
|
var killTask = function(taskId) {
|
|
|
|
if(confirm('Do you really want to kill: '+taskId)) {
|
|
|
|
$.ajax({
|
|
|
|
type:'POST',
|
|
|
|
url: '/druid/indexer/v1/task/'+ taskId +'/shutdown',
|
|
|
|
data: ''
|
|
|
|
}).done(function(data) {
|
|
|
|
setTimeout(function() { location.reload(true) }, 75);
|
|
|
|
}).fail(function(data) {
|
|
|
|
alert('Kill request failed with status: '+data.status+' please check overlord logs');
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-06 13:38:40 -05:00
|
|
|
$(document).ready(function() {
|
2017-02-25 04:28:16 -05:00
|
|
|
var augment = function(data, showKill) {
|
2013-12-13 14:36:36 -05:00
|
|
|
for (i = 0 ; i < data.length ; i++) {
|
|
|
|
var taskId = encodeURIComponent(data[i].id)
|
|
|
|
data[i].more =
|
|
|
|
'<a href="/druid/indexer/v1/task/' + taskId + '">payload</a>' +
|
|
|
|
'<a href="/druid/indexer/v1/task/' + taskId + '/status">status</a>' +
|
|
|
|
'<a href="/druid/indexer/v1/task/' + taskId + '/log">log (all)</a>' +
|
2017-02-25 04:28:16 -05:00
|
|
|
'<a href="/druid/indexer/v1/task/' + taskId + '/log?offset=-8192">log (last 8kb)</a>';
|
|
|
|
if(showKill) {
|
|
|
|
data[i].more += '<a onclick="killTask(\''+ taskId +'\');">kill</a>';
|
|
|
|
}
|
2013-12-13 14:36:36 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-26 20:44:21 -04:00
|
|
|
$.get('/druid/indexer/v1/runningTasks', function(data) {
|
2013-03-06 13:38:40 -05:00
|
|
|
$('.running_loading').hide();
|
2017-02-25 04:28:16 -05:00
|
|
|
augment(data, true);
|
2013-12-13 14:36:36 -05:00
|
|
|
buildTable(data, $('#runningTable'));
|
2013-03-06 13:38:40 -05:00
|
|
|
});
|
|
|
|
|
2013-09-26 20:44:21 -04:00
|
|
|
$.get('/druid/indexer/v1/pendingTasks', function(data) {
|
2013-03-06 13:38:40 -05:00
|
|
|
$('.pending_loading').hide();
|
2017-02-25 04:28:16 -05:00
|
|
|
augment(data, true);
|
2013-12-13 14:36:36 -05:00
|
|
|
buildTable(data, $('#pendingTable'));
|
|
|
|
});
|
|
|
|
|
|
|
|
$.get('/druid/indexer/v1/waitingTasks', function(data) {
|
|
|
|
$('.waiting_loading').hide();
|
2017-02-25 04:28:16 -05:00
|
|
|
augment(data, true);
|
2013-12-13 14:36:36 -05:00
|
|
|
buildTable(data, $('#waitingTable'));
|
|
|
|
});
|
|
|
|
|
|
|
|
$.get('/druid/indexer/v1/completeTasks', function(data) {
|
|
|
|
$('.complete_loading').hide();
|
2017-02-25 04:28:16 -05:00
|
|
|
augment(data, false);
|
2013-12-13 14:36:36 -05:00
|
|
|
buildTable(data, $('#completeTable'));
|
2013-03-06 13:38:40 -05:00
|
|
|
});
|
|
|
|
|
2013-09-26 20:44:21 -04:00
|
|
|
$.get('/druid/indexer/v1/workers', function(data) {
|
2013-03-06 13:38:40 -05:00
|
|
|
$('.workers_loading').hide();
|
|
|
|
buildTable(data, $('#workerTable'));
|
|
|
|
});
|
|
|
|
|
2013-09-26 20:44:21 -04:00
|
|
|
$.get('/druid/indexer/v1/scaling', function(data) {
|
2013-03-06 13:38:40 -05:00
|
|
|
$('.events_loading').hide();
|
|
|
|
buildTable(data, $('#eventTable'));
|
|
|
|
});
|
2013-12-13 14:36:36 -05:00
|
|
|
});
|