Highlight the weekends on daily graphs.

Random bug fixes and cleanups.
This commit is contained in:
Tim 2015-08-11 21:56:31 +02:00
parent c7af1c127c
commit de66480d5f
7 changed files with 30 additions and 7 deletions

View file

@ -46,8 +46,8 @@ DOCUMENTATION :: END
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div> <div>
<input type="button" id="save_user_name" class="btn btn-bright" value="Save">
<span id="edit-user-status-message"></span> <span id="edit-user-status-message"></span>
<input type="button" id="save_user_name" class="btn btn-bright" value="Save">
</div> </div>
</div> </div>
</div> </div>

View file

@ -276,6 +276,15 @@
var dateArray = []; var dateArray = [];
for (var i = 0; i < data.categories.length; i++) { for (var i = 0; i < data.categories.length; i++) {
dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf()); dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf());
// Highlight the weekend
if ((moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sat') ||
(moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sun')) {
hc_plays_by_day_options.xAxis.plotBands.push({
from: i,
to: i+1,
color: 'rgba(80,80,80,0.3)'
});
}
} }
hc_plays_by_day_options.yAxis.min = 0; hc_plays_by_day_options.yAxis.min = 0;
hc_plays_by_day_options.xAxis.categories = dateArray; hc_plays_by_day_options.xAxis.categories = dateArray;
@ -345,6 +354,15 @@
var dateArray = []; var dateArray = [];
for (var i = 0; i < data.categories.length; i++) { for (var i = 0; i < data.categories.length; i++) {
dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf()); dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf());
// Highlight the weekend
if ((moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sat') ||
(moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sun')) {
hc_plays_by_stream_type_options.xAxis.plotBands.push({
from: i,
to: i+1,
color: 'rgba(80,80,80,0.3)'
});
}
} }
hc_plays_by_stream_type_options.yAxis.min = 0; hc_plays_by_stream_type_options.yAxis.min = 0;
hc_plays_by_stream_type_options.xAxis.categories = dateArray; hc_plays_by_stream_type_options.xAxis.categories = dateArray;
@ -525,6 +543,9 @@
$('.yaxis-text').html('Play duration'); $('.yaxis-text').html('Play duration');
} }
hc_plays_by_day_options.xAxis.plotBands = [];
hc_plays_by_stream_type_options.xAxis.plotBands = [];
hc_plays_by_day_options.yAxis.labels.formatter = yaxis_format; hc_plays_by_day_options.yAxis.labels.formatter = yaxis_format;
hc_plays_by_dayofweek_options.yAxis.labels.formatter = yaxis_format; hc_plays_by_dayofweek_options.yAxis.labels.formatter = yaxis_format;
hc_plays_by_hourofday_options.yAxis.labels.formatter = yaxis_format; hc_plays_by_hourofday_options.yAxis.labels.formatter = yaxis_format;

View file

@ -200,7 +200,7 @@ DOCUMENTATION :: END
<div class='container-fluid'> <div class='container-fluid'>
<div class='row'> <div class='row'>
<div class='col-md-12'> <div class='col-md-12'>
<div class='table-card-back'> <div class='table-card-header'>
<div class="header-bar"> <div class="header-bar">
<span>Episode list for <strong>${data['title']}</strong></span> <span>Episode list for <strong>${data['title']}</strong></span>
</div> </div>

View file

@ -46,7 +46,8 @@ var hc_plays_by_day_options = {
color: '#aaa' color: '#aaa'
} }
}, },
categories: [{}] categories: [{}],
plotBands: []
}, },
yAxis: { yAxis: {
title: { title: {

View file

@ -46,7 +46,8 @@ var hc_plays_by_stream_type_options = {
color: '#aaa' color: '#aaa'
} }
}, },
categories: [{}] categories: [{}],
plotBands: []
}, },
yAxis: { yAxis: {
title: { title: {

View file

@ -175,7 +175,7 @@ from plexpy import version
<br/> <br/>
<p>Setup is now complete. For more configuration options please visit the Settings menu on the home page.</p> <p>Setup is now complete. For more configuration options please visit the Settings menu on the home page.</p>
<br/> <br/>
<i class="fa fa-refresh fa-spin"></i>&nbspJust configuring a few things, please wait... <i class="fa fa-refresh fa-spin"></i>&nbspWaiting 5 seconds to ensure authentication token is registered...
</div> </div>
</div> </div>

View file

@ -261,7 +261,7 @@ def initialize_scheduler():
minutes = 0 minutes = 0
schedule_job(versioncheck.checkGithub, 'Check GitHub for updates', hours=0, minutes=minutes) schedule_job(versioncheck.checkGithub, 'Check GitHub for updates', hours=0, minutes=minutes)
# Start checking for new sessions every minute # Start checking for new sessions at set interval
if CONFIG.MONITORING_INTERVAL: if CONFIG.MONITORING_INTERVAL:
# Our interval should never be less than 30 seconds # Our interval should never be less than 30 seconds
if CONFIG.MONITORING_INTERVAL > 30: if CONFIG.MONITORING_INTERVAL > 30:
@ -271,7 +271,7 @@ def initialize_scheduler():
else: else:
seconds = 0 seconds = 0
if CONFIG.PMS_IP: if CONFIG.PMS_IP and CONFIG.PMS_TOKEN:
schedule_job(plextv.get_real_pms_url, 'Refresh Plex Server URLs', hours=12, minutes=0, seconds=0) schedule_job(plextv.get_real_pms_url, 'Refresh Plex Server URLs', hours=12, minutes=0, seconds=0)
schedule_job(monitor.check_active_sessions, 'Check for active sessions', hours=0, minutes=0, seconds=seconds) schedule_job(monitor.check_active_sessions, 'Check for active sessions', hours=0, minutes=0, seconds=seconds)