diff options
author | Britney Fransen <brfransen@gmail.com> | 2014-10-08 20:01:44 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2014-10-08 20:01:44 (GMT) |
commit | 2ea48e47ea995e476ded4f64d98f1e2b481a11dd (patch) | |
tree | 5fd309511f442a2eb9e3211177ef5f00e150fc8f | |
parent | 6358892e473348dfff97ec76938b73b42ac333ce (diff) | |
download | linhes_pkgbuild-2ea48e47ea995e476ded4f64d98f1e2b481a11dd.zip linhes_pkgbuild-2ea48e47ea995e476ded4f64d98f1e2b481a11dd.tar.gz linhes_pkgbuild-2ea48e47ea995e476ded4f64d98f1e2b481a11dd.tar.bz2 |
supplemental-web: process.py: add loading indicator for all operations.
-rw-r--r-- | abs/core/supplemental-web/PKGBUILD | 2 | ||||
-rwxr-xr-x | abs/core/supplemental-web/contents/process.py | 63 |
2 files changed, 49 insertions, 16 deletions
diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index 2a25f72..2dd59c8 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,7 +1,7 @@ pkgbase=supplemental-web pkgname=('supplemental-web' 'supplemental-web-slave') pkgver=8.2 -pkgrel=2 +pkgrel=3 arch=('i686' 'x86_64') license=('GPL') backup=('data/srv/httpd/cgi/extra.cfg.txt') diff --git a/abs/core/supplemental-web/contents/process.py b/abs/core/supplemental-web/contents/process.py index 7ad9af6..d624f60 100755 --- a/abs/core/supplemental-web/contents/process.py +++ b/abs/core/supplemental-web/contents/process.py @@ -266,12 +266,45 @@ def go_restart_mbe_local(): -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>''' +mainpage = '''<title>%s</title>''' + +loading = ''' +<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> +''' error = ''' <h1>Error</h1> @@ -316,8 +349,9 @@ if __name__ == '__main__': body = result % (radio, hidden) - - + cgiprint(contentheader) # content header + cgiprint() # finish headers with blank line + print loading % body #print mainpage % body selection=radio myhost=hidden.lower() @@ -328,7 +362,6 @@ if __name__ == '__main__': mylogfile=go_backup(myhost) elif selection == "Dbackup": mylogfile=go_download_backup(dl_file) - elif selection == "Update": mylogfile=go_update(myhost,update_type) elif selection == "Shutdown": @@ -350,16 +383,15 @@ if __name__ == '__main__': elif selection == "RestartMBE": mylogfile = go_restart_mbe_local() - - cgiprint(contentheader) # content header + #cgiprint(contentheader) # content header cgiprint() # finish headers with blank line - print mainpage % body + #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" > ''' @@ -370,7 +402,9 @@ 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> ''' @@ -387,4 +421,3 @@ if __name__ == '__main__': #<a href="myfile.htm"><img src="rainbow.gif"></a> #print oldurl print javascript - |