Greg Padgett has uploaded a new change for review. Change subject: webadmin: show hosted engine info in host>general tab ......................................................................
webadmin: show hosted engine info in host>general tab Display a single entry in the host > general tab displaying hosted engine status, if it is configured on the selected host. WIP - working on the conditional display of the entry Change-Id: I17f0eff120b2ab99b4badc53da1780c1e758299c Bug-Url: https://bugzilla.redhat.com/1047649 Signed-off-by: Greg Padgett <gpadg...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.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 5 files changed, 79 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/23267/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 dc35949..e0cc911 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 @@ -647,6 +647,46 @@ } } + private String hostedEngineHa; + + public String getHostedEngineHa() + { + return hostedEngineHa; + } + + public void setHostedEngineHa(String value) + { + if (hostedEngineHa == null && value == null) + { + return; + } + if (hostedEngineHa == null || !hostedEngineHa.equals(value)) + { + hostedEngineHa = value; + onPropertyChanged(new PropertyChangedEventArgs("HostedEngineHa")); //$NON-NLS-1$ + } + } + + private Boolean hostedEngineHaIsConfigured; + + public Boolean getHostedEngineHaIsConfigured() + { + return hostedEngineHaIsConfigured; + } + + public void setHostedEngineHaIsConfigured(Boolean value) + { + if (hostedEngineHaIsConfigured == null && value == null) + { + return; + } + if (hostedEngineHaIsConfigured == null || !hostedEngineHaIsConfigured.equals(value)) + { + hostedEngineHaIsConfigured = value; + onPropertyChanged(new PropertyChangedEventArgs("HostedEngineHaIsConfigured")); //$NON-NLS-1$ + } + } + // Alert section in general tab private boolean hasAnyAlert; @@ -1088,6 +1128,23 @@ setSharedMemory(vds.getMemSharedPercent()); setMemoryPageSharing(vds.getKsmState()); setAutomaticLargePage(vds.getTransparentHugePagesState()); + + if (!vds.getHighlyAvailableIsConfigured()) { + setHostedEngineHaIsConfigured(false); + setHostedEngineHa(constants.unsupported()); + } else { + setHostedEngineHaIsConfigured(true); + if (vds.getHighlyAvailableGlobalMaintenance()) { + setHostedEngineHa(constants.haGlobalMaintenance()); + } else if (vds.getHighlyAvailableLocalMaintenance()) { + setHostedEngineHa(constants.haLocalMaintenance()); + } else if (vds.getHighlyAvailableIsActive()) { + setHostedEngineHa(messages.haActive(vds.getHighlyAvailableScore())); + } else { + setHostedEngineHa(constants.haNotActive()); + } + setThreadsPerCore(constants.unknown()); + } } private void updateAlerts() diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java index 6bf1084..ac06538 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java @@ -2114,8 +2114,16 @@ @DefaultStringValue("Not available when Templates are not configured.") String notAvailableWithNoTemplates(); - @DefaultStringValue("Connecting to pool not supported.") String connectToPoolNotSupported(); + + @DefaultStringValue("Global Maintenance Enabled") + String haGlobalMaintenance(); + + @DefaultStringValue("Local Maintenance Enabled") + String haLocalMaintenance(); + + @DefaultStringValue("Not Active") + String haNotActive(); } diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java index 204edb5..8a7fa53 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java @@ -339,4 +339,6 @@ @DefaultMessage("{0} (Thin/Dependent)") String vmTemplateWithThinProvisioning(String templateName); + @DefaultMessage("Active (Score: {0})") + String haActive(int score); } 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 9d80abd..a441aba 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 @@ -1413,6 +1413,9 @@ @DefaultStringValue("Shared Memory") String sharedMemHostGeneral(); + @DefaultStringValue("Hosted Engine HA") + String hostedEngineHaHostGeneral(); + @DefaultStringValue("Action Items") String actionItemsHostGeneral(); 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 0441a13..c0c4182 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 @@ -67,6 +67,7 @@ NullableNumberTextBoxLabel<Integer> numberOfSockets = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); NullableNumberTextBoxLabel<Integer> coresPerSocket = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); TextBoxLabel spmPriority = new TextBoxLabel(); + TextBoxLabel hostedEngineHa = new TextBoxLabel(); MemorySizeTextBoxLabel<Integer> physicalMemory; MemorySizeTextBoxLabel<Integer> usedMemory; @@ -134,7 +135,7 @@ boolean glusterSupported = ApplicationModeHelper.isModeSupported(ApplicationMode.GlusterOnly); // Build a form using the FormBuilder - formBuilder = new FormBuilder(formPanel, 3, 7); + formBuilder = new FormBuilder(formPanel, 3, 8); formBuilder.addFormItem(new FormItem(constants.osVersionHostGeneral(), oS, 0).withAutoPlacement()); formBuilder.addFormItem(new FormItem(constants.kernelVersionHostGeneral(), kernelVersion, 0).withAutoPlacement()); @@ -159,6 +160,12 @@ 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.hostedEngineHaHostGeneral(), hostedEngineHa, 0, 2, "HostedEngineHaIsConfigured") { //$NON-NLS-1$ + @Override + public boolean getIsAvailable() { + return getDetailModel().getHostedEngineHaIsConfigured(); + } + }.withAutoPlacement()); } void initMemorySizeLabels() { -- To view, visit http://gerrit.ovirt.org/23267 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17f0eff120b2ab99b4badc53da1780c1e758299c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Greg Padgett <gpadg...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches