Merge branch 'feature/AddFailBubbleLinks' into develop

This commit is contained in:
JackDandy 2018-06-01 16:57:54 +01:00
commit 5565a2bfae
8 changed files with 118 additions and 82 deletions

View file

@ -1,6 +1,7 @@
### 0.17.0 (2018-xx-xx xx:xx:xx UTC)
* Add TVDB, TheXem, and GitHub buttons to page History/Layout "Provider fails" that fetches a site Up/Down report
* Add bubble links to History/Provider fails when more than one provider has failures
* Add "Keep up to x most recent downloads" to Edit Show/Other
* Add "Keep up to x most recent downloads" to Manage/Bulk Change/Edit
* Change append number of downloads to keep to the number of file(s) at Display Show

View file

@ -70,10 +70,12 @@ pre .prelight-num{
border-color:#222
}
.component-group.bubblelist a,
.ui-widget-content a{
color:#2d8fbf
}
.component-group.bubblelist a:hover,
.ui-widget-content a:hover{
color:#09a2ff
}
@ -990,7 +992,7 @@ fieldset[disabled] .navbar-default .btn-link:focus{
color:#ddd
}
.component-group.typelist .bgcol,
.component-group.bubblelist .bgcol,
.dropdown-menu{
background-color:#333;
border:1px solid rgba(0, 0, 0, 0.15);

View file

@ -65,10 +65,12 @@ pre .prelight-num{
border-color:#fff
}
.component-group.bubblelist a,
.ui-widget-content a{
color:rgb(42, 100, 150)
}
.component-group.bubblelist a:hover,
.ui-widget-content a:hover{
color:#09a2ff
}
@ -963,7 +965,7 @@ fieldset[disabled] .navbar-default .btn-link:focus{
background-color:#333
}
.component-group.typelist .bgcol,
.component-group.bubblelist .bgcol,
.dropdown-menu{
background-color:#f5f1e4;
border:1px solid rgba(0, 0, 0, 0.15);

View file

@ -236,6 +236,7 @@ inc_top.tmpl
border:1px solid
}
.component-group.bubblelist a,
.ui-widget-content a{
text-decoration:none
}
@ -3802,6 +3803,18 @@ fieldset[disabled] .navbar-default .btn-link:focus{
color:#ccc
}
.component-group.bubble.last{padding:0;margin:0;border-bottom:none}
.component-group.bubblelist{min-height:30px}
.component-group.bubblelist .type{padding:6px}
.component-group.bubblelist .item{display:inline-block}
.component-group.bubblelist .item img{margin-right:4px}
.component-group.bubblelist .item.text{font-size:12px; padding-right:3px}
.component-group.bubblelist .item a{font-size:16px;padding-right:20px}
.component-group.bubblelist .item.text,
.component-group.bubblelist .item a{line-height:16px;vertical-align:middle}
.component-group.bubblelist .item a img{vertical-align:bottom;opacity:0.65;filter:alpha(opacity=65)}
.component-group.bubblelist .item a:hover img{opacity:1;filter:alpha(opacity=1)}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus{
color:#262626;
text-decoration:none;

View file

@ -23,17 +23,6 @@
<h1 class="title">$title</h1>
#end if
<style>
.component-group.typelist{min-height:30px}
.component-group.typelist .type{padding:6px}
.component-group.typelist .item{display:inline-block}
.component-group.typelist .item img{margin-right:4px}
.component-group.typelist .item.text{font-size:12px; padding-right:3px}
.component-group.typelist .item a{font-size:16px;padding-right:20px}
.component-group.typelist .item.text,
.component-group.typelist .item a{line-height:16px;vertical-align:middle}
</style>
<img src="$sbRoot/images/loading16#echo ('', '-dark')['dark' == $sickbeard.THEME_NAME]#.gif" height="16" width="16" style="display:none">
<div id="config">
<div id="config-content">
@ -52,17 +41,17 @@
<div id="tabs-1">
<div class="component-group typelist">
<div class="component-group bubblelist">
<div class="type bgcol">
<span class="list"><div class="item text">Bubble links:</div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/emby.png"><a href="#emby" rel="noreferrer">Emby</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/kodi.png"><a href="#kodi" rel="noreferrer">Kodi</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/plex.png"><a href="#plex" rel="noreferrer">Plex</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/nmj.png"><a href="#nmj" rel="noreferrer">NMJ</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/nmj.png"><a href="#nmjv2" rel="noreferrer">NMJv2</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/synoindex.png"><a href="#synoindexer" rel="noreferrer">Syno Indexer</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/synologynotifier.png"><a href="#synonotifier" rel="noreferrer">Syno Notifier</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/pytivo.png"><a href="#pytivo" rel="noreferrer">pyTivo</a></div>
<div class="item"><a href="#emby" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/emby.png">Emby</a></div>
<div class="item"><a href="#kodi" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/kodi.png">Kodi</a></div>
<div class="item"><a href="#plex" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/plex.png">Plex</a></div>
<div class="item"><a href="#nmj" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/nmj.png">NMJ</a></div>
<div class="item"><a href="#nmjv2" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/nmj.png">NMJv2</a></div>
<div class="item"><a href="#synoindexer" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/synoindex.png">Syno Indexer</a></div>
<div class="item"><a href="#synonotifier" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/synologynotifier.png">Syno Notifier</a></div>
<div class="item"><a href="#pytivo" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/pytivo.png">pyTivo</a></div>
</span>
</div>
</div>
@ -841,18 +830,18 @@
<div id="tabs-2">
<div class="component-group typelist">
<div class="component-group bubblelist">
<div class="type bgcol">
<span class="list"><div class="item text">Bubble links:</div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/boxcar2.png"><a href="#boxcar2" rel="noreferrer">Boxcar2</a></div>
<div class="item"><a href="#boxcar2" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/boxcar2.png">Boxcar2</a></div>
#if 'PUSHALOT' in NotifierFactory().notifiers
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/pushalot.png"><a href="#pushalot" rel="noreferrer">Pushalot</a></div>
<div class="item"><a href="#pushalot" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/pushalot.png">Pushalot</a></div>
#end if
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/pushbullet.png"><a href="#pushbullet" rel="noreferrer">Pushbullet</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/pushover.png"><a href="#pushover" rel="noreferrer">Pushover</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/growl.png"><a href="#growl" rel="noreferrer">Growl</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/prowl.png"><a href="#prowl" rel="noreferrer">Prowl</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/libnotify.png"><a href="#libnotify" rel="noreferrer">Libnotify</a></div>
<div class="item"><a href="#pushbullet" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/pushbullet.png">Pushbullet</a></div>
<div class="item"><a href="#pushover" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/pushover.png">Pushover</a></div>
<div class="item"><a href="#growl" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/growl.png">Growl</a></div>
<div class="item"><a href="#prowl" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/prowl.png">Prowl</a></div>
<div class="item"><a href="#libnotify" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/libnotify.png">Libnotify</a></div>
</span>
</div>
</div>
@ -1437,15 +1426,15 @@
<div id="tabs-3">
<div class="component-group typelist">
<div class="component-group bubblelist">
<div class="type bgcol">
<span class="list"><div class="item text">Bubble links:</div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/trakt.png"><a href="#trakt" rel="noreferrer">Trakt</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/slack.png"><a href="#slack" rel="noreferrer">Slack</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/discordapp.png"><a href="#discordapp" rel="noreferrer">Discordapp</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/gitter.png"><a href="#gitter" rel="noreferrer">Gitter</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/twitter.png"><a href="#twitter" rel="noreferrer">Twitter</a></div>
<div class="item"><img height="16px" src="$sbRoot/images/notifiers/email.png"><a href="#email" rel="noreferrer">Email</a></div>
<div class="item"><a href="#trakt" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/trakt.png">Trakt</a></div>
<div class="item"><a href="#slack" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/slack.png">Slack</a></div>
<div class="item"><a href="#discordapp" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/discordapp.png">Discordapp</a></div>
<div class="item"><a href="#gitter" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/gitter.png">Gitter</a></div>
<div class="item"><a href="#twitter" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/twitter.png">Twitter</a></div>
<div class="item"><a href="#email" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/email.png">Email</a></div>
</span>
</div>
</div>

View file

@ -589,57 +589,80 @@
##
##
<div id="provider-failures">
<div style="padding-bottom:10px">
#for ($check, $check_name, $check_url) in [
('tvdb', 'TVDB Api', 'api.thetvdb.com'), ('thexem', 'The Xem', 'thexem.de'), ('github', 'GitHub', 'github.com'),
]
<div id="check-$check" data-check="check_$check" class="check-site" style="margin-bottom:10px">
<input type="button" class="btn" value="Check $check_name">
<span style="line-height:26px">Test if site is up<span class="result"></span>
<a class="addQTip" style="margin-left:2px;display:none" href="$sickbeard.helpers.anon_url('http://www.isitdownrightnow.com/downorjustme.php?url=' + $check_url)" rel="noreferrer" onclick="window.open(this.href, '_blank'); return !1;" title="View full report for $check_name in new tab"><img alt="[IsItDown]" height="16" width="16" src="$sbRoot/images/iidrn.png" /></a>
</span>
</div>
<div id="check-$check" data-check="check_$check" class="check-site" style="margin-bottom:10px">
<input type="button" class="btn" value="Check $check_name">
<span style="line-height:26px">Test if site is up<span class="result"></span>
<a class="addQTip" style="margin-left:2px;display:none" href="$sickbeard.helpers.anon_url('http://www.isitdownrightnow.com/downorjustme.php?url=' + $check_url)" rel="noreferrer" onclick="window.open(this.href, '_blank'); return !1;" title="View full report for $check_name in new tab"><img alt="[IsItDown]" height="16" width="16" src="$sbRoot/images/iidrn.png" /></a>
</span>
</div>
#end for
</div>
#if not $provider_fails
<p>No current provider failures. Failure stats display here when appropriate.</p>
#else
<p>When a provider cannot be contacted over a period, SickGear backs off and waits an increasing interval between each retry</p>
#for $prov in $provider_fail_stats
<style>
.component-group{min-height:50px}
.component-group.bubblelist{padding:0;border-bottom:none}
.component-group.bubblelist .item a{font-size:14px;padding-right:14px}
</style>
#set dev = (1, 3)[False]
#if 1 < len([$prov for $prov in $provider_fail_stats * $dev if len($prov['fails'])])
<div class="component-group bubblelist" style="margin:0 0 3px">
<div class="type bgcol">
<span class="list"><div class="item text">Bubble links:</div>
#for $n, $prov in enumerate($provider_fail_stats * $dev)
#if $len($prov['fails'])
<div class="item"><a href="#$prov['prov_id']-section-$n" rel="noreferrer"><img height="16px" src="$sbRoot/images/providers/$prov['prov_img']">$prov['name']</a></div>
#end if
#end for
</span>
</div>
</div>
#end if
<p id="bubble-after">When a provider cannot be contacted over a period, SickGear backs off and waits an increasing interval between each retry</p>
#for $n, $prov in enumerate($provider_fail_stats * $dev)
#if $len($prov['fails'])
<!-- $prov['name'] -->
<div>
<div class="component-group bubble#if $n + 1 == $len($provider_fail_stats * $dev)# last#end if#">
<div name="$prov['prov_id']-section-$n" style="text-align:left">
#set $prov_class = '<span %sstyle="vertical-align:middle">'
#if not $prov['active']
#set $prov_class = $prov_class % 'class="grey-text" '
#else
#set $prov_class = $prov_class % ''
#end if
<input type="button" class="shows-more btn" value="Expand" style="display:none"><input type="button" class="shows-less btn" value="Collapse"><img src="$sbRoot/images/providers/$prov['prov_img']" width="16" height="16" style="margin:0 6px 0 3px">$prov_class$prov['name']
<input type="button" class="shows-more btn" value="Expand" style="display:none"><input type="button" class="shows-less btn" value="Collapse"><img src="$sbRoot/images/providers/$prov['prov_img']" width="16" height="16" style="margin:0 6px 0 3px">$prov_class$prov['name']
#if $prov['active']
#if $prov['next_try']
#set nt = $str($prov['next_try']).split('.', 2)[0][::-1].replace(':', ' m', 1).replace(':', ' h', 1)[::-1]
... is paused until $sbdatetime.sbdatetime.sbftime($sbdatetime.sbdatetime.now() + $prov['next_try'], markup=True) (in ${nt}s) <input type="button" class="provider-retry btn" id="$prov['prov_id']-btn-retry" value="Ignore pause on next search">
... is paused until $sbdatetime.sbdatetime.sbftime($sbdatetime.sbdatetime.now() + $prov['next_try'], markup=True) (in ${nt}s) <input type="button" class="provider-retry btn" id="$prov['prov_id']-btn-retry" value="Ignore pause on next search">
#end if
#else
... is not enabled
... is not enabled
#end if
</span>
</div>
<table class="manageTable provider-failures tablesorter hover-highlight focus-highlight text-center" cellspacing="0" border="0" cellpadding="0">
<thead>
<tr>
<th class="text-center" style="width:13em;padding-right:20px">period of 1hr</th>
<th class="text-center" style="padding-right:20px">server/timeout</th>
<th class="text-center" style="padding-right:20px">network</th>
<th class="text-center" style="padding-right:20px">no data</th>
<th class="text-center" style="padding-right:20px">other</th>
</span>
</div>
<table class="manageTable provider-failures tablesorter hover-highlight focus-highlight text-center" cellspacing="0" border="0" cellpadding="0">
<thead>
<tr>
<th class="text-center" style="width:13em;padding-right:20px">period of 1hr</th>
<th class="text-center" style="padding-right:20px">server/timeout</th>
<th class="text-center" style="padding-right:20px">network</th>
<th class="text-center" style="padding-right:20px">no data</th>
<th class="text-center" style="padding-right:20px">other</th>
#if $prov['has_limit']
<th class="text-center" style="padding-right:20px">hit limit</th>
#end if
</tr>
</thead>
<tbody>
</tr>
</thead>
<tbody>
#set $day = []
#for $fail in $prov['fails']
#set $child = True
@ -648,33 +671,33 @@
#set $child = False
#end if
#slurp#
<tr#if $fail['multirow'] and $child# class="tablesorter-childRow"#end if#>
<tr#if $fail['multirow'] and $child# class="tablesorter-childRow"#end if#>
#if $fail['multirow']
#if not $child
<td><a href="#" class="provider-fail-parent-toggle" title="Totals (expand for detail)">$sbdatetime.sbdatetime.sbfdate($fail['date_time'])</a></td>
<td><a href="#" class="provider-fail-parent-toggle" title="Totals (expand for detail)">$sbdatetime.sbdatetime.sbfdate($fail['date_time'])</a></td>
#else
<td>$sbdatetime.sbdatetime.sbftime($fail['date_time'], markup=True)</td>
<td>$sbdatetime.sbdatetime.sbftime($fail['date_time'], markup=True)</td>
#end if
#else
<td>$sbdatetime.sbdatetime.sbfdatetime($fail['date_time'], markup=True)</td>
<td>$sbdatetime.sbdatetime.sbfdatetime($fail['date_time'], markup=True)</td>
#end if
#set $blank = '-'
#set $title=None
#if $fail['http']['count']
#set $title=$fail['http']['code']
#end if
<td>#if $fail['http']['count']#<span title="#if $child or not $fail['multirow']#$title#else#Expand for fail codes#end if#">$fail['http']['count']</span>#else#$blank#end if# / #echo $fail['timeout'].get('count', 0) or $blank#</td>
<td>#echo ($fail['connection'].get('count', 0) + $fail['connection_timeout'].get('count', 0)) or $blank#</td>
<td>#echo $fail['nodata'].get('count', 0) or $blank#</td>
<td>#echo $fail['other'].get('count', 0) or $blank#</td>
<td>#if $fail['http']['count']#<span title="#if $child or not $fail['multirow']#$title#else#Expand for fail codes#end if#">$fail['http']['count']</span>#else#$blank#end if# / #echo $fail['timeout'].get('count', 0) or $blank#</td>
<td>#echo ($fail['connection'].get('count', 0) + $fail['connection_timeout'].get('count', 0)) or $blank#</td>
<td>#echo $fail['nodata'].get('count', 0) or $blank#</td>
<td>#echo $fail['other'].get('count', 0) or $blank#</td>
#if $prov['has_limit']
<td>#echo $fail.get('limit', {}).get('count', 0) or $blank#</td>
<td>#echo $fail.get('limit', {}).get('count', 0) or $blank#</td>
#end if
</tr>
</tr>
#end for
</tbody>
</table>
<!-- /$prov['name'] -->
</tbody>
</table>
</div><!-- /$prov['name'] -->
#end if
#end for
#end if

View file

@ -5,13 +5,6 @@
$(document).ready(function(){
var loading = '<img src="' + sbRoot + '/images/loading16' + themeSpinner + '.gif" height="16" width="16" />';
$('.typelist').on('click', '.list .item a', function(){
$(this).closest('.component-group').after(
$('[name=' + $(this).attr('href').replace('#','') + ']').closest('.component-group')
);
return !1;
});
$('#test-growl').click(function () {
var growlHost = $.trim($('#growl-host').val());
var growlPassword = $.trim($('#growl-password').val());

View file

@ -42,4 +42,17 @@ $(document).ready(function(){
$('#NAV' + topmenu).addClass('active');
$('.dropdown-toggle').dropdownHover();
(/undefined/i.test(document.createElement('input').placeholder)) && $('body').addClass('no-placeholders');
$('.bubblelist').on('click', '.list .item a', function(){
var bubbleAfter$ = $('#bubble-after'),
lastBubble$ = $('.bubble.last'), toBubble = $(this).attr('href').replace('#', ''),
doLast = (lastBubble$.length && toBubble === lastBubble$.find('div[name*="section"]').attr('name'));
doLast && lastBubble$.removeClass('last');
(bubbleAfter$.length && bubbleAfter$ || $(this).closest('.component-group')).after(
$('[name=' + $(this).attr('href').replace('#','') + ']').closest('.component-group')
);
doLast && $('.bubble').last().addClass('last');
return !1;
});
});