Skip to contentSkip to conversation

conga/luci site/luci/Extensions/StorageReport. ...

Cluster-devel [email protected] 1 participant 1 message Oct 15, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-10-15 05:09:46

Modified files:
luci/site/luci/Extensions: StorageReport.py
luci/storage : form-macros mappings_provider

Log message:
luci storage: cylinders' improvements (path tooltip, 'click me' directions, legend)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/mappings_provider.diff?cvsroot=cluster&r1=1.2&r2=1.3

luci/site/luci/Extensions/StorageReport.py +47 -33
@@ -1822,27 +1822,34 @@
     high_list = {}
     
     # upper cyl
-    upper_cyl = {'offset'   : 0,
-                 'cyls'     : [],
-                 'highs'    : [],
-                 'js'       : [],
-                 'color'    : 'blue'}
+    upper_cyl = {'offset'     : 0,
+                 'cyls'       : [],
+                 'highs'      : [],
+                 'js'         : [],
+                 'color'      : 'blue', 
+                 'color_css'  : '#0192db', 
+                 'description': mapper_data['pretty_targets_name']}
+    if mapper_data['mapper_type'] == MAPPER_PT_TYPE:
+        upper_cyl['description'] = 'Physical ' + upper_cyl['description']
+    
     offset = 0
     for t in mapper_data['targets_all']:
         if t['mapper_type'] == MAPPER_PT_TYPE:
             if t['props']['partition_type']['value'] == 'logical':
                 continue
         data = {}
-        data['bd']     = t
-        data['id']     = t['path']
+        data['bd']        = t
+        data['id']        = t['path']
         beg = offset
         end = beg + int(t['props']['size']['value'])
-        data['beg']    = beg
-        data['end']    = end
-        data['color']  = 'blue'
+        data['beg']       = beg
+        data['end']       = end
+        data['color']     = 'blue'
+        data['color_css'] = '#0192db'
         if mapper_data['mapper_type'] == MAPPER_PT_TYPE:
             if t['props']['partition_type']['value'] == 'extended' and not t['new']:
-                data['color'] = 'black'
+                data['color']     = 'black'
+                data['color_css'] = 'black'
         upper_cyl['cyls'].append(data)
         offset = end
     
@@ -1861,8 +1868,8 @@
                                    'id'   : h_id,
                                    'type' : 'select'})
         upper_cyl['js'].append([d['id'],
-                                [beg,
-                                 end]])
+                                [beg, end],
+                                d['bd']['pretty_name']])
         high_list[d['id']] = [h_id]
         
         # snapshots
@@ -1892,28 +1899,34 @@
     upper_cyl['js'] = str(upper_cyl['js']).replace('L,', ',').replace('L]', ']').replace('u\'', '\'').replace('L]', ']')
     
     # lower cylinder
-    lower_cyl = {'offset'   : 0,
-                 'cyls'     : [],
-                 'highs'    : [],
-                 'js'       : [],
-                 'color'    : 'red'}
+    lower_cyl = {'offset'     : 0,
+                 'cyls'       : [],
+                 'highs'      : [],
+                 'js'         : [],
+                 'color'      : 'red', 
+                 'color_css'  : '#a43737', 
+                 'description': mapper_data['pretty_sources_name']}
+    
     offset = 0
     for t in mapper_data['sources']:
         data = {}
-        data['bd']     = t
-        data['id']     = t['path']
+        data['bd']        = t
+        data['id']        = t['path']
         beg = offset
         end = beg + int(t['props']['size']['value'])
-        data['beg']    = beg
-        data['end']    = end
-        data['color']  = 'red'
+        data['beg']       = beg
+        data['end']       = end
+        data['color']     = 'red'
+        data['color_css'] = '#a43737'
         lower_cyl['cyls'].append(data)
         offset = end
     
     if mapper_data['mapper_type'] == MAPPER_PT_TYPE:
-        lower_cyl['cyls']  = []
-        lower_cyl['color'] = 'blue'
-        lower_cyl['offset'] = 9999999999999999999999999
+        lower_cyl['description'] = 'Logical ' + mapper_data['pretty_targets_name']
+        lower_cyl['cyls']        = []
+        lower_cyl['color']       = 'blue'
+        lower_cyl['color_css']   = '#0192db'
+        lower_cyl['offset']      = 9999999999999999999999999
         
         offset = 0
         for t in mapper_data['targets_all']:
@@ -1923,13 +1936,14 @@
             if part_beg < lower_cyl['offset']:
                 lower_cyl['offset'] = part_beg
             data = {}
-            data['bd']     = t
-            data['id']     = t['path']
+            data['bd']        = t
+            data['id']        = t['path']
             beg = offset
             end = beg + int(t['props']['size']['value'])
-            data['beg']    = beg
-            data['end']    = end
-            data['color']  = 'blue'
+            data['beg']       = beg
+            data['end']       = end
+            data['color']     = 'blue'
+            data['color_css'] = '#0192db'
             lower_cyl['cyls'].append(data)
             offset = end
             
@@ -1956,8 +1970,8 @@
                                    'id'   : h_id,
                                    'type' : 'select'})
         lower_cyl['js'].append([d['id'],
-                                [beg,
-                                 end]])
+                                [beg, end],
+                                d['bd']['pretty_name']])
         high_list[d['id']] = [h_id]
     lower_cyl['js'] = str(lower_cyl['js']).replace('L,', ',').replace('L]', ']').replace('u\'', '\'').replace('L]', ']')
     
luci/storage/form-macros +4 -4
@@ -522,14 +522,14 @@
      <iframe style="border: none;"
              tal:attributes="src     python:'mappings_provider?storagename=' + storagename + '&mapper_id=' + mapper['mapper_id'] + '&selected_path=' + bd_path;
                              width   string:700px;
-                             height  string:180"></iframe>
+                             height  string:195"></iframe>
     </div>
     
     <div id="textual_view" 
          tal:attributes="class mappings_view_classnames/textual_view">
     <br/>
     <div>
-     <h3>
+     <h3 style="font-size: small;">
       <span tal:omit-tag="" 
             tal:define="targets mapper/targets_all">
        <span tal:omit-tag="" 
@@ -551,7 +551,7 @@
     </div>
     <br/>
     <div>
-     <h3>
+     <h3 style="font-size: small;">
       <span tal:omit-tag="" 
             tal:define="sources mapper/sources">
        <span tal:omit-tag="" 
@@ -1431,7 +1431,7 @@
                             URL python:tmp_URL + '?storagename=' + storagename + '&pagetype=62'"
                 tal:attributes="href python:URL + '&mapper_type=' + bd_data['mapper_type'] + '&mapper_id=' + bd_data['mapper_id'] + '&bd_path=' + bd_data['path']"
                 style="font-size: xx-small;"
-                tal:content="python: 'Go to ' + bd_data['pretty_mapper_type']"></a>
+                tal:content="python: 'Go to ' + bd_data['pretty_mapper_type'] + ' view'"></a>
             </span>
            </span>
            <span tal:omit-tag=""
luci/storage/mappings_provider +95 -9

157 lines not on this page · raw message