fill-in action* pages
Stephen Soltesz [Wed, 24 Jun 2009 22:17:23 +0000 (22:17 +0000)]
title pages correctly
remove nodeview and siteview since these are replaced by pcuview
add information to home page

13 files changed:
web/MonitorWeb/monitorweb/templates/actionlist.kid
web/MonitorWeb/monitorweb/templates/actionsummary.kid
web/MonitorWeb/monitorweb/templates/nodehistory.kid
web/MonitorWeb/monitorweb/templates/nodelist.kid
web/MonitorWeb/monitorweb/templates/nodeview.kid [deleted file]
web/MonitorWeb/monitorweb/templates/pcuhistory.kid
web/MonitorWeb/monitorweb/templates/pculist.kid
web/MonitorWeb/monitorweb/templates/pcuview.kid
web/MonitorWeb/monitorweb/templates/sitehistory.kid
web/MonitorWeb/monitorweb/templates/sitelist.kid
web/MonitorWeb/monitorweb/templates/sitemenu.kid
web/MonitorWeb/monitorweb/templates/siteview.kid [deleted file]
web/MonitorWeb/monitorweb/templates/welcome.kid

index ac49259..16414e5 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Node View"
+layout_params['page_title'] = "MyOps Action List"
 from monitor.util import diff_time
 from monitor import config
 from time import mktime
@@ -18,48 +18,54 @@ def zabbix_event_ack_link(eventid):
        <table width="100%">
                <thead>
                        <tr>
-                               <th></th>
-                               <th><a href="${tg.url('action', filter='active')}">Not Acknowledged(${fc['active']})</a></th>
-                               <th><a href="${tg.url('action', filter='acknowledged')}">Acknowledged(${fc['acknowledged']})</a></th>
-                               <th><a href="${tg.url('action', filter='all')}">All(${fc['all']})</a></th>
+                               <th><a href="${link('actionlist', action_type='online_notice', since=1)}">Last Day</a></th>
+                               <th><a href="${link('actionlist', action_type='online_notice', since=7)}">Last Week</a></th>
+                               <th><a href="${link('actionlist', action_type='online_notice', since=30)}">Last Month</a></th>
                        </tr>
                </thead>
                <tbody>
                <tr>
                <td colspan="5">
-               <table id="sortable_table" class="datagrid" border="1" width="100%">
+       <h4>Actions Over the Last ${since} Days</h4>
+               <p py:if="actions and len(actions) == 0">
+                       There are no recent actions taken for this site.
+               </p>
+               <table py:if="actions and len(actions) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
                        <thead>
                                <tr>
                                        <th mochi:format="int"></th>
-                                       <th mochi:format="str">Site</th>
-                                       <th>Hostname</th>
-                                       <th>Issue (severity)</th>
-                                       <th>Last change</th>
-                                       <th>Notes (acknowledged)</th>
-                                       <th></th>
+                                       <th>Date</th>
+                                       <th>Action taken on</th>
+                                       <th>Action Type</th>
+                                       <th>Message ID</th>
+                                       <th>Errors</th>
                                </tr>
                        </thead>
                        <tbody>
-                               <tr py:for="i,node in enumerate(query)">
+                               <tr py:for="i,act in enumerate(actions)" class="${i%2 and 'odd' or 'even'}" >
                                        <td></td>
-                                       <td><a href="${link('pcuview', loginbase=node[0])}">${node[0]}</a></td>
-                                       <td nowrap="true" py:content="node[1]"></td>
-                                       <td nowrap='true' id="severity-${node[3]}" py:content="node[2]"></td>
-                                       <td nowrap='true' py:content="diff_time(int(node[4]))"></td>
-                                       <?python
-                                               try:
-                                                       int(node[5])
-                                                       val = True
-                                               except:
-                                                       val = False
-                                       ?>
-                                       <!-- NOTE: only one of the next two columns will be displayed. -->
-                                       <td py:if="val"><a href="${zabbix_event_ack_link(node[5])}">Provide Ack</a></td>
-                                       <td py:if="not val" py:content="node[5]">Message from user</td>
-                                       <td py:if="not val"><a href="${zabbix_event_ack_link(node[6])}">Add</a></td>
+                                       <td py:content="act.date_created"></td>
+                                       <td py:if="act.hostname is not None" nowrap="true" >
+                                               <a class="ext-link" href="${plc_node_uri(act.hostname)}">
+                                                       <span class="icon">${act.hostname}</span></a>
+                                       </td>
+                                       <td py:if="act.hostname is None" nowrap="true">
+                                               <a class="ext-link" href="${plc_site_uri(act.loginbase)}">
+                                                       <span class="icon">${act.loginbase}</span></a>
+                                       </td>
+                                       <!--td py : content="diff_time(mktime(node.date_checked.timetuple()))"></td-->
+                                       <td py:content="act.action_type"></td>
+                                       <td><a class="ext-link" href="${plc_mail_uri(act.message_id)}">
+                                                       <span py:if="act.message_id != 0" class="icon">${act.message_id}</span></a></td>
+                                       <td py:if="'bootmanager' in act.action_type or 'unknown' in act.action_type">
+                                               <a href="/monitorlog/bm.${act.hostname}.log">latest bm log</a>
+                                       </td>
+                                       <td py:if="'bootmanager' not in act.action_type">
+                                               <pre py:content="act.error_string"></pre></td>
                                </tr>
                        </tbody>
                </table>
+
                </td>
                </tr>
                </tbody>
index b6f4955..d54e918 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Node View"
+layout_params['page_title'] = "MyOps Action Summary"
 from monitor.util import diff_time
 from monitor import config
 from time import mktime
@@ -18,9 +18,9 @@ def zabbix_event_ack_link(eventid):
        <table width="100%">
                <thead>
                        <tr>
-                               <th>Last Day</th>
-                               <th>Last Week</th>
-                               <th>Last Month</th>
+                               <th><a href="actionsummary?since=1">Last Day</a></th>
+                               <th><a href="actionsummary?since=7">Last Week</a></th>
+                               <th><a href="actionsummary?since=30">Last Month</a></th>
                        </tr>
                </thead>
                <tbody>
@@ -37,7 +37,7 @@ def zabbix_event_ack_link(eventid):
                        <tbody>
                                <tr py:for="key in results.keys()">
                                        <td></td>
-                                       <td nowrap="true" py:content="key"></td>
+                                       <td nowrap="true"><a href="actionlist?action_type=${key}" py:content="key"></a></td>
                                        <td nowrap='true' py:content="results[key]"></td>
                                </tr>
                        </tbody>
index f03b692..de60dd9 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Node List"
+layout_params['page_title'] = "MyOps Node History"
 from monitor.util import diff_time
 from time import mktime
 from links import *
index 29a09fe..b6ee42a 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Node List"
+layout_params['page_title'] = "MyOps Node List"
 from monitor.util import diff_time
 from time import mktime
 from links import *
