diff --git a/ironic_ui/static/dashboard/admin/ironic/maintenance/maintenance.service.js b/ironic_ui/static/dashboard/admin/ironic/maintenance/maintenance.service.js
index 166ecbd8..3647d76f 100644
--- a/ironic_ui/static/dashboard/admin/ironic/maintenance/maintenance.service.js
+++ b/ironic_ui/static/dashboard/admin/ironic/maintenance/maintenance.service.js
@@ -36,13 +36,14 @@
function maintenanceService($uibModal, basePath, nodeActions) {
var service = {
- putNodeInMaintenanceMode: putNodeInMaintenanceMode,
- removeNodeFromMaintenanceMode: removeNodeFromMaintenanceMode
+ setMaintenance: setMaintenance
};
return service;
/*
- * @description Put a specified list of nodes into mainenance
+ * @description Put a specified list of nodes into mainenance.
+ * A modal dialog is used to prompt the user for a reason for
+ * putting the nodes in maintenance mode.
*
* @param {object[]} nodes - List of node objects
* @return {promise}
@@ -66,5 +67,19 @@
function removeNodeFromMaintenanceMode(nodes) {
return nodeActions.removeNodeFromMaintenanceMode(nodes);
}
+
+ /*
+ * @description Set the maintenance mode of a specified list of nodes
+ *
+ * @param {object[]} nodes - List of node objects
+ * @param {boolean} mode - Desired maintenance state.
+ * 'true' -> Node is in maintenance mode
+ * 'false' -> Node is not in maintenance mode
+ * @return {promise}
+ */
+ function setMaintenance(nodes, mode) {
+ return mode ? putNodeInMaintenanceMode(nodes)
+ : removeNodeFromMaintenanceMode(nodes);
+ }
}
})();
diff --git a/ironic_ui/static/dashboard/admin/ironic/node-details/node-details.html b/ironic_ui/static/dashboard/admin/ironic/node-details/node-details.html
index bacf7e98..c3121724 100644
--- a/ironic_ui/static/dashboard/admin/ironic/node-details/node-details.html
+++ b/ironic_ui/static/dashboard/admin/ironic/node-details/node-details.html
@@ -26,18 +26,17 @@
{$ transition.label $}
-