Improvements to enroll-node service
- Rename the modal function to enrollNode which better desribes its role - The enrollNode function returns a promise that when successfully resolved will contain the newly enrolled node. This change can be used to support more efficient UI updates. Change-Id: Id8f46cf85b6a1adb65c87d3c10729aea123241e7
This commit is contained in:
parent
6bc5cf3f95
commit
ed87e4f117
@ -74,15 +74,8 @@
|
||||
ironic.createNode(ctrl.node).then(
|
||||
function(response) {
|
||||
$log.info("create node response = " + JSON.stringify(response));
|
||||
$uibModalInstance.close();
|
||||
$rootScope.$emit(ironicEvents.ENROLL_NODE_SUCCESS);
|
||||
if (ctrl.moveNodeToManageableState) {
|
||||
$log.info("Setting node provision state");
|
||||
ironic.setNodeProvisionState(response.data.uuid, 'manage');
|
||||
}
|
||||
},
|
||||
function() {
|
||||
// No additional error processing for now
|
||||
$uibModalInstance.close(response.data);
|
||||
});
|
||||
$log.debug("<< EnrollNodeController.submit()");
|
||||
};
|
||||
|
@ -28,16 +28,16 @@
|
||||
|
||||
function enrollNodeService($uibModal, basePath) {
|
||||
var service = {
|
||||
modal: modal
|
||||
enrollNode: enrollNode
|
||||
};
|
||||
|
||||
function modal() {
|
||||
function enrollNode() {
|
||||
var options = {
|
||||
controller: 'EnrollNodeController as ctrl',
|
||||
backdrop: 'static',
|
||||
templateUrl: basePath + '/base-node/base-node.html'
|
||||
};
|
||||
return $uibModal.open(options);
|
||||
return $uibModal.open(options).result;
|
||||
}
|
||||
|
||||
return service;
|
||||
|
@ -181,7 +181,7 @@
|
||||
}
|
||||
|
||||
function enrollNode() {
|
||||
enrollNodeService.modal();
|
||||
enrollNodeService.enrollNode();
|
||||
}
|
||||
|
||||
function editNode(node) {
|
||||
|
Loading…
Reference in New Issue
Block a user