mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Move refresh interval setting to homepage
This commit is contained in:
parent
084732706d
commit
749e1fcebe
4 changed files with 48 additions and 25 deletions
|
@ -294,10 +294,6 @@ object {
|
|||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.padded-header h3 small {
|
||||
font-size: 13px;
|
||||
text-transform: none;
|
||||
}
|
||||
.btn {
|
||||
outline:0px !important;
|
||||
}
|
||||
|
@ -2377,6 +2373,18 @@ a .library-user-instance-box:hover {
|
|||
margin-top: 9px;
|
||||
width: 175px;
|
||||
}
|
||||
.home-padded-header .info-bar {
|
||||
float: left;
|
||||
margin-left: 15px;
|
||||
line-height: 35px;
|
||||
}
|
||||
.home-padded-header .info-bar small {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
color: #777;
|
||||
}
|
||||
.home-padded-header .button-bar {
|
||||
float: left;
|
||||
}
|
||||
|
|
|
@ -10,8 +10,16 @@
|
|||
% if section == 'current_activity':
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="padded-header" id="current-activity-header">
|
||||
<h3><span id="sessions-shortcut">Activity</span>
|
||||
<div class="home-padded-header padded-header" id="current-activity-header">
|
||||
<h3 class="pull-left"><span id="sessions-shortcut">Current Activity</span></h3>
|
||||
<div class="button-bar">
|
||||
<div class="input-group pull-left" style="width: 1px; margin-right: 3px" id="activity-refresh-interval-selection">
|
||||
<span class="input-group-addon btn-dark inactive">Refresh every</span>
|
||||
<input type="number" class="form-control number-input" name="activity-refresh-interval" id="activity-refresh-interval" value="${config['home_refresh_interval']}" min="2" data-default="2" data-toggle="tooltip" title="Min: 2 seconds" />
|
||||
<span class="input-group-addon btn-dark inactive">seconds</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-bar">
|
||||
<small>
|
||||
<span id="currentActivityHeader" style="display: none;">
|
||||
Streams: <span id="currentActivityHeader-streams"></span> |
|
||||
|
@ -19,7 +27,7 @@
|
|||
<span id="currentActivityHeader-bandwidth-tooltip" data-toggle="tooltip" title="Streaming Brain Estimate (Required Bandwidth)"><i class="fa fa-info-circle"></i></span>
|
||||
</span>
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div id="currentActivity">
|
||||
<% from plexpy import PLEX_SERVER_UP %>
|
||||
|
@ -585,11 +593,16 @@
|
|||
}
|
||||
|
||||
getCurrentActivity();
|
||||
setInterval(function () {
|
||||
if (!(create_instances.length) && activity_ready) {
|
||||
getCurrentActivity();
|
||||
}
|
||||
}, ${config['home_refresh_interval'] * 1000});
|
||||
|
||||
function refreshActivity(seconds) {
|
||||
return setInterval(function () {
|
||||
if (!(create_instances.length) && activity_ready) {
|
||||
getCurrentActivity();
|
||||
}
|
||||
}, seconds * 1000);
|
||||
}
|
||||
var refresh_interval = $('#activity-refresh-interval').val();
|
||||
var activityRefresh = refreshActivity(refresh_interval);
|
||||
|
||||
setInterval(function(){
|
||||
$('.progress_time_offset').each(function () {
|
||||
|
@ -685,6 +698,16 @@
|
|||
window.open(sessions_url, '_blank');
|
||||
});
|
||||
});
|
||||
|
||||
$('#activity-refresh-interval').change(function () {
|
||||
forceMinMax($(this));
|
||||
clearInterval(activityRefresh);
|
||||
refresh_interval = $(this).val();
|
||||
activityRefresh = refreshActivity(refresh_interval);
|
||||
$.post('set_home_stats_config', { refresh_interval: refresh_interval });
|
||||
});
|
||||
|
||||
$('#activity-refresh-interval').tooltip({ container: 'body', placement: 'top', html: true });
|
||||
% endif
|
||||
</script>
|
||||
% endif
|
||||
|
|
|
@ -271,17 +271,6 @@
|
|||
<h3>Activity</h3>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="home_refresh_interval">Activty Refresh Interval</label>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<input type="text" class="form-control" data-parsley-type="integer" id="home_refresh_interval" name="home_refresh_interval" value="${config['home_refresh_interval']}" size="5" data-parsley-min="2" data-parsley-trigger="change" data-parsley-errors-container="#home_refresh_interval_error" required>
|
||||
</div>
|
||||
<div id="home_refresh_interval_error" class="alert alert-danger settings-alert" role="alert"></div>
|
||||
</div>
|
||||
<p class="help-block">Set the interval (in seconds) to refresh the current activity on the homepage. Minimum 2.</p>
|
||||
</div>
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Sections</h3>
|
||||
</div>
|
||||
|
|
|
@ -286,7 +286,11 @@ class WebInterface(object):
|
|||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
def set_home_stats_config(self, time_range=None, stats_type=None, stats_count=None, recently_added_count=None, **kwargs):
|
||||
def set_home_stats_config(self, refresh_interval=None, time_range=None, stats_type=None, stats_count=None,
|
||||
recently_added_count=None, **kwargs):
|
||||
if refresh_interval:
|
||||
plexpy.CONFIG.__setattr__('HOME_REFRESH_INTERVAL', refresh_interval)
|
||||
plexpy.CONFIG.write()
|
||||
if time_range:
|
||||
plexpy.CONFIG.__setattr__('HOME_STATS_LENGTH', time_range)
|
||||
plexpy.CONFIG.write()
|
||||
|
@ -2643,7 +2647,6 @@ class WebInterface(object):
|
|||
"home_sections": json.dumps(plexpy.CONFIG.HOME_SECTIONS),
|
||||
"home_stats_cards": json.dumps(plexpy.CONFIG.HOME_STATS_CARDS),
|
||||
"home_library_cards": json.dumps(plexpy.CONFIG.HOME_LIBRARY_CARDS),
|
||||
"home_refresh_interval": plexpy.CONFIG.HOME_REFRESH_INTERVAL,
|
||||
"buffer_threshold": plexpy.CONFIG.BUFFER_THRESHOLD,
|
||||
"buffer_wait": plexpy.CONFIG.BUFFER_WAIT,
|
||||
"group_history_tables": checked(plexpy.CONFIG.GROUP_HISTORY_TABLES),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue