1
0
Fork 0

created new dashboard route in showClusterView

This commit is contained in:
scottashton 2014-02-27 17:41:15 +01:00
parent 616dd60028
commit c8856ab3f6
6 changed files with 47 additions and 10 deletions

View File

@ -11,7 +11,8 @@
"planSymmetrical" : "planSymmetric",
"planAsymmetrical" : "planAsymmetric",
"shards" : "showShards",
"showCluster" : "showCluster"
"showCluster" : "showCluster",
"dashboard/:server" : "dashboard"
},
getNewRoute: function(last) {
@ -106,6 +107,30 @@
this.clusterDownView = new window.ClusterDownView();
}
this.clusterDownView.render(content);
},
dashboard: function(server) {
console.log(server);
if (this.statisticsDescription === undefined) {
this.statisticsDescription = new window.StatisticsDescription();
this.statisticsDescription.fetch({
async:false
});
}
if (this.statistics === undefined) {
this.statisticsCollection = new window.StatisticsCollection();
}
console.log(this.statisticsCollection);
console.log(this.statisticsDescription);
console.log( window.arangoDocumentsStore);
if (this.dashboardView === undefined) {
this.dashboardView = new dashboardView({
collection: this.statisticsCollection,
description: this.statisticsDescription,
documentStore: new window.arangoDocumentsStore()
});
}
this.dashboardView.render();
}
});

View File

@ -33,7 +33,7 @@
console.log(c);
%>
<li class="tile">
<div class="coordinator <%=statusClass(c.get('status'))%> href="/_db/_system/_admin/aardvark/cluster/dashboard/<%=c.get('address')%>">
<div class="coordinator <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
<span class="clusterInfoIcon icon_arangodb_compass"></span>
</div>
<h5 class="collectionName"><%=c.get("name")%></h5>
@ -43,7 +43,7 @@
_.each(s.dbs, function(c) {
%>
<li class="tile">
<div class="dbserver <%=statusClass(c.get('status'))%>" href="/_db/_system/_admin/aardvark/cluster/dashboard/<%=c.get('address')%>">
<div class="dbserver <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
<span class="clusterInfoIcon icon_arangodb_database1"></span>
</div>
<h5 class="collectionName"><%=c.get("name")%> (Shards: <span id="<%=c.get("name")%>Shards" class="shardCounter"/>)</h5>
@ -56,7 +56,7 @@
%>
<li class="tile">
<% _.each(s.coords, function(c) { %>
<div class="coordinator <%=statusClass(c.get('status'))%> href="/_db/_system/_admin/aardvark/cluster/dashboard/<%=c.get('address')%>">
<div class="coordinator <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
<span class="clusterInfoIcon icon_arangodb_compass"></span>
<h6 class="serverName"><%=c.get("name")%></h6>
</div>
@ -65,7 +65,7 @@
_.each(s.dbs, function(c) {
dbName = c.get("name");
%>
<div class="dbserver <%=statusClass(c.get('status'))%> href="/_db/_system/_admin/aardvark/cluster/dashboard/<%=c.get('address')%>">
<div class="dbserver <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
<span class="clusterInfoIcon icon_arangodb_database1"></span>
<h6 class="serverName"><%=c.get("name")%></h6>
</div>

View File

@ -13,6 +13,8 @@
events: {
"change #selectDB" : "updateCollections",
"change #selectCol" : "updateShards",
"click .coordinator" : "dashboard",
"click .dbserver" : "dashboard",
"click #clusterShutdown" : "clusterShutdown",
"mouseover #lineGraph" : "setShowAll",
"mouseout #lineGraph" : "resetShowAll"
@ -402,8 +404,11 @@
clusterShutdown : function() {
window.App.navigate("", {trigger: true});
},
dashboard: function(e) {
var id = $(e.currentTarget).attr("id");
window.App.navigate("dashboard/"+id, {trigger: true});
}
});
}());

View File

@ -12,7 +12,7 @@
offset: 0,
url: '/_api/documents',
model: arangoDocumentModel,
model: window.arangoDocumentModel,
getFirstDocuments: function () {
if (this.currentPage !== 1) {
var link = window.location.hash.split("/");

View File

@ -286,7 +286,7 @@
initialize: function () {
this.arangoReplication = new window.ArangoReplication();
console.log();
this.documentStore = this.options.documentStore;
this.getStatisticHistory();
this.description = this.options.description.models[0];
@ -596,7 +596,6 @@
},
stopUpdating: function () {
console.log("stopupdating");
this.isUpdating = false;
},

View File

@ -155,6 +155,10 @@
"frontend/html/start.html.part",
"clusterFrontend/html/head.html.part",
"frontend/js/templates/**",
"frontend/js/templates/dashboardView.ejs",
"frontend/js/templates/dashboardDistributed.ejs",
"frontend/js/templates/dashboardHttpGroup.ejs",
"frontend/js/templates/lineChartDetailView.ejs",
"clusterFrontend/js/templates/**",
"frontend/html/body.html.part",
"clusterFrontend/html/scripts.html.part",
@ -164,7 +168,8 @@
"css/cluster.css": {
"files": [
"frontend/scss/cluster.css"
"frontend/scss/cluster.css",
"frontend/scss/generated.css"
]
},
@ -176,7 +181,10 @@
"clusterFrontend/js/models/**",
"clusterFrontend/js/collections/**",
"frontend/js/views/footerView.js",
"frontend/js/views/dashboardView.js",
"frontend/js/collections/arangoStatisticsCollection.js",
"frontend/js/collections/arangoDocuments.js",
"frontend/js/models/arangoDocument.js",
"frontend/js/collections/arangoStatisticsDescriptionCollection.js",
"clusterFrontend/js/views/**",
"clusterFrontend/js/routers/**"