[node-patches] Change in ovirt-node[master]: setup: Improve status page

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Jan 14 20:15:18 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: setup: Improve status page
......................................................................

setup: Improve status page

Change-Id: I867b09e286eb38f033c7702256d9d957873c93eb
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/setup/status_page.py
1 file changed, 40 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/94/10994/1

diff --git a/scripts/tui/src/ovirt/node/setup/status_page.py b/scripts/tui/src/ovirt/node/setup/status_page.py
index f0d4861..25147dd 100644
--- a/scripts/tui/src/ovirt/node/setup/status_page.py
+++ b/scripts/tui/src/ovirt/node/setup/status_page.py
@@ -84,7 +84,9 @@
                           ui.Button("action.poweroff", "Poweroff")
                           ]
 
-        widgets = [ui.KeywordLabel("status", aligned("Status: ")),
+        widgets = [ui.Header("header[0]", "System Information"),
+
+                   ui.KeywordLabel("status", aligned("Status: ")),
                    ui.Divider("divider[0]"),
 
                    ui.Row("row[0]", network_widgets),
@@ -100,9 +102,13 @@
                    ui.Label("support.hint", "Press F8 for support menu"),
                    ui.Divider("divider[4]"),
 
-                   ui.Button("action.hostkey", "View Host Key"),
+                   ui.Row("row[1]",
+                          [ui.Button("action.hostkey", "View Host Key"),
+                           ui.Button("action.cpu_features",
+                                     "View CPU Features"),
+                           ]),
 
-                   ui.Row("row[1]", action_widgets),
+                   ui.Row("row[2]", action_widgets),
                    ]
 
         self.widgets.add(widgets)
@@ -140,34 +146,14 @@
 
         elif "action.hostkey" in changes:
             self.logger.info("Showing hostkey")
-            return self._build_hostkey_dialog()
+            return HostkeyDialog("dialog.hostkey", "Host Key")
+
+        elif "action.cpu_features" in changes:
+            self.logger.info("Showing CPU features")
+            return CPUFeaturesDialog("dialog.cpu_features", "CPU Features")
 
         elif "_save" in changes:
             self.widgets["dialog.hostkey"].close()
-
-    def _build_dialog(self, path, txt, widgets):
-        self.widgets.add(widgets)
-        self.widgets.add(ui.Dialog(path, txt, widgets))
-        return self.widgets[path]
-
-    def _build_hostkey_dialog(self):
-        ssh = security.Ssh()
-        fp, hk = ssh.get_hostkey()
-        dialog = self._build_dialog("dialog.hostkey", "Host Key",
-                                    [ui.Label("hostkey.label[0]",
-                                              "RSA Host Key Fingerprint:"),
-                                     ui.Label("hostkey.fp", fp),
-
-                                     ui.Divider("hostkey.divider[0]"),
-
-                                     ui.Label("hostkey.label[1]",
-                                              "RSA Host Key:"),
-                                     ui.Label("hostkey",
-                                              "\n".join(textwrap.wrap(hk,
-                                                                      64))),
-                                     ])
-        dialog.buttons = []
-        return dialog
 
     def _build_lock_dialog(self):
         widgets = [ui.Header("lock.label[0]",
@@ -181,3 +167,29 @@
         page.buttons = [ui.Button("action.unlock", "Unlock")]
         page.escape_key = None
         return page
+
+
+class HostkeyDialog(ui.Dialog):
+    def __init__(self, path, title):
+        super(HostkeyDialog, self).__init__(path, title, [])
+        ssh = security.Ssh()
+        fp, hk = ssh.get_hostkey()
+        self.children = [ui.Label("hostkey.label[0]",
+                                  "RSA Host Key Fingerprint:"),
+                         ui.Label("hostkey.fp", fp),
+
+                         ui.Divider("hostkey.divider[0]"),
+
+                         ui.Label("hostkey.label[1]",
+                                  "RSA Host Key:"),
+                         ui.Label("hostkey", "\n".join(textwrap.wrap(hk, 64))),
+                         ]
+        self.buttons = [ui.CloseButton("dialog.close")]
+
+
+class CPUFeaturesDialog(ui.Dialog):
+    def __init__(self, path, title):
+        super(CPUFeaturesDialog, self).__init__(path, title, [])
+        self.children = [ui.Label("label[0]", "TBD"),
+                         ]
+        self.buttons = [ui.CloseButton("dialog.close")]


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I867b09e286eb38f033c7702256d9d957873c93eb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list