mirror of https://github.com/apache/druid.git
Add supervisors to overlord console. (#4248)
This commit is contained in:
parent
d0f89e969a
commit
f0fd8ba191
|
@ -37,6 +37,11 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="heading">Coordinator Console</div>
|
<div class="heading">Coordinator Console</div>
|
||||||
|
<div class="supervisors_section" style="display: none;">
|
||||||
|
<h2>Supervisors</h2>
|
||||||
|
<table id="supervisorsTable"></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>Running Tasks</h2>
|
<h2>Running Tasks</h2>
|
||||||
<div class="running_loading">Loading Running Tasks... this may take a few minutes</div>
|
<div class="running_loading">Loading Running Tasks... this may take a few minutes</div>
|
||||||
<table id="runningTable"></table>
|
<table id="runningTable"></table>
|
||||||
|
|
|
@ -16,6 +16,34 @@ var killTask = function(taskId) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var resetSupervisor = function(supervisorId) {
|
||||||
|
if(confirm('Do you really want to reset: '+ supervisorId)) {
|
||||||
|
$.ajax({
|
||||||
|
type:'POST',
|
||||||
|
url: '/druid/indexer/v1/supervisor/' + supervisorId + '/reset',
|
||||||
|
data: ''
|
||||||
|
}).done(function(data) {
|
||||||
|
setTimeout(function() { location.reload(true) }, 750);
|
||||||
|
}).fail(function(data) {
|
||||||
|
alert('Reset request failed, please check overlord logs for details.');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var shutdownSupervisor = function(supervisorId) {
|
||||||
|
if(confirm('Do you really want to shutdown: '+ supervisorId)) {
|
||||||
|
$.ajax({
|
||||||
|
type:'POST',
|
||||||
|
url: '/druid/indexer/v1/supervisor/' + supervisorId + '/shutdown',
|
||||||
|
data: ''
|
||||||
|
}).done(function(data) {
|
||||||
|
setTimeout(function() { location.reload(true) }, 750);
|
||||||
|
}).fail(function(data) {
|
||||||
|
alert('Shutdown request failed, please check overlord logs for details.');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var augment = function(data, showKill) {
|
var augment = function(data, showKill) {
|
||||||
for (i = 0 ; i < data.length ; i++) {
|
for (i = 0 ; i < data.length ; i++) {
|
||||||
|
@ -31,6 +59,26 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$.get('/druid/indexer/v1/supervisor', function(dataList) {
|
||||||
|
var data = []
|
||||||
|
for (i = 0 ; i < dataList.length ; i++) {
|
||||||
|
var supervisorId = encodeURIComponent(dataList[i])
|
||||||
|
data[i] = {
|
||||||
|
"dataSource" : supervisorId,
|
||||||
|
"more" :
|
||||||
|
'<a href="/druid/indexer/v1/supervisor/' + supervisorId + '">payload</a>' +
|
||||||
|
'<a href="/druid/indexer/v1/supervisor/' + supervisorId + '/status">status</a>' +
|
||||||
|
'<a href="/druid/indexer/v1/supervisor/' + supervisorId + '/history">history</a>' +
|
||||||
|
'<a onclick="resetSupervisor(\'' + supervisorId + '\');">reset</a>' +
|
||||||
|
'<a onclick="shutdownSupervisor(\'' + supervisorId + '\');">shutdown</a>'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buildTable((data), $('#supervisorsTable'));
|
||||||
|
if (dataList.length > 0) {
|
||||||
|
$('.supervisors_section').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$.get('/druid/indexer/v1/runningTasks', function(data) {
|
$.get('/druid/indexer/v1/runningTasks', function(data) {
|
||||||
$('.running_loading').hide();
|
$('.running_loading').hide();
|
||||||
augment(data, true);
|
augment(data, true);
|
||||||
|
|
Loading…
Reference in New Issue