mirror of https://gitee.com/bigwinds/arangodb
scale view
This commit is contained in:
parent
dcd001d8eb
commit
3b3cae42be
|
@ -3,11 +3,6 @@
|
|||
<div class="headerBar" style="margin-top: -60px">
|
||||
<div class="headerButtonBar">
|
||||
<ul class="headerButtonList">
|
||||
<li class="enabled">
|
||||
<a id="exportCollection" class="headerButton">
|
||||
<span title="Scale cluster nodes"><i class="fa fa-sliders"></i></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
<div class="<%= genClass %> mid" id="plannedCoords"><i class="fa fa-circle-o-notch fa-spin"></i></div>
|
||||
<div class="<%= genClass %> mid" id="statusCoords"><i class="fa fa-circle-o-notch fa-spin"></i></div>
|
||||
<div class="<%= genClass %> actions right">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true" id="addCoord"></i>
|
||||
<i class="fa fa-minus-circle" aria-hidden="true" id="removeCoord"></i>
|
||||
<i class="fa fa-plus-circle" aria-hidden="true" id="addCoord"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -33,8 +33,8 @@
|
|||
<div class="<%= genClass %> mid" id="plannedDBs"><i class="fa fa-circle-o-notch fa-spin"></i></div>
|
||||
<div class="<%= genClass %> mid" id="statusDBs"><i class="fa fa-circle-o-notch fa-spin"></i></div>
|
||||
<div class="<%= genClass %> actions right">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true" id="addDBs"></i>
|
||||
<i class="fa fa-minus-circle" aria-hidden="true" id="removeDBs"></i>
|
||||
<i class="fa fa-plus-circle" aria-hidden="true" id="addDBs"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -999,7 +999,7 @@
|
|||
total = $('#totalDocuments');
|
||||
}
|
||||
if (this.type === 'document') {
|
||||
total.html(numeral(this.collection.getTotal()).format('0,0') + " document(s)");
|
||||
total.html(numeral(this.collection.getTotal()).format('0,0') + " doc(s)");
|
||||
}
|
||||
if (this.type === 'edge') {
|
||||
total.html(numeral(this.collection.getTotal()).format('0,0') + " edge(s)");
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
},
|
||||
|
||||
initialize: function (options) {
|
||||
clearInterval(this.intervalFunction);
|
||||
|
||||
if (window.App.isCluster) {
|
||||
this.dbServers = options.dbServers;
|
||||
|
@ -24,11 +25,10 @@
|
|||
this.toRender = options.toRender;
|
||||
|
||||
//start polling with interval
|
||||
window.setInterval(function() {
|
||||
if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes') {
|
||||
this.intervalFunction = window.setInterval(function() {
|
||||
if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes' || window.location.hash === '#nodes') {
|
||||
|
||||
var callback = function(data) {
|
||||
};
|
||||
console.log("rerender health");
|
||||
|
||||
}
|
||||
}, this.interval);
|
||||
|
|
|
@ -19,16 +19,18 @@
|
|||
},
|
||||
|
||||
setCoordSize: function(number) {
|
||||
//TODO AJAX API CALL
|
||||
var self = this;
|
||||
var data = {
|
||||
numberOfCoordinators: number
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: arangoHelper.databaseUrl("/_admin/cluster/setCoordSize"),
|
||||
type: "PUT",
|
||||
url: arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({
|
||||
value: number
|
||||
}),
|
||||
data: JSON.stringify(data),
|
||||
success: function() {
|
||||
$('#plannedCoords').html(number);
|
||||
self.updateTable(data);
|
||||
},
|
||||
error: function() {
|
||||
arangoHelper.arangoError("Scale", "Could not set coordinator size.");
|
||||
|
@ -37,16 +39,18 @@
|
|||
},
|
||||
|
||||
setDBsSize: function(number) {
|
||||
//TODO AJAX API CALL
|
||||
var self = this;
|
||||
var data = {
|
||||
numberOfDBServers: number
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: arangoHelper.databaseUrl("/_admin/cluster/setDBsSize"),
|
||||
type: "PUT",
|
||||
url: arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({
|
||||
value: number
|
||||
}),
|
||||
data: JSON.stringify(data),
|
||||
success: function() {
|
||||
$('#plannedCoords').html(number);
|
||||
self.updateTable(data);
|
||||
},
|
||||
error: function() {
|
||||
arangoHelper.arangoError("Scale", "Could not set coordinator size.");
|
||||
|
@ -158,25 +162,30 @@
|
|||
},
|
||||
|
||||
updateTable: function(data) {
|
||||
$('#plannedCoords').html(data.numberOfCoordinators);
|
||||
$('#plannedDBs').html(data.numberOfDBServers);
|
||||
|
||||
var scalingActive = '<span class="warning">scaling in progress</span>';
|
||||
var scalingDone = '<span class="positive">no scaling process active</span>';
|
||||
|
||||
if (this.coordinators.toJSON().length === data.numberOfCoordinators) {
|
||||
$('#statusCoords').html(scalingDone);
|
||||
if (data.numberOfCoordinators) {
|
||||
$('#plannedCoords').html(data.numberOfCoordinators);
|
||||
|
||||
if (this.coordinators.toJSON().length === data.numberOfCoordinators) {
|
||||
$('#statusCoords').html(scalingDone);
|
||||
}
|
||||
else {
|
||||
$('#statusCoords').html(scalingActive);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#statusCoords').html(scalingActive);
|
||||
}
|
||||
|
||||
if (this.dbServers.toJSON().length === data.numberOfDBServers) {
|
||||
$('#statusDBs').html(scalingDone);
|
||||
}
|
||||
else {
|
||||
$('#statusDBs').html(scalingActive);
|
||||
|
||||
if (data.numberOfDBServers) {
|
||||
$('#plannedDBs').html(data.numberOfDBServers);
|
||||
if (this.dbServers.toJSON().length === data.numberOfDBServers) {
|
||||
$('#statusDBs').html(scalingDone);
|
||||
}
|
||||
else {
|
||||
$('#statusDBs').html(scalingActive);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
waitForDBServers: function(callback) {
|
||||
|
|
|
@ -1,5 +1,33 @@
|
|||
@media (max-width: 568px) {
|
||||
|
||||
//PAGINATION
|
||||
|
||||
.pagination-line {
|
||||
.pre-pagi,
|
||||
.las-pagi {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.arango-pagination {
|
||||
li:first-child,
|
||||
li:last-child {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
li a {
|
||||
padding: 2px 4px;
|
||||
}
|
||||
}
|
||||
|
||||
//LOG
|
||||
#arangoLogTable {
|
||||
.table-cell0 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
//LOGIN
|
||||
.login-window {
|
||||
padding: 10px 10px 40px;
|
||||
|
@ -35,6 +63,11 @@
|
|||
}
|
||||
|
||||
// NAVIGATION TOP
|
||||
|
||||
.breadcrumb {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.subnavmenu {
|
||||
a {
|
||||
font-size: 8pt;
|
||||
|
@ -142,6 +175,33 @@
|
|||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
//PAGINATION
|
||||
|
||||
.pagination-line {
|
||||
.pre-pagi,
|
||||
.las-pagi {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.arango-pagination {
|
||||
li:first-child,
|
||||
li:last-child {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
li a {
|
||||
padding: 2px 4px;
|
||||
}
|
||||
}
|
||||
|
||||
// NAVIGATION TOP
|
||||
|
||||
.breadcrumb {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dashboard-large-chart,
|
||||
.dashboard-tendency-container {
|
||||
box-sizing: content-box;
|
||||
|
@ -193,7 +253,9 @@
|
|||
|
||||
//actions sub menu
|
||||
.headerButtonBar {
|
||||
display: none;
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-bar-chart-container {
|
||||
|
|
Loading…
Reference in New Issue