Numerous styling changes. Please refresh browser cache after update.

Add option on tables to show/hide columns.
Add option in settings to manually check for updates.
Add option in config to toggle github update checks.
Remove the hidden danger zone link to wipe database.
This commit is contained in:
Tim 2015-07-19 13:00:44 +02:00
parent 19d5eb9abb
commit 1c1ad5ab30
14 changed files with 1471 additions and 115 deletions

View file

@ -9,31 +9,22 @@
</%def>
<%def name="body()">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="wellheader-bg">
<div class="dashboard-wellheader-no-chevron">
<div class="row-fluid">
<div class="span9"><h2><i class="fa fa-cog"></i> Settings</h2></div>
<div class="span3">
<div class="pull-right">
<h5><a id="menu_link_shutdown" href="shutdown"><i class="fa fa-power-off"></i> Shut Down</a>
&nbsp<a id="menu_link_restart" href="restart"><i class="fa fa-refresh"></i> Restart</a></h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="container-fluid">
<div class='row-fluid'>
<div class='span12'>
<div class="card-back">
<div class='table-card-back'>
<div style="float: left;">
<h2><i class="fa fa-cog"></i> Settings</h2>
</div>
<div style="float: right;" class="button-bar">
% if config['check_github']:
<button id="menu_link_update_check" class="rounded"><i class="fa fa-arrow-circle-up"></i> Check for Updates</button>
% endif
<button id="menu_link_restart" class="rounded"><i class="fa fa-refresh"></i> Restart</button>
<button id="menu_link_shutdown" class="rounded alert"><i class="fa fa-power-off"></i> Shut Down</button>
</div>
</div>
<div class="table-card-back">
<form action="configUpdate" method="post" class="form" id="configUpdate" data-parsley-validate>
<div role="tabpanel">
<!-- Nav tabs -->
@ -119,6 +110,15 @@
<p class="help-block">Current API key: <strong><br/>${config['api_key']}</strong></p>
</div>
</fieldset>
<fieldset>
<div class="wellheader">
<h3>Software Updates</h3>
</div>
<div class="checkbox">
<input type="checkbox" id="check_github" name="check_github" value="1" ${config['check_github']}> Enable Updates
<p class="help-block">If you have Git installed, allow periodic checks for updates.</p>
</div>
</fieldset>
</div>
</div>
</div>
@ -846,6 +846,20 @@
}
});
});
$("#menu_link_shutdown").click(function() {
var r = confirm("Are you sure you want to shutdown PlexPy?");
if (r == true) {
window.location.href = "shutdown";
}
});
$("#menu_link_restart").click(function() {
window.location.href = "restart";
});
$("#menu_link_update_check").click(function() {
window.location.href = "checkGithub";
});
$( ".pms-settings" ).change(function() {
$("#pms_identifier").val("");

View file

@ -0,0 +1,123 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* ColVis styles
*/
div.ColVis {
float: right;
}
button.ColVis_Button,
ul.ColVis_collection li {
position: relative;
float: left;
color: #fff;
margin-right: 3px;
padding: 5px 8px;
cursor: pointer;
*cursor: hand;
font-size: 0.88em;
white-space: nowrap;
}
.ColVis_Button:hover,
ul.ColVis_collection li:hover {
color: #F9AA03;
}
button.ColVis_Button {
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
background-color: #444;
border: 1px solid transparent;
border-radius: 14.5px;
outline:0px !important;
-webkit-appearance:none;
}
button.ColVis_Button::-moz-focus-inner {
border: none !important;
padding: 0;
}
button.ColVis_Button:active {
outline: none;
}
div.ColVis_collectionBackground {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: black;
z-index: 1100;
}
ul.ColVis_collection {
list-style: none;
width: 150px;
padding: 8px 8px 4px 8px;
margin: 10px 0px 0px 0px;
background-color: rgba( 88, 88, 88, 0.8 );
overflow: hidden;
z-index: 2002;
}
ul.ColVis_collection li {
position: relative;
height: auto;
left: 0;
right: 0;
display: block;
float: none;
}
ul.ColVis_collection li {
text-align: left;
}
ul.ColVis_collection li.ColVis_Button:hover {
border: 1px solid #999;
}
ul.ColVis_collection li span {
display: inline-block;
padding-left: 0.5em;
line-height: 1em;
cursor: pointer;
}
ul.ColVis_collection li.ColVis_Special {
}
ul.ColVis_collection li.ColVis_Special:hover {
}
span.ColVis_radio {
display: inline-block;
width: 20px;
}
div.ColVis_catcher {
position: absolute;
z-index: 1101;
}
.disabled {
color: #999;
}

View file

@ -51,28 +51,42 @@
background-color: rgba(0,0,0,.5);
border-radius: 8px;
}
.dataTables_length {
@media (min-width: 768px) {
.dataTables_length {
width: 40%;
float: left;
margin-left: 15px;
margin-bottom: 20px;
}
}
@media (max-width: 767px) {
.dataTables_length {
display: none;
}
}
.dataTables_filter {
float: right;
text-align: right;
margin-right: 15px;
margin-bottom: 20px;
}
.dataTables_info {
@media (min-width: 768px) {
.dataTables_info {
width: 60%;
float: left;
margin-top: 12px;
margin-left: 15px;
margin-bottom: 12px;
text-overflow: ellipsis;
overflow: hidden;
}
}
@media (max-width: 767px) {
.dataTables_info {
display: none;
}
}
.dataTables_paginate {
@ -650,3 +664,30 @@ div.box {
td.no-wrap, th.no-wrap {
white-space:nowrap;
}
div.colVis {
}
button.ColVis_Button {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
background-color: #444;
border: 1px solid transparent;
border-radius: 14.5px;
}

View file

@ -1320,7 +1320,6 @@ input[type="color"]:focus,
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
*margin-top: 0;
/* IE7 */
@ -8277,3 +8276,31 @@ ol.test >li {
.table-card-back td {
font-size: 12px;
}
button.rounded {
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
background-color: #444;
border: 1px solid transparent;
border-radius: 14.5px;
outline:0px !important;
-webkit-appearance:none;
}
.rounded:hover{
color: #F9AA03;
}

View file

@ -6,24 +6,22 @@ from plexpy import helpers
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/plexwatch-tables.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.responsive.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.colVis.css">
</%def>
<%def name="body()">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="wellheader-bg">
<div class="dashboard-wellheader-no-chevron">
<h2><i class="fa fa-history"></i> History</h2>
</div>
</div>
</div>
</div>
</div>
<div class='container-fluid'>
<div class='row-fluid'>
<div class='span12'>
<div class='table-card-back'>
<div style="float: left;">
<h2><i class="fa fa-history"></i> History</h2>
</div>
<div style="float: right;" class="button-bar">
</div>
</div>
<div class='table-card-back'>
<table class="display" id="history_table" width="100%">
<thead>
@ -57,6 +55,7 @@ from plexpy import helpers
<%def name="javascriptIncludes()">
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
<script src="interfaces/default/js/dataTables.colVis.js"></script>
<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/moment-with-locale.js"></script>
@ -72,6 +71,9 @@ from plexpy import helpers
}
history_table = $('#history_table').DataTable(history_table_options);
var colvis = new $.fn.dataTable.ColVis( history_table );
$( colvis.button() ).appendTo('div.button-bar');
});
</script>

View file

@ -41,6 +41,7 @@ from plexpy import helpers
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/plexwatch-tables.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.colVis.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.responsive.css">
</%def>
@ -166,9 +167,13 @@ from plexpy import helpers
<div class='row-fluid'>
<div class='span12'>
<div class='table-card-back'>
<div style="float: left;">
% if data['type'] == 'movie' or data['type'] == 'episode' or data['type'] == 'show':
<h3>Watch history for <strong>${data['title']}</strong></h3>
</div>
<div style="float: right;" class="button-bar">
</div>
</div>
<div class="table-card-back">
<table class="display" id="history_table" width="100%">
<thead>
@ -220,6 +225,7 @@ from plexpy import helpers
<%def name="javascriptIncludes()">
<script src="interfaces/default/js/jquery.rateit.min.js"></script>
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
<script src="interfaces/default/js/dataTables.colVis.js"></script>
<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/moment-with-locale.js"></script>
@ -250,7 +256,11 @@ from plexpy import helpers
history_table = $('#history_table').DataTable(history_table_options);
// Hide the title column
history_table.column(5).visible(false);
$("#title").removeClass("min-tablet").addClass("never");
history_table.column(4).visible(false);
var colvis = new $.fn.dataTable.ColVis( history_table );
$( colvis.button() ).appendTo('div.button-bar');
});
</script>
@ -269,6 +279,9 @@ from plexpy import helpers
}
history_table = $('#history_table').DataTable(history_table_options);
var colvis = new $.fn.dataTable.ColVis( history_table );
$( colvis.button() ).appendTo('div.button-bar');
});

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@ sync_table_options = {
"sPaginationType": "bootstrap",
"order": [ 0, 'desc'],
"pageLength": 25,
"stateSave": true,
"stateSave": false,
"language": {
"search":"Search: ",
"lengthMenu":"Show _MENU_ lines per page",

View file

@ -15,26 +15,17 @@ from plexpy import helpers
</%def>
<%def name="body()">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="wellheader-bg">
<div class="dashboard-wellheader-no-chevron">
<div class="span9"><h2><i class="fa fa-book"></i> Logs</h2></div>
<div class="span3">
<div class="pull-right" id="clear-logs">
<h5><a id="menu_link_edit" href="clearLogs"><i class="fa fa-trash-o"></i> Clear log</a></h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='container-fluid'>
<div class='row-fluid'>
<div class='span12'>
<div class='table-card-back'>
<div style="float: left;">
<h2><i class="fa fa-book"></i> Logs</h2>
</div>
<div style="float: right;" class="button-bar">
<button class="rounded" id="clear-logs"><i class="fa fa-trash-o"></i> Clear log</button>
</div>
</div>
<div class='table-card-back'>
<div role="tabpanel">
<ul class="nav nav-pills" role="tablist">
@ -127,6 +118,13 @@ from plexpy import helpers
LoadPlexLogs();
});
$("#clear-logs").click(function() {
var r = confirm("Are you sure you want to clear the PlexPy log?");
if (r == true) {
window.location.href = "clearLogs";
}
});
var timer;
function setRefresh()
{

View file

@ -5,6 +5,7 @@ from plexpy import helpers
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/plexwatch-tables.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.colVis.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.responsive.css">
<style>
td {word-wrap: break-word}
@ -15,20 +16,16 @@ from plexpy import helpers
</%def>
<%def name="body()">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="wellheader-bg">
<div class="dashboard-wellheader-no-chevron">
<h2><i class="fa fa-cloud-download"></i> Synced Items</h2>
</div>
</div>
</div>
</div>
</div>
<div class='container-fluid'>
<div class='row-fluid'>
<div class='span12'>
<div class='table-card-back'>
<div style="float: left;">
<h2><i class="fa fa-cloud-download"></i> Synced Items</h2>
</div>
<div style="float: right;" class="button-bar">
</div>
</div>
<div class='table-card-back'>
<table class="display" id="sync_table" width="100%">
<thead>
@ -59,6 +56,7 @@ from plexpy import helpers
<%def name="javascriptIncludes()">
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
<script src="interfaces/default/js/dataTables.colVis.js"></script>
<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>
@ -68,6 +66,9 @@ from plexpy import helpers
"url": "get_sync"
}
sync_table = $('#sync_table').DataTable(sync_table_options);
var colvis = new $.fn.dataTable.ColVis( sync_table );
$( colvis.button() ).appendTo('div.button-bar');
});
</script>
</%def>

