mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Get started on input validation and config page clean-up.
Minor UI adjustments.
This commit is contained in:
parent
55efb0a711
commit
b244e09c24
8 changed files with 47 additions and 17 deletions
|
@ -34,7 +34,7 @@
|
|||
<div class='row-fluid'>
|
||||
<div class='span12'>
|
||||
<div class="card-back">
|
||||
<form action="configUpdate" method="post" class="form" id="configUpdate">
|
||||
<form action="configUpdate" method="post" class="form" id="configUpdate" data-parsley-validate>
|
||||
<div role="tabpanel">
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-pills" role="tablist">
|
||||
|
@ -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" required="required">
|
||||
<input type="text" id="http_host" name="http_host" value="${config['http_host']}" size="30" data-parsley-trigger="change" 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" required="required">
|
||||
<input type="text" data-parsley-type="integer" id="http_port" name="http_port" value="${config['http_port']}" size="10" data-parsley-trigger="change" required>
|
||||
<p class="help-block">Port to bind web server to. Note that ports below 1024 may require root.</p>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
|
@ -122,7 +122,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="button" class="btn btn-medium btn-primary" value="Save" onclick="doAjaxCall('configUpdate',$(this),'tabs',true);return false;" data-success="Changes saved successfully">
|
||||
<input type="button" class="btn btn-medium btn-primary save-button" value="Save" data-success="Changes saved successfully">
|
||||
</div>
|
||||
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-2">
|
||||
|
@ -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" required="required">
|
||||
<input type="text" id="date_format" name="date_format" value="${config['date_format']}" size="30" data-parsley-trigger="change" 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" required="required">
|
||||
<input type="text" id="time_format" name="time_format" value="${config['time_format']}" size="30" data-parsley-trigger="change" 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" required="required">
|
||||
<input type="text" id="pms_ip" name="pms_ip" value="${config['pms_ip']}" size="30" data-parsley-trigger="change" 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" required="required">
|
||||
<input data-parsley-type="integer" type="text" id="pms_port" name="pms_port" value="${config['pms_port']}" size="30" data-parsley-trigger="change" 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" required="required">
|
||||
<input type="text" id="plexwatch_database" name="plexwatch_database" value="${config['plexwatch_database']}" size="30" data-parsley-trigger="change" required>
|
||||
<p class="help-block">Full path and file name of your PlexWatch database.</p>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
|
@ -205,7 +205,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="button" class="btn btn-medium btn-primary" value="Save" onclick="doAjaxCall('configUpdate',$(this),'tabs',true);return false;" data-success="Changes saved successfully">
|
||||
<input type="button" class="btn btn-medium btn-primary save-button" value="Save" data-success="Changes saved successfully">
|
||||
|
||||
<!--
|
||||
<div role="tabpanel" class="tab-pane" id="tabs-5">
|
||||
|
@ -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" required="required">
|
||||
<input type="text" id="pms_username" name="pms_username" size="30">
|
||||
<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" required="required">
|
||||
<input type="password" id="pms_password" name="pms_password" size="30">
|
||||
<p class="help-block">Password for Plex.tv authentication.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -720,8 +720,21 @@
|
|||
</%def>
|
||||
|
||||
<%def name="javascriptIncludes()">
|
||||
<script src="interfaces/default/js/parsley.min.js"></script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
var configForm = $("#configUpdate");
|
||||
$('.save-button').click(function() {
|
||||
if (configForm.parsley().validate()) {
|
||||
doAjaxCall('configUpdate',$(this),'tabs',true);
|
||||
return false;
|
||||
} else {
|
||||
showMsg('<i class="fa fa-exclamation-circle"></i> Please verify your settings.',false,true,2000)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Plex.tv auth token fetch
|
||||
$("#get-pms-auth-token").click(function() {
|
||||
$("#pms-token-status").html('<i class="fa fa-refresh fa-spin"></i> Fetching token...');
|
||||
|
|
9
data/interfaces/default/js/parsley.min.js
vendored
Normal file
9
data/interfaces/default/js/parsley.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -15,6 +15,14 @@ function initConfigCheckbox(elem) {
|
|||
});
|
||||
}
|
||||
|
||||
function refreshTab() {
|
||||
var url = $(location).attr('href');
|
||||
var tabId = $('.ui-tabs-panel:visible').attr("id");
|
||||
$('.ui-tabs-panel:visible').load(url + " #"+ tabId, function() {
|
||||
initThisPage();
|
||||
});
|
||||
}
|
||||
|
||||
function showMsg(msg,loader,timeout,ms) {
|
||||
var feedback = $("#ajaxMsg");
|
||||
update = $("#updatebar");
|
||||
|
|
|
@ -177,7 +177,7 @@ history_table_options = {
|
|||
$('#ajaxMsg').addClass('success').fadeOut();
|
||||
},
|
||||
"preDrawCallback": function(settings) {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Fetching rows...</div>");
|
||||
$('#ajaxMsg').html("<div class='msg'><i class='fa fa-refresh fa-spin'></i> Fetching rows...</div>");
|
||||
$('#ajaxMsg').addClass('success').fadeIn();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ $('#log_table').dataTable( {
|
|||
$('#ajaxMsg').addClass('success').fadeOut();
|
||||
},
|
||||
"preDrawCallback": function(settings) {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Fetching rows...</div>");
|
||||
$('#ajaxMsg').html("<div class='msg'><i class='fa fa-refresh fa-spin'></i> Fetching rows...</div>");
|
||||
$('#ajaxMsg').addClass('success').fadeIn();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -75,7 +75,7 @@ sync_table_options = {
|
|||
megabytes = Math.round((cellData/1024)/1024, 0)
|
||||
$(td).html(megabytes + 'MB');
|
||||
} else {
|
||||
$(td).html(megabytes + '0MB');
|
||||
$(td).html('0MB');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -69,7 +69,7 @@ user_ip_table_options = {
|
|||
$('#ajaxMsg').addClass('success').fadeOut();
|
||||
},
|
||||
"preDrawCallback": function(settings) {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Fetching rows...</div>");
|
||||
$('#ajaxMsg').html("<div class='msg'><i class='fa fa-refresh fa-spin'></i> Fetching rows...</div>");
|
||||
$('#ajaxMsg').addClass('success').fadeIn();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ users_list_table_options = {
|
|||
$('#ajaxMsg').addClass('success').fadeOut();
|
||||
},
|
||||
"preDrawCallback": function(settings) {
|
||||
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Fetching rows...</div>");
|
||||
$('#ajaxMsg').html("<div class='msg'><i class='fa fa-refresh fa-spin'></i> Fetching rows...</div>");
|
||||
$('#ajaxMsg').addClass('success').fadeIn();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue