Author: tmckay Date: 2011-07-05 15:35:39 +0000 (Tue, 05 Jul 2011) New Revision: 4863
Modified: branches/clarity/cumin/etc/sysvinit-cumin branches/clarity/cumin/open-flash-chart/elements/axis/XAxisLabels.as branches/clarity/cumin/open-flash-chart/elements/labels/Keys.as branches/clarity/cumin/open-flash-chart/main.as branches/clarity/cumin/open-flash-chart/tr.as branches/clarity/cumin/python/cumin/account/widgets.strings branches/clarity/cumin/python/cumin/grid/job.py branches/clarity/cumin/python/cumin/main.py branches/clarity/cumin/python/cumin/main.strings branches/clarity/cumin/python/cumin/stat.py branches/clarity/cumin/python/cumin/task.py branches/clarity/cumin/python/cumin/widgets.strings branches/clarity/cumin/resources/app.css branches/clarity/cumin/resources/app.js branches/clarity/cumin/resources/open-flash-chart.swf branches/clarity/wooly/python/wooly/pages.py branches/clarity/wooly/resources/wooly.js Log: Merge BZ fixes from trunk. (svn merge -c 4842 svn+ssh://svn.fedorahosted.org/svn/cumin/trunk .) (svn merge -r 4842:4846 svn+ssh://svn.fedorahosted.org/svn/cumin/trunk .) (svn merge -r 4848:4850 -r 4851:4853 -r 4857:4860 svn+ssh://svn.fedorahosted.org/svn/cumin/trunk .)
BZ703621 BZ715956 BZ715973 BZ703630 BZ699732 BZ707576 BZ717953
Modified: branches/clarity/cumin/etc/sysvinit-cumin =================================================================== --- branches/clarity/cumin/etc/sysvinit-cumin 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/etc/sysvinit-cumin 2011-07-05 15:35:39 UTC (rev 4863) @@ -7,17 +7,6 @@ # pidfile: /var/run/cumin.pid #
-# Sanity checks. -test -x /usr/bin/cumin || { - echo "/usr/bin/cumin has been removed" - exit 1 -} - -test -x /usr/bin/cumin-database || { - echo "/usr/bin/cumin-database has been removed" - exit 1 -} - SYSCONFIG="/etc/sysconfig/cumin" [ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
@@ -39,6 +28,19 @@ exit 1 fi
+ # Sanity checks. + test -x /usr/bin/cumin || { + echo_failure; echo + echo "/usr/bin/cumin has been removed" + exit 1 + } + + test -x /usr/bin/cumin-database || { + echo_failure; echo + echo "/usr/bin/cumin-database has been removed" + exit 1 + } + # Initial checks for the start case cumin-database check-started &> /dev/null || { echo_failure; echo
Modified: branches/clarity/cumin/open-flash-chart/elements/axis/XAxisLabels.as =================================================================== --- branches/clarity/cumin/open-flash-chart/elements/axis/XAxisLabels.as 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/open-flash-chart/elements/axis/XAxisLabels.as 2011-07-05 15:35:39 UTC (rev 4863) @@ -25,7 +25,7 @@ //[Embed(systemFont = 'Arial', fontName = 'spArial', mimeType = 'application/x-font' // ,unicodeRange = 'ofcRange') //] - [Embed(systemFont = 'Arial', fontName = 'spArial', mimeType = 'application/x-font')] + [Embed(systemFont = 'Arial', embedAsCFF='false', advancedAntiAliasing='true', fontName = 'spArial', mimeType = 'application/x-font')]
public static var ArialFont__:Class;
Modified: branches/clarity/cumin/open-flash-chart/elements/labels/Keys.as =================================================================== --- branches/clarity/cumin/open-flash-chart/elements/labels/Keys.as 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/open-flash-chart/elements/labels/Keys.as 2011-07-05 15:35:39 UTC (rev 4863) @@ -7,6 +7,7 @@ import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; + import flash.display.Shape;
import flash.filters.DropShadowFilter; @@ -199,6 +200,12 @@ this.graphics.clear(); + // adding a white background rectangle to "clip" the tops off of any stray data points + this.graphics.beginFill(0xffffff); + this.graphics.drawRect(this.x-2, this.y-10, this.stage.width - 100,25); + this.graphics.endFill(); + + for( var i:Number=0; i<this.numChildren; i++ ) { var width:Number = this.getChildAt(i).width;
Modified: branches/clarity/cumin/open-flash-chart/main.as =================================================================== --- branches/clarity/cumin/open-flash-chart/main.as 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/open-flash-chart/main.as 2011-07-05 15:35:39 UTC (rev 4863) @@ -850,9 +850,7 @@ this.radar_axis = new RadarAxis( json.radar_axis ); this.keys = new Keys( this.obs, json.legend ); - this.addChild( this.radar_axis ); - this.addChild( this.keys ); - + this.addChild( this.radar_axis ); } else if ( !JsonInspector.has_pie_chart( json ) ) { @@ -868,13 +866,13 @@ this.tooltip.set_tip_style( Tooltip.NORMAL );
this.keys = new Keys( this.obs, json.legend ); - this.addChild( this.keys ); }
// these are added in the Flash Z Axis order this.addChild( this.title ); for each( var set:Sprite in this.obs.sets ) this.addChild( set ); + this.addChild( this.keys ); // done here since we are using the background rectangle to "clip" stray data this.addChild( this.tooltip );
if (json['menu'] != null) { @@ -932,7 +930,6 @@ this.addChild( this.y_axis ); this.addChild( this.y_axis_right ); this.addChild( this.x_axis ); - this.addChild( this.keys ); // now these children have access to the stage, // tell them to init
Modified: branches/clarity/cumin/open-flash-chart/tr.as =================================================================== --- branches/clarity/cumin/open-flash-chart/tr.as 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/open-flash-chart/tr.as 2011-07-05 15:35:39 UTC (rev 4863) @@ -1,20 +1,28 @@ package { - import org.flashdevelop.utils.FlashConnect; + //import org.flashdevelop.utils.FlashConnect; import com.serialization.json.JSON; + import flash.external.ExternalInterface; public class tr { public static function ace( o:Object ):void { - if ( o == null ) - FlashConnect.trace( 'null' ); - else - FlashConnect.trace( o.toString() ); if ( false ) tr.trace_full(); } // + // Log to the browser console, if available + // + public static function log(message:String):void { + if (ExternalInterface.available) { + message = "function(){if (window.console) console.log('" + message; + message += "');}"; + ExternalInterface.call(message); + } + } + + // // e.g: tr.aces( 'my val', val ); // public static function aces( ... optionalArgs ):void { @@ -29,7 +37,7 @@ tmp.push( o.toString() ); } - FlashConnect.trace( tmp.join(', ') ); + // FlashConnect.trace( tmp.join(', ') ); } // this doesn't work cos I don't know how to set 'permit debugging' yet @@ -68,13 +76,13 @@
if (str == null) // means we aren't on the Debug player { - FlashConnect.trace( "(!debug) " ); + //FlashConnect.trace( "(!debug) " ); } else { var stacks:Array = str.split("\n"); // split into each line var caller:String = tr.gimme_caller(stacks[snum]); // get the caller for just one specific line in the stack trace - FlashConnect.trace( caller ); + //FlashConnect.trace( caller ); } }
Modified: branches/clarity/cumin/python/cumin/account/widgets.strings =================================================================== --- branches/clarity/cumin/python/cumin/account/widgets.strings 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/account/widgets.strings 2011-07-05 15:35:39 UTC (rev 4863) @@ -67,6 +67,7 @@
<div>{hidden_inputs}</div> </form> +<div style="display:none;visibility:hidden" id="loginpage_token"/>
<script type="text/javascript"> $("{id}").elements[0].focus();
Modified: branches/clarity/cumin/python/cumin/grid/job.py =================================================================== --- branches/clarity/cumin/python/cumin/grid/job.py 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/grid/job.py 2011-07-05 15:35:39 UTC (rev 4863) @@ -707,6 +707,8 @@ self.add_parameter(self.ads)
self.item_renderer = EditablePropertyRenderer(self, "property_html") + + self.update_enabled = False
def do_get_items(self, session): ads = self.ads.get(session)
Modified: branches/clarity/cumin/python/cumin/main.py =================================================================== --- branches/clarity/cumin/python/cumin/main.py 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/main.py 2011-07-05 15:35:39 UTC (rev 4863) @@ -589,6 +589,12 @@ self.page.main.grid.submission.id.set(session, submission_id) self.page.main.grid.submission.view.show(session) return branch.marshal() + + def render_cell_content(self, session, record): + retval = len(record) > 0 and record[self.field.index] or "" + if(len(record[self.field.index]) > 50): + retval = record[self.field.index][:50] + "..." #indicate that we truncated the name + return retval
class DurationColumn(TopTableColumn): def render_header_content(self, session):
Modified: branches/clarity/cumin/python/cumin/main.strings =================================================================== --- branches/clarity/cumin/python/cumin/main.strings 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/main.strings 2011-07-05 15:35:39 UTC (rev 4863) @@ -4,14 +4,14 @@ <tbody> <tr> <td> -<div class="fullpageable"> +<div class="fullpageable oldfpiconlocation"> <h2><img src="{resource_prefix}/queue-20.png" alt="" /> Deepest Message Queues</h2>
<div class="iblock">{queues}</div> </div> </td> <td> -<div class="fullpageable"> +<div class="fullpageable oldfpiconlocation"> <h2><img src="{resource_prefix}/job-20.png" alt="" /> Longest Running Grid Submissions</h2> <div class="iblock">{submissions}</div> </div> @@ -19,7 +19,7 @@ </tr> <tr> <td> -<div class="fullpageable"> +<div class="fullpageable oldfpiconlocation"> <h2><img src="{resource_prefix}/system-20.png" alt=""/> Busiest Systems</h2>
<div class="iblock">{systems}</div>
Modified: branches/clarity/cumin/python/cumin/stat.py =================================================================== --- branches/clarity/cumin/python/cumin/stat.py 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/stat.py 2011-07-05 15:35:39 UTC (rev 4863) @@ -903,7 +903,7 @@ self.fix_method(method, mode), mode, delta, stats, end_seconds_ago=end_seconds_ago) - max_value, min_value = self.get_max_min(session, stats, samples) + max_value, min_value = self.get_max_min(session, stats, samples, time_span, end_seconds_ago)
append = False # if we should append the new samples, see if the y-axis has changed @@ -920,7 +920,7 @@ self.fix_method(method, mode), mode, False, stats, end_seconds_ago=end_seconds_ago) - max_value, min_value = self.get_max_min(session, stats, samples) + max_value, min_value = self.get_max_min(session, stats, samples, time_span, end_seconds_ago) else: append = True
@@ -1026,18 +1026,27 @@
return samples
- def get_max_min(self, session, stats, samples): + def get_max_min(self, session, stats, samples, time_span=99999, end_seconds_ago=0): # take stddev into account for max and min y values max_value = 0 min_value = 0
for stat in stats: for x in samples[stat]: - devmax = nvl(x[1], 0) + float(nvl(x[2], 0)) - devmin = nvl(x[1], 0) - float(nvl(x[2], 0)) - max_value = max(max_value, devmax) - min_value = min(min_value, devmin) + try: + # Only compute the y-axis based on visible data + # be sure to factor-in end_seconds_ago and time_span + time_change = timedelta(seconds=end_seconds_ago) + window_adjusted_time = datetime.now() - time_change + if( (window_adjusted_time - x[0]).seconds <= int(time_span)): + devmax = nvl(x[1], 0) + float(nvl(x[2], 0)) + devmin = nvl(x[1], 0) - float(nvl(x[2], 0)) + max_value = max(max_value, devmax) + min_value = min(min_value, devmin) + except Exception, err: + log.debug(err)
+ max_value = round(max_value * 1.1 + 1) if min_value < 0: min_value = round(min_value * 1.1 - 1)
Modified: branches/clarity/cumin/python/cumin/task.py =================================================================== --- branches/clarity/cumin/python/cumin/task.py 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/task.py 2011-07-05 15:35:39 UTC (rev 4863) @@ -197,8 +197,11 @@ self.add_child(self.item_widget)
def get_items(self, session): - login = session.client_session.attributes["login_session"] - return [x for x in login.task_invocations if not x.dismissed] + items = [] + if("login_session" in session.client_session.attributes.keys() ): + login = session.client_session.attributes["login_session"] + items = [x for x in login.task_invocations if not x.dismissed] + return items
def do_process(self, session): super(TaskInvocationSet, self).do_process(session)
Modified: branches/clarity/cumin/python/cumin/widgets.strings =================================================================== --- branches/clarity/cumin/python/cumin/widgets.strings 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/python/cumin/widgets.strings 2011-07-05 15:35:39 UTC (rev 4863) @@ -150,7 +150,7 @@ cumin.expireIntervalUpdate(); cumin.set_updated(true); } - }, 30*60*1000); + }, 30*60*1000); // The page updates will last for 30 minutes before the "resume updates" button appears }; }; cumin.expireIntervalUpdate(); @@ -489,8 +489,8 @@ </tr>
[EditablePropertyRenderer.bool_html] -<input class="edit_bool" id="{pname}.true" type="radio" name="{pname}" value="TRUE" {true_selected} /> <label for="{pname}.true">True</label> -<input class="edit_bool" id="{pname}.false" type="radio" name="{pname}" value="FALSE" {false_selected} /> <label for="{pname}.false">False</label> +<input class="edit_bool" id="{pname}.true" type="radio" name="{pname}" value="true" {true_selected} /> <label for="{pname}.true">True</label> +<input class="edit_bool" id="{pname}.false" type="radio" name="{pname}" value="false" {false_selected} /> <label for="{pname}.false">False</label> <input type="hidden" name="{ptype_name}" value="{ptype_value}"/> {orig_value}
Modified: branches/clarity/cumin/resources/app.css =================================================================== --- branches/clarity/cumin/resources/app.css 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/resources/app.css 2011-07-05 15:35:39 UTC (rev 4863) @@ -496,8 +496,8 @@ top: 0px; z-index: 201; } - -p.fullpageIcon { +p.fullpageIcon, +p.fullpageIconOldLocation { background-color: white; border-top: 2px solid #685B8A; border-left: 1px solid #685B8A; @@ -515,14 +515,22 @@ right: 60px; display: none; } +p.fullpageIconOldLocation { + top: -2px; + right: 14px; +} div.fullpageable:hover div.fullpageTitle, div.fullpageable:hover p.fullpageIcon, div.fullpaged div.fullpageTitle, -div.fullpaged p.fullpageIcon { +div.fullpaged p.fullpageIcon, +div.fullpaged p.fullpageIconOldLocation, +div.fullpageable:hover p.fullpageIconOldLocation + { display: block; }
-div.fullpaged p.fullpageIcon { +div.fullpaged p.fullpageIcon, +div.fullpaged p.fullpageIconOldLocation { border-top: 1px solid #cbb4ff; border-left: 1px solid #cbb4ff; border-bottom: 2px solid #685B8A;
Modified: branches/clarity/cumin/resources/app.js =================================================================== --- branches/clarity/cumin/resources/app.js 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/cumin/resources/app.js 2011-07-05 15:35:39 UTC (rev 4863) @@ -236,7 +236,12 @@ if (element.getParent().getElement(".fullpageIcon")) return; // already fullpaged
- var icon = new Element('p', {'class': 'fullpageIcon', + var fpIconClass = 'fullpageIcon'; + if (element.get('class').indexOf("oldfpiconlocation") != -1) { + fpIconClass = 'fullpageIconOldLocation'; + } + + var icon = new Element('p', {'class': fpIconClass, 'title': 'Full Page', 'events': {'click': function () {fullpage(this)}}});
Modified: branches/clarity/cumin/resources/open-flash-chart.swf =================================================================== (Binary files differ)
Modified: branches/clarity/wooly/python/wooly/pages.py =================================================================== --- branches/clarity/wooly/python/wooly/pages.py 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/wooly/python/wooly/pages.py 2011-07-05 15:35:39 UTC (rev 4863) @@ -211,7 +211,14 @@ return "no-cache"
def do_process(self, session): - self.html_page.process(self.session.get(session)) + # get the session for the main page + sess = self.session.get(session) + self.html_page.process(sess) + # if the main page set it's redirect attribute in it's session + redirect = self.html_page.redirect.get(sess) + # pass that redirect on to the the update page + if redirect: + self.redirect.set(session, redirect)
def render_widgets(self, session): writer = Writer()
Modified: branches/clarity/wooly/resources/wooly.js =================================================================== --- branches/clarity/wooly/resources/wooly.js 2011-07-05 14:31:11 UTC (rev 4862) +++ branches/clarity/wooly/resources/wooly.js 2011-07-05 15:35:39 UTC (rev 4863) @@ -329,13 +329,14 @@
this.updatePage = function(xml) { var success = true; + var had_updates = false; if(xml == null) { success = false; } else { var child = xml.documentElement.firstChild; - while (child) { if (child.nodeType == 1 && child.nodeName == "widget") { + had_updates = true; var id = child.getAttribute("id"); var oldElem = document.getElementById(id); @@ -369,6 +370,30 @@ child = child.nextSibling; } + + if(!had_updates) { + // if there were no updates in the returned XML, + // maybe it was because our session timed-out and + // we need to be sent to the login page + child = xml.documentElement.firstChild; + while(child) { + if(child.nodeType == 1) { + if(child.nodeName == "body") { + body = child.firstChild; + while(body) { + if(body.nodeType == 1) { + if(body.getAttribute("id") == "loginpage_token") { + document.location.href = '/login.html'; + } + } + body = body.nextSibling; + } + } + } + child = child.nextSibling; + } + } + } var len = wooly.pageUpdateListeners.length;