mirror of https://gitee.com/bigwinds/arangodb
help us view, cluster state
This commit is contained in:
parent
dca43f884b
commit
ac8c1b11f5
|
@ -142,7 +142,9 @@
|
|||
collection: this.arangoCollectionsStore
|
||||
});
|
||||
|
||||
this.footerView = new window.FooterView();
|
||||
this.footerView = new window.FooterView({
|
||||
collection: self.coordinatorCollection
|
||||
});
|
||||
this.notificationList = new window.NotificationCollection();
|
||||
|
||||
this.currentDB.fetch({
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<script id="helpUsView.ejs" type="text/template">
|
||||
|
||||
<div class="helpUs">
|
||||
<div class="_form_87"></div><script src="https://arangodb.activehosted.com/f/embed.php?id=87" type="text/javascript" charset="utf-8"></script>
|
||||
</div>
|
||||
|
||||
</script>
|
|
@ -1,6 +1,7 @@
|
|||
<script id="navigationView.ejs" type="text/template">
|
||||
<ul class="navlist arango-collection-ul" id="arangoCollectionUl">
|
||||
<% if (isCluster) { %>
|
||||
<li class="navbar-spacer big"></li>
|
||||
<li class="cluster-menu"><a id="cluster" class="tab" href="#cluster"><i class="fa fa-circle-o"></i>Cluster</a></li>
|
||||
<li class="nodes-menu"><a id="nodes" class="tab" href="#nodes"><i class="fa fa-server"></i>Nodes</a></li>
|
||||
<% } else { %>
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
template: templateEngine.createTemplate("footerView.ejs"),
|
||||
|
||||
showServerStatus: function(isOnline) {
|
||||
var self = this;
|
||||
|
||||
if (!window.App.isCluster) {
|
||||
if (isOnline === true) {
|
||||
$('#healthStatus').removeClass('negative');
|
||||
|
@ -46,6 +48,49 @@
|
|||
$('.health-icon').html('<i class="fa fa-exclamation-circle"></i>');
|
||||
}
|
||||
}
|
||||
else {
|
||||
self.collection.fetch({
|
||||
success: function() {
|
||||
self.renderClusterState();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
renderClusterState: function() {
|
||||
var ok = 0, error = 0;
|
||||
|
||||
this.collection.each(function(value) {
|
||||
if (value.toJSON().status === 'ok') {
|
||||
ok++;
|
||||
}
|
||||
else {
|
||||
error++;
|
||||
}
|
||||
});
|
||||
|
||||
if (error > 0) {
|
||||
$('#healthStatus').removeClass('positive');
|
||||
$('#healthStatus').addClass('negative');
|
||||
if (error === 1) {
|
||||
$('.health-state').html(error + ' NODE ERROR');
|
||||
}
|
||||
else {
|
||||
$('.health-state').html(error + ' NODES ERROR');
|
||||
}
|
||||
$('.health-icon').html('<i class="fa fa-exclamation-circle"></i>');
|
||||
}
|
||||
else {
|
||||
$('#healthStatus').removeClass('negative');
|
||||
$('#healthStatus').addClass('positive');
|
||||
if (ok === 1) {
|
||||
$('.health-state').html(ok + ' NODE OK');
|
||||
}
|
||||
else {
|
||||
$('.health-state').html(ok + ' NODES OK');
|
||||
}
|
||||
$('.health-icon').html('<i class="fa fa-check-circle"></i>');
|
||||
}
|
||||
},
|
||||
|
||||
showShortcutModal: function() {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global arangoHelper, Backbone, templateEngine, $, window*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
window.HelpUsView = Backbone.View.extend({
|
||||
|
||||
el: "#content",
|
||||
|
||||
template: templateEngine.createTemplate("helpUsView.ejs"),
|
||||
|
||||
render: function () {
|
||||
this.$el.html(this.template.render({}));
|
||||
}
|
||||
|
||||
});
|
||||
}());
|
Loading…
Reference in New Issue