We have initial implementation of sync lists (may still be buggy)

To get usernames in sync lists go to Users->Refresh Users.
This commit is contained in:
Tim 2015-07-02 13:04:19 +02:00
commit d2db662e14
7 changed files with 103 additions and 36 deletions

View file

@ -113,6 +113,19 @@ from plexpy import version
</a>
</li>
% endif
% if title=="Synced Items":
<li class="active">
<a href="sync">
<i class="fa fa-cloud-download fa-2x" data-toggle="tooltip" data-placement="bottom" title="Synced Items" id="sync"></i>
</a>
</li>
% else:
<li>
<a href="sync">
<i class="fa fa-cloud-download fa-2x" data-toggle="tooltip" data-placement="bottom" title="Synced Items" id="sync"></i>
</a>
</li>
% endif
% if title=="Log":
<li class="active">
<a href="logs">
@ -161,6 +174,9 @@ ${next.body()}
$(document).ready(function() {
$('#graphs').tooltip();
});
$(document).ready(function() {
$('#sync').tooltip();
});
$(document).ready(function() {
$('#logs').tooltip();
});

View file

@ -57,12 +57,12 @@
</div>
<div class="form-group">
<label for="http_host">HTTP Host</label>
<input type="text" id="http_host" name="http_host" value="${config['http_host']}" size="30">
<input type="text" id="http_host" name="http_host" value="${config['http_host']}" size="30" required="required">
<p class="help-block">e.g. localhost or an IP, such as 0.0.0.0</p>
</div>
<div class="form-group">
<label for="http_port">HTTP Port</label>
<input type="text" id="http_port" name="http_port" value="${config['http_port']}" size="10">
<input type="text" id="http_port" name="http_port" value="${config['http_port']}" size="10" required="required">
<p class="help-block">Port to bind web server to. Note that ports below 1024 may require root.</p>
</div>
<div class="checkbox">
@ -136,12 +136,12 @@
</div>
<div class="form-group">
<label for="date_format">Date Format</label>
<input type="text" id="date_format" name="date_format" value="${config['date_format']}" size="30">
<input type="text" id="date_format" name="date_format" value="${config['date_format']}" size="30" required="required">
<p class="help-block">Set your preferred date format. <a href="#dateTimeOptionsModal" data-toggle="modal">Click here</a> to see the parameter list.</p>
</div>
<div class="form-group">
<label for="date_format">Time Format</label>
<input type="text" id="time_format" name="time_format" value="${config['time_format']}" size="30">
<input type="text" id="time_format" name="time_format" value="${config['time_format']}" size="30" required="required">
<p class="help-block">Set your preferred time format. <a href="#dateTimeOptionsModal" data-toggle="modal">Click here</a> to see the parameter list.</p>
</div>
</fieldset>
@ -153,12 +153,12 @@
</div>
<div class="form-group">
<label for="pms_ip">PMS IP</label>
<input type="text" id="pms_ip" name="pms_ip" value="${config['pms_ip']}" size="30">
<input type="text" id="pms_ip" name="pms_ip" value="${config['pms_ip']}" size="30" required="required">
<p class="help-block">IP Address for Plex Media Server.</p>
</div>
<div class="form-group">
<label for="pms_port">PMS Port</label>
<input type="text" id="pms_port" name="pms_port" value="${config['pms_port']}" size="30">
<input type="text" id="pms_port" name="pms_port" value="${config['pms_port']}" size="30" required="required">
<p class="help-block">Port that Plex Media Server is listening on.</p>
</div>
<div class="form-group">
@ -176,7 +176,7 @@
<fieldset>
<div class="form-group">
<label for="plexwatch_database">PlexWatch Database</label>
<input type="text" id="plexwatch_database" name="plexwatch_database" value="${config['plexwatch_database']}" size="30">
<input type="text" id="plexwatch_database" name="plexwatch_database" value="${config['plexwatch_database']}" size="30" required="required">
<p class="help-block">Full path and file name of your PlexWatch database.</p>
</div>
<div class="checkbox">
@ -697,12 +697,12 @@
<br/><br/>
<div class="form-group">
<label for="pms_username">PMS Username</label>
<input type="text" id="pms_username" name="pms_username" size="30">
<input type="text" id="pms_username" name="pms_username" size="30" required="required">
<p class="help-block">Username for Plex.tv authentication.</p>
</div>
<div class="form-group">
<label for="pms_password">PMS Password</label>
<input type="password" id="pms_password" name="pms_password" size="30">
<input type="password" id="pms_password" name="pms_password" size="30" required="required">
<p class="help-block">Password for Plex.tv authentication.</p>
</div>
</div>

