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