mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 07:54:01 +01:00
some more commits, extras.html, config.html (bad layout), otherstuff, changed log levels
This commit is contained in:
@@ -1,46 +1,42 @@
|
|||||||
<%inherit file="base.html"/>
|
<%inherit file="base.html"/>
|
||||||
<form action="configUpdate" method="post">
|
<form action="configUpdate" method="post">
|
||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
|
<h1>Web Interface</h1>
|
||||||
<table class="configtable" summary="Web Interface">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p> HTTP Host: <br />
|
<p> HTTP Host: <br />
|
||||||
<input type="text" name="http_host" value="${config['http_host']}" size="30" maxlength="40"><br />
|
<input type="text" name="http_host" value="${config['http_host']}" size="30" maxlength="40"><br />
|
||||||
<i class="smalltext">e.g. localhost or 0.0.0.0</i>
|
<i class="smalltext">e.g. localhost or 0.0.0.0</i>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>HTTP Username: <br />
|
<p>HTTP Username: <br />
|
||||||
<input type="text" name="http_username" value="${config['http_user']}" size="30" maxlength="40">
|
<input type="text" name="http_username" value="${config['http_user']}" size="30" maxlength="40">
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>HTTP Port: <br />
|
<p>HTTP Port: <br />
|
||||||
<input type="text" name="http_port" value="${config['http_port']}" size="20" maxlength="40">
|
<input type="text" name="http_port" value="${config['http_port']}" size="20" maxlength="40">
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>HTTP Password: <br />
|
<p>HTTP Password: <br />
|
||||||
<input type="password" name="http_password" value="${config['http_pass']}" size="30" maxlength="40">
|
<input type="password" name="http_password" value="${config['http_pass']}" size="30" maxlength="40">
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>Launch Browser on Startup:<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']} /></p>
|
<p>Launch Browser on Startup:<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']} /></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
<a name="download">
|
<h1>Download Settings</h1>
|
||||||
<h1>
|
|
||||||
<u>Download Settings</u>
|
|
||||||
</h1>
|
|
||||||
</a>
|
|
||||||
<table class="configtable" summary="Download Settings">
|
<table class="configtable" summary="Download Settings">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
%>
|
%>
|
||||||
%if out_tuple:
|
%if out_tuple:
|
||||||
<%
|
<%
|
||||||
if out_tuple[1] == 'WARNING' or out_tuple[1] == 'ERROR':
|
if out_tuple[1] == 'DEBUG':
|
||||||
|
continue
|
||||||
|
elif out_tuple[1] == 'WARNING' or out_tuple[1] == 'ERROR':
|
||||||
grade = 'X'
|
grade = 'X'
|
||||||
else:
|
else:
|
||||||
grade = 'Z'
|
grade = 'Z'
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
<%inherit file="base.html"/>
|
|
||||||
|
|
||||||
<%def name="headIncludes()">
|
|
||||||
<meta http-equiv="refresh" content="30;url=index">
|
|
||||||
</%def>
|
|
||||||
|
|
||||||
<%def name="body()">
|
|
||||||
Headphones is restarting
|
|
||||||
</%def>
|
|
||||||
@@ -5,5 +5,7 @@
|
|||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="body()">
|
<%def name="body()">
|
||||||
Headphones is shutting down
|
<div class="table_wrapper">
|
||||||
|
Headphones is ${message}
|
||||||
|
</div>
|
||||||
</%def>
|
</%def>
|
||||||
@@ -2,9 +2,28 @@
|
|||||||
<%def name="body()">
|
<%def name="body()">
|
||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
<h1>Upcoming Albums</h1>
|
<h1>Upcoming Albums</h1>
|
||||||
%for album in wanted:
|
<table class="display" id="upcoming_table">
|
||||||
|
<thead>
|
||||||
%endfor
|
<tr>
|
||||||
|
<th id="albumart"></th>
|
||||||
|
<th id="albumname">Album Name</th>
|
||||||
|
<th id="reldate">Release Date</th>
|
||||||
|
<th id="type">Release Type</th>
|
||||||
|
<th id="status">Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
%for album in upcoming:
|
||||||
|
<tr class="gradeZ">
|
||||||
|
<td id="albumart"><img src="http://ec1.images-amazon.com/images/P/${album['AlbumASIN']}.01.MZZZZZZZ.jpg" height="50" width="50"></td>
|
||||||
|
<td id="albumname"><a href="albumPage?AlbumID=${album['AlbumID']}">${album['AlbumTitle']}</a></td>
|
||||||
|
<td id="reldate">${album['ReleaseDate']}</td>
|
||||||
|
<td id="type"></td>
|
||||||
|
<td id="status"></td>
|
||||||
|
</tr>
|
||||||
|
%endfor
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
@@ -12,3 +31,22 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
<%def name="headIncludes()">
|
||||||
|
<link rel="stylesheet" href="css/data_table.css">
|
||||||
|
</%def>
|
||||||
|
|
||||||
|
<%def name="javascriptIncludes()">
|
||||||
|
<script src="js/libs/jquery.dataTables.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function()
|
||||||
|
{
|
||||||
|
$('#track_table').dataTable(
|
||||||
|
{
|
||||||
|
"bFilter": false,
|
||||||
|
"bInfo": false,
|
||||||
|
"bPaginate": false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</%def>
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<%inherit file="base.html"/>
|
|
||||||
|
|
||||||
<%def name="headIncludes()">
|
|
||||||
<meta http-equiv="refresh" content="120;url=index">
|
|
||||||
</%def>
|
|
||||||
|
|
||||||
<%def name="body()">
|
|
||||||
Headphones is updating
|
|
||||||
</%def>
|
|
||||||
@@ -115,7 +115,7 @@ def searchNZB(albumid=None, new=False):
|
|||||||
}
|
}
|
||||||
|
|
||||||
searchURL = "http://rss.nzbmatrix.com/rss.php?" + urllib.urlencode(params)
|
searchURL = "http://rss.nzbmatrix.com/rss.php?" + urllib.urlencode(params)
|
||||||
logger.info(u"Parsing results from "+searchURL)
|
logger.debug(u'Parsing results from <a href="%s">NZBMatrix</a>' % searchURL)
|
||||||
try:
|
try:
|
||||||
data = urllib2.urlopen(searchURL, timeout=20).read()
|
data = urllib2.urlopen(searchURL, timeout=20).read()
|
||||||
except urllib2.URLError, e:
|
except urllib2.URLError, e:
|
||||||
@@ -161,7 +161,7 @@ def searchNZB(albumid=None, new=False):
|
|||||||
|
|
||||||
searchURL = headphones.NEWZNAB_HOST + '/api?' + urllib.urlencode(params)
|
searchURL = headphones.NEWZNAB_HOST + '/api?' + urllib.urlencode(params)
|
||||||
|
|
||||||
logger.info(u"Parsing results from "+searchURL)
|
logger.debug(u'Parsing results from <a href="%s">%s</a>' % (searchURL, headphones.NEWZNAB_HOST))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = urllib2.urlopen(searchURL, timeout=20).read()
|
data = urllib2.urlopen(searchURL, timeout=20).read()
|
||||||
@@ -215,7 +215,7 @@ def searchNZB(albumid=None, new=False):
|
|||||||
}
|
}
|
||||||
|
|
||||||
searchURL = 'https://secure.nzbs.org/rss.php?' + urllib.urlencode(params)
|
searchURL = 'https://secure.nzbs.org/rss.php?' + urllib.urlencode(params)
|
||||||
logger.info(u"Parsing results from "+searchURL)
|
logger.debug(u'Parsing results from <a href="%s">%s</a>' % (searchURL, provider))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = urllib2.urlopen(searchURL, timeout=20).read()
|
data = urllib2.urlopen(searchURL, timeout=20).read()
|
||||||
@@ -293,7 +293,7 @@ def searchNZB(albumid=None, new=False):
|
|||||||
searchURL = providerurl + "search/?%s" % urllib.urlencode(params)
|
searchURL = providerurl + "search/?%s" % urllib.urlencode(params)
|
||||||
data = getNewzbinURL(searchURL)
|
data = getNewzbinURL(searchURL)
|
||||||
if data:
|
if data:
|
||||||
logger.info(u"Parsing results from "+searchURL)
|
logger.debug(u'Parsing results from <a href="%s">%s</a>' % (searchURL, providerurl))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
d = minidom.parseString(data)
|
d = minidom.parseString(data)
|
||||||
@@ -440,7 +440,7 @@ def searchNZB(albumid=None, new=False):
|
|||||||
linkparams["nzbname"] = nzb_folder_name
|
linkparams["nzbname"] = nzb_folder_name
|
||||||
|
|
||||||
saburl = 'http://' + headphones.SAB_HOST + '/sabnzbd/api?' + urllib.urlencode(linkparams)
|
saburl = 'http://' + headphones.SAB_HOST + '/sabnzbd/api?' + urllib.urlencode(linkparams)
|
||||||
logger.info(u"Sending link to SABNZBD: " + saburl)
|
logger.debug(u"Sending link to SABNZBD: " + saburl)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
urllib.urlopen(saburl)
|
urllib.urlopen(saburl)
|
||||||
|
|||||||
@@ -15,10 +15,4 @@ def dbUpdate():
|
|||||||
artistid = artist[0]
|
artistid = artist[0]
|
||||||
importer.addArtisttoDB(artistid)
|
importer.addArtisttoDB(artistid)
|
||||||
|
|
||||||
logger.info('Update complete')
|
logger.info('Update complete')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+14
-7
@@ -206,8 +206,8 @@ class WebInterface(object):
|
|||||||
|
|
||||||
def upcoming(self):
|
def upcoming(self):
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
upcoming = myDB.select("SELECT AlbumTitle, ReleaseDate, DateAdded, AlbumASIN, AlbumID, ArtistName, ArtistID from albums WHERE ReleaseDate > date('now') order by ReleaseDate DESC")
|
upcoming = myDB.select("SELECT * from albums WHERE ReleaseDate > date('now') order by ReleaseDate DESC")
|
||||||
wanted = myDB.select("SELECT AlbumTitle, ReleaseDate, DateAdded, AlbumASIN, AlbumID, ArtistName, ArtistID from albums WHERE Status='Wanted'")
|
wanted = myDB.select("SELECT * from albums WHERE Status='Wanted'")
|
||||||
return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, wanted=wanted)
|
return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, wanted=wanted)
|
||||||
upcoming.exposed = True
|
upcoming.exposed = True
|
||||||
|
|
||||||
@@ -287,9 +287,13 @@ class WebInterface(object):
|
|||||||
logs.exposed = True
|
logs.exposed = True
|
||||||
|
|
||||||
def clearhistory(self, type=None):
|
def clearhistory(self, type=None):
|
||||||
logger.info(u"Clearing history where status is %s" % type)
|
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
myDB.action('DELETE from snatched WHERE Status=?', [type])
|
if type == 'all':
|
||||||
|
logger.info(u"Clearing all history")
|
||||||
|
myDB.action('DELETE from snatched')
|
||||||
|
else:
|
||||||
|
logger.info(u"Clearing history where status is %s" % type)
|
||||||
|
myDB.action('DELETE from snatched WHERE Status=?', [type])
|
||||||
raise cherrypy.HTTPRedirect("history")
|
raise cherrypy.HTTPRedirect("history")
|
||||||
clearhistory.exposed = True
|
clearhistory.exposed = True
|
||||||
|
|
||||||
@@ -396,7 +400,8 @@ class WebInterface(object):
|
|||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
logger.info(u"Headphones is shutting down...")
|
logger.info(u"Headphones is shutting down...")
|
||||||
threading.Timer(2, headphones.shutdown).start()
|
threading.Timer(2, headphones.shutdown).start()
|
||||||
return serve_template(templatename="shutdown.html", title="Shutting Down")
|
message = 'Shutting Down'
|
||||||
|
return serve_template(templatename="shutdown.html", title="Shutting Down", message=message)
|
||||||
return page
|
return page
|
||||||
|
|
||||||
shutdown.exposed = True
|
shutdown.exposed = True
|
||||||
@@ -404,13 +409,15 @@ class WebInterface(object):
|
|||||||
def restart(self):
|
def restart(self):
|
||||||
logger.info(u"Headphones is restarting...")
|
logger.info(u"Headphones is restarting...")
|
||||||
threading.Timer(2, headphones.shutdown, [True]).start()
|
threading.Timer(2, headphones.shutdown, [True]).start()
|
||||||
return serve_template(templatename="restart.html", title="Restarting")
|
message = 'Restarting'
|
||||||
|
return serve_template(templatename="shutdown.html", title="Restarting", message=message)
|
||||||
restart.exposed = True
|
restart.exposed = True
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
logger.info('Headphones is updating...')
|
logger.info('Headphones is updating...')
|
||||||
threading.Timer(2, headphones.shutdown, [True, True]).start()
|
threading.Timer(2, headphones.shutdown, [True, True]).start()
|
||||||
return serve_template(templatename="update.html", title="Updating")
|
message = 'Updating'
|
||||||
|
return serve_template(templatename="shutdown.html", title="Updating", message=message)
|
||||||
return page
|
return page
|
||||||
|
|
||||||
update.exposed = True
|
update.exposed = True
|
||||||
|
|||||||
Reference in New Issue
Block a user