[Kimchi-devel] [PATCH 3/3] Issue 728 : processor info displays blank for system z

chandra at linux.vnet.ibm.com chandra at linux.vnet.ibm.com
Thu Nov 26 12:53:06 UTC 2015


From: Chandra Shekhar Reddy Potula <chandra at linux.vnet.ibm.com>

UI changes to accommodate the basic system info
1. memory shows online, offline memory info
2. cpu shows online, offline cpu info
On s390x deidcated, shared cpu info shown
3. On s390x hypervisor, LPAR details shown
---
 .../gingerbase/ui/css/src/modules/_host.scss       |  9 +++++----
 .../ui/js/src/gingerbase.host-dashboard.js         | 23 +++++++++++++++++++++-
 .../gingerbase/ui/pages/host-dashboard.html.tmpl   |  8 ++++++++
 3 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/src/wok/plugins/gingerbase/ui/css/src/modules/_host.scss b/src/wok/plugins/gingerbase/ui/css/src/modules/_host.scss
index 1fb062c..dc27df5 100644
--- a/src/wok/plugins/gingerbase/ui/css/src/modules/_host.scss
+++ b/src/wok/plugins/gingerbase/ui/css/src/modules/_host.scss
@@ -104,22 +104,23 @@
 #host-info-container {
     padding-top: 10px;
     .basic-information-list {
-        height: 517px;
+        height: auto;
         overflow-x: hidden;
         overflow-y: auto;
         margin: 0;
         @extend .row; // Extending bootstrap .row clearfix util
-        .basic-information-list dt {
+
+    }
+    .panel-body dt {
             font-weight: 600;
             font-size: 14.5pt;
             line-height: 12px;
         }
-        .basic-information-list dd {
+    .panel-body dd {
             font-size: 12.5pt;
             font-weight: 400;
             margin-bottom: 12px;
         }
-    }
 }
 
 
diff --git a/src/wok/plugins/gingerbase/ui/js/src/gingerbase.host-dashboard.js b/src/wok/plugins/gingerbase/ui/js/src/gingerbase.host-dashboard.js
index 047ba5b..c4530d7 100644
--- a/src/wok/plugins/gingerbase/ui/js/src/gingerbase.host-dashboard.js
+++ b/src/wok/plugins/gingerbase/ui/js/src/gingerbase.host-dashboard.js
@@ -297,15 +297,36 @@ gingerbase.host_dashboard = function() {
 
     gingerbase.getHost(function(data) {
         var htmlTmpl = $('#host-dashboard-tmpl').html();
+        var memory = null
+        var cpus = null
         data['logo'] = data['logo'] || '';
-        data['memory'] = wok.formatMeasurement(data['memory'], {
+        // Memory fetch online, offline details
+        data['memory']['online'] = wok.formatMeasurement(data['memory']['online'], {
             fixed: 2
         });
+        data['memory']['offline'] = wok.formatMeasurement(data['memory']['offline'], {
+            fixed: 2
+        });
+        memory = "Online: " + data['memory']['online'] + ", Offline: " + data['memory']['offline'];
+        // CPU fetch online, offline details
+        cpus = 'Online: ' + data['cpus']['online'] + ', Offline: ' + data['cpus']['offline'];
+        // This code is only for s390x architecture where hypervisor details required.
+        if (data['architecture'] == 's390x'){
+            cpus += ', Shared: ' + data['cpus']['shared'] + ', Dedicated: ' + data['cpus']['dedicated'];
+            data['lpar_details'] = 'Name: ' + data['virtualization']['lpar_name'] + ', ID: ' + data['virtualization']['lpar_number'];
+            data['hypervisor_details'] = 'Name: ' + data['virtualization']['hypervisor'] + ', Vendor :' + data['virtualization']['hypervisor_vendor'];
+        }
+        data['memory'] = memory
+        data['cpus'] = cpus
         var templated = wok.substitute(htmlTmpl, data);
         $('#host-content-container').html(templated);
 
         initPage();
         initTracker();
+        // Enable hypervisor, LPAR details on s390x architechture
+        if (data['architecture'] == 's390x'){
+            $('#s390x-info').removeClass();
+        }
     });
 
     var StatsMgr = function() {
diff --git a/src/wok/plugins/gingerbase/ui/pages/host-dashboard.html.tmpl b/src/wok/plugins/gingerbase/ui/pages/host-dashboard.html.tmpl
index 06b8088..eec40c3 100644
--- a/src/wok/plugins/gingerbase/ui/pages/host-dashboard.html.tmpl
+++ b/src/wok/plugins/gingerbase/ui/pages/host-dashboard.html.tmpl
@@ -106,6 +106,8 @@
                 </div>
                 <div class="panel-body">
                     <dl class="basic-information-list">
+                        <dt>{architecture}</dt>
+                        <dd>$_("Architecture")</dd>
                         <dt>{os_distro}</dt>
                         <dd>$_("OS Distro")</dd>
                         <dt>{os_version}</dt>
@@ -119,6 +121,12 @@
                         <dt>{memory}</dt>
                         <dd>$_("Memory")</dd>
                     </dl>
+                    <dl id="s390x-info" class="hidden">
+                        <dt>{lpar_details}</dt>
+                        <dd>$_("LPAR Details")</dd>
+                        <dt>{hypervisor_details}</dt>
+                        <dd>$_("Hypervisor Details")</dd>
+                    </dl>
                 </div>
             </div>
             <div id="debug-report-section" class="col-md-6 hidden"></div>
-- 
2.4.0




More information about the Kimchi-devel mailing list