From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 15 Oct 2006 05:09:47 -0000 Subject: [Cluster-devel] conga/luci site/luci/Extensions/StorageReport. ... Message-ID: <20061015050947.20751.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- conga/luci/site/luci/Extensions/StorageReport.py 2006/10/14 20:01:52 1.14 +++ conga/luci/site/luci/Extensions/StorageReport.py 2006/10/15 05:09:46 1.15 @@ -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]', ']') --- conga/luci/storage/form-macros 2006/10/14 20:01:52 1.12 +++ conga/luci/storage/form-macros 2006/10/15 05:09:46 1.13 @@ -522,14 +522,14 @@ + height string:195">

-

+


-

+

+ tal:content="python: 'Go to ' + bd_data['pretty_mapper_type'] + ' view'"> beg && x < end) select_subcyl(id, h_data); } } - + + + + + + function cyl_over(msg_board, X, Y, c_data, h_data) { + if (Y < 0 || Y > 40) { + msg_board.style.visibility = 'invisible'; + return; + } + var x = X - ellipse(Y); + var y = Y; + for (var i=0; i beg && x < end) { + var descr = elem[2]; + msg_board.innerHTML = descr; + msg_board.style.width = (descr.length + 1) + 'ex'; + msg_board.style.left = X - 35; + msg_board.style.top = Y + 15; + msg_board.style.visibility = 'visible'; + return; + } + } + msg_board.style.visibility = 'invisible'; + } + + + @@ -176,16 +206,37 @@ - +
+ + + + + +
+ tal:attributes="style python:here.add_commas('position:absolute', here.add_commas('left: ' + str(X_offset), 'top: ' + str(Y_offset)))"> + + +
+
+ : +
+
@@ -198,20 +249,38 @@
+
- +
+ tal:attributes="style python:here.add_commas('position:absolute', here.add_commas('left: ' + str(X_offset), 'top: ' + str(lower_Y_offset)))"> + +
+
+ : +
+
+
@@ -224,12 +293,29 @@
+
- - - + + + +
+
+ Click cylinders to view properties, unselect all to view 's properties +
+
+ + +