Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Add QoS widget to host network dialog
......................................................................

webadmin: Add QoS widget to host network dialog

Added a QoS widget to the edit host network dialog, which allows users
to override the QoS configuration on a specific host interface.

Also refactored some more NetworkQoSModel-related code, some for reuse
purposes and some to encapsulate changeability/availability state
management in BaseNetworkQosModel.

Change-Id: I0f622b23f86a8e19d373f2210e71804006e70c5f
Signed-off-by: Lior Vernia <[email protected]>
---
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/datacenters/BaseNetworkQosModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkQoSModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQoSModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQosParametersModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NewNetworkQoSModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.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/popup/host/HostInterfacePopupView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java
12 files changed, 139 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/09/22809/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 a3a239a..18c8769 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
@@ -90,6 +90,7 @@
     VncKeyboardLayoutValidValues(ConfigAuthType.User),
     CustomDeviceProperties(ConfigAuthType.User),
     MultipleGatewaysSupported,
+    HostNetworkQosSupported,
     VirtIoScsiEnabled(ConfigAuthType.User),
     SshSoftFencingCommand,
     MemorySnapshotSupported(ConfigAuthType.User),
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/BaseNetworkQosModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/BaseNetworkQosModel.java
index 56c0bbd..7efc24a 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/BaseNetworkQosModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/BaseNetworkQosModel.java
@@ -1,16 +1,18 @@
 package org.ovirt.engine.ui.uicommonweb.models.datacenters;
 
 import org.ovirt.engine.core.common.businessentities.network.NetworkQoS;
-import org.ovirt.engine.core.common.queries.ConfigurationValues;
-import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider;
 import org.ovirt.engine.ui.uicommonweb.models.Model;
+import org.ovirt.engine.ui.uicompat.Event;
+import org.ovirt.engine.ui.uicompat.EventArgs;
+import org.ovirt.engine.ui.uicompat.IEventListener;
+import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs;
 
 public class BaseNetworkQosModel extends Model {
 
     private NetworkQosParametersModel inbound;
     private NetworkQosParametersModel outbound;
 
-    protected NetworkQoS networkQoS = new NetworkQoS();
+    protected NetworkQoS networkQoS;
 
     public NetworkQosParametersModel getInbound() {
         return inbound;
@@ -31,21 +33,59 @@
     public BaseNetworkQosModel() {
         setInbound(new NetworkQosParametersModel());
         setOutbound(new NetworkQosParametersModel());
-        getInbound().getAverage()
-                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundAverageDefaultValue));
-        getInbound().getPeak()
-                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundPeakDefaultValue));
-        getInbound().getBurst()
-                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundBurstDefaultValue));
-        getOutbound().getAverage()
-                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundAverageDefaultValue));
-        getOutbound().getPeak()
-                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundPeakDefaultValue));
-        getOutbound().getBurst()
-                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundBurstDefaultValue));
+        getPropertyChangedEvent().addListener(new IEventListener() {
+
+            @Override
+            public void eventRaised(Event ev, Object sender, EventArgs args) {
+                String property = ((PropertyChangedEventArgs) 
args).PropertyName;
+                if ("IsChangable".equals(property)) { //$NON-NLS-1$
+                    boolean value = BaseNetworkQosModel.super.getIsChangable();
+                    getInbound().getEnabled().setEntity(value);
+                    getOutbound().getEnabled().setEntity(value);
+                } else if ("IsAvailable".equals(property)) { //$NON-NLS-1$
+                    boolean value = getIsAvailable();
+                    getInbound().setIsAvailable(value);
+                    getOutbound().setIsAvailable(value);
+                }
+            }
+        });
     }
 