View file

@ -29,6 +29,7 @@ from plexpy import helpers
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/plexwatch-tables.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.colVis.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.responsive.css">
</%def>
@ -173,11 +174,15 @@ from plexpy import helpers
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="table-card-back">
<div class='table-card-back'>
<div style="float: left;">
<h3>Watch History for <strong>
<span class="set-username">${data['friendly_name']}</span>
</strong></h3>
</div>
<div style="float: right;" id="button-bar-history">
</div>
</div>
<div class="table-card-back">
<table class="display" id="history_table" width="100%">
<thead>
@ -209,11 +214,15 @@ from plexpy import helpers
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="table-card-back">
<div class='table-card-back'>
<div style="float: left;">
<h3>Synced Items for <strong>
<span class="set-username">${data['friendly_name']}</span>
</strong></h3>
</div>
<div style="float: right;" id="button-bar-sync">
</div>
</div>
<div class="table-card-back">
<table class="display" id="sync_table" width="100%">
<thead>
@ -245,6 +254,7 @@ from plexpy import helpers
<%def name="javascriptIncludes()">
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
<script src="interfaces/default/js/dataTables.colVis.js"></script>
<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/moment-with-locale.js"></script>
@ -303,7 +313,10 @@ from plexpy import helpers
}
}
history_table = $('#history_table').DataTable(history_table_options);
history_table.column(2).visible(false); // Hide the title column
history_table.column(1).visible(false);
var colvis = new $.fn.dataTable.ColVis( history_table );
$( colvis.button() ).appendTo('#button-bar-history');
});
$( "#ip-tab-btn" ).one( "click", function() {
@ -331,6 +344,9 @@ from plexpy import helpers
}
}
sync_table = $('#sync_table').DataTable(sync_table_options);
var colvis_sync = new $.fn.dataTable.ColVis( sync_table );
$( colvis_sync.button() ).appendTo('#button-bar-sync');
});
// Load edit user modal

