Merge "Add support for editing node's resource_class"

This commit is contained in:
Jenkins 2017-06-26 13:29:00 +00:00 committed by Gerrit Code Review
commit 118a3ea81f
7 changed files with 32 additions and 3 deletions

View File

@ -87,7 +87,8 @@
name: null, name: null,
driver: null, driver: null,
driver_info: {}, driver_info: {},
network_interface: null network_interface: null,
resource_class: null
}; };
angular.forEach(ctrl.propertyCollections, function(collection) { angular.forEach(ctrl.propertyCollections, function(collection) {

View File

@ -80,7 +80,8 @@
driver_info: {}, driver_info: {},
properties: {}, properties: {},
extra: {}, extra: {},
network_interface: null}); network_interface: null,
resource_class: null});
expect(Object.getOwnPropertyNames(ctrl).sort()).toEqual( expect(Object.getOwnPropertyNames(ctrl).sort()).toEqual(
BASE_NODE_CONTROLLER_PROPERTIES.sort()); BASE_NODE_CONTROLLER_PROPERTIES.sort());
}); });

View File

@ -31,7 +31,6 @@
<!--base node form--> <!--base node form-->
<form id="baseNodeForm" <form id="baseNodeForm"
name="baseNodeForm"> name="baseNodeForm">
<!--tabbed content--> <!--tabbed content-->
<div class="tab-content"> <div class="tab-content">
<!-- node info tab--> <!-- node info tab-->
@ -53,6 +52,22 @@
placeholder="{$ ::'A unique node name. Optional.' | translate $}"/> placeholder="{$ ::'A unique node name. Optional.' | translate $}"/>
</div> </div>
</div> </div>
<!--resource class-->
<div class="form-group"
ng-class="{'has-error': baseNodeForm.resource_class.$invalid &&
baseNodeForm.resource_class.$dirty}">
<label for="resource_class"
class="control-label"
translate>Resource Class</label>
<div>
<input type="text maxlength=80"
class="form-control"
ng-model="ctrl.node.resource_class"
id="resource_class"
name="resource_class"
placeholder="{$ ::'A resource class name for future nova scheduling, in stand-alone usage only. Optional.' | translate $}"/>
</div>
</div>
<!--network interface--> <!--network interface-->
<div class="form-group"> <div class="form-group">
<label for="network_interface" <label for="network_interface"

View File

@ -83,6 +83,7 @@
ctrl.baseNode = node; ctrl.baseNode = node;
ctrl.node.name = node.name; ctrl.node.name = node.name;
ctrl.node.resource_class = node.resource_class;
ctrl.node.network_interface = node.network_interface; ctrl.node.network_interface = node.network_interface;
for (var i = 0; i < ctrl.drivers.length; i++) { for (var i = 0; i < ctrl.drivers.length; i++) {
if (ctrl.drivers[i].name === node.driver) { if (ctrl.drivers[i].name === node.driver) {
@ -121,6 +122,7 @@
this.path = path; this.path = path;
}; };
angular.forEach([new PatchItem("name", "/name"), angular.forEach([new PatchItem("name", "/name"),
new PatchItem("resource_class", "/resource_class"),
new PatchItem("network_interface", "/network_interface"), new PatchItem("network_interface", "/network_interface"),
new PatchItem("driver", "/driver"), new PatchItem("driver", "/driver"),
new PatchItem("properties", "/properties"), new PatchItem("properties", "/properties"),

View File

@ -77,6 +77,7 @@
PROPERTY_COLLECTION_PROPERTIES.sort()); PROPERTY_COLLECTION_PROPERTIES.sort());
}); });
expect(ctrl.node.name).toEqual(editNode.name); expect(ctrl.node.name).toEqual(editNode.name);
expect(ctrl.node.resource_class).toEqual(editNode.resource_class);
expect(ctrl.node.network_interface).toEqual(editNode.network_interface); expect(ctrl.node.network_interface).toEqual(editNode.network_interface);
expect(ctrl.node.properties).toEqual(editNode.properties); expect(ctrl.node.properties).toEqual(editNode.properties);
expect(ctrl.node.extra).toEqual(editNode.extra); expect(ctrl.node.extra).toEqual(editNode.extra);

View File

@ -9,6 +9,8 @@
<dd>{$ ctrl.node.uuid | noValue $}</dd> <dd>{$ ctrl.node.uuid | noValue $}</dd>
<dt translate>Chassis ID</dt> <dt translate>Chassis ID</dt>
<dd>{$ ctrl.node.chassis_uuid | noValue $}</dd> <dd>{$ ctrl.node.chassis_uuid | noValue $}</dd>
<dt translate>Resource Class</dt>
<dd>{$ ctrl.node.resource_class | noValue $}</dd>
<dt translate>Created At</dt> <dt translate>Created At</dt>
<dd>{$ ctrl.node.created_at | date:'medium' | noValue $}</dd> <dd>{$ ctrl.node.created_at | date:'medium' | noValue $}</dd>
</dl> </dl>

View File

@ -0,0 +1,7 @@
---
features:
- |
The node-details/configuration page shows the node's ``resource_class``.
- |
The user is now able to edit/update the ``resource_class`` field
when enrolling/updating a node.