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



##########
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:
       Applies to all functions defined below.




-- 
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:
[email protected]


Reply via email to