View file

@ -9,25 +9,17 @@ from plexpy import helpers
</%def>
<%def name="body()">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="wellheader-bg">
<div class="dashboard-wellheader-no-chevron">
<div class="span9"><h2><i class="fa fa-group"></i> Active Users</h2></div>
<div class="span3">
<div class="pull-right">
<h5><a href="refresh_users_list"><i class="fa fa-refresh"></i> Refresh users</a></h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='container-fluid'>
<div class='row-fluid'>
<div class='span12'>
<div class='table-card-back'>
<div style="float: left;">
<h2><i class="fa fa-group"></i> Active Users</h2>
</div>
<div style="float: right;" class="button-bar">
<button class="rounded" id="refresh-users-list"><i class="fa fa-refresh"></i> Refresh users</button>
</div>
</div>
<div class='table-card-back'>
<table id="users_list_table" class="display" width="100%">
<thead>
@ -67,6 +59,19 @@ from plexpy import helpers
var users_list_table = $('#users_list_table').DataTable(users_list_table_options);
$("#refresh-users-list").click(function() {
$.ajax({
url: 'refresh_users_list',
cache: false,
async: true,
success : function(data) {
showMsg('<i class="fa fa-check"></i>&nbspUser list refresh started...',false,true,2000,false)
},
error: function(jqXHR, textStatus, errorThrown) {
showMsg('<i class="fa fa-exclamation-circle"></i>&nbspUnable to refresh user list.',false,true,2000,true)
},
});
});
</script>
</%def>

