mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Add setting to selectively hide watch statistic cards on homepage
This commit is contained in:
parent
6eec4d1ca6
commit
20056718db
5 changed files with 91 additions and 19 deletions
|
@ -33,6 +33,33 @@ select.input-sm {
|
|||
color: #999;
|
||||
outline: none;
|
||||
}
|
||||
select[multiple] {
|
||||
height: 125px;
|
||||
margin: 5px 0 5px 0;
|
||||
color: #fff;
|
||||
border: 0px solid #444;
|
||||
background: #555;
|
||||
padding: 2px 2px;
|
||||
background-color: #555;
|
||||
border-radius: 3px;
|
||||
transition: background-color .3s;
|
||||
}
|
||||
select[multiple]:focus {
|
||||
outline: 0;
|
||||
outline: thin dotted \9;
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
transition: background-color .3s;
|
||||
}
|
||||
select[multiple]:focus::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0,0,0,.15);
|
||||
}
|
||||
select[multiple] option {
|
||||
padding: 6px 10px;
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
img {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% if config['home_stats_cards'] > 'watch_statistics':
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="padded-header">
|
||||
|
@ -27,6 +28,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="padded-header" id="library-statistics-header">
|
||||
|
|
|
@ -34,14 +34,15 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
<div class="col-md-4">
|
||||
<ul class="nav-settings list-unstyled" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#tabs-1" aria-controls="tabs-1" role="tab" data-toggle="tab">General</a></li>
|
||||
<li role="presentation"><a href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Web Interface</a></li>
|
||||
<li role="presentation"><a href="#tabs-3" aria-controls="tabs-3" role="tab" data-toggle="tab">Access Control</a></li>
|
||||
<li role="presentation"><a href="#tabs-4" aria-controls="tabs-4" role="tab" data-toggle="tab">Plex Media Server</a></li>
|
||||
<li role="presentation"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Plex.tv Account</a></li>
|
||||
<li role="presentation"><a href="#tabs-6" aria-controls="tabs-6" role="tab" data-toggle="tab">Extra Settings</a></li>
|
||||
<li role="presentation"><a href="#tabs-7" aria-controls="tabs-7" role="tab" data-toggle="tab">Monitoring</a></li>
|
||||
<li role="presentation"><a href="#tabs-8" aria-controls="tabs-8" role="tab" data-toggle="tab">Notifications</a></li>
|
||||
<li role="presentation"><a href="#tabs-9" aria-controls="tabs-9" role="tab" data-toggle="tab">Notification Agents</a></li>
|
||||
<li role="presentation"><a href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Homepage Statistics</a></li>
|
||||
<li role="presentation"><a href="#tabs-3" aria-controls="tabs-3" role="tab" data-toggle="tab">Web Interface</a></li>
|
||||
<li role="presentation"><a href="#tabs-4" aria-controls="tabs-4" role="tab" data-toggle="tab">Access Control</a></li>
|
||||
<li role="presentation"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Plex Media Server</a></li>
|
||||
<li role="presentation"><a href="#tabs-6" aria-controls="tabs-6" role="tab" data-toggle="tab">Plex.tv Account</a></li>
|
||||
<li role="presentation"><a href="#tabs-7" aria-controls="tabs-7" role="tab" data-toggle="tab">Extra Settings</a></li>
|
||||
<li role="presentation"><a href="#tabs-8" aria-controls="tabs-8" role="tab" data-toggle="tab">Monitoring</a></li>
|
||||
<li role="presentation"><a href="#tabs-9" aria-controls="tabs-9" role="tab" data-toggle="tab">Notifications</a></li>
|
||||
<li role="presentation"><a href="#tabs-10" aria-controls="tabs-10" role="tab" data-toggle="tab">Notification Agents</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
|
@ -83,10 +84,33 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
</div>
|
||||
<p class="help-block">Set your preferred time format. <a href="javascript:void(0)" data-target="#dateTimeOptionsModal" data-toggle="modal">Click here</a> to see the parameter list.</p>
|
||||
</div>
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-2">
|
||||
<div class="padded-header">
|
||||
<h3>Homepage Statistics</h3>
|
||||
<h3>Watch Statistics</h3>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="home_stats_cards">Cards</label>
|
||||
<p class="help-block">Select the cards to show in the watch statistics on the home page.</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<select multiple class="form-control" id="home_stats_cards" name="home_stats_cards" data-parsley-trigger="change">
|
||||
<option id="card-watch_statistics" value="watch_statistics" class="hidden" selected>Watch Statistics</option>
|
||||
<option id="card-top_tv" value="top_tv">Most Watched TV</option>
|
||||
<option id="card-popular_tv" value="popular_tv">Most Popular TV</option>
|
||||
<option id="card-top_movies" value="top_movies">Most Watched Movie</option>
|
||||
<option id="card-popular_movies" value="popular_movies">Most Popular Movie</option>
|
||||
<option id="card-top_music" value="top_music">Most Listened Music</option>
|
||||
<option id="card-popular_music" value="popular_music">Most Popular Music</option>
|
||||
<option id="card-top_users" value="top_users">Most Active User</option>
|
||||
<option id="card-top_platforms" value="top_platforms">Most Active Platform</option>
|
||||
<option id="card-last_watched" value="last_watched">Last Watched</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="home_stats_length">Time Frame</label>
|
||||
<div class="row">
|
||||
|
@ -95,7 +119,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
</div>
|
||||
<div id="home_stats_length_error" class="alert alert-danger settings-alert" role="alert"></div>
|
||||
</div>
|
||||
<p class="help-block">Specify the number of days for the statistics on the home page. Default is 30 days.</p>
|
||||
<p class="help-block">Specify the number of days for the watch statistics on the home page. Default is 30 days.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="home_stats_count">Top Lists</label>
|
||||
|
@ -105,7 +129,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
</div>
|
||||
<div id="home_stats_count_error" class="alert alert-danger settings-alert" role="alert"></div>
|
||||
</div>
|
||||
<p class="help-block">Specify the number of items to show in the top lists for the statistics on the home page. Max is 10 items, default is 5 items, 0 to disable.</p>
|
||||
<p class="help-block">Specify the number of items to show in the top lists for the watch statistics on the home page. Max is 10 items, default is 5 items, 0 to disable.</p>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
|
@ -115,7 +139,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
</div>
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-2">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-3">
|
||||
<div class="padded-header">
|
||||
<h3>Web Interface</h3>
|
||||
</div>
|
||||
|
@ -164,7 +188,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-3">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-4">
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Authentication</h3>
|
||||
|
@ -216,7 +240,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-4">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-5">
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Plex Media Server</h3>
|
||||
|
@ -272,7 +296,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
<input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully">
|
||||
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-5">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-6">
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Plex.tv Authentication</h3>
|
||||
|
@ -315,7 +339,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-6">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-7">
|
||||
<div class="padded-header">
|
||||
<h3>Extra Settings</h3>
|
||||
</div>
|
||||
|
@ -334,7 +358,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-7">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-8">
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Monitoring Settings</h3>
|
||||
|
@ -416,7 +440,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-8">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-9">
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Global Notification Toggles</h3>
|
||||
|
@ -566,7 +590,7 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
|
||||
<p><input type="button" class="btn btn-bright save-button" value="Save" data-success="Changes saved successfully"></p>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-9">
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-10">
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Notification Agents</h3>
|
||||
|
@ -1178,6 +1202,19 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
var accordion = new Accordion($('#accordion'), false);
|
||||
|
||||
var cards = "${config['home_stats_cards']}".split(/[\s,]+/);
|
||||
cards.forEach(function (item) {
|
||||
$('#card-'+item).prop('selected', !$(this).prop('selected'));
|
||||
});
|
||||
$('#home_stats_cards').on('mousedown', function(e) {
|
||||
e.preventDefault();
|
||||
var scroll = this.scrollTop;
|
||||
e.target.selected = !e.target.selected;
|
||||
this.scrollTop = scroll;
|
||||
}).on('mousemove', function(e) {
|
||||
e.preventDefault()
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
|
|
@ -85,6 +85,7 @@ _CONFIG_DEFINITIONS = {
|
|||
'HOME_STATS_LENGTH': (int, 'General', 30),
|
||||
'HOME_STATS_TYPE': (int, 'General', 0),
|
||||
'HOME_STATS_COUNT': (int, 'General', 5),
|
||||
'HOME_STATS_CARDS': (str, 'General', 'top_tv, popular_tv, top_movies, popular_movies, top_music, popular_music, top_users, top_platforms, last_watched'),
|
||||
'HTTPS_CERT': (str, 'General', ''),
|
||||
'HTTPS_KEY': (str, 'General', ''),
|
||||
'HTTP_HOST': (str, 'General', '0.0.0.0'),
|
||||
|
|
|
@ -472,6 +472,7 @@ class WebInterface(object):
|
|||
"home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH,
|
||||
"home_stats_type": checked(plexpy.CONFIG.HOME_STATS_TYPE),
|
||||
"home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT,
|
||||
"home_stats_cards": plexpy.CONFIG.HOME_STATS_CARDS,
|
||||
"buffer_threshold": plexpy.CONFIG.BUFFER_THRESHOLD,
|
||||
"buffer_wait": plexpy.CONFIG.BUFFER_WAIT
|
||||
}
|
||||
|
@ -524,6 +525,10 @@ class WebInterface(object):
|
|||
if kwargs['pms_ip'] != plexpy.CONFIG.PMS_IP:
|
||||
refresh_users = True
|
||||
|
||||
if 'home_stats_cards' in kwargs:
|
||||
if kwargs['home_stats_cards'] != 'watch_statistics':
|
||||
kwargs['home_stats_cards'] = ', '.join(kwargs['home_stats_cards'])
|
||||
|
||||
plexpy.CONFIG.process_kwargs(kwargs)
|
||||
|
||||
# Write the config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue