mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
179 lines
5 KiB
HTML
179 lines
5 KiB
HTML
<%inherit file="base.html"/>
|
|
|
|
<%def name="headIncludes()">
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="padded-header" id="current-activity-header">
|
|
<h3>Activity</h3>
|
|
</div>
|
|
<div id="currentActivity">
|
|
<div class="text-muted"><i class="fa fa-refresh fa-spin"></i> Checking for activity...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% if config['home_stats_cards'] > 'watch_statistics':
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="padded-header">
|
|
<h3>Watch Statistics <small>Last ${config['home_stats_length']} days</small></h3>
|
|
</div>
|
|
<div id="home-stats" class="home-platforms">
|
|
<div class='text-muted'><i class="fa fa-refresh fa-spin"></i> Loading stats...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
% if config['home_library_cards'] > 'library_statistics':
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="padded-header" id="library-statistics-header">
|
|
<h3>Library Statistics</h3>
|
|
</div>
|
|
<div id="library-stats" class="library-platforms">
|
|
<div class='text-muted'><i class="fa fa-refresh fa-spin"></i> Loading stats...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
<div class='row'>
|
|
<div class="col-md-12">
|
|
<div class="padded-header">
|
|
<h3>Recently Added</h3>
|
|
</div>
|
|
<div id='recentlyAdded'>
|
|
<div class='text-muted'><i class="fa fa-refresh fa-spin"></i> Looking for new items...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="interfaces/default/js/moment-with-locale.js"></script>
|
|
<script>
|
|
|
|
function currentActivityHeader() {
|
|
$.ajax({
|
|
url: 'get_current_activity_header',
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#current-activity-header").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
currentActivityHeader();
|
|
setInterval(currentActivityHeader, 15000);
|
|
|
|
function currentActivity() {
|
|
$.ajax({
|
|
url: 'get_current_activity',
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#currentActivity").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
currentActivity();
|
|
setInterval(currentActivity, 15000);
|
|
|
|
function getHomeStats(days) {
|
|
$.ajax({
|
|
url: 'home_stats',
|
|
cache: false,
|
|
async: true,
|
|
data: { },
|
|
complete: function(xhr, status) {
|
|
$("#home-stats").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
|
|
function getLibraryStatsHeader() {
|
|
$.ajax({
|
|
"url": "get_servers_info",
|
|
type: "post",
|
|
cache: false,
|
|
async: true,
|
|
data: { },
|
|
complete: function (xhr, status) {
|
|
server_info = $.parseJSON(xhr.responseText);
|
|
var server_name = 'Server name not found';
|
|
for (var i in server_info) {
|
|
if (server_info[i].machine_identifier == '${config['pms_identifier']}') {
|
|
server_name = server_info[i].name
|
|
break;
|
|
}
|
|
}
|
|
$('#library-statistics-header h3').append(' <small>' + server_name + '</small>')
|
|
}
|
|
});
|
|
}
|
|
|
|
function getLibraryStats() {
|
|
$.ajax({
|
|
url: 'library_stats',
|
|
cache: false,
|
|
async: true,
|
|
data: { },
|
|
complete: function(xhr, status) {
|
|
$("#library-stats").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
|
|
function recentlyAdded() {
|
|
var widthVal = $('body').find(".container-fluid").width();
|
|
var tmp = (widthVal-20) / 182;
|
|
|
|
if (tmp > 0) {
|
|
containerSize = parseInt(tmp);
|
|
} else {
|
|
containerSize = 1;
|
|
}
|
|
|
|
$.ajax({
|
|
url: 'get_recently_added',
|
|
type: "GET",
|
|
async: true,
|
|
data: { count : containerSize },
|
|
complete: function(xhr, status) {
|
|
$("#recentlyAdded").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
$(document).ready(function () {
|
|
recentlyAdded();
|
|
$(window).resize(function() {
|
|
recentlyAdded();
|
|
});
|
|
});
|
|
|
|
var date_format = 'YYYY-MM-DD';
|
|
var time_format = 'hh:mm a';
|
|
$.ajax({
|
|
url: 'get_date_formats',
|
|
type: 'GET',
|
|
success: function(data) {
|
|
date_format = data.date_format;
|
|
time_format = data.time_format;
|
|
}
|
|
});
|
|
|
|
getHomeStats();
|
|
getLibraryStatsHeader();
|
|
getLibraryStats();
|
|
|
|
|
|
</script>
|
|
|
|
</%def>
|