mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
136 lines
3.6 KiB
HTML
136 lines
3.6 KiB
HTML
<%inherit file="base.html"/>
|
|
<%!
|
|
from plexpy import helpers
|
|
%>
|
|
|
|
<%def name="headIncludes()">
|
|
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
<div class="container-fluid">
|
|
|
|
<div class="row-fluid">
|
|
<div class="span12">
|
|
<div class="wellbg">
|
|
<div class="wellheader">
|
|
<div class="dashboard-wellheader">
|
|
<div id="currentActivityHeader">
|
|
<h3>Activity</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="currentActivity">
|
|
<div class="muted"><i class="fa fa-refresh fa-spin"></i> Checking for activity...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row-fluid">
|
|
<div class="span12">
|
|
<div class="wellbg">
|
|
<div class="wellheader">
|
|
<div class="dashboard-wellheader">
|
|
<h3>Statistics (Past 30 days)</h3>
|
|
</div>
|
|
</div>
|
|
<div id="home-stats" class="user-platforms">
|
|
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Loading stats...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class='row-fluid'>
|
|
<div class='wellbg'>
|
|
<div class='wellheader'>
|
|
<div class='dashboard-wellheader'>
|
|
<h3>Recently Added</h3>
|
|
</div>
|
|
</div>
|
|
<div id='recentlyAdded'>
|
|
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Looking for new items...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer></footer>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="interfaces/default/js/moment-with-locale.js"></script>
|
|
<script>
|
|
|
|
function getHomeStats(days) {
|
|
$.ajax({
|
|
url: 'home_stats',
|
|
cache: false,
|
|
async: true,
|
|
data: {time_range: days},
|
|
complete: function(xhr, status) {
|
|
$("#home-stats").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
|
|
function currentActivity() {
|
|
$.ajax({
|
|
url: 'get_current_activity',
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#currentActivity").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
currentActivity();
|
|
setInterval(currentActivity, 15000);
|
|
|
|
function currentActivityHeader() {
|
|
$.ajax({
|
|
url: 'get_current_activity_header',
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#currentActivityHeader").html(xhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
currentActivityHeader();
|
|
setInterval(currentActivityHeader, 15000);
|
|
|
|
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();
|
|
});
|
|
});
|
|
|
|
getHomeStats(30);
|
|
|
|
|
|
</script>
|
|
|
|
</%def>
|