From d0adff06bed72f9a0edd7adccfa6a1111784bc8b Mon Sep 17 00:00:00 2001 From: Koren Lev Date: Fri, 29 Sep 2017 01:38:18 +0300 Subject: release 1.0 calipso for opnfv apex Change-Id: I3e63cd27c5f4d3756e67a07c749863a68e84dde2 Signed-off-by: Koren Lev (cherry picked from commit d32f75145676bacefde0d08a14680a5984623451) --- .../ui/components/environment/environment.js | 57 +++++++++++++++------- 1 file changed, 40 insertions(+), 17 deletions(-) (limited to 'ui/imports/ui/components/environment/environment.js') diff --git a/ui/imports/ui/components/environment/environment.js b/ui/imports/ui/components/environment/environment.js index 1f0e723..9df6046 100644 --- a/ui/imports/ui/components/environment/environment.js +++ b/ui/imports/ui/components/environment/environment.js @@ -96,6 +96,7 @@ Template.Environment.onCreated(function () { vedgeInfoWindow: { node: null, left: 0, top: 0, show: false }, dashboardName: 'environment', collapsedSideMenu: instance.collapsedSideMenu, + isLoading: false, }); instance.currentData = new ReactiveVar(null, EJSON.equals); @@ -226,27 +227,44 @@ Template.Environment.onCreated(function () { }); - /* - (() => { - if (R.isNil(controller.params.query.selectedNodeId) && - R.isNil(selectedNodeId)) { - return; - } + /* + (() => { + if (R.isNil(controller.params.query.selectedNodeId) && + R.isNil(selectedNodeId)) { + return; + } - let srlSelectedNodeId = idToStr(selectedNodeId); - if (R.equals(controller.params.query.selectedNodeId, srlSelectedNodeId)) { - return; - } + let srlSelectedNodeId = idToStr(selectedNodeId); + if (R.equals(controller.params.query.selectedNodeId, srlSelectedNodeId)) { + return; + } - setTimeout(() => { - Router.go('environment', - { _id: controller.params._id }, - { query: { selectedNodeId: srlSelectedNodeId } }); - }, 1); + setTimeout(() => { + Router.go('environment', + { _id: controller.params._id }, + { query: { selectedNodeId: srlSelectedNodeId } }); + }, 1); + + })(); + */ - })(); - */ + let prevIdPath = null; + instance.autorun(function () { + let idPath = instance.rdxSelectedNodeIdPath.get(); + if (prevIdPath !== idPath) { + prevIdPath = idPath; + instance.state.set('isLoading', true); + } + }); + instance.autorun(function () { + let isLoading = instance.state.get('isLoading'); + if (isLoading) { + setTimeout(() => { + instance.state.set('isLoading', false); + }, 200); + } + }); }); Template.Environment.onDestroyed(function () { @@ -294,6 +312,11 @@ Template.Environment.helpers({ return instance.state.get(key); }, + isLoading: function () { + let instance = Template.instance(); + return instance.state.get('isLoading'); + }, + argsNavMenu: function (envName, mainNode) { let instance = Template.instance(); return { -- cgit 1.2.3-korg