Daniel Erez has posted comments on this change.
Change subject: Expose the info about HBA devices in frontend
......................................................................
Patch Set 5: (3 inline comments)
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java
Line 162: List<EnumMap<HbaDeviceKeys, String>> hbaDevices = new
ArrayList<EnumMap<HbaDeviceKeys, String>>();
Line 163: List<Map<String, String>> fcDevices =
vds.getHBAs().get("FC"); //$NON-NLS-1$
Line 164:
Line 165: if (fcDevices != null) {
Line 166: for (Map<String, String> device: fcDevices) {
Wouldn't it be nicer to get a list of classes from the backend? It could be
then easily reused in the ui models (and most of this logic could be avoided...)
Line 167: EnumMap<HbaDeviceKeys, String> deviceModel = new
EnumMap<HbaDeviceKeys, String>(HbaDeviceKeys.class);
Line 168: deviceModel.put(HbaDeviceKeys.MODEL_NAME,
device.get("model")); //$NON-NLS-1$
Line 169: deviceModel.put(HbaDeviceKeys.WWNN,
device.get("wwnn")); //$NON-NLS-1$
Line 170: deviceModel.put(HbaDeviceKeys.WWNPS,
device.get("wwpn")); //$NON-NLS-1$
....................................................
File
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java
Line 81:
Line 82: @Override
Line 83: public void setMainTabSelectedItem(VDS selectedItem) {
Line 84: driver.edit(getDetailModel());
Line 85:
The logic in this method is quite heavy for each selection... Instead, I'd
prefer to see it in a popup invoked from the General sub-tab. But I guess it's
a UX decision.
Line 86: /* refresh all the information about HBA (FC, iSCSI) devices */
Line 87: habInventory.clear();
Line 88:
Line 89: if (selectedItem != null && getDetailModel().getHbaDevices()
!= null) {
Line 90:
Line 91: /*
Line 92: * traverse the model and get all the HBAs
Line 93: */
Line 94: for (EnumMap<HostHardwareGeneralModel.HbaDeviceKeys,
String> hbaDevice : getDetailModel().getHbaDevices()) {
Consider extracting(dividing) it into class private method(s).
Line 95: GeneralFormPanel hbaFormPanel = new GeneralFormPanel()
{
Line 96: {
Line 97: getElement().getStyle().setFloat(Float.LEFT);
Line 98: getElement().getStyle().setBorderWidth(1,
Unit.PX);
--
To view, visit http://gerrit.ovirt.org/15091
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44efcf1feabb3491aa46bd9294b14424483872c1
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches