diff --git a/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.controller.js b/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.controller.js index d62aca1b..6944332c 100644 --- a/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.controller.js +++ b/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.controller.js @@ -29,9 +29,9 @@ 'horizon.dashboard.admin.ironic.validDatapathIdPattern', 'horizon.dashboard.admin.ironic.form-field.service', 'horizon.app.core.openstack-service-api.ironic', + 'horizon.dashboard.admin.ironic.property-collection.service', 'ctrl', - 'node' - ]; + 'node']; /** * @description Utility class used to manage local-link-connection @@ -141,13 +141,9 @@ validDatapathIdPattern, formFieldService, ironic, + propertyCollectionService, ctrl, node) { - ctrl.port = { - extra: {}, - node_uuid: node.uuid - }; - ctrl.address = new formFieldService.FormField({ id: "macAddress", title: gettext("MAC address"), @@ -186,7 +182,8 @@ var field = ctrl.portgroup_uuid; if (portgroups.length > 0) { - field.portgroups.push({uuid: null, name: gettext("Select a portgroup")}); + field.portgroups.push({uuid: null, + name: gettext("Select a portgroup")}); } field.portgroups = field.portgroups.concat(portgroups); @@ -195,6 +192,13 @@ } }); + ctrl.extra = new propertyCollectionService.PropertyCollection({ + id: 'extra', + title: gettext('Extras'), + addPropertyLabel: gettext('Add Extra'), + placeholder: gettext('Property Name') + }); + /** * Cancel the modal * @@ -203,26 +207,5 @@ ctrl.cancel = function() { $uibModalInstance.dismiss('cancel'); }; - - /** - * Delete a port metadata property - * - * @param {string} propertyName - Name of the property - * @return {void} - */ - ctrl.deleteExtra = function(propertyName) { - delete ctrl.port.extra[propertyName]; - }; - - /** - * Check whether the specified port metadata property already exists - * - * @param {string} propertyName - Name of the metadata property - * @return {boolean} True if the property already exists, - * otherwise false - */ - ctrl.checkExtraUnique = function(propertyName) { - return !(propertyName in ctrl.port.extra); - }; } })(); diff --git a/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.html b/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.html index 7958e680..ff2ee476 100644 --- a/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.html +++ b/ironic_ui/static/dashboard/admin/ironic/base-port/base-port.html @@ -26,49 +26,7 @@ -
- - +