mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Add hidden cache debug page
This commit is contained in:
parent
8ec41d752f
commit
55458e549b
5 changed files with 129 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
* Add Kodi notifier and metadata
|
||||
* Add priority, device, and sound support to Pushover notifier (port from midgetspy/sickbeard)
|
||||
* Fix updating of pull requests
|
||||
* Add hidden cache debug page
|
||||
|
||||
[develop changelog]
|
||||
* Fix traceback error when using the menu item Manage/Update Kodi
|
||||
|
|
|
@ -1781,6 +1781,31 @@ h2.day, h2.network {
|
|||
top:0;
|
||||
}
|
||||
|
||||
/* =======================================================================
|
||||
cache.tmpl
|
||||
========================================================================== */
|
||||
|
||||
#cacheTable {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th.col-name-cache,
|
||||
td.col-name-cache {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th.col-episodes,
|
||||
td.col-episodes {
|
||||
max-width: 250px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
th.col-cache,
|
||||
td.col-cache {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
|
||||
/* =======================================================================
|
||||
config*.tmpl
|
||||
========================================================================== */
|
||||
|
|
85
gui/slick/interfaces/default/cache.tmpl
Normal file
85
gui/slick/interfaces/default/cache.tmpl
Normal file
|
@ -0,0 +1,85 @@
|
|||
#import sickbeard
|
||||
#import os.path
|
||||
#set global $title='Cache'
|
||||
#set global $header='Cache'
|
||||
#set global $sbPath='..'
|
||||
#set global $topmenu='cache'#
|
||||
|
||||
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
|
||||
|
||||
<style type="text/css">
|
||||
.sort_data {display:none}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
\$(document).ready(function()
|
||||
{
|
||||
\$('#cacheTable:has(tbody tr)').tablesorter({
|
||||
widgets: ['zebra', 'filter'],
|
||||
sortList: [[0,1]],
|
||||
});
|
||||
|
||||
#raw
|
||||
$('.addQTip').each(function () {
|
||||
$(this).css({'cursor':'help', 'text-shadow':'0px 0px 0.5px #666'});
|
||||
$(this).qtip({
|
||||
show: {solo:true},
|
||||
position: {viewport:$(window), my:'right center', adjust:{ y: -10, x: -15 }},
|
||||
style: {classes:'qtip-rounded qtip-shadow'}
|
||||
});
|
||||
});
|
||||
#end raw
|
||||
});
|
||||
//-->
|
||||
</script>
|
||||
|
||||
#if $varExists('header')
|
||||
<h1 class="header">$header</h1>
|
||||
#else
|
||||
<h1 class="title">$title</h1>
|
||||
#end if
|
||||
|
||||
<table id="cacheTable" class="sickbeardTable tablesorter" cellspacing="1" border="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-cache">Provider</th>
|
||||
<th class="col-name-cache">Name</th>
|
||||
<th class="col-cache">Season</th>
|
||||
<th class="col-episodes">Episodes</th>
|
||||
<th class="col-cache">Indexer Id</th>
|
||||
<th class="col-cache">Url</th>
|
||||
<th class="col-cache">Time</th>
|
||||
<th class="col-cache">Quality</th>
|
||||
<th class="col-cache">Release Group</th>
|
||||
<th class="col-cache">Version</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="nowrap" colspan="10"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
#for $provider in $cacheResults:
|
||||
#for $hItem in $provider[1]:
|
||||
<tr>
|
||||
<td class="col-cache">$provider[0]</td>
|
||||
<td class="col-name-cache">$hItem['name']</td>
|
||||
<td class="col-cache">$hItem['season']</td>
|
||||
<td class="col-episodes">$hItem['episodes']</td>
|
||||
<td class="col-cache">$hItem['indexerid']</td>
|
||||
<td class="col-cache"><span title="$hItem['url']" class="addQTip"><img src="$sbRoot/images/info32.png" width="16" height="16" /></span></td>
|
||||
<td class="col-cache">$hItem['time']</td>
|
||||
<td class="col-cache">$hItem['quality']</td>
|
||||
<td class="col-cache">$hItem['release_group']</td>
|
||||
<td class="col-cache">$hItem['version']</td>
|
||||
</tr>
|
||||
#end for
|
||||
#end for
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#include $os.path.join($sickbeard.PROG_DIR,'gui/slick/interfaces/default/inc_bottom.tmpl')
|
|
@ -4627,4 +4627,21 @@ class ApiBuilder(MainHandler):
|
|||
else:
|
||||
t.apikey = 'api key not generated'
|
||||
|
||||
return t.respond()
|
||||
|
||||
|
||||
class Cache(MainHandler):
|
||||
def index(self):
|
||||
myDB = db.DBConnection('cache.db')
|
||||
results = []
|
||||
for provider in sickbeard.providers.sortedProviderList():
|
||||
try:
|
||||
sqlResults = myDB.select('SELECT * FROM %s' % provider.cache.providerID)
|
||||
except:
|
||||
continue
|
||||
results.append((provider.name, sqlResults))
|
||||
|
||||
t = PageTemplate(headers=self.request.headers, file='cache.tmpl')
|
||||
t.cacheResults = results
|
||||
|
||||
return t.respond()
|
|
@ -89,6 +89,7 @@ class WebServer(threading.Thread):
|
|||
self.app.add_handlers('.*$', [
|
||||
(r'%s/api/builder(/?)(.*)' % self.options['web_root'], webserve.ApiBuilder),
|
||||
(r'%s/api(/?.*)' % self.options['web_root'], webapi.Api),
|
||||
(r'%s/cache(/?.*)' % self.options['web_root'], webserve.Cache),
|
||||
(r'%s/config/general(/?.*)' % self.options['web_root'], webserve.ConfigGeneral),
|
||||
(r'%s/config/search(/?.*)' % self.options['web_root'], webserve.ConfigSearch),
|
||||
(r'%s/config/providers(/?.*)' % self.options['web_root'], webserve.ConfigProviders),
|
||||
|
|
Loading…
Reference in a new issue