remove unnecessary informatiton on pcuview page
authorStephen Soltesz <soltesz@cs.princeton.edu>
Wed, 10 Jun 2009 18:45:09 +0000 (18:45 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Wed, 10 Jun 2009 18:45:09 +0000 (18:45 +0000)
add history for pcu
change 'increase penalty' to 'reduce privilege'

monitor/wrapper/emailTxt.py
web/MonitorWeb/monitorweb/controllers.py
web/MonitorWeb/monitorweb/static/css/style.css
web/MonitorWeb/monitorweb/templates/nodehistory.kid
web/MonitorWeb/monitorweb/templates/pcuview.kid

index cd3ab2a..9a7fec3 100644 (file)
@@ -309,12 +309,12 @@ Thank you very much for your help,
   -- PlanetLab Central (support@planet-lab.org)
        """)
 
-       clear_penalty=("""MONTEST: All penalties cleared from site %(loginbase)s""",
+       clear_penalty=("""MONTEST: All privileges restored to site %(loginbase)s""",
        """
-This notice is to let you know that any penalties previously applied to your 
-site have been removed: %(penalty_level)s.
+This notice is to let you know that any privileges previously reduced at your 
+site have been restored: %(penalty_level)s.
 
-All privileges have been restored.  You may create slices again, and if your 
+All privileges are restored.  You may create slices again, and if your 
 slices were disabled, please allow up to 30 minutes for them to return to 
 enabled.
 
@@ -330,10 +330,10 @@ Legend:
   2+ - all existing slices will be disabled.
        """)
 
-       increase_penalty=("""MONTEST: Penalty increased for site %(loginbase)s""",
+       increase_penalty=("""MONTEST: Privilege reduced for site %(loginbase)s""",
        """
-This notice is to let you know that the penalty applied to your site has
-increased: %(penalty_level)s.
+This notice is to let you know that the privileges granted to your site as
+a participating member of Planetlab have reduced: %(penalty_level)s.
 
 Your privileges will be reduced corresponding to the legend below.  To 
 restore these privileges, please return at least two machines to working 
index 33f88e1..aad1f21 100644 (file)
@@ -363,6 +363,19 @@ class Root(controllers.RootController, MonitorXmlrpcServer):
                        
                return dict(sitequery=sitequery, pcuquery=pcuquery, nodequery=nodequery, actions=actions, exceptions=exceptions)
 
+       @expose(template="monitorweb.templates.pcuhistory")
+       def pcuhistory(self, pcu_id=None):
+               query = []
+               if pcu_id:
+                       fbnode = HistoryPCURecord.get_by(plc_pcuid=pcu_id)
+                       l = fbnode.versions[-100:]
+                       l.reverse()
+                       for pcu in l:
+                               #prep_node_for_display(node)
+                               query.append(pcu)
+
+               return dict(query=query, pcu_id=pcu_id)
+
        @expose(template="monitorweb.templates.nodehistory")
        def nodehistory(self, hostname=None):
                query = []
index 4367a0a..d3a365c 100644 (file)
@@ -108,6 +108,16 @@ a.right { float: right; }
 #site-offline { background-color: red; }\r
 #site-down { background-color: indianred; }\r
 \r
+#node-online { background-color : lightgreen; }\r
+#node-good { background-color : darkseagreen; }\r
+#node-offline { background-color: red; }\r
+#node-down { background-color: indianred; }\r
+\r
+#pcu-online { background-color : lightgreen; }\r
+#pcu-good { background-color : darkseagreen; }\r
+#pcu-offline { background-color: red; }\r
+#pcu-down { background-color: indianred; }\r
+\r
 /*#site-0 { background-color : white; }*/\r
 #site-1 { background-color: gold; }\r
 #site-2 { background-color: indianred; }\r
index a7ff408..f03b692 100644 (file)
@@ -51,7 +51,7 @@ from links import *
                                        <td py:content="node.last_checked"></td>
                                        <td nowrap="true">
                                                <a target="_top" href="${link('pcuview', hostname=node.hostname)}" py:content="node.hostname">your.host.org</a></td>
-                                       <td py:content="node.status"></td>
+                                       <td id="node-${node.status}" py:content="node.status"></td>
                                </tr>
                        </tbody>
                </table>
index fc471d9..56660a1 100644 (file)
@@ -44,9 +44,10 @@ from links import *
                        <thead>
                                <tr>
                                        <th mochi:format="int"></th>
+                                       <th>History</th>
                                        <th>PCU Name</th>
                                        <th>Missing Fields</th>
-                                       <th>DNS Status</th>
+                                       <th nowrap='true'>DNS Status</th>
                                        <th nowrap='true'>Port Status</th>
                                        <th width="80%">Test Results</th>
                                        <th>Model</th>
@@ -56,6 +57,7 @@ from links import *
                        <tbody>
                                <tr py:for="i,pcu 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 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>
@@ -167,27 +169,27 @@ from links import *
                                        </td>
                                        <td>
                                                <!-- TODO: add some values/code to authenticate the operation.  -->
-                                               <form action="${link('pcuview', hostname=node.hostname)}" name="externalscan${i}" method='post'>
+                                               <!--form action="${link('pcuview', hostname=node.hostname)}" name="externalscan${i}" method='post'>
                                                <input type='hidden' name='hostname' value='${node.hostname}'/> 
                                                <input type='hidden' name='type' value='ExternalScan' /> 
                                                </form>
-                                               <a onclick='document.externalscan${i}.submit();' href="javascript: void(1);">ExternalScan</a>
+                                               <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'>
+                                               <!--form action="${link('pcuview', hostname=node.hostname)}" name="internalscan${i}" method='post'>
                                                <input type='hidden' name='hostname' value='${node.hostname}'/> 
                                                <input type='hidden' name='type' value='InternalScan' /> 
                                                </form>
-                                               <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a>
+                                               <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a-->
                                        </td>
                                        <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'>
+                                               <!--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='type' value='Reboot' /> 
                                                </form>
-                                               <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a>
+                                               <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a-->
                                        </td>
                                </tr>
                        </tbody>
@@ -237,8 +239,8 @@ from links import *
        <!-- TODO: figure out how to make this conditional by model rather than port;
                                it is convenient to have links to ilo, drac, amt, etc.
                                regardless of whether the last PCU scan was successful.  -->
-       <h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
-               <div py:if="len(pcuquery) != 0" class="code"> <!-- pcu is not None" class="code"-->
+       <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
+               <div py:if="len(pcuquery) != 0" class="code"> 
                        <span   py:for="port,state in pcu.ports">
                                        <span class="code" py:if="port == 22 and state == 'open'">
                                                ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no 
@@ -257,9 +259,9 @@ from links import *
                                                <br/>
                                                <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
                                                <br/>
-                                               curl -s --form 'user=${pcu.plc_pcu_stats['username']}' 
-                                                               --form 'password=${pcu.plc_pcu_stats['password']}' 
-                                                               --insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
+                                               curl -s -form 'user=${pcu.plc_pcu_stats['username']}' 
+                                                               -form 'password=${pcu.plc_pcu_stats['password']}' 
+                                                               -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
                                                <br/>
                                                /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']} 
                                                        -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
@@ -276,7 +278,7 @@ from links import *
                                                        -user admin -pass '${pcu.plc_pcu_stats['password']}'
                                        </span>
                        </span>
-               </div>
+               </div-->
 
   </div>