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(
|
ironic.createNode(ctrl.node).then(
|
||||||
function(response) {
|
function(response) {
|
||||||
$log.info("create node response = " + JSON.stringify(response));
|
$log.info("create node response = " + JSON.stringify(response));
|
||||||
$uibModalInstance.close();
|
|
||||||
$rootScope.$emit(ironicEvents.ENROLL_NODE_SUCCESS);
|
$rootScope.$emit(ironicEvents.ENROLL_NODE_SUCCESS);
|
||||||
if (ctrl.moveNodeToManageableState) {
|
$uibModalInstance.close(response.data);
|
||||||
$log.info("Setting node provision state");
|
|
||||||
ironic.setNodeProvisionState(response.data.uuid, 'manage');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function() {
|
|
||||||
// No additional error processing for now
|
|
||||||
});
|
});
|
||||||
$log.debug("<< EnrollNodeController.submit()");
|
$log.debug("<< EnrollNodeController.submit()");
|
||||||
};
|
};
|
||||||
|
@ -28,16 +28,16 @@
|
|||||||
|
|
||||||
function enrollNodeService($uibModal, basePath) {
|
function enrollNodeService($uibModal, basePath) {
|
||||||
var service = {
|
var service = {
|
||||||
modal: modal
|
enrollNode: enrollNode
|
||||||
};
|
};
|
||||||
|
|
||||||
function modal() {
|
function enrollNode() {
|
||||||
var options = {
|
var options = {
|
||||||
controller: 'EnrollNodeController as ctrl',
|
controller: 'EnrollNodeController as ctrl',
|
||||||
backdrop: 'static',
|
backdrop: 'static',
|
||||||
templateUrl: basePath + '/base-node/base-node.html'
|
templateUrl: basePath + '/base-node/base-node.html'
|
||||||
};
|
};
|
||||||
return $uibModal.open(options);
|
return $uibModal.open(options).result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return service;
|
return service;
|
||||||
|
@ -181,7 +181,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function enrollNode() {
|
function enrollNode() {
|
||||||
enrollNodeService.modal();
|
enrollNodeService.enrollNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
function editNode(node) {
|
function editNode(node) {
|
||||||
|
Loading…
Reference in New Issue
Block a user