From 006fb5a9dd30bdbfcf47b599c489fa51da289b8d Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Fri, 13 Jan 2023 15:26:17 -0500 Subject: linhes-web: cleanup for lh 9 --- linhes/linhes-web/PKGBUILD | 4 +- linhes/linhes-web/website/contents/calllog.py | 66 ------------------ linhes/linhes-web/website/contents/calllog.shtml | 19 ------ linhes/linhes-web/website/contents/count.py | 85 ++++++++++++------------ linhes/linhes-web/website/contents/docs.html | 11 +-- linhes/linhes-web/website/contents/fe_status.py | 2 +- linhes/linhes-web/website/contents/header.html | 11 ++- linhes/linhes-web/website/contents/home.shtml | 4 +- 8 files changed, 60 insertions(+), 142 deletions(-) delete mode 100644 linhes/linhes-web/website/contents/calllog.py delete mode 100644 linhes/linhes-web/website/contents/calllog.shtml diff --git a/linhes/linhes-web/PKGBUILD b/linhes/linhes-web/PKGBUILD index 0bb2824..cb68780 100644 --- a/linhes/linhes-web/PKGBUILD +++ b/linhes/linhes-web/PKGBUILD @@ -1,6 +1,6 @@ pkgname=linhes-web pkgver=9.0.0 -pkgrel=3 +pkgrel=4 conflicts=() pkgdesc="LinHES local website" depends=('lighttpd' 'php-cgi') @@ -9,7 +9,7 @@ arch=('x86_64') license=('GPL') source=('linhes-web.conf' 'website.tar.gz') sha256sums=('e39ce02bde5eb3d359f1286b41751aa715961cf2b2d9a1243c7f01d20ed9c993' - '6ff99589d225826d86bd1911aa0223f3c9668c02ff15e7bc607e52d90cca20ae') + '4d6f1e09b1f9ba5585acf8c15097c296a13b00782ee039809ecb5c6ef83dc805') package() { mkdir -p $pkgdir/data/srv/httpd/htdocs/ diff --git a/linhes/linhes-web/website/contents/calllog.py b/linhes/linhes-web/website/contents/calllog.py deleted file mode 100644 index 0b2fb22..0000000 --- a/linhes/linhes-web/website/contents/calllog.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/python2 -# import MySQL module - -import MySQLdb -import sys -import getopt -import socket - - -def main(argv): - grandtotal=0 - grandtotal_current=0 - db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="ncid") - # create a cursor - cursor = db.cursor() - # execute SQL statement - # cursor.execute("select name,number,count(number) as '# calls' from cid group by number,name order by '# calls' DESC limit 20;") - # result = cursor.fetchall() - - - #Top 20 callers - #print '

' - print '

' - print '' - print "Top 20 callers" - searchstring=''' ''' - cursor.execute("select name,number,count(number) from cid group by number,name order by count(number) DESC limit 20;") - result = cursor.fetchall() - for row in result: - print " " - #print " " - print searchstring % (row[0], row [0]) - print " " - #print " " - print searchstring % (row[1], row [1]) - print " " - #print "%40s %26s %10s" %(row[0],row[2],row[1]) - print "
%s
",row[0],"",row[2],"",row[1],"
" - print "
" - - - #last 20 calls - print '
' - print '
' - #print '

' - print '

' - print '' - print "Last 20 calls" - print '
' - cursor.execute("select date,time,name,number from cid order by date(ts) DESC ,time DESC limit 20 ;" ) - result = cursor.fetchall() - for row in result: - print " " - print " " %(row[0]) - print " " - #print " " - print searchstring % (row[2], row [2]) - #print " " - print searchstring % (row[3], row [3]) - print " " -# print "%26s %26s %26s %26s " %(row[0],row[1],row[2],row[3]) - print "
%s ",row[1],"",row[2],"",row[3],"
" - print "
" - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/linhes/linhes-web/website/contents/calllog.shtml b/linhes/linhes-web/website/contents/calllog.shtml deleted file mode 100644 index 5b64dc3..0000000 --- a/linhes/linhes-web/website/contents/calllog.shtml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - -
-
- - - - diff --git a/linhes/linhes-web/website/contents/count.py b/linhes/linhes-web/website/contents/count.py index 76d18e8..d5f3259 100644 --- a/linhes/linhes-web/website/contents/count.py +++ b/linhes/linhes-web/website/contents/count.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python # import MySQL module import MySQLdb @@ -9,8 +9,11 @@ import socket def main(argv): #get LinHES version - verfile = open('/etc/LinHES-release', 'r') - verLH = verfile.read() + verfile = open('/etc/os-release', 'r') + for line in verfile: + if line.startswith('PRETTY_NAME'): + verLHlist = line.split('"') + verLH = verLHlist[1] verfile.close() grandtotal=0 @@ -18,7 +21,7 @@ def main(argv): db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="mythconverg") # create a cursor cursor = db.cursor() - # execute SQL statement + # execute SQL statement cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM oldrecorded where oldrecorded.recstatus = -3 ORDER by starttime;") result = cursor.fetchall() @@ -43,58 +46,58 @@ def main(argv): hours_current = grandtotal_current / 60.0 days_current = hours_current / 24.0 - print '') + print("

") #Top shows - print '

' - print '' - print "Top 20 Shows" + print('

') + print('
') + print("Top 20 Shows") cursor.execute("select title,count(title),category as numtitle from oldrecorded where oldrecorded.recstatus = -3 group by title having (COUNT(title) > 0 ) order by (COUNT(title)) DESC limit 20;" ) result = cursor.fetchall() for row in result: - print " " - print " " - print " " - print " " - print " " + print(" ") + print(" ") + print(" ") + print(" ") + print(" ") # print "%40s %26s %10s" %(row[0],row[2],row[1]) - print "
",row[0],"",row[2],"",row[1],"
",row[0],"",row[2],"",row[1],"
" - print "
" + print("") + print("
") #Top categories - print '
' - print '' - print "Top 20 Categories" + print('
') + print('
') + print("Top 20 Categories") cursor.execute("select category,count(category) as numtitle from oldrecorded where oldrecorded.recstatus = -3 group by category having (COUNT(category) > 0 ) order by (COUNT(category)) DESC limit 20; " ) result = cursor.fetchall() for row in result: category = row[0] if category == "": category = "Unknown" - print " " - print " " - print " " - print " " + print(" ") + print(" ") + print(" ") + print(" ") #print "%16s %16s" %(row[0],row[1]) - print "
",category,"",row[1],"
",category,"",row[1],"
" - print "
" + print("") + print("
") if __name__ == "__main__": main(sys.argv[1:]) diff --git a/linhes/linhes-web/website/contents/docs.html b/linhes/linhes-web/website/contents/docs.html index dc3a936..d08c32e 100644 --- a/linhes/linhes-web/website/contents/docs.html +++ b/linhes/linhes-web/website/contents/docs.html @@ -25,14 +25,15 @@

Starting and Stopping Services

- +

MythFrontend Menu Navigation