-    protected boolean validate() {
+    @Override
+    public boolean getIsChangable() {
+        return super.getIsChangable() || getInbound().getEnabled().getEntity()
+                || getOutbound().getEnabled().getEntity();
+    }
+
+    public void init(NetworkQoS qos) {
+        if (qos == null) {
+            networkQoS = new NetworkQoS();
+        } else {
+            networkQoS = qos;
+        }
+
+        if (networkQoS.getInboundAverage() == null
+                || networkQoS.getInboundPeak() == null
+                || networkQoS.getInboundBurst() == null) {
+            getInbound().getEnabled().setEntity(false);
+        } else {
+            
getInbound().getAverage().setEntity(networkQoS.getInboundAverage());
+            getInbound().getPeak().setEntity(networkQoS.getInboundPeak());
+            getInbound().getBurst().setEntity(networkQoS.getInboundBurst());
+        }
+
+        if (networkQoS.getOutboundAverage() == null
+                || networkQoS.getOutboundPeak() == null
+                || networkQoS.getOutboundBurst() == null) {
+            getOutbound().getEnabled().setEntity(false);
+        } else {
+            
getOutbound().getAverage().setEntity(networkQoS.getOutboundAverage());
+            getOutbound().getPeak().setEntity(networkQoS.getOutboundPeak());
+            getOutbound().getBurst().setEntity(networkQoS.getOutboundBurst());
+        }
+    }
+
+    public boolean validate() {
         getInbound().validate();
         getOutbound().validate();
 
@@ -53,7 +93,7 @@
         return getIsValid();
     }
 
-    protected void flush() {
+    public NetworkQoS flush() {
         if (getInbound().getEnabled().getEntity()) {
             
networkQoS.setInboundAverage(getInbound().getAverage().getEntity());
             networkQoS.setInboundPeak(getInbound().getPeak().getEntity());
@@ -73,6 +113,8 @@
             networkQoS.setOutboundPeak(null);
             networkQoS.setOutboundBurst(null);
         }
+
+        return networkQoS;
     }
 
 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkQoSModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkQoSModel.java
index f3141c6..a55fcf6 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkQoSModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkQoSModel.java
@@ -15,34 +15,10 @@
 
     public EditNetworkQoSModel(NetworkQoS networkQoS, Model sourceModel, 
StoragePool dataCenter) {
         super(sourceModel, dataCenter);
-        this.networkQoS = networkQoS;
-        init();
-    }
-
-    private void init() {
         
setTitle(ConstantsManager.getInstance().getConstants().editNetworkQoSTitle());
         setHashName("edit_network_qos"); //$NON-NLS-1$
         getName().setEntity(networkQoS.getName());
-
-        if (networkQoS.getInboundAverage() == null
-                || networkQoS.getInboundPeak() == null
-                || networkQoS.getInboundBurst() == null) {
-            getInbound().getEnabled().setEntity(false);
-        } else {
-            
getInbound().getAverage().setEntity(networkQoS.getInboundAverage());
-            getInbound().getPeak().setEntity(networkQoS.getInboundPeak());
-            getInbound().getBurst().setEntity(networkQoS.getInboundBurst());
-        }
-
-        if (networkQoS.getOutboundAverage() == null
-                || networkQoS.getOutboundPeak() == null
-                || networkQoS.getOutboundBurst() == null) {
-            getOutbound().getEnabled().setEntity(false);
-        } else {
-            
getOutbound().getAverage().setEntity(networkQoS.getOutboundAverage());
-            getOutbound().getPeak().setEntity(networkQoS.getOutboundPeak());
-            getOutbound().getBurst().setEntity(networkQoS.getOutboundBurst());
-        }
+        init(networkQoS);
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQoSModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQoSModel.java
index c706f66..531fba9 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQoSModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQoSModel.java
@@ -2,9 +2,11 @@
 
 import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.businessentities.network.NetworkQoS;
+import org.ovirt.engine.core.common.queries.ConfigurationValues;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.compat.StringHelper;
 import org.ovirt.engine.ui.uicommonweb.UICommand;
+import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider;
 import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
 import org.ovirt.engine.ui.uicommonweb.models.ListModel;
 import org.ovirt.engine.ui.uicommonweb.models.Model;
@@ -33,11 +35,23 @@
         setDataCenters(new ListModel<StoragePool>());
         getDataCenters().setSelectedItem(dataCenter);
         getDataCenters().setIsChangable(false);
+        getInbound().getAverage()
+                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundAverageDefaultValue));
+        getInbound().getPeak()
+                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundPeakDefaultValue));
+        getInbound().getBurst()
+                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundBurstDefaultValue));
+        getOutbound().getAverage()
+                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundAverageDefaultValue));
+        getOutbound().getPeak()
+                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundPeakDefaultValue));
+        getOutbound().getBurst()
+                .setEntity((Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundBurstDefaultValue));
         addCommands();
     }
 
     @Override
