mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Move database functions to its own file. Incorporate datatables changes into original file and remove the test file. Remove old plexWatch processing and db files and references.
1267 lines
80 KiB
HTML
1267 lines
80 KiB
HTML
<%inherit file="base.html"/>
|
|
<%!
|
|
import plexpy
|
|
import string
|
|
%>
|
|
|
|
<%def name="headerIncludes()">
|
|
|
|
</%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>
|
|
 <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='row-fluid'>
|
|
<div class='span12'>
|
|
<div class="card-back">
|
|
<form action="configUpdate" method="post" class="form" id="configUpdate" data-parsley-validate>
|
|
<div role="tabpanel">
|
|
<!-- Nav tabs -->
|
|
<ul class="nav nav-pills" role="tablist">
|
|
<li role="presentation" class="active"><a href="#tabs-1" aria-controls="tabs-1" role="tab" data-toggle="tab">Web Interface</a></li>
|
|
<li role="presentation"><a href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Plex Settings</a></li>
|
|
<li role="presentation"><a href="#tabs-3" aria-controls="tabs-3" role="tab" data-toggle="tab">Monitoring</a></li>
|
|
<li role="presentation"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Notification Agents</a></li>
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="tabs-1">
|
|
<div class="alert">Web Interface changes require a restart to take effect.</div>
|
|
<div class="wellbg" style="padding: 0px 0px 0px 20px;">
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Basic</h3>
|
|
</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" 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" 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">
|
|
<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']}> Launch Browser on Startup
|
|
<p class="help-block">Launch browser pointed to PlexPy, on startup.</p>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="enable_https" id="enable_https" value="1" ${config['enable_https']} /> Enable HTTPS
|
|
<p class="help-block">Enable HTTPS for web server for encrypted communication.</p>
|
|
</div>
|
|
<div id="https_options">
|
|
<div class="form-group">
|
|
<label for="https_cert">HTTPS Cert</label>
|
|
<input type="text" id="https_cert" name="https_cert" value="${config['https_cert']}" size="30">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="https_key">HTTPS Key</label>
|
|
<input type="text" id="https_key" name="https_key" value="${config['https_key']}" size="30">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Authentication</h3>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="http_username">HTTP Username</label>
|
|
<input type="text" id="http_username" name="http_username" value="${config['http_username']}" size="30">
|
|
<p class="help-block">Username for web server authentication. Leave empty to disable.</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="http_password">HTTP Password</label>
|
|
<input type="password" id="http_password" name="http_password" value="${config['http_password']}" size="30">
|
|
<p class="help-block">Password for web server authentication. Leave empty to disable.</p>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>API</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="api_enabled" name="api_enabled" value="1" ${config['api_enabled']}> Enable API
|
|
<p class="help-block">Allow remote applications to interface with PlexPy.</p>
|
|
</div>
|
|
<div id="apioptions" class="form-group">
|
|
<label for="api_key">API key</label>
|
|
<input type="text" name="api_key" id="api_key" value="${config['api_key']}" size="20">
|
|
<input type="button" class="btn btn-link" value="Generate" id="generate_api">
|
|
<p class="help-block">Current API key: <strong><br/>${config['api_key']}</strong></p>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<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">
|
|
<div class="wellbg" style="padding: 0px 0px 0px 20px;">
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>General</h3>
|
|
</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" 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" 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>
|
|
<br/>
|
|
</div>
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Plex Media Server</h3>
|
|
</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" 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 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">
|
|
<label for="pms_token">PMS Token</label>
|
|
<input type="text" id="pms_token" name="pms_token" value="${config['pms_token']}" size="30" data-parsley-trigger="change" required>
|
|
<p class="help-block">Token for Plex.tv authentication. This field is required.</p>
|
|
</div>
|
|
<p class="help-block"><a href="#pms-auth-modal" data-toggle="modal">Fetch Token</a></p>
|
|
</fieldset>
|
|
</div>
|
|
<div class="span4">
|
|
<div class="wellheader">
|
|
<h3>Extra Settings</h3>
|
|
</div>
|
|
<fieldset>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="pms_use_bif" name="pms_use_bif" value="1" ${config['pms_use_bif']}> Use BIF thumbs
|
|
<p class="help-block">If you have media indexing enabled on your server, use these on the activity pane.</p>
|
|
</div>
|
|
</fieldset>
|
|
<div class="wellheader">
|
|
<h3>Plex Logs</h3>
|
|
</div>
|
|
<fieldset>
|
|
<div class="form-group">
|
|
<label for="pms_logs_folder">Logs Folder</label>
|
|
<input type="text" id="pms_logs_folder" name="pms_logs_folder" value="${config['pms_logs_folder']}" size="30" data-parsley-trigger="change">
|
|
<p class="help-block">Set the folder where your Plex Server logs are. <br/><a href="https://support.plex.tv/hc/en-us/articles/200250417-Plex-Media-Server-Log-Files" target="_blank">Click here</a> for help.</p>
|
|
</div>
|
|
</fieldset>
|
|
<!--
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="grouping_user_history" name="grouping_user_history" value="1" ${config['grouping_user_history']}> User History
|
|
<p class="help-block">Enable user history grouping.</p>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="grouping_charts" name="grouping_charts" value="1" ${config['grouping_charts']}> Charts History
|
|
<p class="help-block">Enable chart grouping.</p>
|
|
</div>
|
|
-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<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-3">
|
|
<div class="alert">These features are currently experimental, please report any bugs on the Github project page <a href="https://www.github.com/drzoidberg33/plexpy/issues" target="_blank">Here</a></div>
|
|
<div class="wellbg" style="padding: 0px 0px 0px 20px;">
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<div class="span4">
|
|
<div class="wellheader">
|
|
<h3>Monitoring Settings</h3>
|
|
</div>
|
|
<fieldset>
|
|
<div class="form-group">
|
|
<label for="monitoring_interval">Monitoring Interval</label>
|
|
<input type="text" data-parsley-type="integer" id="monitoring_interval" name="monitoring_interval" value="${config['monitoring_interval']}" size="5" data-parsley-min="30" data-parsley-trigger="change" required>
|
|
<p class="help-block">The interval (in seconds) PlexPy will ping your Plex Server. Min 30 seconds, Recommended 60 seconds. 0 to disable.</p>
|
|
<p><strong>Disabling monitoring will disable ALL notifications and history logging.</strong></p>
|
|
</div>
|
|
</fieldset>
|
|
<div class="wellheader">
|
|
<h3>User List</h3>
|
|
</div>
|
|
<fieldset>
|
|
<div class="form-group">
|
|
<label for="refresh_users_interval">User list Refresh Interval</label>
|
|
<input type="text" data-parsley-type="integer" id="refresh_users_interval" name="refresh_users_interval" value="${config['refresh_users_interval']}" size="5" data-parsley-min="0" data-parsley-trigger="change" required>
|
|
<p class="help-block">The interval (in hours) PlexPy will request an updated friends list from Plex.tv. 0 to disable.</p>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="refresh_users_on_startup" name="refresh_users_on_startup" value="1" ${config['refresh_users_on_startup']}> Refresh user list on startup
|
|
<p class="help-block">Refresh the user list when PlexPy starts.</p>
|
|
</div>
|
|
</fieldset>
|
|
<div class="wellheader">
|
|
<h3>PlexWatch Import Tool</h3>
|
|
</div>
|
|
<fieldset>
|
|
<p class="help-block"><a href="#plexwatch-import-modal" id="toggle-plexwatch-import-modal" data-toggle="modal">Click here to Import an existing Plexwatch database.</a></p>
|
|
</fieldset>
|
|
</div>
|
|
<div class="span4">
|
|
<div class="wellheader">
|
|
<h3>History Logging</h3>
|
|
</div>
|
|
<fieldset>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="video_logging_enable" name="video_logging_enable" value="1" ${config['video_logging_enable']}> Log Movies and TV
|
|
<p class="help-block">Keep records of all video items played from your Plex Media Server.</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="monitoring_interval">Ignore Interval</label>
|
|
<input type="text" data-parsley-type="integer" id="logging_ignore_interval" name="logging_ignore_interval" value="${config['logging_ignore_interval']}" size="5" data-parsley-min="0" data-parsley-trigger="change" required>
|
|
<p class="help-block">The interval (in seconds) PlexPy will wait for a video item to be active before logging it. 0 to disable.</p>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="music_logging_enable" name="music_logging_enable" value="1" ${config['music_logging_enable']}> Log Music
|
|
<p class="help-block">Keep records of all audio items played from your Plex Media Server. VERY experimental.</p>
|
|
</div>
|
|
</fieldset>
|
|
<div class="wellheader">
|
|
<h3>IP Logging</h3>
|
|
</div>
|
|
<fieldset>
|
|
<div class="checkbox">
|
|
<input type="checkbox" id="ip_logging_enable" name="ip_logging_enable" value="1" ${config['ip_logging_enable']}> Enable IP Logging
|
|
<p class="help-block">
|
|
Enable this to attempt to log the IP address of the user. Debug logging must be enabled and your log folder must be set in the PlexPy settings.
|
|
</p>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
<div class="span4">
|
|
<div class="wellheader">
|
|
<h3>Global Notifications</h3>
|
|
</div>
|
|
<fieldset>
|
|
<dl>
|
|
<dt>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="tv_notify_enable" id="tv_notify_enable" value="1" ${config['tv_notify_enable']}> Enable TV Notifications
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div id="tv_notify_options" data-parsley-group="tv_notify">
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="tv_notify_on_start" id="tv_notify_on_start" data-parsley-multiple="tv_notify" value="1" ${config['tv_notify_on_start']}> Notify on playback start
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="tv_notify_on_stop" id="tv_notify_on_stop" data-parsley-multiple="tv_notify" value="1" ${config['tv_notify_on_stop']}> Notify on playback stop
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="tv_notify_on_pause" id="tv_notify_on_pause" data-parsley-multiple="tv_notify" data-parsley-mincheck="1" data-parsley-required value="1" ${config['tv_notify_on_pause']}> Notify on playback pause
|
|
</div>
|
|
</div>
|
|
</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="movie_notify_enable" id="movie_notify_enable" value="1" ${config['movie_notify_enable']}> Enable Movie Notifications
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div id="movie_notify_options" data-parsley-group="movie_notify">
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="movie_notify_on_start" id="movie_notify_on_start" data-parsley-multiple="movie_notify" value="1" ${config['movie_notify_on_start']}> Notify on playback start
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="movie_notify_on_stop" id="movie_notify_on_stop" data-parsley-multiple="movie_notify" value="1" ${config['movie_notify_on_stop']}> Notify on playback stop
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="movie_notify_on_pause" id="movie_notify_on_pause" data-parsley-multiple="movie_notify" data-parsley-mincheck="1" data-parsley-required value="1" ${config['movie_notify_on_pause']}> Notify on playback pause
|
|
</div>
|
|
</div>
|
|
</dd>
|
|
</dl>
|
|
<dl>
|
|
<dt>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="music_notify_enable" id="music_notify_enable" value="1" ${config['music_notify_enable']}> Enable Music Notifications
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div id="music_notify_options" data-parsley-group="music_notify">
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="music_notify_on_start" id="music_notify_on_start" data-parsley-multiple="music_notify" value="1" ${config['music_notify_on_start']}> Notify on playback start
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="music_notify_on_stop" id="music_notify_on_stop" data-parsley-multiple="music_notify" value="1" ${config['music_notify_on_stop']}> Notify on playback stop
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="music_notify_on_pause" id="music_notify_on_pause" data-parsley-multiple="music_notify" data-parsley-mincheck="1" data-parsley-required value="1" ${config['music_notify_on_pause']}> Notify on playback pause
|
|
</div>
|
|
</div>
|
|
</dd>
|
|
</dl>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<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-5">
|
|
<div class="wellbg" style="padding: 0px 0px 0px 20px;">
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Growl</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="growl_enabled" id="growl" value="1" ${config['growl_enabled']}> Enable Growl Notifications
|
|
</div>
|
|
<div id="growloptions">
|
|
<div class="form-group">
|
|
<label for="growl_host">Growl Host:Port</label>
|
|
<input type="text" id="growl_host" name="growl_host" value="${config['growl_host']}" size="30">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="growl_password">Growl Password</label>
|
|
<input type="password" id="growl_password" name="growl_password" value="${config['growl_password']}" size="30">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Prowl</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="prowl_enabled" id="prowl" value="1" ${config['prowl_enabled']}> Enable Prowl Notifications
|
|
</div>
|
|
<div id="prowloptions">
|
|
<div class="form-group">
|
|
<label for="prowl_keys">API Key</label>
|
|
<input type="text" id="prowl_keys" name="prowl_keys" value="${config['prowl_keys']}" size="50">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="prowl_priority">Priority (-2,-1,0,1 or 2)</label>
|
|
<input type="text" id="prowl_priority" name="prowl_priority" value="${config['prowl_priority']}" size="2">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>XBMC</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="xbmc_enabled" id="xbmc" value="1" ${config['xbmc_enabled']}> Enable XBMC Notifications
|
|
</div>
|
|
<div id="xbmcoptions">
|
|
<div class="form-group">
|
|
<label for="xbmc_host">XBMC Host:Port</label>
|
|
<input type="text" id="xbmc_host" name="xbmc_host" value="${config['xbmc_host']}" size="30">
|
|
<p class="help-block">e.g. http://localhost:8080. Separate hosts with commas.</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="xbmc_username">XBMC Username</label>
|
|
<input type="text" id="xbmc_username" name="xbmc_username" value="${config['xbmc_username']}" size="30">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="xbmc_password">XBMC Password</label>
|
|
<input type="password" id="xbmc_password" name="xbmc_password" value="${config['xbmc_password']}" size="30">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Plex Home Theatre</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="plex_enabled" id="plex" value="1" ${config['plex_enabled']}> Enable Plex Notifications
|
|
</div>
|
|
<div id="plexoptions">
|
|
<div class="form-group">
|
|
<label for="plex_client_host">Plex Client Host:Port</label>
|
|
<input type="text" id="plex_client_host" name="plex_client_host" value="${config['plex_client_host']}" size="30">
|
|
<p class="help-block">Host running Plex Client (eg. http://192.168.1.100:3000).</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plex_username">Plex Username</label>
|
|
<input type="text" id="plex_username"name="plex_username" value="${config['plex_username']}" size="30">
|
|
<p class="help-block">Username of your Plex client API (blank for none).</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plex_password">Plex Password</label>
|
|
<input type="password" id="plex_password" name="plex_password" value="${config['plex_password']}" size="30">
|
|
<p class="help-block">Password of your Plex client API (blank for none).</p>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>NotifyMyAndroid</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="nma_enabled" id="nma" value="1" ${config['nma_enabled']}> Enable NotifyMyAndroid
|
|
</div>
|
|
<div id="nmaoptions">
|
|
<div class="form-group">
|
|
<label for="nma_apikey">NotifyMyAndroid API Key</label>
|
|
<input type="text" id="nma_apikey" name="nma_apikey" value="${config['nma_apikey']}" size="30">
|
|
<p class="help-block">Separate multiple api keys with commas.</p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="nma_priority">Priority</label>
|
|
<select id="nma_priority" name="nma_priority">
|
|
%for x in [-2,-1,0,1,2]:
|
|
<%
|
|
if config['nma_priority'] == x:
|
|
nma_priority_selected = 'selected'
|
|
else:
|
|
nma_priority_selected = ''
|
|
if x == -2:
|
|
nma_priority_value = 'Very Low'
|
|
elif x == -1:
|
|
nma_priority_value = 'Moderate'
|
|
elif x == 0:
|
|
nma_priority_value = 'Normal'
|
|
elif x == 1:
|
|
nma_priority_value = 'High'
|
|
else:
|
|
nma_priority_value = 'Emergency'
|
|
%>
|
|
<option value=${x} ${nma_priority_selected}>${nma_priority_value}</option>
|
|
%endfor
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Pushalot</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="pushalot_enabled" id="pushalot" value="1" ${config['pushalot_enabled']}> Enable Pushalot
|
|
</div>
|
|
<div id="pushalotoptions">
|
|
<div class="form-group">
|
|
<label for="pushalot_apikey">Pushalot API Key</label>
|
|
<input type="text" id="pushalot_apikey" name="pushalot_apikey" value="${config['pushalot_apikey']}" size="30">
|
|
<p class="help-block">Separate multiple api keys with commas.</p>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Email</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="email_enabled" id="email" value="1" ${config['email_enabled']}> Enable Email Notifications
|
|
</div>
|
|
<div id="email_options">
|
|
<div class="form-group">
|
|
<label for="email_from">From</label>
|
|
<input type="text" id="email_from" name="email_from" value="${config['email_from']}" size="254">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email_to">To</label>
|
|
<input type="text" id="email_to" name="email_to" value="${config['email_to']}" size="254">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email_smtp_server">SMTP Server</label>
|
|
<input type="text" id="email_smtp_server" name="email_smtp_server" value="${config['email_smtp_server']}" size="254">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email_smtp_user">SMTP User</label>
|
|
<input type="text" id="email_smtp_user" name="email_smtp_user" value="${config['email_smtp_user']}" size="254">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email_smtp_password">SMTP Password</label>
|
|
<input type="password" id="email_smtp_password" name="email_smtp_password" value="${config['email_smtp_password']}" size="50">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email_smtp_port">SMTP Port</label>
|
|
<input type="text" id="email_smtp_port" name="email_smtp_port" value="${config['email_smtp_port']}" size="4">
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="email_tls" value="1" ${config['email_tls']}> TLS
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="span4">
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Pushover</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="pushover_enabled" id="pushover" value="1" ${config['pushover_enabled']}> Enable Pushover Notifications
|
|
</div>
|
|
<div id="pushoveroptions">
|
|
<div class="form-group">
|
|
<label for="pushover_keys">User key</label>
|
|
<input type="text" id="pushover_keys" name="pushover_keys" value="${config['pushover_keys']}" size="50">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="pushover_priority">Priority (-1,0, or 1)</label>
|
|
<input type="text" id="pushover_priority" name="pushover_priority" value="${config['pushover_priority']}" size="2">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="pushover_apitoken">API Token (leave blank to use PlexPy default)</label>
|
|
<input type="text" id="pushover_apitoken" name="pushover_apitoken" value="${config['pushover_apitoken']}" size="50">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Pushbullet</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="pushbullet_enabled" id="pushbullet" value="1" ${config['pushbullet_enabled']}> Enable PushBullet Notifications
|
|
</div>
|
|
<div id="pushbulletoptions">
|
|
<div class="form-group">
|
|
<label for="pushbullet_apikey">API Key</label>
|
|
<input type="text" id="pushbullet_apikey" name="pushbullet_apikey" value="${config['pushbullet_apikey']}" size="50">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="pushbullet_deviceid">Device ID</label>
|
|
<input type="text" id="pushbullet_deviceid" name="pushbullet_deviceid" value="${config['pushbullet_deviceid']}" size="50">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<!-- We need to test Twitter first
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Twitter</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="twitter_enabled" id="twitter" value="1" ${config['twitter_enabled']}> Enable Twitter Notifications
|
|
</div>
|
|
<div id="twitteroptions">
|
|
<div class="form-group">
|
|
<input type="button" class="btn btn-small" value="Request Authorization" id="twitterStep1" />
|
|
</div>
|
|
<div class="form-group">
|
|
<input type="text" id="twitter_key" value="" size="35" placeholder="Input Authorization Key" />
|
|
<input type="button" class="btn btn-link" value="Verify Key" id="twitterStep2" />
|
|
</div>
|
|
<div class="form-group">
|
|
<input type="button" class="btn btn-small" value="Test Twitter" id="testTwitter" />
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
-->
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>OS X</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="osx_notify_enabled" id="osx_notify" value="1" ${config['osx_notify_enabled']}> Enable OS X Notifications
|
|
</div>
|
|
<div id="osx_notify_options">
|
|
<div class="form-group">
|
|
<label for="osx_notify_reg">Register Notify App</label>
|
|
<input type="text" id="osx_notify_reg" name="osx_notify_app" value="${config['osx_notify_app']}" size="50">
|
|
<input type="button" class="btn btn-link" value="Register" id="osxnotifyregister">
|
|
<p class="help-block">Enter the path/application name to be registered with the Notification Center, default is /Applications/PlexPy.</p>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<div class="wellheader">
|
|
<h3>Boxcar2</h3>
|
|
</div>
|
|
<div class="checkbox">
|
|
<input type="checkbox" name="boxcar_enabled" id="boxcar" value="1" ${config['boxcar_enabled']}> Enable Boxcar2 Notifications
|
|
</div>
|
|
<div id="boxcar_options">
|
|
<div class="form-group">
|
|
<label for="boxcar_token">Access Token</label>
|
|
<input type="text" id="boxcar_token" name="boxcar_token" value="${config['boxcar_token']}" size="35">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
</div>
|
|
<input type="button" class="btn btn-medium btn-primary save-button" value="Save" data-success="Changes saved successfully">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div id="dateTimeOptionsModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="dateTimeOptionsModal" aria-hidden="true">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
<h3 id="myModalLabel">Date & Time Format Options</h3>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="card-back">
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td colspan="3"><h5>Day</h5></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>DD</strong></td>
|
|
<td width="300">Numeric, with leading zeros</td>
|
|
<td>01 to 31</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>D</strong></td>
|
|
<td>Numeric, without leading zeros</td>
|
|
<td>1 to 31</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>Do</strong></td>
|
|
<td>The English suffix for the day of the month</td>
|
|
<td>st, nd or th in the 1st, 2nd or 15th.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="3"><h5>Month</h5></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>MM</strong></td>
|
|
<td>Numeric, with leading zeros</td>
|
|
<td>01 to 31</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>M</strong></td>
|
|
<td>Numeric, without leading zeros</td>
|
|
<td>1 to 31</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>MMMM</strong></td>
|
|
<td>Textual full</td>
|
|
<td>January to December</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>MMM</strong></td>
|
|
<td>Textual three letters</td>
|
|
<td>Jan to Dec</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="3"><h5>Year</h5></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>YYYY</strong></td>
|
|
<td>Numeric, 4 digits</td>
|
|
<td>Eg., 1999, 2003</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>YY</strong></td>
|
|
<td>Numeric, 2 digits</td>
|
|
<td>Eg., 99, 03</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="3"><h5>Time</h5></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>a</strong></td>
|
|
<td width="300">am/pm Lowercase</td>
|
|
<td>am, pm</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>A</strong></td>
|
|
<td>AM/PM Uppercase</td>
|
|
<td>AM, PM</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>h</strong></td>
|
|
<td>Hour, 12-hour, without leading zeros</td>
|
|
<td>1-12</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>hh</strong></td>
|
|
<td>Hour, 12-hour, with leading zeros</td>
|
|
<td>01-12</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>H</strong></td>
|
|
<td>Hour, 24-hour, without leading zeros</td>
|
|
<td>0-23</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>HH</strong></td>
|
|
<td>Hour, 24-hour, with leading zeros</td>
|
|
<td>00-23</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>mm</strong></td>
|
|
<td>Minutes, with leading zeros</td>
|
|
<td>00-59</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>ss</strong></td>
|
|
<td>Seconds, with leading zeros</td>
|
|
<td>00-59</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>zz</strong></td>
|
|
<td>Timezone abbreviation</td>
|
|
<td>Eg., EST, MDT ...</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer"></div>
|
|
</div>
|
|
<div id="pms-auth-modal" class="modal hide fade" tabindex="-1" role="dialog"
|
|
aria-labelledby="ip-info-modal" aria-hidden="true">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i
|
|
class="fa fa-remove"></i></button>
|
|
<h3 id="PMSAuthModal">Fetch Plex.tv Token</h3>
|
|
</div>
|
|
<div class="modal-body" id="modal-text">
|
|
<div>
|
|
<div class="card-back">
|
|
<span>
|
|
This will attempt to fetch your token for you. This will not work on Internet Explorer 9 or lower.
|
|
PlexPy does not store your username and password.
|
|
</span>
|
|
<br/><br/>
|
|
<div class="form-group">
|
|
<label for="pms_username">PMS Username</label>
|
|
<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">
|
|
<p class="help-block">Password for Plex.tv authentication.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="">
|
|
<input type="button" id="get-pms-auth-token" class="btn btn-primary" value="Fetch Token">
|
|
<span id="pms-token-status"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="plexwatch-import-modal" class="modal hide fade" tabindex="-1" role="dialog"
|
|
aria-labelledby="plexwatch-import-modal" aria-hidden="true">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</%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...');
|
|
if (($("#pms_username").val() !== '') || ($("#pms_password").val() !== '')) {
|
|
$.ajax({
|
|
type: "post",
|
|
url: "https://plex.tv/users/sign_in.xml",
|
|
dataType: 'xml',
|
|
async: true,
|
|
headers: {'Content-Type': 'application/xml; charset=utf-8',
|
|
'X-Plex-Device-Name': 'PlexPy',
|
|
'X-Plex-Product': 'PlexPy',
|
|
'X-Plex-Version': 'v0.1 dev',
|
|
'X-Plex-Client-Identifier': '${config['pms_uuid']}',
|
|
'Authorization': 'Basic ' + btoa($("#pms_username").val() + ':' + $("#pms_password").val())
|
|
},
|
|
error: function(jqXHR, textStatus, errorThrown) {
|
|
$("#pms-token-status").html('<i class="fa fa-exclamation-circle"></i> Authentation failed!');
|
|
},
|
|
success: function (xml) {
|
|
var authToken = $(xml).find('user').attr('authenticationToken');
|
|
$("#pms-token-status").html('<i class="fa fa-check"></i> Authentation successful!');
|
|
$("#pms_token").val(authToken);
|
|
$('#pms-auth-modal').modal('hide');
|
|
}
|
|
});
|
|
} else {
|
|
$("#pms-token-status").html("You must enter both fields.");
|
|
}
|
|
});
|
|
|
|
// Load PlexWatch import modal
|
|
$("#toggle-plexwatch-import-modal").click(function() {
|
|
$.ajax({
|
|
url: 'plexwatch_import',
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#plexwatch-import-modal").html(xhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
|
|
function openExtrasDialog() {
|
|
$("#dialog").dialog({ close: function(){
|
|
var elem = '<input type="button" data-success="Changes saved successfully">';
|
|
doAjaxCall('configUpdate', elem,'tabs',true);
|
|
}}).dialog("open");
|
|
};
|
|
|
|
function initThisPage()
|
|
{
|
|
if ($("#api_enabled").is(":checked"))
|
|
{
|
|
$("#apioptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#apioptions").hide();
|
|
}
|
|
|
|
$("#api_enabled").click(function(){
|
|
if ($("#api_enabled").is(":checked"))
|
|
{
|
|
$("#apioptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#apioptions").slideUp();
|
|
}
|
|
});
|
|
|
|
$('#api_key').click(function(){ $('#api_key').select() });
|
|
$("#generate_api").click(function(){
|
|
$.get('generateAPI',
|
|
function(data){
|
|
if (data.error != undefined) {
|
|
alert(data.error);
|
|
return;
|
|
}
|
|
$('#api_key').val(data);
|
|
});
|
|
});
|
|
if ($("#enable_https").is(":checked"))
|
|
{
|
|
$("#https_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#https_options").hide();
|
|
}
|
|
|
|
$("#enable_https").click(function(){
|
|
if ($("#enable_https").is(":checked"))
|
|
{
|
|
$("#https_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#https_options").slideUp();
|
|
}
|
|
});
|
|
if ($("#growl").is(":checked"))
|
|
{
|
|
$("#growloptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#growloptions").hide();
|
|
}
|
|
|
|
$("#growl").click(function(){
|
|
if ($("#growl").is(":checked"))
|
|
{
|
|
$("#growloptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#growloptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#prowl").is(":checked"))
|
|
{
|
|
$("#prowloptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#prowloptions").hide();
|
|
}
|
|
|
|
$("#prowl").click(function(){
|
|
if ($("#prowl").is(":checked"))
|
|
{
|
|
$("#prowloptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#prowloptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#xbmc").is(":checked"))
|
|
{
|
|
$("#xbmcoptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#xbmcoptions").hide();
|
|
}
|
|
|
|
$("#xbmc").click(function(){
|
|
if ($("#xbmc").is(":checked"))
|
|
{
|
|
$("#xbmcoptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#xbmcoptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#plex").is(":checked"))
|
|
{
|
|
$("#plexoptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#plexoptions").hide();
|
|
}
|
|
|
|
$("#plex").click(function(){
|
|
if ($("#plex").is(":checked"))
|
|
{
|
|
$("#plexoptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#plexoptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#nma").is(":checked"))
|
|
{
|
|
$("#nmaoptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#nmaoptions").hide();
|
|
}
|
|
|
|
$("#nma").click(function(){
|
|
if ($("#nma").is(":checked"))
|
|
{
|
|
$("#nmaoptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#nmaoptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#pushalot").is(":checked"))
|
|
{
|
|
$("#pushalotoptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#pushalotoptions").hide();
|
|
}
|
|
|
|
$("#pushalot").click(function(){
|
|
if ($("#pushalot").is(":checked"))
|
|
{
|
|
$("#pushalotoptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#pushalotoptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#pushover").is(":checked"))
|
|
{
|
|
$("#pushoveroptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#pushoveroptions").hide();
|
|
}
|
|
|
|
$("#pushover").click(function(){
|
|
if ($("#pushover").is(":checked"))
|
|
{
|
|
$("#pushoveroptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#pushoveroptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#pushbullet").is(":checked"))
|
|
{
|
|
$("#pushbulletoptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#pushbulletoptions").hide();
|
|
}
|
|
|
|
|
|
$("#pushbullet").click(function(){
|
|
if ($("#pushbullet").is(":checked"))
|
|
{
|
|
$("#pushbulletoptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#pushbulletoptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#twitter").is(":checked"))
|
|
{
|
|
$("#twitteroptions").show();
|
|
}
|
|
else
|
|
{
|
|
$("#twitteroptions").hide();
|
|
}
|
|
|
|
$("#twitter").click(function(){
|
|
if ($("#twitter").is(":checked"))
|
|
{
|
|
$("#twitteroptions").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#twitteroptions").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#osx_notify").is(":checked"))
|
|
{
|
|
$("#osx_notify_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#osx_notify_options").hide();
|
|
}
|
|
|
|
$("#osx_notify").click(function(){
|
|
if ($("#osx_notify").is(":checked"))
|
|
{
|
|
$("#osx_notify_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#osx_notify_options").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#boxcar").is(":checked"))
|
|
{
|
|
$("#boxcar_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#boxcar_options").hide();
|
|
}
|
|
|
|
$("#boxcar").click(function(){
|
|
if ($("#boxcar").is(":checked"))
|
|
{
|
|
$("#boxcar_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#boxcar_options").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#email").is(":checked"))
|
|
{
|
|
$("#email_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#email_options").hide();
|
|
}
|
|
|
|
$("#email").click(function(){
|
|
if ($("#email").is(":checked"))
|
|
{
|
|
$("#email_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#email_options").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#tv_notify_enable").is(":checked"))
|
|
{
|
|
$("#tv_notify_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#tv_notify_options").hide();
|
|
}
|
|
|
|
$("#tv_notify_enable").click(function(){
|
|
if ($("#tv_notify_enable").is(":checked"))
|
|
{
|
|
$("#tv_notify_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#tv_notify_options").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#movie_notify_enable").is(":checked"))
|
|
{
|
|
$("#movie_notify_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#movie_notify_options").hide();
|
|
}
|
|
|
|
$("#movie_notify_enable").click(function(){
|
|
if ($("#movie_notify_enable").is(":checked"))
|
|
{
|
|
$("#movie_notify_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#movie_notify_options").slideUp();
|
|
}
|
|
});
|
|
|
|
if ($("#music_notify_enable").is(":checked"))
|
|
{
|
|
$("#music_notify_options").show();
|
|
}
|
|
else
|
|
{
|
|
$("#music_notify_options").hide();
|
|
}
|
|
|
|
$("#music_notify_enable").click(function(){
|
|
if ($("#music_notify_enable").is(":checked"))
|
|
{
|
|
$("#music_notify_options").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#music_notify_options").slideUp();
|
|
}
|
|
});
|
|
|
|
initConfigCheckbox("#api_enabled");
|
|
initConfigCheckbox("#enable_https");
|
|
|
|
$('#twitterStep1').click(function () {
|
|
$.get("/twitterStep1", function (data) {window.open(data); })
|
|
.done(function () { $('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>Confirm Authorization. Check pop-up blocker if no response.</div>"); });
|
|
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();
|
|
});
|
|
|
|
$('#twitterStep2').click(function () {
|
|
var twitter_key = $("#twitter_key").val();
|
|
$.get("/twitterStep2", {'key': twitter_key}, function (data) { $('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+data+"</div>"); });
|
|
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();
|
|
});
|
|
|
|
$('#testTwitter').click(function () {
|
|
$.get("/testTwitter",
|
|
function (data) { $('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+data+"</div>"); });
|
|
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();
|
|
});
|
|
|
|
$('#osxnotifyregister').click(function () {
|
|
var osx_notify_app = $("#osx_notify_reg").val();
|
|
$.get("/osxnotifyregister", {'app': osx_notify_app}, function (data) { $('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+data+"</div>"); });
|
|
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut()
|
|
})
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
initThisPage();
|
|
});
|
|
|
|
</script>
|
|
</%def>
|