Author: justi9
Date: 2008-09-02 14:19:14 -0400 (Tue, 02 Sep 2008)
New Revision: 2380
Modified:
mgmt/trunk/cumin/python/cumin/scheduler.py
mgmt/trunk/cumin/python/cumin/scheduler.strings
Log:
Add scripting for live updates
Modified: mgmt/trunk/cumin/python/cumin/scheduler.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/scheduler.py 2008-09-02 18:09:39 UTC (rev 2379)
+++ mgmt/trunk/cumin/python/cumin/scheduler.py 2008-09-02 18:19:14 UTC (rev 2380)
@@ -64,6 +64,10 @@
details = CuminDetails(app, "details")
self.__tabs.add_tab(details)
+ def render_script(self, session, sched):
+ data = "model.xml?class=scheduler;id=%i" % sched.id
+ return "wooly.setIntervalUpdate('%s', updateScheduler, 3000)" %
data
+
class SchedulerStatus(CuminStatus):
pass
Modified: mgmt/trunk/cumin/python/cumin/scheduler.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/scheduler.strings 2008-09-02 18:09:39 UTC (rev 2379)
+++ mgmt/trunk/cumin/python/cumin/scheduler.strings 2008-09-02 18:19:14 UTC (rev 2380)
@@ -7,6 +7,23 @@
[SchedulerSet.count_sql]
select count(*) from scheduler
+[SchedulerView.javascript]
+function updateScheduler(data) {
+ var model = data.objectify();
+ var scheds = model.scheduler;
+ var sched;
+
+ for (var key in scheds) {
+ sched = scheds[key];
+ break;
+ }
+
+ cumin.runModelListeners(model);
+ cumin.runObjectListeners(sched);
+
+ //throw new Error();
+}
+
[SchedulerStats.html]
<table class="twocol">
<tbody>
Show replies by date