View file

@ -150,7 +150,7 @@ def initialize(config_file):
version_lock_file, e)
# Check for new versions
if CONFIG.CHECK_GITHUB_ON_STARTUP:
if CONFIG.CHECK_GITHUB_ON_STARTUP and CONFIG.CHECK_GITHUB:
try:
LATEST_VERSION = versioncheck.checkGithub()
except:
@ -255,7 +255,7 @@ def initialize_scheduler():
start_jobs = not len(SCHED.get_jobs())
# Update check
if CONFIG.CHECK_GITHUB_INTERVAL:
if CONFIG.CHECK_GITHUB_INTERVAL and CONFIG.CHECK_GITHUB:
minutes = CONFIG.CHECK_GITHUB_INTERVAL
else:
minutes = 0

View file

@ -326,6 +326,7 @@ class WebInterface(object):
"freeze_db": checked(plexpy.CONFIG.FREEZE_DB),
"log_dir": plexpy.CONFIG.LOG_DIR,
"cache_dir": plexpy.CONFIG.CACHE_DIR,
"check_github": checked(plexpy.CONFIG.CHECK_GITHUB),
"interface_list": interface_list,
"growl_enabled": checked(plexpy.CONFIG.GROWL_ENABLED),
"growl_host": plexpy.CONFIG.GROWL_HOST,
@ -411,7 +412,7 @@ class WebInterface(object):
checked_configs = [
"launch_browser", "enable_https", "api_enabled", "freeze_db", "growl_enabled",
"prowl_enabled", "xbmc_enabled",
"prowl_enabled", "xbmc_enabled", "check_github",
"plex_enabled", "nma_enabled", "pushalot_enabled",
"pushover_enabled", "pushbullet_enabled",
"twitter_enabled", "osx_notify_enabled",
@ -483,13 +484,6 @@ class WebInterface(object):
cherrypy.response.headers['Content-type'] = 'application/json'
return json.dumps(history)
@cherrypy.expose
def clear_all_history(self, **kwargs):
from plexpy import database
threading.Thread(target=database.clear_history_tables).start()
raise cherrypy.HTTPRedirect("config")
@cherrypy.expose
def shutdown(self):
return self.do_state_change('shutdown', 'Shutting Down', 15)
@ -923,8 +917,8 @@ class WebInterface(object):
@cherrypy.expose
def refresh_users_list(self, **kwargs):
plextv.refresh_users()
raise cherrypy.HTTPRedirect("users")
threading.Thread(target=plextv.refresh_users).start()
logger.info('Manual user list refresh requested.')
@cherrypy.expose
def get_sync(self, machine_id=None, user_id=None, **kwargs):