From 2a0d2bfc8c2a10c161778285b5615bdffc1d698e Mon Sep 17 00:00:00 2001 From: hkernbach Date: Tue, 30 May 2017 15:02:57 +0200 Subject: [PATCH] adjusted ui to internal cluster api --- .../APP/frontend/js/models/clusterCoordinator.js | 1 + .../aardvark/APP/frontend/js/routers/router.js | 6 +++--- .../aardvark/APP/frontend/js/views/nodeView.js | 13 ++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/models/clusterCoordinator.js b/js/apps/system/_admin/aardvark/APP/frontend/js/models/clusterCoordinator.js index 7d2bdc3ca8..7db6cd323b 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/models/clusterCoordinator.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/models/clusterCoordinator.js @@ -5,6 +5,7 @@ window.ClusterCoordinator = Backbone.Model.extend({ defaults: { 'name': '', + 'id': '', 'status': 'ok', 'address': '', 'protocol': '' 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 849286644b..6666366d02 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 @@ -326,10 +326,10 @@ this.clusterView.render(); }, - node: function (name, initialized) { + node: function (id, initialized) { this.checkUser(); if (!initialized || this.isCluster === undefined) { - this.waitForInit(this.node.bind(this), name); + this.waitForInit(this.node.bind(this), id); return; } if (this.isCluster === false) { @@ -342,7 +342,7 @@ this.nodeView.remove(); } this.nodeView = new window.NodeView({ - coordname: name, + coordid: id, coordinators: this.coordinatorCollection, dbServers: this.dbServers }); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/nodeView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/nodeView.js index c1f3ef00c6..c7f125b162 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/nodeView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/nodeView.js @@ -17,7 +17,7 @@ if (window.App.isCluster) { this.coordinators = options.coordinators; this.dbServers = options.dbServers; - this.coordname = options.coordname; + this.coordid = options.coordid; this.updateServerTime(); // start polling with interval @@ -47,8 +47,7 @@ var callback = function () { this.continueRender(); - this.breadcrumb(arangoHelper.getCoordinatorShortName(this.coordname)); - // window.arangoHelper.buildNodeSubNav(this.coordname, 'Dashboard', 'Logs') + this.breadcrumb(arangoHelper.getCoordinatorShortName(this.coordid)); $(window).trigger('resize'); }.bind(this); @@ -59,8 +58,8 @@ if (!this.initDBDone) { this.waitForDBServers(callback); } else { - this.coordname = window.location.hash.split('/')[1]; - this.coordinator = this.coordinators.findWhere({name: this.coordname}); + this.coordid = window.location.hash.split('/')[1]; + this.coordinator = this.coordinators.findWhere({id: this.coordid}); callback(); } }, @@ -79,7 +78,7 @@ raw: this.coordinator.get('address'), isDBServer: false, endpoint: this.coordinator.get('protocol') + '://' + this.coordinator.get('address'), - target: this.coordinator.get('name') + target: this.coordinator.get('id') } }); } else { @@ -113,7 +112,7 @@ if (self.coordinators.length === 0) { self.waitForCoordinators(callback); } else { - self.coordinator = self.coordinators.findWhere({name: self.coordname}); + self.coordinator = self.coordinators.findWhere({id: self.coordid}); self.initCoordDone = true; if (callback) { callback();