-    protected boolean validate() {
+    public boolean validate() {
         super.validate();
         getName().validateEntity(new IValidation[] { new NotEmptyValidation(), 
new AsciiNameValidation() });
 
@@ -61,10 +75,11 @@
     }
 
     @Override
-    protected void flush() {
+    public NetworkQoS flush() {
         super.flush();
         networkQoS.setName((String) getName().getEntity());
         
networkQoS.setStoragePoolId(((StoragePool)getDataCenters().getSelectedItem()).getId());
+        return networkQoS;
     }
 
     protected abstract void executeSave();
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQosParametersModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQosParametersModel.java
index a80918e..4a2dedc 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQosParametersModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NetworkQosParametersModel.java
@@ -9,6 +9,7 @@
 import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation;
 import org.ovirt.engine.ui.uicompat.Event;
 import org.ovirt.engine.ui.uicompat.EventArgs;
+import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs;
 
 public class NetworkQosParametersModel extends Model {
 
@@ -55,6 +56,7 @@
         setBurst(new EntityModel<Integer>());
         setEnabled(new EntityModel<Boolean>(true));
         getEnabled().getPropertyChangedEvent().addListener(this);
+        getPropertyChangedEvent().addListener(this);
     }
 
     public boolean validate() {
@@ -85,6 +87,8 @@
 
         if (getEnabled().equals(sender)) {
             updateChangeability();
+        } else if (this.equals(sender) && 
"IsAvailable".equals(((PropertyChangedEventArgs) args).PropertyName)) { 
//$NON-NLS-1$
+            updateAvailability();
         }
     }
 
@@ -95,4 +99,12 @@
         getBurst().setIsChangable(enabled);
     }
 
+    private void updateAvailability() {
+        boolean visible = getIsAvailable();
+        getAverage().setIsAvailable(visible);
+        getPeak().setIsAvailable(visible);
+        getBurst().setIsAvailable(visible);
+        getEnabled().setIsAvailable(visible);
+    }
+
 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NewNetworkQoSModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NewNetworkQoSModel.java
index 35e0cca..3556372 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NewNetworkQoSModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/NewNetworkQoSModel.java
@@ -4,6 +4,7 @@
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VdcReturnValueBase;
 import org.ovirt.engine.core.common.businessentities.StoragePool;
+import org.ovirt.engine.core.common.businessentities.network.NetworkQoS;
 import org.ovirt.engine.ui.frontend.Frontend;
 import org.ovirt.engine.ui.uicommonweb.models.Model;
 import org.ovirt.engine.ui.uicompat.ConstantsManager;
@@ -13,12 +14,9 @@
 public class NewNetworkQoSModel extends NetworkQoSModel {
     public NewNetworkQoSModel(Model sourceModel, StoragePool dataCenter) {
         super(sourceModel, dataCenter);
-        init();
-    }
-
-    private void init() {
         
setTitle(ConstantsManager.getInstance().getConstants().newNetworkQoSTitle());
         setHashName("new_network_qos"); //$NON-NLS-1$
+        networkQoS = new NetworkQoS();
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java
index 5805139..6e9fe2a 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java
@@ -8,6 +8,7 @@
 import org.ovirt.engine.core.compat.StringHelper;
 import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
 import org.ovirt.engine.ui.uicommonweb.models.ListModel;
+import org.ovirt.engine.ui.uicommonweb.models.datacenters.BaseNetworkQosModel;
 import org.ovirt.engine.ui.uicommonweb.validation.IValidation;
 import org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation;
 import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation;
@@ -243,6 +244,16 @@
         updateCanSpecify();
     }
 
+    private BaseNetworkQosModel qosModel;
+
+    public BaseNetworkQosModel getQosModel() {
+        return qosModel;
+    }
+
+    private void setQosModel(BaseNetworkQosModel qosModel) {
+        this.qosModel = qosModel;
+    }
+
     public HostInterfaceModel() {
         this(false);
     }
@@ -259,6 +270,7 @@
         setCheckConnectivity(new EntityModel());
         setBondingOptions(new ListModel());
         setCommitChanges(new EntityModel());
+        setQosModel(new BaseNetworkQosModel());
 
         setIsToSync(new EntityModel(){
             @Override
@@ -283,6 +295,7 @@
         getAddress().setIsChangable(false);
         getSubnet().setIsChangable(false);
         getGateway().setIsChangable(false);
+        getQosModel().setIsAvailable(false);
 
         getNetwork().getSelectedItemChangedEvent().addListener(this);
     }
@@ -369,7 +382,9 @@
             }
         }
 
+        getQosModel().validate();
+
         return getNetwork().getIsValid() && getAddress().getIsValid() && 
getSubnet().getIsValid()
-                && getGateway().getIsValid();
+                && getGateway().getIsValid() && getQosModel().getIsValid();
     }
 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java
