mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-21 20:29:27 +00: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"/>
|
||||
<form action="configUpdate" method="post">
|
||||
<div class="table_wrapper">
|
||||
|
||||
<table class="configtable" summary="Web Interface">
|
||||
<tr>
|
||||
<td>
|
||||
<p> HTTP Host: <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>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>HTTP Username: <br />
|
||||
<input type="text" name="http_username" value="${config['http_user']}" size="30" maxlength="40">
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>HTTP Port: <br />
|
||||
<input type="text" name="http_port" value="${config['http_port']}" size="20" maxlength="40">
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>HTTP Password: <br />
|
||||
<input type="password" name="http_password" value="${config['http_pass']}" size="30" maxlength="40">
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Launch Browser on Startup:<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']} /></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1>Web Interface</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<p> HTTP Host: <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>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>HTTP Username: <br />
|
||||
<input type="text" name="http_username" value="${config['http_user']}" size="30" maxlength="40">
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>HTTP Port: <br />
|
||||
<input type="text" name="http_port" value="${config['http_port']}" size="20" maxlength="40">
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>HTTP Password: <br />
|
||||
<input type="password" name="http_password" value="${config['http_pass']}" size="30" maxlength="40">
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Launch Browser on Startup:<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']} /></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="table_wrapper">
|
||||
<a name="download">
|
||||
<h1>
|
||||
<u>Download Settings</u>
|
||||
</h1>
|
||||
</a>
|
||||
<h1>Download Settings</h1>
|
||||
<table class="configtable" summary="Download Settings">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
%>
|
||||
%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'
|
||||
else:
|
||||
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 name="body()">
|
||||
Headphones is shutting down
|
||||
<div class="table_wrapper">
|
||||
Headphones is ${message}
|
||||
</div>
|
||||
</%def>
|
||||
@@ -2,9 +2,28 @@
|
||||
<%def name="body()">
|
||||
<div class="table_wrapper">
|
||||
<h1>Upcoming Albums</h1>
|
||||
%for album in wanted:
|
||||
|
||||
%endfor
|
||||
<table class="display" id="upcoming_table">
|
||||
<thead>
|
||||
<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 class="table_wrapper">
|
||||
@@ -12,3 +31,22 @@
|
||||
|
||||
</div>
|
||||
</%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)
|
||||
logger.info(u"Parsing results from "+searchURL)
|
||||
logger.debug(u'Parsing results from <a href="%s">NZBMatrix</a>' % searchURL)
|
||||
try:
|
||||
data = urllib2.urlopen(searchURL, timeout=20).read()
|
||||
except urllib2.URLError, e:
|
||||
@@ -161,7 +161,7 @@ def searchNZB(albumid=None, new=False):
|
||||
|
||||
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:
|
||||
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)
|
||||
logger.info(u"Parsing results from "+searchURL)
|
||||
logger.debug(u'Parsing results from <a href="%s">%s</a>' % (searchURL, provider))
|
||||
|
||||
try:
|
||||
data = urllib2.urlopen(searchURL, timeout=20).read()
|
||||
@@ -293,7 +293,7 @@ def searchNZB(albumid=None, new=False):
|
||||
searchURL = providerurl + "search/?%s" % urllib.urlencode(params)
|
||||
data = getNewzbinURL(searchURL)
|
||||
if data:
|
||||
logger.info(u"Parsing results from "+searchURL)
|
||||
logger.debug(u'Parsing results from <a href="%s">%s</a>' % (searchURL, providerurl))
|
||||
|
||||
try:
|
||||
d = minidom.parseString(data)
|
||||
@@ -440,7 +440,7 @@ def searchNZB(albumid=None, new=False):
|
||||
linkparams["nzbname"] = nzb_folder_name
|
||||
|
||||
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:
|
||||
urllib.urlopen(saburl)
|
||||
|
||||
@@ -15,10 +15,4 @@ def dbUpdate():
|
||||
artistid = artist[0]
|
||||
importer.addArtisttoDB(artistid)
|
||||
|
||||
logger.info('Update complete')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
logger.info('Update complete')
|
||||
@@ -206,8 +206,8 @@ class WebInterface(object):
|
||||
|
||||
def upcoming(self):
|
||||
myDB = db.DBConnection()
|
||||
upcoming = myDB.select("SELECT AlbumTitle, ReleaseDate, DateAdded, AlbumASIN, AlbumID, ArtistName, ArtistID 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'")
|
||||
upcoming = myDB.select("SELECT * from albums WHERE ReleaseDate > date('now') order by ReleaseDate DESC")
|
||||
wanted = myDB.select("SELECT * from albums WHERE Status='Wanted'")
|
||||
return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, wanted=wanted)
|
||||
upcoming.exposed = True
|
||||
|
||||
@@ -287,9 +287,13 @@ class WebInterface(object):
|
||||
logs.exposed = True
|
||||
|
||||
def clearhistory(self, type=None):
|
||||
logger.info(u"Clearing history where status is %s" % type)
|
||||
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")
|
||||
clearhistory.exposed = True
|
||||
|
||||
@@ -396,7 +400,8 @@ class WebInterface(object):
|
||||
def shutdown(self):
|
||||
logger.info(u"Headphones is shutting down...")
|
||||
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
|
||||
|
||||
shutdown.exposed = True
|
||||
@@ -404,13 +409,15 @@ class WebInterface(object):
|
||||
def restart(self):
|
||||
logger.info(u"Headphones is restarting...")
|
||||
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
|
||||
|
||||
def update(self):
|
||||
logger.info('Headphones is updating...')
|
||||
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
|
||||
|
||||
update.exposed = True
|
||||
|
||||
Reference in New Issue
Block a user