Dima Kuznetsov has uploaded a new change for review. Change subject: webadmin: Move CPU info to HW info tab ......................................................................
webadmin: Move CPU info to HW info tab Moved CPU related labels out of Host-General to Host-Hardware Information sub-tab. The Host-General sub-tab was getting full and I have another patch that introduced a new label that should be put there. I've added a new label called to Host-General, "Logical CPU Cores" that displays the total cores available to the host. This freed up 4 slots on Host-General tab. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=894084 Change-Id: I9e44c8ddb9b144cc322a7ea7772cf99cdf4807fc Signed-off-by: Dima Kuznetsov <dkuzn...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java 5 files changed, 151 insertions(+), 126 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/27255/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java index 6414cd9..8426523 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java @@ -353,98 +353,6 @@ } } - private String cpuType; - - public String getCpuType() - { - return cpuType; - } - - public void setCpuType(String value) - { - if (!ObjectUtils.objectsEqual(cpuType, value)) - { - cpuType = value; - onPropertyChanged(new PropertyChangedEventArgs("CpuType")); //$NON-NLS-1$ - } - } - - private String cpuModel; - - public String getCpuModel() - { - return cpuModel; - } - - public void setCpuModel(String value) - { - if (!ObjectUtils.objectsEqual(cpuModel, value)) - { - cpuModel = value; - onPropertyChanged(new PropertyChangedEventArgs("CpuModel")); //$NON-NLS-1$ - } - } - - private Integer numberOfSockets; - - public Integer getNumberOfSockets() - { - return numberOfSockets; - } - - public void setNumberOfSockets(Integer value) - { - if (numberOfSockets == null && value == null) - { - return; - } - if (numberOfSockets == null || !numberOfSockets.equals(value)) - { - numberOfSockets = value; - onPropertyChanged(new PropertyChangedEventArgs("NumberOfSockets")); //$NON-NLS-1$ - } - } - - private Integer coresPerSocket; - - public Integer getCoresPerSocket() - { - return coresPerSocket; - } - - public void setCoresPerSocket(Integer value) - { - if (coresPerSocket == null && value == null) - { - return; - } - if (coresPerSocket == null || !coresPerSocket.equals(value)) - { - coresPerSocket = value; - onPropertyChanged(new PropertyChangedEventArgs("CoresPerSocket")); //$NON-NLS-1$ - } - } - - private String threadsPerCore; - - public String getThreadsPerCore() - { - return threadsPerCore; - } - - public void setThreadsPerCore(String value) - { - if (threadsPerCore == null && value == null) - { - return; - } - if (threadsPerCore == null || !threadsPerCore.equals(value)) - { - threadsPerCore = value; - onPropertyChanged(new PropertyChangedEventArgs("ThreadsPerCore")); //$NON-NLS-1$ - } - } - // 3rd column in General tab private Integer sharedMemory; @@ -899,6 +807,19 @@ onPropertyChanged(new PropertyChangedEventArgs("bootTime")); //$NON-NLS-1$ } + private Integer logicalCores; + + public Integer getLogicalCores() { + return logicalCores; + } + + public void setLogicalCores(Integer value) { + if (logicalCores != value) { + logicalCores = value; + onPropertyChanged(new PropertyChangedEventArgs("logicalCores")); //$NON-NLS-1$ + } + } + static { requestEditEventDefinition = new EventDefinition("RequestEditEvent", HostGeneralModel.class); //$NON-NLS-1$ @@ -994,25 +915,6 @@ setSpmPriorityValue(vds.getVdsSpmPriority()); setActiveVms(vds.getVmActive()); - setCpuType(vds.getCpuName() != null ? vds.getCpuName().getCpuName() : null); - setCpuModel(vds.getCpuModel()); - setNumberOfSockets(vds.getCpuSockets()); - setCoresPerSocket((vds.getCpuCores() != null && vds.getCpuSockets() != null) - ? vds.getCpuCores() / vds.getCpuSockets() : null); - - if (vds.getVdsGroupCompatibilityVersion() != null - && Version.v3_2.compareTo(vds.getVdsGroupCompatibilityVersion()) > 0) { - // Members of pre-3.2 clusters don't support SMT; here we act like a 3.1 engine - setThreadsPerCore(constants.unsupported()); - } else if (vds.getCpuThreads() == null || vds.getCpuCores() == null) { - setThreadsPerCore(constants.unknown()); - } else { - Integer threads = vds.getCpuThreads() / vds.getCpuCores(); - setThreadsPerCore(messages - .commonMessageWithBrackets(threads.toString(), - threads > 1 ? constants.smtEnabled() - : constants.smtDisabled())); - } setPhysicalMemory(vds.getPhysicalMemMb()); setSwapTotal(vds.getSwapTotal()); @@ -1039,6 +941,13 @@ setHostedEngineHa(messages.haActive(vds.getHighlyAvailableScore())); } } + + if (vds.getVdsGroupCompatibilityVersion() != null + && Version.v3_2.compareTo(vds.getVdsGroupCompatibilityVersion()) > 0) { + setLogicalCores(vds.getCpuCores()); + } else { + setLogicalCores(vds.getCpuThreads()); + } } private void updateAlerts() diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java index 8d9642b..ab3227e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java @@ -8,14 +8,20 @@ import org.ovirt.engine.core.common.businessentities.VDS; import org.ovirt.engine.core.common.mode.ApplicationMode; import org.ovirt.engine.core.common.utils.ObjectUtils; +import org.ovirt.engine.core.compat.Version; import org.ovirt.engine.ui.uicommonweb.help.HelpTag; import org.ovirt.engine.ui.uicommonweb.models.EntityModel; import org.ovirt.engine.ui.uicompat.ConstantsManager; import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; +import org.ovirt.engine.ui.uicompat.UIConstants; +import org.ovirt.engine.ui.uicompat.UIMessages; @SuppressWarnings("unused") public class HostHardwareGeneralModel extends EntityModel { + private static final UIConstants constants = ConstantsManager.getInstance().getConstants(); + private static final UIMessages messages = ConstantsManager.getInstance().getMessages(); + @Override public VDS getEntity() { @@ -119,6 +125,88 @@ } } + + private String cpuType; + + public String getCpuType() + { + return cpuType; + } + + public void setCpuType(String value) + { + if (!ObjectUtils.objectsEqual(cpuType, value)) { + cpuType = value; + onPropertyChanged(new PropertyChangedEventArgs("CpuType")); //$NON-NLS-1$ + } + } + + private String cpuModel; + + public String getCpuModel() + { + return cpuModel; + } + + public void setCpuModel(String value) + { + if (!ObjectUtils.objectsEqual(cpuModel, value)) { + cpuModel = value; + onPropertyChanged(new PropertyChangedEventArgs("CpuModel")); //$NON-NLS-1$ + } + } + + private Integer numberOfSockets; + + public Integer getNumberOfSockets() + { + return numberOfSockets; + } + + public void setNumberOfSockets(Integer value) + { + if (numberOfSockets == null && value == null) { + return; + } if (numberOfSockets == null || !numberOfSockets.equals(value)) { + numberOfSockets = value; + onPropertyChanged(new PropertyChangedEventArgs("NumberOfSockets")); //$NON-NLS-1$ + } + } + + private Integer coresPerSocket; + + public Integer getCoresPerSocket() + { + return coresPerSocket; + } + + public void setCoresPerSocket(Integer value) + { + if (coresPerSocket == null && value == null) { + return; + } if (coresPerSocket == null || !coresPerSocket.equals(value)) { + coresPerSocket = value; + onPropertyChanged(new PropertyChangedEventArgs("CoresPerSocket")); //$NON-NLS-1$ + } + } + + private String threadsPerCore; + + public String getThreadsPerCore() + { + return threadsPerCore; + } + + public void setThreadsPerCore(String value) + { + if (threadsPerCore == null && value == null) { + return; + } if (threadsPerCore == null || !threadsPerCore.equals(value)) { + threadsPerCore = value; + onPropertyChanged(new PropertyChangedEventArgs("ThreadsPerCore")); //$NON-NLS-1$ + } + } + public enum HbaDeviceKeys { MODEL_NAME, // Model name field TYPE, // Device type WWNN, // WWNN of the NIC @@ -159,6 +247,26 @@ setHardwareSerialNumber(vds.getHardwareSerialNumber()); setHardwareFamily(vds.getHardwareFamily()); + setCpuType(vds.getCpuName() != null ? vds.getCpuName().getCpuName() : null); + setCpuModel(vds.getCpuModel()); + setNumberOfSockets(vds.getCpuSockets()); + setCoresPerSocket((vds.getCpuCores() != null && vds.getCpuSockets() != null) + ? vds.getCpuCores() / vds.getCpuSockets() : null); + + if (vds.getVdsGroupCompatibilityVersion() != null + && Version.v3_2.compareTo(vds.getVdsGroupCompatibilityVersion()) > 0) { + // Members of pre-3.2 clusters don't support SMT; here we act like a 3.1 engine + setThreadsPerCore(constants.unsupported()); + } else if (vds.getCpuThreads() == null || vds.getCpuCores() == null) { + setThreadsPerCore(constants.unknown()); + } else { + Integer threads = vds.getCpuThreads() / vds.getCpuCores(); + setThreadsPerCore(messages + .commonMessageWithBrackets(threads.toString(), + threads > 1 ? constants.smtEnabled() + : constants.smtDisabled())); + } + /* Go through the list of HBA devices and transfer the necessary info to the GWT host hardware model */ List<EnumMap<HbaDeviceKeys, String>> hbaDevices = new ArrayList<EnumMap<HbaDeviceKeys, String>>(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java index ba57f00..6e5d7cb 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java @@ -1410,6 +1410,9 @@ @DefaultStringValue("Active VMs") String activeVmsHostGeneral(); + @DefaultStringValue("Logical CPU Cores") + String logicalCores(); + @DefaultStringValue("CPU Model") String cpuModelHostGeneral(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java index 1ce6140..53b6c45 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java @@ -58,15 +58,11 @@ VersionTextBoxLabel glusterVersion = new VersionTextBoxLabel(); @Path("IScsiInitiatorName") TextBoxLabel iScsiInitiatorName = new TextBoxLabel(); - TextBoxLabel cpuType = new TextBoxLabel(); - TextBoxLabel cpuModel = new TextBoxLabel(); - TextBoxLabel threadsPerCore = new TextBoxLabel(); VersionTextBoxLabel vdsmVersion = new VersionTextBoxLabel(); PercentTextBoxLabel<Integer> sharedMemory = new PercentTextBoxLabel<Integer>(); BooleanTextBoxLabel memoryPageSharing = new BooleanTextBoxLabel(constants.active(), constants.inactive()); NullableNumberTextBoxLabel<Integer> activeVms = new NullableNumberTextBoxLabel<Integer>(); - NullableNumberTextBoxLabel<Integer> numberOfSockets = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); - NullableNumberTextBoxLabel<Integer> coresPerSocket = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); + NullableNumberTextBoxLabel<Integer> logicalCores = new NullableNumberTextBoxLabel<Integer>(); TextBoxLabel spmPriority = new TextBoxLabel(); TextBoxLabel hostedEngineHa = new TextBoxLabel(); FullDateTimeLabel bootTime = new FullDateTimeLabel(); @@ -146,16 +142,14 @@ formBuilder.addFormItem(new FormItem(constants.vdsmVersionHostGeneral(), vdsmVersion, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.spiceVersionHostGeneral(), spiceVersion, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.glusterVersionHostGeneral(), glusterVersion, 0, glusterSupported).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.hostedEngineHaHostGeneral(), hostedEngineHa, 0, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.spmPriority(), spmPriority, 0, 1, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.activeVmsHostGeneral(), activeVms, 1, virtSupported).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.cpuModelHostGeneral(), cpuModel, 2, 1)); - formBuilder.addFormItem(new FormItem(constants.cpuTypeHostGeneral(), cpuType, 1).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.numOfSocketsHostGeneral(), numberOfSockets, 1).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.numOfCoresPerSocketHostGeneral(), coresPerSocket, 1).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.numOfThreadsPerCoreHostGeneral(), threadsPerCore, 1).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.logicalCores(), logicalCores, 1).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.bootTimeHostGeneral(), bootTime, 1).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.hostedEngineHaHostGeneral(), hostedEngineHa, 1, virtSupported).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.isciInitNameHostGeneral(), iScsiInitiatorName, 1, virtSupported).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.kdumpStatus(), kdumpStatus, 1).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.physMemHostGeneral(), physicalMemoryDetails, 2).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.swapSizeHostGeneral(), swapSizeDetails, 2).withAutoPlacement()); @@ -163,8 +157,6 @@ formBuilder.addFormItem(new FormItem(constants.maxSchedulingMemory(), maxSchedulingMemory, 2, virtSupported).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.memPageSharingHostGeneral(), memoryPageSharing, 2).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.autoLargePagesHostGeneral(), automaticLargePage, 2).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.isciInitNameHostGeneral(), iScsiInitiatorName, 2, virtSupported).withAutoPlacement()); - formBuilder.addFormItem(new FormItem(constants.kdumpStatus(), kdumpStatus, 2).withAutoPlacement()); } void initMemorySizeLabels() { diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java index f84f967..fa365f7 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java @@ -28,11 +28,14 @@ import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Widget; +import org.ovirt.engine.ui.webadmin.widget.label.NullableNumberTextBoxLabel; public class SubTabHostHardwareView extends AbstractSubTabFormView<VDS, HostListModel, HostHardwareGeneralModel> implements SubTabHostHardwarePresenter.ViewDef, Editor<HostHardwareGeneralModel> { interface Driver extends SimpleBeanEditorDriver<HostHardwareGeneralModel, SubTabHostHardwareView> { } + + ApplicationConstants constants = GWT.create(ApplicationConstants.class); TextBoxLabel hardwareManufacturer = new TextBoxLabel(); TextBoxLabel hardwareProductName = new TextBoxLabel(); @@ -40,6 +43,11 @@ TextBoxLabel hardwareVersion = new TextBoxLabel(); TextBoxLabel hardwareUUID = new TextBoxLabel(); TextBoxLabel hardwareFamily = new TextBoxLabel(); + TextBoxLabel cpuType = new TextBoxLabel(); + TextBoxLabel cpuModel = new TextBoxLabel(); + NullableNumberTextBoxLabel<Integer> numberOfSockets = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); + NullableNumberTextBoxLabel<Integer> coresPerSocket = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); + TextBoxLabel threadsPerCore = new TextBoxLabel(); @UiField(provided = true) GeneralFormPanel formPanel; @@ -47,7 +55,6 @@ @UiField FlowPanel hbaInventory; - ApplicationConstants constants; FormBuilder formBuilder; private final Driver driver = GWT.create(Driver.class); @@ -69,7 +76,7 @@ driver.initialize(this); // Build a form using the FormBuilder - formBuilder = new FormBuilder(formPanel, 3, 2); + formBuilder = new FormBuilder(formPanel, 3, 4); formBuilder.addFormItem(new FormItem(constants.hardwareManufacturerGeneral(), hardwareManufacturer, 0, 0)); formBuilder.addFormItem(new FormItem(constants.hardwareFamilyGeneral(), hardwareFamily, 0, 1)); formBuilder.addFormItem(new FormItem(constants.hardwareProductNameGeneral(), hardwareProductName, 0, 2)); @@ -77,6 +84,12 @@ formBuilder.addFormItem(new FormItem(constants.hardwareUUIDGeneral(), hardwareUUID, 1, 1)); formBuilder.addFormItem(new FormItem(constants.hardwareSerialNumberGeneral(), hardwareSerialNumber, 1, 2)); + formBuilder.addFormItem(new FormItem(constants.cpuModelHostGeneral(), cpuModel, 0).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.cpuTypeHostGeneral(), cpuType, 1).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.numOfSocketsHostGeneral(), numberOfSockets, 2).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.numOfCoresPerSocketHostGeneral(), coresPerSocket, 0).withAutoPlacement()); + formBuilder.addFormItem(new FormItem(constants.numOfThreadsPerCoreHostGeneral(), threadsPerCore, 1).withAutoPlacement()); + } @Override -- To view, visit http://gerrit.ovirt.org/27255 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e44c8ddb9b144cc322a7ea7772cf99cdf4807fc Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov <dkuzn...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches