mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Massive code cleanup
* Finish up library pages (toggles and notifications) * Update user pages to match library pages * Fix no current activity bif thumbnail at the start of a stream * Improved logging throughout PlexPy
This commit is contained in:
parent
5fedac691d
commit
636f898da8
31 changed files with 2873 additions and 2715 deletions
|
@ -43,15 +43,16 @@
|
|||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-remove"></i></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Confirm Purge</h4>
|
||||
<h4 class="modal-title" id="myModalLabel">Confirm Delete/Purge</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="text-align: center;">
|
||||
<ul id="libraries-to-delete" class="list-unstyled"></ul>
|
||||
<ul id="libraries-to-purge" class="list-unstyled"></ul>
|
||||
<p>This is permanent and cannot be undone!</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-dark" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-danger btn-ok" data-dismiss="modal" id="confirm-purge">Confirm</button>
|
||||
<button type="button" class="btn btn-danger btn-ok" data-dismiss="modal" id="confirm-delete">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -83,7 +84,8 @@
|
|||
|
||||
$('#row-edit-mode').on('click', function () {
|
||||
$('#row-edit-mode-alert').fadeIn(200);
|
||||
$('#libraries_to_purge').html('');
|
||||
$('#libraries-to-delete').html('');
|
||||
$('#libraries-to-purge').html('');
|
||||
|
||||
if ($(this).hasClass('active')) {
|
||||
if (libraries_to_purge.length > 0) {
|
||||
|
@ -91,6 +93,17 @@
|
|||
$(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger');
|
||||
});
|
||||
|
||||
libraries_to_purge = $.grep(libraries_to_purge, function (value) {
|
||||
return $.inArray(value, libraries_to_delete) < 0;
|
||||
});
|
||||
|
||||
if (libraries_to_delete.length > 0) {
|
||||
$('#libraries-to-delete').prepend('<p>Are you REALLY sure you want to delete the following libraries:</p>')
|
||||
for (var i = 0; i < libraries_to_delete.length; i++) {
|
||||
$('#libraries-to-delete').append('<li>' + $('div[data-id=' + libraries_to_delete[i] + ']').text() + '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
if (libraries_to_purge.length > 0) {
|
||||
$('#libraries-to-purge').prepend('<p>Are you REALLY sure you want to purge all history for the following libraries:</p>')
|
||||
for (var i = 0; i < libraries_to_purge.length; i++) {
|
||||
|
@ -99,7 +112,19 @@
|
|||
}
|
||||
|
||||
$('#confirm-modal').modal();
|
||||
$('#confirm-modal').one('click', '#confirm-purge', function () {
|
||||
$('#confirm-modal').one('click', '#confirm-delete', function () {
|
||||
for (var i = 0; i < libraries_to_delete.length; i++) {
|
||||
$.ajax({
|
||||
url: 'delete_library',
|
||||
data: { section_id: libraries_to_delete[i] },
|
||||
cache: false,
|
||||
async: true,
|
||||
success: function (data) {
|
||||
var msg = "Library deleted";
|
||||
showMsg(msg, false, true, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var i = 0; i < libraries_to_purge.length; i++) {
|
||||
$.ajax({
|
||||
url: 'delete_all_library_history',
|
||||
|
@ -122,6 +147,7 @@
|
|||
});
|
||||
|
||||
} else {
|
||||
libraries_to_delete = [];
|
||||
libraries_to_purge = [];
|
||||
$('.edit-control').each(function () {
|
||||
$(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger');
|
||||
|
@ -137,13 +163,13 @@
|
|||
cache: false,
|
||||
async: true,
|
||||
success: function (data) {
|
||||
showMsg('<i class="fa fa-refresh"></i> Libraries list refresh started...', false, true, 2000, false)
|
||||
showMsg('<i class="fa fa-refresh"></i> Libraries list refresh started...', false, true, 2000, false);
|
||||
},
|
||||
complete: function (data) {
|
||||
showMsg('<i class="fa fa-check"></i> Libraries list refreshed.', false, true, 2000, false)
|
||||
showMsg('<i class="fa fa-check"></i> Libraries list refreshed.', false, true, 2000, false);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
showMsg('<i class="fa fa-exclamation-circle"></i> Unable to refresh libraries list.',false,true,2000,true)
|
||||
showMsg('<i class="fa fa-exclamation-circle"></i> Unable to refresh libraries list.', false, true, 2000, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue