From b2a8f5b6cf0bd826151b23beaade6cc024c96d24 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Sun, 23 Sep 2012 13:39:57 -0500 Subject: supplemental-web/xymon: When restoring the database from the webui, prompt to make sure it's really what the user wants. Also limit db dropdown to 30 entries --- abs/core/supplemental-web/PKGBUILD | 2 +- abs/core/supplemental-web/contents/back.png | Bin 0 -> 3133 bytes abs/core/supplemental-web/contents/go.png | Bin 0 -> 2471 bytes abs/core/supplemental-web/contents/process.py | 6 +- abs/core/xymon/PKGBUILD | 4 +- abs/core/xymon/hbnotes.py | 142 ++++++++++++++++++-------- 6 files changed, 105 insertions(+), 49 deletions(-) create mode 100644 abs/core/supplemental-web/contents/back.png create mode 100644 abs/core/supplemental-web/contents/go.png diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index afbf678..573278d 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,6 +1,6 @@ pkgname=supplemental-web pkgver=1.0 -pkgrel=26 +pkgrel=27 arch=('i686' 'x86_64') MVDIR=$startdir/pkg/usr/MythVantage install=supplemental-web.install diff --git a/abs/core/supplemental-web/contents/back.png b/abs/core/supplemental-web/contents/back.png new file mode 100644 index 0000000..6b5da48 Binary files /dev/null and b/abs/core/supplemental-web/contents/back.png differ diff --git a/abs/core/supplemental-web/contents/go.png b/abs/core/supplemental-web/contents/go.png new file mode 100644 index 0000000..c70bf2a Binary files /dev/null and b/abs/core/supplemental-web/contents/go.png differ diff --git a/abs/core/supplemental-web/contents/process.py b/abs/core/supplemental-web/contents/process.py index f6c6db1..22ffb0f 100644 --- a/abs/core/supplemental-web/contents/process.py +++ b/abs/core/supplemental-web/contents/process.py @@ -297,7 +297,11 @@ if __name__ == '__main__': print line + '
\r\n' print endbox - print ' Back ' + print "

" + #print ' Back ' + s='' %oldurl + print s + # #print oldurl print javascript diff --git a/abs/core/xymon/PKGBUILD b/abs/core/xymon/PKGBUILD index b68d1fe..8247592 100755 --- a/abs/core/xymon/PKGBUILD +++ b/abs/core/xymon/PKGBUILD @@ -1,7 +1,7 @@ pkgbase=xymon pkgname=(xymonserver xymonclient) pkgver=4.3.5 -pkgrel=33 +pkgrel=35 pkgdesc="Hobbit is a system for monitoring servers and networks. " license="GPL" arch=('i686' 'x86_64') @@ -119,7 +119,7 @@ md5sums=('31923ec126fe1c264fceb459d2175161' '2d88e59ab17114030da514ba3f0a5b64' 'ee608dcafc050d790e28647a670f6b60' 'b2f98ac0df013332deedc1efae0a270d' - '94e561bc2d9ba5755f04ed642485e83b' + '69439732c9f81c663d1cdd65be453631' '0f70e76a164f648f0a4a01110137cb20' 'f6921f0413215ae174e81306be80d37f' '54ba9d7bff5875150e511c608ffc1e6a' diff --git a/abs/core/xymon/hbnotes.py b/abs/core/xymon/hbnotes.py index 6751865..78145f2 100644 --- a/abs/core/xymon/hbnotes.py +++ b/abs/core/xymon/hbnotes.py @@ -24,17 +24,26 @@ def createdropdown(currenthostype): dropdown=" " dropdown=''' Restore database - \n''' + os.chdir(dir) if os.path.exists(dir): files = os.listdir(dir) - for file in os.listdir(dir): + files.sort(key=lambda x: os.path.getmtime(x) , reverse=True) + #for file in os.listdir(dir): + if len(files) > 20: + del files[20:] + + + for file in files: if (file.endswith(".tgz")): - dropdown+=' ' - dropdown+='
Backup database
' - dropdown+='Optimize database
' + dropdown+=' \n' + dropdown+=''' +
+ Backup database
+ Optimize database
+ ''' if currenthostype == "Master_backend": - dropdown+='Shutdown All Systems (expect MBE)
' + dropdown+='Shutdown All Systems (expect MBE)
\n' #dropdown+='''Update All Systems Update System - -
- Restart interface: - -
- Shutdown System
- Reboot System
- Wake on Lan
- - Update System + +
+ + Restart interface: + +
+ + Shutdown System
+ Reboot System
+ Wake on Lan
+ + -
- - - - ''' +
+ + + + + +''' if currenthostype == "Master_backend" or currenthostype == "Standalone": mbeoptions=createdropdown(currenthostype) @@ -356,7 +408,7 @@ def main(argv): file.write(returnurl) file.write(closetag) - string=(' ') + string=('') file.write(string) if __name__ == "__main__": -- cgit v0.12