Author: eallen
Date: 2008-11-26 10:51:20 -0500 (Wed, 26 Nov 2008)
New Revision: 2886
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added "See Other Pools" link to Pool view
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-11-26 14:04:03 UTC (rev 2885)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-11-26 15:51:20 UTC (rev 2886)
@@ -1,17 +1,19 @@
-import logging
+from datetime import datetime, timedelta
+from formats import *
+from job import *
from mint.schema import *
+from parameters import *
+from pool import PoolSlotSet, PoolMachineSet
+from struct import unpack, calcsize
+from system import SystemSlotSet
+from time import *
+from types import *
+from util import *
from wooly import *
from wooly.parameters import *
from wooly.widgets import *
-from time import *
-from datetime import datetime, timedelta
-from types import *
-from struct import unpack, calcsize
+import logging
-from util import *
-from formats import *
-from parameters import *
-from job import *
log = logging.getLogger("cumin.model")
@@ -612,7 +614,6 @@
def get_colors(self):
return self.load_colors
-from system import SystemSlotSet
class CuminSystem(RemoteClass):
def __init__(self, model):
super(CuminSystem, self).__init__(model, "system", System,
SystemStats)
@@ -1868,8 +1869,6 @@
return Pool(coll)
get = classmethod(get)
-from job import JobSet
-from pool import PoolSlotSet, PoolMachineSet
class CuminPool(CuminClass):
def __init__(self, model):
@@ -1878,6 +1877,11 @@
prop = CuminProperty(self, "id")
prop.title = "Collector ID"
prop.summary = True
+
+ prop = self.OtherPools(self, "others")
+ prop.title = "See Other Pools"
+ prop.escape = False
+ prop.summary = True
stat = self.PercentStat(self, "Running")
stat.title = "Running Jobs"
@@ -1917,6 +1921,21 @@
return title
+ class OtherPools(CuminProperty):
+ def get_title(self, session):
+ return ""
+
+ def value(self, session, object):
+ branch = session.branch()
+ self.model.frame.view.show(branch)
+ href = branch.marshal()
+
+ html = """
+ <ul class="ActionSet">
+ <li><a href="%s">%s</a></li>
+ </ul>"""
+ return html % (href, self.title)
+
class PercentStat(CuminStat):
def value_text(self, pool):
state = self.name
Show replies by date