index 9f598a8..1a9487c 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java
@@ -31,6 +31,7 @@
 import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
 import org.ovirt.engine.ui.uicommonweb.models.Model;
 import org.ovirt.engine.ui.uicommonweb.models.SearchableListModel;
+import org.ovirt.engine.ui.uicommonweb.models.datacenters.BaseNetworkQosModel;
 import 
org.ovirt.engine.ui.uicommonweb.models.hosts.network.BondNetworkInterfaceModel;
 import 
org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel;
 import org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand;
@@ -296,6 +297,15 @@
             
networkDialogModel.getIsToSync().setIsChangable(!logicalNetwork.isInSync());
             networkDialogModel.getIsToSync()
                     
.setEntity(networksToSync.contains(logicalNetwork.getName()));
+            if ((Boolean) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.HostNetworkQosSupported,
+                    getEntity().getVdsGroupCompatibilityVersion().getValue())) 
{
+                BaseNetworkQosModel qosModel = 
networkDialogModel.getQosModel();
+                qosModel.init(entity.getQos());
+                qosModel.setIsAvailable(true);
+                if (!entity.isQosOverridden()) {
+                    qosModel.setIsChangable(false);
+                }
+            }
             editPopup = networkDialogModel;
 
             // OK Target
@@ -312,6 +322,10 @@
                         entity.setGateway((String) 
networkDialogModel.getGateway().getEntity());
                     }
 