diff --git a/web/MonitorWeb/monitorweb/templates/nodeview.kid b/web/MonitorWeb/monitorweb/templates/nodeview.kid
deleted file mode 100644 (file)
index 1b36b5c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<?python
-layout_params['page_title'] = "Monitor Node View"
-from monitor.util import diff_time
-from time import mktime
-from pcucontrol.reboot import pcu_name, model_to_object
-from links import *
-?>
-<html  py:layout="'sitemenu.kid'"
-       xmlns:py="http://purl.org/kid/ns#"
-       xmlns:mochi="http://www.mochi.org">
-
-  <div py:match="item.tag == 'content'">
-    <h3>Node Status</h3>
-               <table id="sortable_table" class="datagrid" border="1" width="100%">
-                       <thead>
-                               <tr>
-                                       <th mochi:format="int"></th>
-                                       <th mochi:format="str">Site</th>
-                                       <th>Hostname</th>
-                                       <th>ping</th>
-                                       <!--th>ssh</th-->
-                                       <th>kernel</th>
-                                       <th>last_change</th>
-                                       <th>last_contact</th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                               <tr py:for="i,node in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
-                                       <td></td>
-                                       <td><a class="ext-link" href="${plc_site_uri_id(node.plc_node_stats['site_id'])}">
-                                                       <span class="icon">${node.loginbase}</span></a>
-                                       </td>
-                                       <td id="node-${node.observed_status}" nowrap="true" >
-                                               <a class="ext-link" href="${plc_node_uri_id(node.plc_nodeid)}">
-                                                       <span class="icon">${node.hostname}</span></a>
-                                       </td>
-                                       <td py:content="node.ping_status"></td>
-                                       <td nowrap="true" py:content="node.kernel"></td>
-                                       <td py:content="diff_time(mktime(node.history.last_changed.timetuple()))"></td>
-                                       <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
-                               </tr>
-                       </tbody>
-               </table>
-    <h3 py:if="node.pcu is not None">Controlling PCU</h3>
-               <table py:if="node.pcu is not None" id="sortable_table" class="datagrid" border="1" width="100%">
-                       <thead>
-                               <tr>
-                                       <th mochi:format="int"></th>
-                                       <th>PCU Name</th>
-                                       <th>Model</th>
-                                       <th width="80%">Test Results</th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                               <?python pcu = node.pcu ?>
-                               <tr>
-                                       <td></td>
-                                       <td nowrap="true" >
-                                               <a class="ext-link" href="${plc_pcu_uri_id(pcu.plc_pcu_stats['pcu_id'])}">
-                                                       <span class="icon">${pcu_name(pcu.plc_pcu_stats)}</span>
-                                               </a>
-                                       </td>
-                                       <td py:content="pcu.plc_pcu_stats['model']"></td>
-                                       <td width="20%" nowrap='true' align='center' id="status-${node.pcu_short_status}">
-                                               <div id="links">
-                                                       <a class="info" py:if="'error' in node.pcu_short_status" 
-                                                               href="${link('pcuview', pcuid=node.plc_pcuid)}">
-                                                               Error<span><pre>${node.pcu.reboot_trial_status}</pre></span></a>
-                                                       <a py:if="'error' not in node.pcu_short_status and 'none' not in node.pcu_short_status" 
-                                                               href="${link('pcuview', pcuid=node.plc_pcuid)}"
-                                                               py:content="node.pcu_short_status">Reboot Status</a>
-                                                       <span py:if="'none' in node.pcu_short_status" 
-                                                               py:content="node.pcu_short_status">Reboot Status</span>
-                                               </div>
-                                       </td>
-                               </tr>
-                       </tbody>
-               </table>
-    <h3>Actions Taken</h3>
-  </div>
-
-</html>
index 5f97176..79fd07b 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Node List"
+layout_params['page_title'] = "MyOps PCU History"
 from monitor.util import diff_time
 from time import mktime
 from links import *
index 2d06887..e9f8cdc 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor PCU List"
+layout_params['page_title'] = "MyOps PCU List"
 from pcucontrol.reboot import pcu_name, model_to_object
 from monitor import config
 from links import *
index ed0f9e8..685f18c 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor PCU View"
+layout_params['page_title'] = "MyOps Detail View"
 from monitor.util import diff_time
 from monitor import config
 from time import mktime
@@ -200,7 +200,7 @@ from links import *
                <div id="status_block" class="flash"
             py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
 
-       <h4>Actions Over the Last Week</h4>
+       <h4>Actions Over the Last ${since} Days</h4>
                <p py:if="actions and len(actions) == 0">
                        There are no recent actions taken for this site.
                </p>
index 68e3c45..8dfb823 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Site History List"
+layout_params['page_title'] = "MyOps Site History"
 from monitor.util import diff_time
 from time import mktime
 from links import *
index ec56bf1..ae136a6 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Site List"
+layout_params['page_title'] = "MyOps Site List"
 from monitor.util import diff_time
 from time import mktime
 from links import *
index 43d3c21..9479293 100644 (file)
@@ -36,7 +36,7 @@
                                <th><a href="${link('site')}">Sites</a></th>
                                <th><a href="${link('pcu')}">PCUs</a></th>
                                <th><a href="${link('node')}">Nodes</a></th>
