svn merge -r 12308:13112 https://svn.planet-lab.org/svn/Monitor/branches/2.0/
[monitor.git] / www / gadgets / sitemonitor.py
index e92a9cc..3ec6231 100755 (executable)
@@ -6,7 +6,7 @@ cgitb.enable()
 print "Content-Type: text/html\r\n"
 
 import time
-from unified_model import *
+from monitor.model import *
 from monitor import database
 from HyperText.HTML import A, BR, IMG, TABLE, TR, TH, TD, EM, quote_body, CENTER
 from HyperText.Documents import Document
@@ -102,19 +102,24 @@ def main():
        
        if form.has_key('loginbase'):
                loginbase = form.getvalue('loginbase')
+               loginbase = loginbase.rstrip("_")
        else:
                loginbase = "undefined"
 
        fb = database.dbLoad("findbad")
        lb2hn = database.dbLoad("plcdb_lb2hn")
-       pf = database.dbLoad("node_persistflags")
+       # todo: pull from HistoryNodeRecord table instead
+       #pf = database.dbLoad("node_persistflags")
 
        # SETUP header
        t = TABLE(border="0", cellspacing="0", cellpadding="0")
        r = TR()
 
        if loginbase not in lb2hn:
-               value = ("Select 'Edit settings' to enter your Site's loginbase.", "")
+               value = ("""Select 'Edit settings' to enter your Site's loginbase.<br><br>
+                                       The loginbase is the unchangable portion of your slicename.  
+                                       For instance, your slice follows the pattern loginbase_slicename.<br><br>
+                                       If this hint is unclear, then you can find your loginbase by visiting 'My Site' at <a target=_blank href=http://www.planet-lab.org>'PlanetLab.org'</a>""", "")
                r = TR(TD(value[0]))
                t.append(r)
        else:
@@ -131,7 +136,8 @@ def main():
                        url = 'http://www.planet-lab.org/db/nodes/index.php?nodepattern=%s' % host
                        td = TD(A(host, target='_blank', href=url), bgcolor=color)
                        r.append(td)
-                       lc = pf[host].last_changed
+                       #lc = pf[host].last_changed
+                       lc=-1
                        td = TD(diff_time(lc))
                        r.append(td)
                        t.append(r)