algairim commented on a change in pull request #228:
URL: https://github.com/apache/brooklyn-ui/pull/228#discussion_r655135942



##########
File path: ui-modules/home/app/views/about/about.controller.js
##########
@@ -67,4 +72,139 @@ export function aboutStateController($scope, brBrandInfo, 
version, states) {
         buildCommitId: BUILD_COMMIT_ID,
         brooklynVersion: BROOKLYN_VERSION,
     };
+
+    this.container = $element[0];
+    this.now = Date.now();
+    this.expectedNodeCounter = Object.keys(this.states.nodes).length;
+    this.template = 'haStatusTemplate';
+
+    let modalInstance = null;
+
+    this.openDialog = function (states, nodeId, serverApi, container) {
+        if (!modalInstance) {
+            modalInstance = $uibModal.open({
+                template: nodeManagementTemplate,
+                controller: ['$scope', '$uibModalInstance', 'node', 
'serverApi', nodeManagementController],
+                controllerAs: 'vm',
+                backdrop: 'static',
+                windowClass: 'quick-launch-modal',
+                size: 'md',
+                resolve: {
+                    node: function () {
+                        return states.nodes[nodeId];
+                    },
+                    serverApi: function () {
+                        return serverApi;
+                    }
+                }
+            });
+            modalInstance.result.then(
+                (promiseList) => {
+                    this.template = 'spinnerTemplate';
+                    Promise.allSettled(promiseList).then((values) => {
+                        let event = new CustomEvent('update-states', {});
+                        container.dispatchEvent(event);
+                    });
+                    modalInstance = null;
+                },
+                () => {
+                    this.template = 'spinnerTemplate';
+                    let event = new CustomEvent('update-states', {});
+                    container.dispatchEvent(event);
+                    modalInstance = null;
+                }
+            );
+        }
+
+    };
+
+    function nodeManagementController($scope, $uibModalInstance, node, 
serverApi) {
+
+        this.node = node;

Review comment:
       Controller instance could be named asa `vm`, the same as `controllerAs: 
'vm',`, instead of `mgmtController`.
   See examples in blueprint-composer, e.g. spec-editor.

##########
File path: ui-modules/home/app/views/about/about.controller.js
##########
@@ -67,4 +72,139 @@ export function aboutStateController($scope, brBrandInfo, 
version, states) {
         buildCommitId: BUILD_COMMIT_ID,
         brooklynVersion: BROOKLYN_VERSION,
     };
+
+    this.container = $element[0];
+    this.now = Date.now();
+    this.expectedNodeCounter = Object.keys(this.states.nodes).length;
+    this.template = 'haStatusTemplate';
+
+    let modalInstance = null;
+
+    this.openDialog = function (states, nodeId, serverApi, container) {
+        if (!modalInstance) {
+            modalInstance = $uibModal.open({
+                template: nodeManagementTemplate,
+                controller: ['$scope', '$uibModalInstance', 'node', 
'serverApi', nodeManagementController],
+                controllerAs: 'vm',
+                backdrop: 'static',
+                windowClass: 'quick-launch-modal',
+                size: 'md',
+                resolve: {
+                    node: function () {
+                        return states.nodes[nodeId];
+                    },
+                    serverApi: function () {
+                        return serverApi;
+                    }
+                }
+            });
+            modalInstance.result.then(
+                (promiseList) => {
+                    this.template = 'spinnerTemplate';
+                    Promise.allSettled(promiseList).then((values) => {
+                        let event = new CustomEvent('update-states', {});
+                        container.dispatchEvent(event);
+                    });
+                    modalInstance = null;
+                },
+                () => {
+                    this.template = 'spinnerTemplate';
+                    let event = new CustomEvent('update-states', {});
+                    container.dispatchEvent(event);
+                    modalInstance = null;
+                }
+            );
+        }
+
+    };
+
+    function nodeManagementController($scope, $uibModalInstance, node, 
serverApi) {
+
+        this.node = node;

Review comment:
       Controller instance could be named as `vm`, the same as `controllerAs: 
'vm',`, instead of `mgmtController`.
   See examples in blueprint-composer, e.g. spec-editor.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to