summaryrefslogtreecommitdiffstats
path: root/abs/core/supplemental-web/contents
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2014-10-27 20:28:27 (GMT)
committerBritney Fransen <brfransen@gmail.com>2014-10-27 20:28:27 (GMT)
commitf7b823f55a80b1498c30e9f3a47692a2329c4f09 (patch)
tree6de557714e6336282fbc0ab16c6578386dfc6654 /abs/core/supplemental-web/contents
parent4c2a2e3504f472628285a989c7c9a76be6855f54 (diff)
parent01c1a60f3b7f93b3ed7404196c2cf798c4d8c674 (diff)
downloadlinhes_pkgbuild-f7b823f55a80b1498c30e9f3a47692a2329c4f09.zip
linhes_pkgbuild-f7b823f55a80b1498c30e9f3a47692a2329c4f09.tar.gz
linhes_pkgbuild-f7b823f55a80b1498c30e9f3a47692a2329c4f09.tar.bz2
Merge branch 'testing'
Diffstat (limited to 'abs/core/supplemental-web/contents')
-rwxr-xr-xabs/core/supplemental-web/contents/ajaxloader.min.js1
-rw-r--r--abs/core/supplemental-web/contents/fe_status.py138
-rw-r--r--abs/core/supplemental-web/contents/fe_status.shtml18
-rwxr-xr-xabs/core/supplemental-web/contents/fe_status_load.shtml41
-rw-r--r--abs/core/supplemental-web/contents/frame.css117
-rw-r--r--abs/core/supplemental-web/contents/header.html17
-rwxr-xr-x[-rw-r--r--]abs/core/supplemental-web/contents/process.py156
7 files changed, 383 insertions, 105 deletions
diff --git a/abs/core/supplemental-web/contents/ajaxloader.min.js b/abs/core/supplemental-web/contents/ajaxloader.min.js
new file mode 100755
index 0000000..11c14ba
--- /dev/null
+++ b/abs/core/supplemental-web/contents/ajaxloader.min.js
@@ -0,0 +1 @@
+function AjaxLoader(e,t){function n(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,n,r){return t+t+n+n+r+r});var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}function r(e,t,n){return"#"+((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}function b(){p=s>=32?s>=128?72:36:18,d=.5*s*o,v=2*Math.PI/p;h=a/m;if(f){h=-h}g.width=s;g.height=s}function w(e){var t=2*Math.PI*e;var n=Math.cos(t),r=Math.sin(t),i=.5*s*(1+n),o=.5*s*(1-r),a=i-d*n,l=o+d*r;y.clearRect(0,0,s,s);for(var c=0;c<p;c++){y.beginPath();if(f){y.fillStyle="rgba("+u.r+","+u.g+","+u.b+","+(p-1-c)/(p-1)+")"}else{y.fillStyle="rgba("+u.r+","+u.g+","+u.b+","+c/(p-1)+")"}y.moveTo(i,o);y.lineTo(a,l);t+=v,n=Math.cos(t);r=Math.sin(t);i=.5*s*(1+n);o=.5*s*(1-r);a=i-d*n;l=o+d*r;y.lineTo(a,l);y.lineTo(i,o);y.closePath();y.fill()}}var i={size:32,factor:.25,speed:1,color:"#000",clockwise:true};var s,o,u,a,f,l,c=0,h,p,d,v,m=30;if(t!=null){s="size"in t?t.size:i.size;o="factor"in t?t.factor:i.factor;u=n("color"in t?t.color:i.color);a="speed"in t?t.speed:i.speed;f="clockwise"in t?t.clockwise:i.clockwise}else{s=i.size;o=i.factor;u=n(i.color);a=i.speed;f=i.clockwise}var g=document.getElementById(e);if(g==null){console.log("AjaxLoader Error! Cannot find canvas element by id '"+e+"'");return null}var y=g.getContext("2d");b();this.show=function(){g.removeAttribute("style");clearInterval(l);l=setInterval(function(){w(c);c+=h;c=c-Math.floor(c)},1e3/m)};this.hide=function(){clearInterval(l);g.style.display="none"};this.getSize=function(){return s};this.setSize=function(e){s=e;b()};this.getFactor=function(){return o};this.setFactor=function(e){o=e;b()};this.getSpeed=function(){return a};this.setSpeed=function(e){a=e;b()};this.getColor=function(){return r(u.r,u.g,u.b)};this.setColor=function(e){u=n(e)};this.getClockwise=function(){return f};this.setClockwise=function(e){f=e;b()}} \ No newline at end of file
diff --git a/abs/core/supplemental-web/contents/fe_status.py b/abs/core/supplemental-web/contents/fe_status.py
new file mode 100644
index 0000000..993ef72
--- /dev/null
+++ b/abs/core/supplemental-web/contents/fe_status.py
@@ -0,0 +1,138 @@
+#!/usr/bin/python2
+
+import urllib2
+import xml.etree.ElementTree as ET
+import socket
+from MythTV import Frontend
+import sys
+#socket.setdefaulttimeout(1)
+#socket.setdefaulttimeout(.00001)
+
+def msg(msg):
+ #if cmdargs.silent is False:
+ print "%s" %msg
+
+
+def parse_xml(frontend):
+ temp_dict = {'state':" --- ",
+ 'title':" --- ",
+ 'subtitle':" --- ",
+ 'location':" --- "}
+ url = "http://%s:6547/Frontend/GetStatus" %frontend
+ try:
+ request = urllib2.Request(url)
+ xml = urllib2.urlopen(request,timeout=1)
+ tree = ET.parse(xml)
+ root = tree.getroot()
+ except:
+ msg(" Couldn't connect to %s" %frontend)
+ return temp_dict
+
+ lst = root.find("State")
+ for item in lst:
+ try:
+ keyitem = (item.find('Key').text).strip()
+ valueitem = (item.find('Value').text).strip()
+ except:
+ continue
+ if keyitem == "state":
+ temp_dict['state'] = valueitem
+
+ elif keyitem == "title":
+ temp_dict['title'] = valueitem
+
+ elif keyitem == "subtitle":
+ temp_dict['subtitle'] = valueitem
+
+ elif keyitem == "currentlocation":
+ temp_dict['location'] = valueitem
+
+ return temp_dict
+
+
+def mythfe_status(cursor,mythDB):
+ frontends=list(Frontend.fromUPNP())
+ status_dict={}
+ #try:
+ #frontends = mythDB.getFrontends() #use cursor instead so it doesn't test connection
+ #cursor.execute("select hostname from settings where value = 'FrontendIdleTimeout'")
+ #frontends=cursor.fetchall()
+ #except:
+ #msg("Excptions")
+ #return
+
+ for i in frontends:
+ try:
+ fe_hostname = socket.gethostbyaddr(i.host)[0]
+ except:
+ print "DNS lookup failed for %s" %i.host
+ fe_hostname = i.host
+ status_dict[fe_hostname] = parse_xml(i.host)
+
+ return status_dict
+
+
+def print_html(status_dict):
+ print '<div> <p></p>'
+ print '</br> </br> '
+ print '<table class="calllog">'
+
+ #print "Current state of all online frontends"
+ #print '</br> </br> '
+
+ #print status_dict
+ row = '''
+<tr>
+ <td> %s </td>
+ <td> %s </td>
+ <td> %s </td>
+ <td> %s </td>
+ <td> %s </td>
+</tr>
+'''
+ print row %(" MythFrontend Host "," State "," Title "," Subtitle "," MythFrontend Location ")
+ for fe in status_dict.keys():
+ temp_dict = status_dict[fe]
+ print row %(fe,
+ temp_dict['state'],
+ temp_dict['title'],
+ temp_dict['subtitle'],
+ temp_dict['location'])
+
+ print "</table>"
+ print '</div>'
+
+ print '''
+ <div id="footer">
+ </br>
+ <p>Offline systems are not listed</p>
+ </div>
+'''
+
+
+def main():
+ try:
+ from MythTV import MythDB
+ mythDB = MythDB()
+ cursor = mythDB.cursor()
+ db_conn=True
+ except:
+ msg("Couldn't connect to MythTV database.")
+ db_conn=False
+
+ try:
+ from MythTV import MythBE
+ mythBE = MythBE()
+ be_conn=True
+ except:
+ msg("Couldn't connect to MythTV backend.")
+ be_conn=False
+
+ if (db_conn):
+ status_dict = mythfe_status(cursor,mythDB)
+ print_html(status_dict)
+
+
+
+if __name__ == "__main__":
+ main()
diff --git a/abs/core/supplemental-web/contents/fe_status.shtml b/abs/core/supplemental-web/contents/fe_status.shtml
new file mode 100644
index 0000000..8fda3df
--- /dev/null
+++ b/abs/core/supplemental-web/contents/fe_status.shtml
@@ -0,0 +1,18 @@
+<html>
+ <head>
+ <style type="text/css">@import "/frame.css";</style>
+ <meta http-equiv="cache-control" content="max-age=0" />
+ <meta http-equiv="cache-control" content="no-cache" />
+ <meta http-equiv="expires" content="0" />
+ <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
+ <meta http-equiv="pragma" content="no-cache" />
+ <meta http-equiv="refresh" content="30">
+ </head>
+
+ <body>
+ <div id="header">
+ <h1>MythFrontend Status</h1>
+ </div>
+ <!--#exec cmd="MYTHCONFDIR=/usr/share/mythtv /data/srv/httpd/htdocs/fe_status.py" -->
+ </body>
+</html>
diff --git a/abs/core/supplemental-web/contents/fe_status_load.shtml b/abs/core/supplemental-web/contents/fe_status_load.shtml
new file mode 100755
index 0000000..b83c13f
--- /dev/null
+++ b/abs/core/supplemental-web/contents/fe_status_load.shtml
@@ -0,0 +1,41 @@
+<html>
+ <head>
+ <style type="text/css">@import "/frame.css";</style>
+ <script src="/ajaxloader.min.js"></script>
+ <meta http-equiv="cache-control" content="max-age=0">
+ <meta http-equiv="cache-control" content="no-cache">
+ <meta http-equiv="expires" content="0">
+ <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
+ <meta http-equiv="pragma" content="no-cache">
+ <meta http-equiv="refresh" content="0; url=/fe_status.shtml">
+ <script language="javascript">
+ function redirect() {
+ window.location.replace("/fe_status.shtml");}
+ </script>
+ </head>
+
+ <body onload="redirect()">
+ <div id="header">
+ <h1>MythFrontend Status</h1>
+ </div>
+ <br> <br>
+ <h3>Querying MythFrontends...</h3>
+ <br>
+ <div id="container">
+ <div>
+ <canvas id="spinner"></canvas>
+ </div>
+ </div>
+ <script type="text/javascript">
+ var opts = {
+ size: 72, // Width and height of the spinner
+ factor: 0.25, // Factor of thickness, density, etc.
+ color: "#ebb81c", // Color #rgb or #rrggbb
+ speed: 1.0, // Number of turns per second
+ clockwise: true // Direction of rotation
+ };
+ var ajaxLoader = new AjaxLoader("spinner", opts);
+ ajaxLoader.show();
+ </script>
+ </body>
+</html>
diff --git a/abs/core/supplemental-web/contents/frame.css b/abs/core/supplemental-web/contents/frame.css
index 59da3c7..0008aec 100644
--- a/abs/core/supplemental-web/contents/frame.css
+++ b/abs/core/supplemental-web/contents/frame.css
@@ -1,12 +1,12 @@
* /* Our "universal rule" */
{
- padding: 0px;
- margin: 0px;
- border: 0px;
+ padding: 0px;
+ margin: 0px;
+ border: 0px;
}
body {
/* background: url("page_background.jpg") repeat-y #9FA9B3; */
- background-color: #191c26;
+ background-color: #191c26;
//background-color: #ebb81c;
//background-image: -webkit-gradient(linear, left top, left bottom, from(#ebb81c), to(#0072bc)); /* Saf4+, Chrome */
@@ -38,27 +38,27 @@ body {
#mainContainer {
clear: both;
- width: 770px;
- margin: 10px auto;
- text-align: left; /* Since we used text-align: center in the body to be sure some older IE versions are going to center our design, we now align the text left */
- display: block;
+ width: 770px;
+ margin: 10px auto;
+ text-align: left; /* Since we used text-align: center in the body to be sure some older IE versions are going to center our design, we now align the text left */
+ display: block;
}
#header {
- color: #fff;
- text-align: center;
+ color: #fff;
+ text-align: center;
}
#content {
- float: left; /* Our content is going to be left aligned */
- width: 320px; /* And it's going to have a 320px width */
- /*background: #D9D9D9;*/
- margin-left:60px;
+ float: left; /* Our content is going to be left aligned */
+ width: 320px; /* And it's going to have a 320px width */
+ /*background: #D9D9D9;*/
+ margin-left:60px;
}
#column {
- float: right; /* Our column is going to be right aligned */
- width: 320px; /* And it's going to have a 320px width */
- /*background: #8A8AE6;*/
- margin-right:60px;
+ float: right; /* Our column is going to be right aligned */
+ width: 320px; /* And it's going to have a 320px width */
+ /*background: #8A8AE6;*/
+ margin-right:60px;
}
#resultbox {
@@ -79,8 +79,8 @@ body {
#netContainer {
clear: both;
width: 770px;
- margin: 10px auto;
- display: block;
+ margin: 10px auto;
+ display: block;
}
img.center {
@@ -93,10 +93,10 @@ img.center {
}
#footer {
- clear: both; /* We have to clear our floats */
- width: 770px; /* We need to set the width on the footer since it's outside the mainContainer, and therefor isn't controlled by it */
- margin: 0px auto; /* We need to center the footer also */
- color: gold;
+ clear: both; /* We have to clear our floats */
+ width: 770px; /* We need to set the width on the footer since it's outside the mainContainer, and therefor isn't controlled by it */
+ margin: 0px auto; /* We need to center the footer also */
+ color: gold;
text-align: center;
font-size: 10px;
}
@@ -115,9 +115,9 @@ img.center {
}
#navlist a:link
{
- color: #fff;
+ color: #fff;
# background-color: #FDB14F;
- text-decoration: underline;
+ text-decoration: underline;
}
@@ -125,45 +125,48 @@ img.center {
#navlist a:visited
{
# color: #FDB14F;
- color: gold;
- text-decoration: underline;
+ color: gold;
+ text-decoration: underline;
}
table.sample {
- border-width: 4px;
- border-spacing: 2px;
- border-style: outset;
- border-color: #808080;
- border-collapse: separate;
- width:300px;
+ border-width: 4px;
+ border-spacing: 2px;
+ border-style: outset;
+ border-color: #808080;
+ border-collapse: separate;
+ width:300px;
}
table.sample td {
- border-width: 1px;
- padding: 1px;
- border-style: inset;
- border-color: #808080;
- /*width:300px;*/
- -moz-border-radius: ;
+ border-width: 1px;
+ padding: 1px;
+ border-style: inset;
+ border-color: #808080;
+ /*width:300px;*/
+ -moz-border-radius: ;
}
table.calllog {
- border-width: 4px;
- border-spacing: 2px;
- border-style: outset;
- border-color: #808080;
- border-collapse: separate;
- width:500px;
+ border-width: 4px;
+ border-spacing: 2px;
+ border-style: outset;
+ border-color: #808080;
+ border-collapse: separate;
+ width:85%;
+ margin-left:auto;
+ margin-right:auto;
+ body {text-align:center;}
}
table.calllog td {
- border-width: 1px;
- padding: 1px;
- border-style: inset;
- border-color: #808080;
- /*width:300px;*/
- -moz-border-radius: ;
+ border-width: 1px;
+ padding: 1px;
+ border-style: inset;
+ border-color: #808080;
+ /*width:300px;*/
+ -moz-border-radius: ;
}
@@ -202,9 +205,9 @@ table.calllog td {
a:link
{
- color: #fff;
+ color: #fff;
# background-color: #FDB14F;
- text-decoration: underline;
+ text-decoration: underline;
# margin-left:10px;
@@ -213,9 +216,9 @@ a:link
a:visited
{
# color: #FDB14F;
- color: gold;
- text-decoration: underline;
- margin-left:10px;
+ color: gold;
+ text-decoration: underline;
+ margin-left:10px;
}
#submitbutton {
diff --git a/abs/core/supplemental-web/contents/header.html b/abs/core/supplemental-web/contents/header.html
index 032acd1..9e1472d 100644
--- a/abs/core/supplemental-web/contents/header.html
+++ b/abs/core/supplemental-web/contents/header.html
@@ -39,7 +39,20 @@ function beStatus()
<ul id="nav">
<li><a href="home.shtml" TARGET="content" id="current">Home</a></li>
-<li><a href="mythweb/">MythWeb</a></li>
+<li><a href="mythweb/">MythWeb &#187;</a>
+ <ul>
+ <li><a href="mythweb/tv/list" >Listings</a></li>
+ <li><a href="mythweb/tv/recorded" >Recorded</a></li>
+ <li><a href="mythweb/tv/schedules" >Schedules</a></li>
+ <li><a href="mythweb/tv/searches" >Searches</a></li>
+ <li><a href="mythweb/status" >Status</a></li>
+ <li><a href="mythweb/tv/upcoming" >Upcoming</a></li>
+ <li><a href="mythweb/music" >Music</a></li>
+ <li><a href="mythweb/video" >Video</a></li>
+ </ul>
+</li>
+
+<li><a href="fe_status_load.shtml">MythFrontend Status</a></li>
<li><a id="modify-me">MythBackend Status</a></li>
@@ -61,7 +74,7 @@ function beStatus()
<li><a href="calllog.shtml">Call Log</a></li>
<li><a href="mythexport/setup.cgi">MythExport</a></li>
<li><a href="mythexpress.html">MythExpress</a></li>
- <li><a href="remyth.html" >ReMyth</a></li>
+<!-- <li><a href="remyth.html" >ReMyth</a></li> -->
<li><a href="zm">ZoneMinder</a></li>
</ul>
</li>
diff --git a/abs/core/supplemental-web/contents/process.py b/abs/core/supplemental-web/contents/process.py
index 988ebfc..60714ee 100644..100755
--- a/abs/core/supplemental-web/contents/process.py
+++ b/abs/core/supplemental-web/contents/process.py
@@ -17,14 +17,6 @@ def cgiprint(inline=''):
sys.stdout.flush()
contentheader = 'Content-Type: text/html'
-thepage = '''<html><head>
-<title>%s</title>
-</head><body>
-%s
-</body></html>
-'''
-h1 = '<h1>%s</h1>'
-
def getform(theform, valuelist, notpresent='', nolist=False):
"""
This function, given a CGI form as a
@@ -127,19 +119,14 @@ def go_download_backup(dl_file):
print str
return results
-
def go_restore(restorefile,myhost,prestore):
myhostname = socket.gethostname()
psc = ''
if prestore == "on":
psc = "partial"
-
if myhostname.strip() == myhost.strip():
command="sudo /usr/LH/bin/lh_system_restore_job %s %s" %(restorefile , psc)
-
-
-
else:
#this should never execute
sshcmd="ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /data/srv/.nobody_ssh/id_dsa mythtv@"
@@ -162,16 +149,13 @@ def go_upload(up_file):
line = '''The backup has been uploaded and is now available for restore.
To restore from the file, check "Restore database" then select the file from the drop down menu'''
-
results.append(line)
command2="sleep 1; sudo -u nobody /home/xymon/server/ext/hbnotes.py"
os.popen(command2,'r')
-
return results
-
def go_optimize(myhost):
#myhostname = socket.gethostname()
#if myhostname.strip() == myhost.strip():
@@ -191,14 +175,12 @@ def go_update(myhost,update_type):
return results
def go_updateall(allupdate_type):
-
cmd=" sudo /usr/bin/update_system_all "
cmd+=allupdate_type
command= cmd + " 2>&1 "
results=os.popen(command,'r')
return results
-
def go_shutdown(myhost):
myhostname = socket.gethostname()
message="Shutdown from MBE"
@@ -217,7 +199,7 @@ def go_shutdownall():
db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="mythconverg")
# create a cursor
cursor = db.cursor()
- # execute SQL statement
+ # execute SQL statement
myhostname = socket.gethostname()
results=["Sent shutdown command to: \n "]
cursor.execute("SELECT distinct(hostname) from settings where not hostname = %s ; ",(myhostname))
@@ -257,31 +239,83 @@ def go_kill(myhost,kill_type):
results=os.popen(command,'r')
return results
+def go_restart_mbe_local():
+ cmd = "/usr/LH/bin/lh_backend_control.sh restart &"
+ #results=os.popen(cmd,'r')
+ os.popen(cmd,'r')
+ results = ["Attempting restart of backend service"]
+ return results
+
+mainpage = '''
+<html>
+ <head>
+ <style type="text/css">@import "/frame.css";</style>
+ <meta http-equiv="cache-control" content="max-age=0">
+ <meta http-equiv="cache-control" content="no-cache">
+ <meta http-equiv="expires" content="0">
+ <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
+ <meta http-equiv="pragma" content="no-cache">
+ <title>LinHES</title>
+ </head>
+ <body>
+ %s
+ </body>
+</html>
+'''
+loadingpage = '''
+<html>
+ <head>
+ <style type="text/css">@import "/frame.css";</style>
+ <script src="/ajaxloader.min.js"></script>
+ <meta http-equiv="cache-control" content="max-age=0">
+ <meta http-equiv="cache-control" content="no-cache">
+ <meta http-equiv="expires" content="0">
+ <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
+ <meta http-equiv="pragma" content="no-cache">
+ <title>LinHES</title>
+ </head>
+ <body>
+ <div id="header">
+ %s
+ </div>
+ <div id="container">
+ <br><br>
+ <h3>Working. Please Wait...</h3>
+ <br><br>
+ <div>
+ <canvas id="spinner"></canvas>
+ </div>
+ </div>
+ <script type="text/javascript">
+ var opts = {
+ size: 72, // Width and height of the spinner
+ factor: 0.25, // Factor of thickness, density, etc.
+ color: "#ebb81c", // Color #rgb or #rrggbb
+ speed: 1.0, // Number of turns per second
+ clockwise: true // Direction of rotation
+ };
+ var ajaxLoader = new AjaxLoader("spinner", opts);
+ ajaxLoader.show();
+ </script>
+'''
-mainpage = '''
- <html><head>
- <style type="text/css">@import "/frame.css";</style>
- <!--<meta http-equiv="refresh" content="6">-->
- <title>Receiving a Form</title>
- </head><body>%s</body></html>'''
error = '''
<h1>Error</h1>
<h2>No Form Submission Was Received</h2>'''
+
result = '''
<h1>%s of %s</h1>
'''
+
possible_parameters = ['param1', 'param2', 'param3', 'param4','hiddenparam','param5','param6','param7','uFile','param8']
if __name__ == '__main__':
- #cgiprint(contentheader) # content header
- #cgiprint() # finish headers with blank line
-
theform = cgi.FieldStorage()
#print theform
formdict = getform(theform, possible_parameters)
@@ -310,49 +344,78 @@ if __name__ == '__main__':
prestore = "off"
body = result % (radio, hidden)
-
-
-
- #print mainpage % body
selection=radio
myhost=hidden.lower()
if selection == "Restore":
mylogfile=go_restore(name,myhost,prestore)
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "Backup":
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print loadingpage % body
mylogfile=go_backup(myhost)
elif selection == "Dbackup":
mylogfile=go_download_backup(dl_file)
-
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "Update":
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print loadingpage % body
mylogfile=go_update(myhost,update_type)
elif selection == "Shutdown":
mylogfile=go_shutdown(myhost)
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "Reboot":
mylogfile=go_reboot(myhost)
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "Optimize":
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print loadingpage % body
mylogfile=go_optimize(myhost)
elif selection == "WOL":
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print loadingpage % body
mylogfile=go_wake(myhost)
elif selection == "UpdateAll":
mylogfile=go_updateall(all_update_type)
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "ShutdownAll":
mylogfile=go_shutdownall()
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "Kill":
mylogfile=go_kill(myhost,kill_type)
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
elif selection == "Upload":
mylogfile = go_upload(up_file)
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
+ elif selection == "RestartMBE":
+ mylogfile = go_restart_mbe_local()
+ cgiprint(contentheader) # content header
+ cgiprint() # finish headers with blank line
+ print mainpage % body
-
- cgiprint(contentheader) # content header
cgiprint() # finish headers with blank line
- print mainpage % body
- #box=''' </br> </br>
- #<div style="border: 1px solid #aaa; width:700px; height:700px; overflow:auto; color:#FFF;text-align:left;">
- #<code id="box" style="display: block; height: 700px; width: 700px; overflow: auto;">
- #'''
- box='''</br> </br>
+ box='''<br><br>
<div id="resultbox" >
'''
@@ -363,21 +426,22 @@ if __name__ == '__main__':
'''
javascript='''
<script type="text/javascript">
- var objDiv = document.getElementById("box");
+ document.getElementById("container").style.display = 'none';
+ ajaxLoader.hide();
+ var objDiv = document.getElementById("resultbox");
objDiv.scrollTop = objDiv.scrollHeight;
</script>
- '''
+ '''
print box
for line in mylogfile:
- print line + '</br> \r\n'
+ print line + '<br> \r\n'
print endbox
- print "</br></br>"
+ print "<br><br>"
#print '<a href=', oldurl, ' > Back </a> '
s='<a href="%s"><img src="back.png"></a>' %oldurl
print s
#<a href="myfile.htm"><img src="rainbow.gif"></a>
#print oldurl
print javascript
-