Tal Nisan has uploaded a new change for review.

Change subject: webadmin: Add host uptime to hosts general subtab
......................................................................

webadmin: Add host uptime to hosts general subtab

Change-Id: I1d036a6f654d57839a36ec647adb17d368a543f9
Signed-off-by: Tal Nisan <[email protected]>
Bug-Url: https://bugzilla.redhat.com/1070348
---
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
2 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/34/25834/1

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 f449735..f860e55 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("CPU Threads per Core")
     String numOfThreadsPerCoreHostGeneral();
 
+    @DefaultStringValue("Up Time")
+    String uptimeHostGeneral();
+
     @DefaultStringValue("Physical Memory")
     String physMemHostGeneral();
 
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 945e7dd..af75730 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
@@ -38,6 +38,7 @@
 import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.HTMLPanel;
 import com.google.gwt.user.client.ui.Widget;
+import org.ovirt.engine.ui.webadmin.widget.renderer.UptimeRenderer;
 
 public class SubTabHostGeneralView extends AbstractSubTabFormView<VDS, 
HostListModel, HostGeneralModel> implements SubTabHostGeneralPresenter.ViewDef, 
Editor<HostGeneralModel> {
 
@@ -79,6 +80,9 @@
     MemorySizeTextBoxLabel<Float> maxSchedulingMemory;
 
     @Ignore
+    TextBoxLabel uptime = new TextBoxLabel();
+
+    @Ignore
     DetailsTextBoxLabel<ArrayList<TextBoxLabelBase<Integer>>, Integer> 
physicalMemoryDetails =
             new DetailsTextBoxLabel<ArrayList<TextBoxLabelBase<Integer>>, 
Integer>(constants.total(),
                     constants.used(),
@@ -97,6 +101,8 @@
     GeneralFormPanel formPanel;
 
     FormBuilder formBuilder;
+
+    UptimeRenderer uptimeRenderer;
 
     // This is the panel containing the action items label and the
     // potential list of action items, this way we can hide the panel
@@ -128,6 +134,8 @@
         // Init form panel:
         formPanel = new GeneralFormPanel();
 
+        uptimeRenderer = new UptimeRenderer();
+
         initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));
         driver.initialize(this);
 
@@ -154,6 +162,7 @@
         formBuilder.addFormItem(new 
FormItem(constants.numOfCoresPerSocketHostGeneral(), coresPerSocket, 
1).withAutoPlacement());
         formBuilder.addFormItem(new 
FormItem(constants.numOfThreadsPerCoreHostGeneral(), threadsPerCore, 
1).withAutoPlacement());
 
+        formBuilder.addFormItem(new FormItem(constants.uptimeHostGeneral(), 
uptime, 2).withAutoPlacement());
         formBuilder.addFormItem(new FormItem(constants.physMemHostGeneral(), 
physicalMemoryDetails, 2).withAutoPlacement());
         formBuilder.addFormItem(new FormItem(constants.swapSizeHostGeneral(), 
swapSizeDetails, 2).withAutoPlacement());
         formBuilder.addFormItem(new FormItem(constants.sharedMemHostGeneral(), 
sharedMemory, 2).withAutoPlacement());
@@ -193,6 +202,8 @@
 
         maxSchedulingMemory.setValue(selectedItem.getMaxSchedulingMemory());
 
+        
uptime.setValue(uptimeRenderer.render(selectedItem.getUptime().doubleValue()));
+
         formBuilder.update(getDetailModel());
     }
 


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

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

Reply via email to