diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js b/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js index dd37e588b6..10acf7abf1 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js @@ -230,6 +230,10 @@ _.each(menuItems, function(menu, name) { if (menu.active) { cssClass += ' active'; + + if (menu.disabled) { + cssClass += ' disabled'; + } } else { cssClass = ''; @@ -243,6 +247,21 @@ }); }, + buildNodeSubNav: function(node, activeKey, disabled) { + var menus = { + Dashboard: { + route: '#node/' + encodeURIComponent(node) + }, + Logs: { + route: '#nLogs/' + encodeURIComponent(node) + } + }; + + menus[activeKey].active = true; + menus[disabled].disabled = true; + this.buildSubNavBar(menus); + }, + //nav for collection view buildCollectionSubNav: function(collectionName, activeKey) { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js b/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js index ee300af770..3b7c9d33a0 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js @@ -37,6 +37,7 @@ "cluster": "cluster", "nodes": "nodes", "node/:name": "node", + "nLogs/:name": "nLogs", "logs": "logs", "helpus": "helpUs" }, @@ -230,6 +231,7 @@ this.nodeView = new window.NodeView({ coordname: name, coordinators: this.coordinatorCollection, + dbServers: this.dbServers }); } this.nodeView.render(); @@ -254,7 +256,7 @@ if (!this.nodesView) { this.nodesView = new window.NodesView({ coordinators: this.coordinatorCollection, - dbServers: this.dbServers + dbServers: this.dbServers[0] }); } this.nodesView.render(); @@ -308,6 +310,37 @@ this.logsView.render(); }, + nLogs: function (nodename, initialized) { + this.checkUser(); + if (!initialized) { + this.waitForInit(this.nLogs.bind(this), nodename); + return; + } + var newLogsAllCollection = new window.ArangoLogs( + {upto: true, loglevel: 4} + ), + newLogsDebugCollection = new window.ArangoLogs( + {loglevel: 4} + ), + newLogsInfoCollection = new window.ArangoLogs( + {loglevel: 3} + ), + newLogsWarningCollection = new window.ArangoLogs( + {loglevel: 2} + ), + newLogsErrorCollection = new window.ArangoLogs( + {loglevel: 1} + ); + this.nLogsView = new window.LogsView({ + logall: newLogsAllCollection, + logdebug: newLogsDebugCollection, + loginfo: newLogsInfoCollection, + logwarning: newLogsWarningCollection, + logerror: newLogsErrorCollection + }); + this.nLogsView.render(); + }, + applicationDetail: function (mount, initialized) { this.checkUser(); if (!initialized) { @@ -746,7 +779,7 @@ host: coordinator.get('address') }) ); - }); + }); _.each(this.dbServers, function(dbservers) { dbservers.fetch(); }); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/templates/navigationView.ejs b/js/apps/system/_admin/aardvark/APP/frontend/js/templates/navigationView.ejs index 210bfbd936..fd9c1907d1 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/templates/navigationView.ejs +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/templates/navigationView.ejs @@ -5,11 +5,15 @@