View file

@ -1,12 +1,9 @@
$('#sync_table').dataTable( {
sync_table_options = {
"responsive": {
details: false
},
"processing": false,
"serverSide": false,
"ajax": {
"url": "get_sync"
},
"sPaginationType": "bootstrap",
"order": [ 0, 'desc'],
"pageLength": 25,
@ -108,10 +105,5 @@ $('#sync_table').dataTable( {
"drawCallback": function (settings) {
// Jump to top of page
$('html,body').scrollTop(0);
$('#ajaxMsg').addClass('success').fadeOut();
},
"preDrawCallback": function(settings) {
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Fetching rows...</div>");
$('#ajaxMsg').addClass('success').fadeIn();
}
});
}

View file

@ -20,7 +20,7 @@ from plexpy import helpers
<div class="span12">
<div class="wellheader-bg">
<div class="dashboard-wellheader-no-chevron">
<h2><i class="fa fa-book"></i> Synced Items</h2>
<h2><i class="fa fa-cloud-download"></i> Synced Items</h2>
</div>
</div>
</div>
@ -62,5 +62,12 @@ from plexpy import helpers
<script src="interfaces/default/js/dataTables.responsive.js"></script>
<script src="interfaces/default/js/jquery.dataTables.bootstrap.pagination.integration.js"></script>
<script src="interfaces/default/js/tables/sync_table.js"></script>
<script>
$(document).ready(function() {
sync_table_options.ajax = {
"url": "get_sync"
}
sync_table = $('#sync_table').DataTable(sync_table_options);
});
</script>
</%def>

View file

@ -49,6 +49,7 @@ from plexpy import helpers
<li class="active"><a href="#profile" data-toggle="tab">Profile</a></li>
<li><a id="ip-tab-btn" href="#userAddresses" data-toggle="tab">IP Addresses</a></li>
<li><a id="history-tab-btn" href="#userHistory" data-toggle="tab">History</a></li>
<li><a id="sync-tab-btn" href="#userSyncItems" data-toggle="tab">Synced Items</a></li>
</ul>
</div>
</div>
@ -208,6 +209,40 @@ from plexpy import helpers
</div>
</div>
</div>
<div class="tab-pane" id="userSyncItems">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="table-card-back">
<h3>Synced Items for <strong>
<span class="set-username">${data['friendly_name']}</span>
</strong></h3>
</div>
<div class="table-card-back">
<table class="display" id="sync_table" width="100%">
<thead>
<tr>
<th align='left' id="state">State</th>
<th align='left' id="username">Username</th>
<th align='left' id="sync_title">Title</th>
<th align='left' id="type">Type</th>
<th align='left' id="device">Device</th>
<th align='left' id="sync_platform">Platform</th>
<th align='left' id="size">Total Size</th>
<th align='left' id="items">Total Items</th>
<th align='left' id="converted">Converted</th>
<th align='left' id="downloaded">Downloaded</th>
<th align='left' id="sync_percent_complete">Complete</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<footer></footer>
</%def>
@ -219,6 +254,7 @@ from plexpy import helpers
<script src="interfaces/default/js/moment-with-locale.js"></script>
<script src="interfaces/default/js/tables/history_table.js"></script>
<script src="interfaces/default/js/tables/user_ips.js"></script>
<script src="interfaces/default/js/tables/sync_table.js"></script>
<script>
$(document).ready(function () {
@ -275,6 +311,17 @@ from plexpy import helpers
user_ip_table = $('#user_ip_table').DataTable(user_ip_table_options);
});
$( "#sync-tab-btn" ).one( "click", function() {
// Build user sync table
sync_table_options.ajax = {
"url": "get_sync",
"data": function(d) {
d.user_id = "${data['user_id']}";
}
}
sync_table = $('#sync_table').DataTable(sync_table_options);
});
// Load edit user modal
$("#toggle-edit-user-modal").click(function() {
$.ajax({