add a link to both types of node history, status and data
[monitor.git] / web / MonitorWeb / monitorweb / templates / pcuview.kid
index 56660a1..9390bb4 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
@@ -28,7 +28,7 @@ from links import *
                        <tbody>
                                <tr py:for="i,site in enumerate(sitequery)" class="${i%2 and 'odd' or 'even'}" >
                                        <td><a href="sitehistory?loginbase=${site.loginbase}">history</a></td>
-                                       <td nowrap="true"><a class="ext-link" href="${plc_site_uri(site.loginbase)}">
+                                       <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>
@@ -55,23 +55,23 @@ from links import *
                                </tr>
                        </thead>
                        <tbody>
-                               <tr py:for="i,pcu in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
+                               <tr py:for="i,agg in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
                                        <td></td>
-                                       <td><a href="pcuhistory?pcu_id=${pcu.plc_pcuid}">history</a></td>
+                                       <td><a href="pcuhistory?pcu_id=${agg.pcu.plc_pcuid}">history</a></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 class="ext-link" href="${plc_pcu_uri_id(agg.pcu.plc_pcu_stats['pcu_id'])}">
+                                                       <span class="icon">${pcu_name(agg.pcu.plc_pcu_stats)}</span>
                                                </a>
                                        </td>
-                                       <td py:content="pcu.entry_complete"></td>
-                                       <td id="dns-${pcu.dns_status}" py:content="pcu.dns_status"></td>
+                                       <td py:content="agg.pcu.entry_complete"></td>
+                                       <td nowrap='true' id="dns-${agg.pcu.dns_status}" py:content="agg.pcu.dns_status"></td>
                                        <td nowrap='true'>
-                                               <span py:for="port,state in pcu.ports" 
+                                               <span py:for="port,state in agg.ports" 
                                                id="port${state}" py:content="'%s, ' % port">80</span>
                                        </td>
-                                       <td width="40" id="status-${pcu.status}"><pre class="results" py:content="pcu.reboot_trial_status"></pre></td>
-                                       <td py:content="pcu.plc_pcu_stats['model']"></td>
-                                       <td py:content="len(pcu.plc_pcu_stats['node_ids'])"></td>
+                                       <td width="40" id="status-${agg.status}"><pre class="results" py:content="agg.pcu.reboot_trial_status"></pre></td>
+                                       <td py:content="agg.pcu.plc_pcu_stats['model']"></td>
+                                       <td py:content="len(agg.pcu.plc_pcu_stats['node_ids'])"></td>
                                </tr>
                        </tbody>
                </table>
@@ -143,9 +143,9 @@ from links import *
                        <thead>
                                <tr>
                                        <th mochi:format="int"></th>
-                                       <th>History</th>
+                                       <th>History (scan)</th>
                                        <th>Hostname</th>
-                                       <th>last_contact</th>
+                                       <th>last_contact (cached)</th>
                                        <th>last_checked</th>
                                        <th nowrap='true'>Port Status</th>
                                        <th></th>
@@ -154,31 +154,32 @@ from links import *
                                </tr>
                        </thead>
                        <tbody>
-                               <tr py:for="i,node in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
+                               <tr py:for="i,agg in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
                                        <td></td>
-                                       <td><a href="nodehistory?hostname=${node.hostname}">history</a></td>
-                                       <td id="node-${node.observed_status}" nowrap="true" >
-                                               <a class="ext-link" href="${plc_node_uri(node.hostname)}">
-                                                       <span class="icon">${node.hostname}</span></a>
+                                       <td><a href="nodehistory?hostname=${agg.node.hostname}">status</a>
+                                               (<a href="nodescanhistory?hostname=${agg.node.hostname}">scan</a>) history</td>
+                                       <td id="node-${agg.node.observed_status}" nowrap="true" >
+                                               <a class="ext-link" href="${plc_node_uri_id(agg.node.plc_node_stats['node_id'])}">
+                                                       <span class="icon">${agg.node.hostname}</span></a>
                                        </td>
-                                       <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
-                                       <td py:content="diff_time(mktime(node.date_checked.timetuple()))"></td>
+                                       <td py:content="diff_time(agg.node.plc_node_stats['last_contact'])"></td>
+                                       <td py:content="diff_time(mktime(agg.node.date_checked.timetuple()))"></td>
                                        <td>
-                                               <span py:for="port,state in node.ports" 
+                                               <span py:for="port,state in agg.ports" 
                                                id="port${state}" py:content="'%s, ' % port">80</span>
                                        </td>
                                        <td>
                                                <!-- TODO: add some values/code to authenticate the operation.  -->
-                                               <!--form action="${link('pcuview', hostname=node.hostname)}" name="externalscan${i}" method='post'>
-                                               <input type='hidden' name='hostname' value='${node.hostname}'/> 
+                                               <!--form action="${link('pcuview', hostname=agg.node.hostname)}" name="externalscan${i}" method='post'>
+                                               <input type='hidden' name='hostname' value='${agg.node.hostname}'/> 
                                                <input type='hidden' name='type' value='ExternalScan' /> 
                                                </form>
                                                <a onclick='document.externalscan${i}.submit();' href="javascript: void(1);">ExternalScan</a-->
                                        </td>
                                        <td>
                                                <!-- TODO: add some values/code to authenticate the operation.  -->
-                                               <!--form action="${link('pcuview', hostname=node.hostname)}" name="internalscan${i}" method='post'>
-                                               <input type='hidden' name='hostname' value='${node.hostname}'/> 
+                                               <!--form action="${link('pcuview', hostname=agg.node.hostname)}" name="internalscan${i}" method='post'>
+                                               <input type='hidden' name='hostname' value='${agg.node.hostname}'/> 
                                                <input type='hidden' name='type' value='InternalScan' /> 
                                                </form>
                                                <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a-->
@@ -186,7 +187,7 @@ from links import *
                                        <td py:if="len(pcuquery) > 0">
                                                <!-- TODO: add some values/code to authenticate the operation.  -->
                                                <!--form action="${link('pcuview', pcuid=pcu.plc_pcuid)}" name="reboot${i}" method='post'>
-                                               <input type='hidden' name='hostname' value='${node.hostname}'/> 
+                                               <input type='hidden' name='hostname' value='${agg.node.hostname}'/> 
                                                <input type='hidden' name='type' value='Reboot' /> 
                                                </form>
                                                <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a-->
@@ -200,7 +201,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>
@@ -231,7 +232,11 @@ from links import *
                                        <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><pre py:content="act.error_string"></pre></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>