+                    BaseNetworkQosModel qosModel = 
networkDialogModel.getQosModel();
+                    entity.setQos(qosModel.flush());
+                    entity.setQosOverridden(qosModel.getIsChangable());
+
                     if ((Boolean) 
networkDialogModel.getIsToSync().getEntity()) {
                         networksToSync.add(logicalNetwork.getName());
                     } else {
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 c785679..558aba5 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
@@ -3157,10 +3157,10 @@
     @DefaultStringValue(" (Megabytes)")
     String inMegabytesNetworkQoSPopup();
 
-    @DefaultStringValue("Inbound")
+    @DefaultStringValue("Inbound QoS")
     String inboundLabelQoSPopup();
 
-    @DefaultStringValue("Outbound")
+    @DefaultStringValue("Outbound QoS")
     String outboundLabelQoSPopup();
 
     @DefaultStringValue("Mbps")
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java
index 3bef2a0..7911537 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java
@@ -24,6 +24,7 @@
 import org.ovirt.engine.ui.webadmin.ApplicationResources;
 import org.ovirt.engine.ui.webadmin.ApplicationTemplates;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.host.HostInterfacePopupPresenterWidget;
+import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.networkQoS.NetworkQosWidget;
 import org.ovirt.engine.ui.webadmin.widget.editor.EnumRadioEditor;
 
 import com.google.gwt.core.client.GWT;
@@ -87,6 +88,10 @@
     @UiField
     @Path(value = "gateway.entity")
     EntityModelTextBoxEditor gateway;
+
+    @UiField(provided = true)
+    @Ignore
+    NetworkQosWidget qosWidget;
 
     @UiField(provided = true)
     @Path(value = "checkConnectivity.entity")
@@ -164,6 +169,7 @@
             }
         });
         bootProtocol = new 
EnumRadioEditor<NetworkBootProtocol>(NetworkBootProtocol.class, eventBus);
+        qosWidget = new NetworkQosWidget(constants);
 
         checkConnectivity = new EntityModelCheckBoxEditor(Align.RIGHT);
         commitChanges = new EntityModelCheckBoxEditor(Align.RIGHT);
@@ -199,6 +205,7 @@
     @Override
     public void edit(final HostInterfaceModel object) {
         driver.edit(object);
+        qosWidget.edit(object.getQosModel());
 
         object.getPropertyChangedEvent().addListener(new IEventListener() {
             @Override
@@ -260,6 +267,7 @@
 
     @Override
     public HostInterfaceModel flush() {
+        qosWidget.flush();
         return driver.flush();
     }
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml
index c180809..51fcef0 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml
@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
 <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
-       xmlns:g="urn:import:com.google.gwt.user.client.ui" 
-       xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"
+       xmlns:g="urn:import:com.google.gwt.user.client.ui" 
xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"
        xmlns:t="urn:import:org.ovirt.engine.ui.common.widget.dialog.tab"
-       xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor"
-       xmlns:we="urn:import:org.ovirt.engine.ui.webadmin.widget.editor"
-       xmlns:w="urn:import:org.ovirt.engine.ui.webadmin.widget">
+       xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" 
xmlns:we="urn:import:org.ovirt.engine.ui.webadmin.widget.editor"
+       xmlns:w="urn:import:org.ovirt.engine.ui.webadmin.widget"
+       
xmlns:n="urn:import:org.ovirt.engine.ui.webadmin.section.main.view.popup.networkQoS">
 
        <ui:style 
type="org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInterfacePopupView.Style">
                .checkCon{
@@ -33,6 +32,7 @@
                                                <e:EntityModelTextBoxEditor 
ui:field="address" />
                                                <e:EntityModelTextBoxEditor 
ui:field="subnet" />
                                                <e:EntityModelTextBoxEditor 
ui:field="gateway" />
+                                               <n:NetworkQosWidget 
ui:field="qosWidget" />
                                                <g:HorizontalPanel>
                                                        
<e:EntityModelCheckBoxEditor ui:field="isToSync" />
                                                        <d:InfoIcon 
ui:field="isToSyncInfo"/>
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java
index bc94fb6..bb14902 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java
@@ -38,8 +38,8 @@
 
         // resize
         layoutPanel.remove(infoPanel);
-        layoutPanel.setWidgetSize(mainPanel, 270);
-        asPopupPanel().setPixelSize(400, 350);
+        layoutPanel.setWidgetSize(mainPanel, 440);
+        asPopupPanel().setPixelSize(400, 520);
 
         bootProtocolLabel.setEnabled(object.getBootProtocolsAvailable());
         bootProtocol.setEnabled(object.getBootProtocolsAvailable());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f622b23f86a8e19d373f2210e71804006e70c5f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to