rhmessaging commits: r2722 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 19:14:45 -0400 (Fri, 31 Oct 2008)
New Revision: 2722
Modified:
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Add the X-UA-Compatible meta tag and set it to IE=7 so IE8 won't break. This will be removed once we have time to IE8ify the pages.
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-10-31 21:25:52 UTC (rev 2721)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-10-31 23:14:45 UTC (rev 2722)
@@ -507,6 +507,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>{title}</title>
<link rel="stylesheet" type="text/css" href="cumin.css"/>
<link rel="shortcut icon" href="resource?name=favicon.ico" type="image/x-icon"/>
16 years, 1 month
rhmessaging commits: r2721 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 17:25:52 -0400 (Fri, 31 Oct 2008)
New Revision: 2721
Modified:
mgmt/trunk/cumin/python/wooly/tables.py
Log:
Refactor the code to convert cursor tuples to lists of dictionaries for use by model during an ajax call.
Modified: mgmt/trunk/cumin/python/wooly/tables.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/tables.py 2008-10-31 21:22:45 UTC (rev 2720)
+++ mgmt/trunk/cumin/python/wooly/tables.py 2008-10-31 21:25:52 UTC (rev 2721)
@@ -192,9 +192,9 @@
def render_sql_orderby(self, session, *args):
scol = self.get_selected_column(session)
+ if scol:
+ return scol.get_orderby_sql(session)
- return scol.get_orderby_sql(session)
-
def render_sql_limit(self, session, *args):
return None
@@ -288,21 +288,23 @@
sql = " and ".join(["%s %s" % (select, where), find_where])
try:
cursor.execute(sql, find_values)
-
- cols = [spec[0] for spec in cursor.description]
- row = dict()
- rows = list()
-
- for tuple in cursor:
- for col, datum in zip(cols, tuple):
- row[col] = datum
-
- rows.append(row)
-
- return rows
+ return self.cursor_to_rows(cursor)
except:
pass
+ def cursor_to_rows(self, cursor):
+ cols = [spec[0] for spec in cursor.description]
+ rows = list()
+
+ for tuple in cursor:
+ row = dict()
+ for col, datum in zip(cols, tuple):
+ row[col] = datum
+
+ rows.append(row)
+
+ return rows
+
class SqlTableColumn(ItemTableColumn):
# XXX to be consistent with similar methods, rename to
# get_sql_order_by
16 years, 1 month
rhmessaging commits: r2720 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 17:22:45 -0400 (Fri, 31 Oct 2008)
New Revision: 2720
Modified:
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/pool.py
mgmt/trunk/cumin/python/cumin/slot.py
mgmt/trunk/cumin/python/cumin/slot.strings
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
mgmt/trunk/cumin/python/cumin/system.py
mgmt/trunk/cumin/python/cumin/system.strings
mgmt/trunk/cumin/python/cumin/util.py
Log:
During an ajax call, model will now use the appropriate SQLTable object to get it's list of records instead of constructing it's own SQL.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-10-31 21:22:45 UTC (rev 2720)
@@ -549,6 +549,7 @@
stat.title = "Load Avg"
stat.category = "general"
+from system import SystemSlotSet
class CuminSystem(RemoteClass):
def __init__(self, model):
super(CuminSystem, self).__init__(model, "system", System, SystemStats)
@@ -598,30 +599,40 @@
"Vacating": "red",
"Killing": "blue",
"Benchmarking": "yellow" }
- def do_invoke(self, system, *args):
- slots = self.get_slots(system)[0]
+
+ def __init__(self, cls, name):
+ super(CuminSystem.VisSlots, self).__init__(cls, name)
+
+ self.slot_set = self.ModelSystemSlotSet(cls.model.app, name)
+
+ def get_xml_response(self, session, system, *args):
+ slots = self.get_slots(session, system)[0]
writer = Writer()
writer.write("<slots>")
for slot in slots:
writer.write("<slot id='%i' name='%s' machine='%s' job='%s' color='%s'/>" % \
- (slot.sourceObjectId,
- slot.Name,
- slot.Machine,
- slot.JobId,
+ (slot["id"],
+ slot["name"],
+ slot["machine"],
+ slot["job_id"],
self.get_color(slot)))
writer.write("</slots>")
return writer.to_string()
- def get_slots(self, system):
- elems = list()
- elems.append("machine = '%s'" % system.nodeName)
- elems.append("rec_time > now() - interval '90 minutes'")
- elems.append("deletion_time is null")
- sql = " and ".join(elems)
- return (Slot.select(sql), )
+ def get_slots(self, session, system):
+ cursor = self.slot_set.do_get_items(session, system)
+ slot_list = self.slot_set.cursor_to_rows(cursor)
+ return (slot_list, )
+ class ModelSystemSlotSet(SystemSlotSet):
+ def render_sql_limit(self, session, *args):
+ pass
+
+ def render_sql_orderby(self, session, *args):
+ return "order by name asc"
+
def get_color(self, slot):
- activity = slot.statsCurr.Activity
+ activity = slot["activity"]
if activity in self.load_colors:
return self.load_colors[activity]
return "black"
@@ -1772,6 +1783,7 @@
self.id = self.collector.Pool
self.name = self.collector.Name
+from job import JobSet
class CuminPool(CuminClass):
def __init__(self, model):
super(CuminPool, self).__init__(model, "pool", Pool)
@@ -1816,34 +1828,42 @@
return title
class VisJobs(CuminAction):
- def do_invoke(self, pool, *args):
+ def __init__(self, cls, name):
+ super(CuminPool.VisJobs, self).__init__(cls, name)
+
+ self.job_set = self.ModelSystemJobSet(cls.model.app, name)
+
+ def get_xml_response(self, session, pool, *args):
pool = self.model.get_main_pool()
- jobs = self.get_jobs(pool)[0]
+ jobs = self.get_jobs(session, pool)[0]
writer = Writer()
writer.write("<jobs>")
for job in jobs:
status = self.get_status(job)
writer.write("<job id='%i' name='%s' submitter='%s' status='%s' color='%s'/>" % \
- (job.sourceObjectId,
- job.CustomId,
- job.submitter.Name,
+ (job["id"],
+ job["custom_id"],
+ job["submitter"],
JobStatusInfo.get_status_string(status),
self.get_color(job)))
writer.write("</jobs>")
return writer.to_string()
- def get_jobs(self, pool):
- elems = list()
- #elems.append("job.rec_time > now() - interval '90 minutes'")
- #elems.append("job.deletion_time is null and job_status != %i" % JobStatusInfo.get_status_int("Removed"))
- elems.append("s.pool = '%s'" % pool.id)
- sql = " and ".join(elems)
- jn = "inner join scheduler as s on s.id = scheduler_id"
- return (Job.select(sql, join=jn).orderBy("custom_id"), )
+ def get_jobs(self, session, pool):
+ cursor = self.job_set.do_get_items(session, pool)
+ job_list = self.job_set.cursor_to_rows(cursor)
+ return (job_list, )
+ class ModelSystemJobSet(JobSet):
+ def render_sql_limit(self, session, *args):
+ pass
+
+ def render_sql_orderby(self, session, *args):
+ return "order by custom_id asc"
+
def get_status(self, job):
- status = job.JobStatus
- if status != JobStatusInfo.get_status_int("Completed") and job.deletionTime:
+ status = job["job_status"]
+ if status != JobStatusInfo.get_status_int("Completed") and job["deletion_time"]:
status = JobStatusInfo.get_status_int("Removed")
return status
@@ -2194,7 +2214,7 @@
return self.job_ads
class Fetch(CuminAction):
- def do_invoke(self, job, *args):
+ def get_xml_response(self, session, job, *args):
file, start, end, tail = args
self.job_output = None
self.got_data = False
@@ -2337,6 +2357,9 @@
prop.title = "Machine"
prop.summary = True
+ prop = CuminProperty(self, "System")
+ prop.title = "System"
+
stat = CuminStat(self, "NumUsers")
stat.title = "Users"
@@ -2552,7 +2575,7 @@
return "Stop"
class GetLimitCount(CuminAction):
- def do_invoke(self, negotiator):
+ def get_xml_response(self, session, negotiator):
action = self.model.negotiator.GetLimits
limits = action.do_invoke(negotiator)
error = "False"
@@ -2656,7 +2679,7 @@
for action in cls.actions:
if action.name == method:
args = xargs and xargs.split("&") or list()
- data = action.do_invoke(object, *args)
+ data = action.get_xml_response(session, object, *args)
self.write_xml(writer, data)
return writer.to_string()
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-10-31 21:22:45 UTC (rev 2720)
@@ -262,14 +262,11 @@
def get_args(self, session):
pool = self.frame.get_args(session)[0]
action = self.app.model.pool.jobs
- return action.get_jobs(pool)
+ return action.get_jobs(session, pool)
def render_title(self, session, jobs):
return ""
- def get_object_count(self, session, jobs):
- return jobs.count()
-
def render_override_style(self, session, jobs):
count = self.get_object_count(session, jobs)
if count > 100:
@@ -287,11 +284,12 @@
return ""
def render_cell_id(self, session, count, job):
- return "%i" % job.sourceObjectId
+ return "%i" % job["id"]
def render_href(self, session, count, job):
branch = session.branch()
- return self.page.main.pool.job.get_href(branch, job)
+ ojob = Job.get(job["id"])
+ return self.page.main.pool.job.get_href(branch, ojob)
def get_url(self, session):
pool = self.parent.frame.get_args(session)[0]
Modified: mgmt/trunk/cumin/python/cumin/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/slot.py 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/slot.py 2008-10-31 21:22:45 UTC (rev 2720)
@@ -17,7 +17,21 @@
col = self.Name(app, "name")
self.add_column(col)
+
+ col = self.Machine(app, "machine")
+ self.add_column(col)
+ col = self.System(app, "system")
+ self.add_column(col)
+
class Name(SqlTableColumn):
def render_title(self, session, data):
return "Name"
+
+ class Machine(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Machine"
+
+ class System(SqlTableColumn):
+ def render_title(self, session, data):
+ return "System"
Modified: mgmt/trunk/cumin/python/cumin/slot.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/slot.strings 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/slot.strings 2008-10-31 21:22:45 UTC (rev 2720)
@@ -1,7 +1,11 @@
[SlotSet.sql]
select
s.id,
- s.name
+ s.name,
+ s.machine,
+ s.system,
+ s.job_id,
+ c.activity as activity
from slot as s
left outer join slot_stats as c on c.id = s.stats_curr_id
left outer join slot_stats as p on p.id = s.stats_prev_id
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2008-10-31 21:22:45 UTC (rev 2720)
@@ -167,7 +167,7 @@
self.stats_tmpl.render(writer, session, count, object)
return writer.to_string()
- def get_object_count(self, objects):
+ def get_object_count(self, session, objects):
return len(objects)
def render_override_style(self, session, objects):
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2008-10-31 21:22:45 UTC (rev 2720)
@@ -277,7 +277,7 @@
font-size: 0.8em;
position: absolute;
top: 120%;
- width: 25em;
+/* width: 25em; */
padding: 1em;
background-color: #ffffaa;
background-image: url(resource?name=shade.png);
@@ -338,12 +338,15 @@
onmouseout="document.getElementById('note_{cell_id}').style.display='none';">
<a href="{href}"><button id="button_{cell_id}" class="btn {color}" >{contents}</button></a>
<div id="note_{cell_id}" class="sticky_note position">
- <div class="sticky_names">
- {sticky_names}
- </div>
- <div class="sticky_values">
- {sticky_values}
- </div>
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td><div class="sticky_names">
+ {sticky_names}
+ </div></td>
+ <td><div class="sticky_values">
+ {sticky_values}
+ </div></td>
+ </tr></table>
<div style="clear:left;"><!-- --></div>
</div>
</div>
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-10-31 21:22:45 UTC (rev 2720)
@@ -62,14 +62,11 @@
def get_args(self, session):
system = self.frame.get_args(session)[0]
action = self.app.model.system.slots
- return action.get_slots(system)
+ return action.get_slots(session, system)
def render_title(self, session, slots):
return "Slot Utilization"
- def get_object_count(self, session, slots):
- return slots.count()
-
def get_colors(self, session):
action = self.app.model.system.slots
return action.get_colors()
@@ -90,7 +87,7 @@
return self.page.main.pool.job.get_href(branch, job)
def render_cell_id(self, session, count, slot):
- return "%i" % slot.sourceObjectId
+ return "%i" % slot["id"]
def get_url(self, session):
system = self.parent.frame.get_args(session)[0]
@@ -133,9 +130,10 @@
return "Grid Jobs %s" % fmt_count(self.get_item_count(session, system))
def render_sql_where(self, session, system):
- phase_sql = self.get_phase_sql(session)
- sql = "s.system = %(nodeName)s"
- return "where %s" % " and ".join([phase_sql, sql])
+ elems = list()
+ #elems.append("s.system = %(nodeName)s")
+ elems.append(self.get_phase_sql(session))
+ return "where %s" % " and ".join(elems)
def get_sql_values(self, session, system):
return {"nodeName": system.nodeName}
@@ -151,8 +149,7 @@
def render_sql_where(self, session, system):
elems = list()
- elems.append("machine = %(nodeName)s")
- elems.append("s.rec_time > now() - interval '90 minutes'")
+ #elems.append("machine = %(nodeName)s")
elems.append("deletion_time is null")
return "where %s" % " and ".join(elems)
Modified: mgmt/trunk/cumin/python/cumin/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.strings 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/system.strings 2008-10-31 21:22:45 UTC (rev 2720)
@@ -48,3 +48,27 @@
setTimeout("get_slot_grid()", 1000);
}
+[SystemJobSet.html]
+ <div class="rfloat">{phase}</div>
+<form id="{id}" style="clear:right;" method="post" action="?">
+
+ <div class="sactions">
+ {job_search}
+ <h2>Act on Selected Jobs:</h2>
+ {hold} {release} {remove}
+ </div>
+
+ <table class="mobjects">
+ <thead>
+ <tr>
+ <th class="setnav" colspan="{column_count}">
+ <div class="rfloat">{page}</div>
+ {count}
+ </th>
+ </tr>
+ <tr>{headers}</tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
+ <div>{hidden_inputs}</div>
+</form>
Modified: mgmt/trunk/cumin/python/cumin/util.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/util.py 2008-10-31 21:18:52 UTC (rev 2719)
+++ mgmt/trunk/cumin/python/cumin/util.py 2008-10-31 21:22:45 UTC (rev 2720)
@@ -85,3 +85,38 @@
salt = "".join(sample(password_chars, 2))
return crypt(password, salt)
+
+def parse(text, begin_delim="{", end_delim="}"):
+ strings = list()
+
+ start = 0
+ end = text.find(begin_delim)
+
+ while True:
+ if (end == -1):
+ strings.append(text[start:])
+ break
+
+ strings.append(text[start:end])
+
+ ccurly = text.find(end_delim, end + 1)
+
+ if ccurly == -1:
+ start = end
+ end = -1
+ else:
+ ocurly = text.find(begin_delim, end + 1)
+
+ if ocurly == -1:
+ start = end
+ end = ccurly + 1
+ elif ocurly < ccurly:
+ start = end
+ end = ocurly
+ else:
+ strings.append(begin_delim + text[end + 1:ccurly] + end_delim)
+
+ start = ccurly + 1
+ end = ocurly
+
+ return strings
16 years, 1 month
rhmessaging commits: r2719 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 17:18:52 -0400 (Fri, 31 Oct 2008)
New Revision: 2719
Modified:
mgmt/trunk/cumin/python/cumin/job.strings
Log:
Added deletion_time column
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-10-31 21:18:35 UTC (rev 2718)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-10-31 21:18:52 UTC (rev 2719)
@@ -14,7 +14,8 @@
b.name as submitter,
j.scheduler_id,
j.submitter_id,
- j.cmd
+ j.cmd,
+ j.deletion_time
from job as j
left outer join job_stats as c on c.id = j.stats_curr_id
left outer join job_stats as p on p.id = j.stats_prev_id
16 years, 1 month
rhmessaging commits: r2718 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 17:18:35 -0400 (Fri, 31 Oct 2008)
New Revision: 2718
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Fixed malformed xml that resulted when soft breaks ​ were inserted in an entity ref like &
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-10-31 16:57:11 UTC (rev 2717)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-10-31 21:18:35 UTC (rev 2718)
@@ -604,15 +604,17 @@
if property.renderer:
value = property.renderer(session, value)
ret = escape_entity(str(value))
- #return ret # XXX
return self.insert_breaks(ret)
def insert_breaks(self, value):
subwords = list()
- while len(value) > 40:
- subwords.append(value[:40])
- value = value[40:]
- subwords.append(value)
+ snippets = parse(value, begin_delim="&", end_delim=";")
+ for snippet in snippets:
+ while len(snippet) > 40:
+ subwords.append(snippet[:40])
+ snippet = snippet[40:]
+ subwords.append(snippet)
+
return "​".join(subwords)
def render_inline_help(self, session, item):
@@ -636,17 +638,18 @@
def do_get_items(self, session, args):
job = args[0]
group = args[1]
- all_items = super(JobAdsViewer, self).do_get_items(session, job)
group_items = list()
- for item in all_items:
- if "property" in item:
- property = item["property"]
- item_group = property.group
- else:
- item_group = "Other"
- if item_group == group:
- group_items.append(item)
-
+ if job:
+ all_items = super(JobAdsViewer, self).do_get_items(session, job)
+ for item in all_items:
+ if "property" in item:
+ property = item["property"]
+ item_group = property.group
+ else:
+ item_group = "Other"
+ if item_group == group:
+ group_items.append(item)
+
return group_items
def render_properties(self, session, *args):
16 years, 1 month
rhmessaging commits: r2717 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 12:57:11 -0400 (Fri, 31 Oct 2008)
New Revision: 2717
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
A few if:s to avoid exceptions
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-31 16:56:15 UTC (rev 2716)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-31 16:57:11 UTC (rev 2717)
@@ -493,22 +493,26 @@
def render_title(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return cls.get_object_title(session, object)
+ if cls:
+ return cls.get_object_title(session, object)
def render_icon_href(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return cls.get_icon_href(session)
+ if cls:
+ return cls.get_icon_href(session)
class SummaryProperties(CuminProperties):
def do_get_items(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return [(x.get_title(session), x.value(session, object), x.escape)
+ if cls:
+ return [(x.get_title(session), x.value(session, object), x.escape)
for x in cls.properties if x.summary]
class SummaryActions(CuminActions):
def do_get_items(self, session, object):
cls = self.app.model.get_class_by_object(object)
- return [(x.get_href(session, object), x.get_title(session), x.get_enabled(session, object))
+ if cls:
+ return [(x.get_href(session, object), x.get_title(session), x.get_enabled(session, object))
for x in cls.actions if x.summary and x.navigable]
class StateSwitch(ItemSet):
16 years, 1 month
rhmessaging commits: r2716 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 12:56:15 -0400 (Fri, 31 Oct 2008)
New Revision: 2716
Modified:
mgmt/trunk/cumin/python/cumin/system.py
Log:
Filter Grid Jobs by system by joining job.scheduler.system to system.nodeName
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-10-31 14:20:20 UTC (rev 2715)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-10-31 16:56:15 UTC (rev 2716)
@@ -80,6 +80,14 @@
def render_contents(self, session, count, slot):
return ""
+
+ def render_href(self, session, count, slot):
+ branch = session.branch()
+ try:
+ job = Job.select("custom_id = '%s'" % slot.JobId)[0]
+ except Exception, e:
+ return "#"
+ return self.page.main.pool.job.get_href(branch, job)
def render_cell_id(self, session, count, slot):
return "%i" % slot.sourceObjectId
@@ -121,15 +129,17 @@
from job import JobTab
class SystemJobSet(JobTab):
- def render_title(self, session, *args):
- sql = "1 = 1" # XXX
- return "Grid Jobs %s" % fmt_count(Job.select(sql).count())
+ def render_title(self, session, system):
+ return "Grid Jobs %s" % fmt_count(self.get_item_count(session, system))
- def render_sql_where(self, session, *args):
+ def render_sql_where(self, session, system):
phase_sql = self.get_phase_sql(session)
- sql = "1 = 1" # XXX
+ sql = "s.system = %(nodeName)s"
return "where %s" % " and ".join([phase_sql, sql])
+ def get_sql_values(self, session, system):
+ return {"nodeName": system.nodeName}
+
from slot import SlotSet
class SystemSlotSet(SlotSet):
16 years, 1 month
rhmessaging commits: r2715 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 10:20:20 -0400 (Fri, 31 Oct 2008)
New Revision: 2715
Modified:
mgmt/trunk/cumin/resources/ie.css
Log:
Added IE override of grid widget legend button style
Modified: mgmt/trunk/cumin/resources/ie.css
===================================================================
--- mgmt/trunk/cumin/resources/ie.css 2008-10-31 14:19:38 UTC (rev 2714)
+++ mgmt/trunk/cumin/resources/ie.css 2008-10-31 14:20:20 UTC (rev 2715)
@@ -20,3 +20,6 @@
background-image: url(resource?name=radio-button-checked.png);
}
+div#cell_legend button {
+ top: 0px;
+}
16 years, 1 month
rhmessaging commits: r2714 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 10:19:38 -0400 (Fri, 31 Oct 2008)
New Revision: 2714
Modified:
mgmt/trunk/cumin/python/cumin/pool.py
Log:
Adding link to view job from job grid widget
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-10-31 14:18:57 UTC (rev 2713)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-10-31 14:19:38 UTC (rev 2714)
@@ -289,6 +289,10 @@
def render_cell_id(self, session, count, job):
return "%i" % job.sourceObjectId
+ def render_href(self, session, count, job):
+ branch = session.branch()
+ return self.page.main.pool.job.get_href(branch, job)
+
def get_url(self, session):
pool = self.parent.frame.get_args(session)[0]
return "call.xml?class=pool;method=jobs"
16 years, 1 month
rhmessaging commits: r2713 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 10:18:57 -0400 (Fri, 31 Oct 2008)
New Revision: 2713
Modified:
mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Modifying grid widget legend HTML to accommodate IE
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2008-10-31 14:16:57 UTC (rev 2712)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2008-10-31 14:18:57 UTC (rev 2713)
@@ -329,14 +329,14 @@
[StatUtilizationGrid.legend_html]
<div class="legend">
- <button class="btn {legend_color}" style="background-image: none; width:1em; height:1em;"/> {legend_text}
+ <button class="btn {legend_color}" style="background-image: none; width:1em; height:1em;" ></button> {legend_text}
</div>
[StatUtilizationGrid.cell_html]
<div class="grid_cell" style="width:{cell_width}%; height:{cell_width}%;"
onmouseover="document.getElementById('note_{cell_id}').style.display='block';"
onmouseout="document.getElementById('note_{cell_id}').style.display='none';">
- <a href="#"><button id="button_{cell_id}" class="btn {color}" >{contents}</button></a>
+ <a href="{href}"><button id="button_{cell_id}" class="btn {color}" >{contents}</button></a>
<div id="note_{cell_id}" class="sticky_note position">
<div class="sticky_names">
{sticky_names}
16 years, 1 month