ofri masad has uploaded a new change for review.

Change subject: webadmin: Add version check to QoS editor
......................................................................

webadmin: Add version check to QoS editor

Disable the QoS editor/selector in vnic profile when the DC version is
under 3.3

Change-Id: I6f59bd0fdef058038a31bebc715230d415e0d62e
Signed-off-by: Ofri Masad <oma...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileModel.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
3 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/14/18014/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
index ccf775d..b0b0602 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
@@ -106,7 +106,8 @@
     QoSOutboundBurstDefaultValue,
     MaxVmNameLengthWindows(ConfigAuthType.User),
     MaxVmNameLengthNonWindows(ConfigAuthType.User),
-    AttestationServer
+    AttestationServer,
+    NetworkQosSupported
     ;
 
     public static enum ConfigAuthType {
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileModel.java
index d1a6781..b622773 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileModel.java
@@ -46,6 +46,7 @@
     private final EntityModel sourceModel;
     private final Version dcCompatibilityVersion;
     private final boolean customPropertiesSupported;
+    private final boolean qosSupported;
     private ListModel network;
     private ListModel networkQoS;
     private VnicProfile vnicProfile = null;
@@ -146,6 +147,9 @@
         customPropertiesSupported =
                 (Boolean) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties,
                         dcCompatibilityVersion.toString());
+        qosSupported =
+                (Boolean) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.NetworkQosSupported,
+                        dcCompatibilityVersion.toString());
 
         setName(new EntityModel());
         setNetwork(new ListModel());
@@ -158,6 +162,15 @@
         setDescription(new EntityModel());
         getPortMirroring().setIsChangable(isPortMirroringSupported());
         initCustomPropertySheet();
+
+        if (qosSupported) {
+            getNetworkQoS().setIsChangable(true);
+        } else {
+            
getNetworkQoS().setChangeProhibitionReason(ConstantsManager.getInstance()
+                    .getConstants().qosNotSupportedDcVersion());
+            getNetworkQoS().setIsChangable(false);
+            getNetworkQoS().setSelectedItem(null);
+        }
 
         initCommands();
     }
@@ -297,7 +310,7 @@
     }
 
     public void initNetworkQoSList(final Guid selectedItemId) {
-        if (getDcId() == null) {
+        if (getDcId() == null || !getNetworkQoS().getIsChangable()) {
             return;
         }
 
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 621fcbd..99eb79d 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
@@ -2050,4 +2050,6 @@
     @DefaultStringValue("Cannot edit name in tree context")
     String cannotEditNameInTreeContext();
 
+    @DefaultStringValue("Network QoS is supported only for Data Center version 
3.3 or higher")
+    String qosNotSupportedDcVersion();
 }


-- 
To view, visit http://gerrit.ovirt.org/18014
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f59bd0fdef058038a31bebc715230d415e0d62e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to