-                               <th><a href="">Actions</a></th>
+                               <th><a href="${link('actionsummary')}">Actions</a></th>
                        </tr>
                        </thead>
                        <tbody>
diff --git a/web/MonitorWeb/monitorweb/templates/siteview.kid b/web/MonitorWeb/monitorweb/templates/siteview.kid
deleted file mode 100644 (file)
index bf24fe5..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<?python
-layout_params['page_title'] = "Monitor Site View"
-from monitor.util import diff_time
-from time import mktime
-from links import *
-?>
-<html py:layout="'sitemenu.kid'"
-      xmlns:py="http://purl.org/kid/ns#"
-         xmlns:mochi="http://www.mochi.org">
-
-  <div py:match="item.tag == 'content'">
-    <h3>Site Status</h3>
-               <table id="sub-table" border="1" width="100%">
-                       <thead>
-                               <tr>
-                                       <th>Site name</th>
-                                       <th>Enabled</th>
-                                       <th>Penalty</th>
-                                       <th>Slices/Max</th>
-                                       <th>Nodes/Total</th>
-                                       <th>Status</th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                               <tr py:for="i,site in enumerate(sitequery)">
-                                       <td nowrap="true"><a class="ext-link" href="${plc_site_uri_id(site.plc_siteid)}">
-                                                       <span class="icon">${site.loginbase}</span></a>
-                                       </td>
-                                       <td py:content="site.enabled"></td>
-                                       <td>n/a</td>
-                                       <td>${site.slices_used}/${site.slices_total}</td>
-                                       <td>${site.nodes_up} / ${site.nodes_total}</td>
-                                       <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
-                               </tr>
-                       </tbody>
-               </table>
-    <h3>Node List</h3>
-               <p py:if="len(nodequery) == 0">
-                       There are no registered nodes for this PCU.
-               </p>
-               <table py:if="len(nodequery) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
-                       <thead>
-                               <tr>
-                                       <th mochi:format="int"></th>
-                                       <th>Hostname</th>
-                                       <th>ping</th>
-                                       <!--th>ssh</th-->
-                                       <th>pcu</th>
-                                       <th>kernel</th>
-                                       <th>last_contact</th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                               <tr py:for="i,node in enumerate(nodequery)">
-                                       <td></td>
-                                       <td id="node-${node.observed_status}" nowrap="true">
-                                               <a href="${link('pcuview', hostname=node.hostname)}" py:content="node.hostname">your.host.org</a></td>
-                                       <td py:content="node.ping_status"></td>
-                                       <td py:if="node.pcu_short_status != 'none'" id="status-${node.pcu_short_status}">
-                                               <a href="${link('pcuview', pcuid=node.plc_node_stats['pcu_ids'])}">${node.pcu_short_status}</a></td>
-                                       <td py:if="node.pcu_short_status == 'none'" id="status-${node.pcu_short_status}">
-                                               ${node.pcu_short_status}</td>
-                                       <td nowrap="true" py:content="node.kernel"></td>
-                                       <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
-                               </tr>
-                       </tbody>
-               </table>
-  </div>
-
-</html>
index d1f4b93..43fdc21 100644 (file)
@@ -11,9 +11,9 @@
     <h2>Learn more</h2>\r
     Learn more about MyOps default policies, and take part in its development\r
     <ul class="links">\r
-      <li><a href="https://svn.planet-lab.org/wiki/MonitorDocs">Documentation</a></li>\r
-      <li><a href="https://svn.planet-lab.org/wiki/MonitorPolicyForPlanetLab">Policy</a></li>\r
-      <li><a href="https://svn.planet-lab.org/svn/Monitor">Latest Source</a></li>\r
+      <li><a href="https://svn.planet-lab.org/wiki/MyOpsDocs">Documentation</a></li>\r
+      <li><a href="https://svn.planet-lab.org/wiki/MyOpsPolicyForPlanetLab">Policy</a></li>\r
+      <li><a href="https://svn.planet-lab.org/svn/MyOps">Latest Source</a></li>\r
     </ul>\r
     <span py:replace="now">now</span>\r
   </div>\r