Author: eallen
Date: 2008-11-06 17:11:23 -0500 (Thu, 06 Nov 2008)
New Revision: 2763
Modified:
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Changed daemon status message to use fmt_duration to show age of last Update.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-11-06 21:38:32 UTC (rev 2762)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-11-06 22:11:23 UTC (rev 2763)
@@ -2377,23 +2377,13 @@
class GetStartedAction(CuminAction):
def get_xml_response(self, session, object, *args):
- confidence = self.started_confidence(object)
recTime = object.statsCurr and object.statsCurr.recTime or object.recTime
- conf = "<confidence>%d</confidence>" % confidence
- rect = "<rectime>%s</rectime>" % fmt_datetime(recTime)
+ delta = secs(recTime) - secs(datetime.now())
+ conf = "<age>%i</age>" % -delta
+ rect = "<rectime>%s</rectime>" % fmt_duration(delta)
return "%s%s" % (conf, rect)
- def started_confidence(self, object):
- value = object.statsCurr and object.statsCurr.recTime or object.recTime
- age = datetime.now() - value
- # 100% at now
- # 0% at 10 min
- confidence = float(600 - age.seconds) / 6.0
- if confidence < 0:
- confidence = 0
- return confidence
-
class CuminScheduler(RemoteClass):
def __init__(self, model):
super(CuminScheduler, self).__init__(model, "scheduler",
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-11-06 21:38:32 UTC (rev 2762)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-11-06 22:11:23 UTC (rev 2763)
@@ -1052,14 +1052,13 @@
var elem = document.getElementById(id);
if (elem) {
var recTime = obj.rectime;
- var confidence = obj.confidence;
+ var age = obj.age;
var color = "clear";
var oRecTime = document.getElementById("recTime");
if (oRecTime) {
oRecTime.innerHTML = recTime;
- fConfidence = parseFloat(confidence);
- if (fConfidence < 75) { /* hasn't changed in approx 2.5 minutes */
+ if (age > 150) { /* hasn't changed in 2.5 minutes */
color = "yellow";
} else {
color = "green";
Show replies by date