mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-20 19:59:26 +00:00
864 lines
64 KiB
HTML
864 lines
64 KiB
HTML
<%inherit file="base.html"/>
|
|
<%!
|
|
import headphones
|
|
import string
|
|
%>
|
|
|
|
<%def name="headerIncludes()">
|
|
<div id="subhead_container">
|
|
<div id="subhead_menu">
|
|
<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-power-off"></i> Restart</a> <%-- Changed ID to be unique --%>
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
<div id="paddingheader">
|
|
<h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
|
|
</div>
|
|
<form action="configUpdate" method="post" class="form" id="configUpdateForm"> <%-- Added Form ID --%>
|
|
<div id="tabs" class="ui-tabs"> <%-- Added ui-tabs class for styling --%>
|
|
<ul class="ui-tabs-nav"> <%-- Added ui-tabs-nav class --%>
|
|
<li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" role="tab"><a href="#tabs-1" class="ui-tabs-anchor" role="presentation" tabindex="-1">Web Interface</a></li>
|
|
<li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" role="tab"><a href="#tabs-2" class="ui-tabs-anchor" role="presentation" tabindex="-1">Download settings</a></li>
|
|
<li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" role="tab"><a href="#tabs-3" class="ui-tabs-anchor" role="presentation" tabindex="-1">Search providers</a></li>
|
|
<li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" role="tab"><a href="#tabs-4" class="ui-tabs-anchor" role="presentation" tabindex="-1">Quality & Post Processing</a></li>
|
|
<li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" role="tab"><a href="#tabs-5" class="ui-tabs-anchor" role="presentation" tabindex="-1">Notifications</a></li>
|
|
<li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab" role="tab"><a href="#tabs-6" class="ui-tabs-anchor" role="presentation" tabindex="-1">Advanced Settings</a></li>
|
|
</ul>
|
|
<div id="tabs-1" class="ui-tabs-panel">
|
|
<table class="configtable" summary="Web Interface">
|
|
<tr>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Basic</legend>
|
|
<div class="form-row"> <%-- Changed to a generic form row --%>
|
|
<label for="http_host" title="Host to bind web server to">HTTP Host</label>
|
|
<input type="text" id="http_host" name="HTTPHost" value="${headphones.CONFIG.HTTP_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="http_port" title="Port to bind web server to">HTTP Port</label>
|
|
<input type="text" id="http_port" name="HTTPPort" value="${headphones.CONFIG.HTTP_PORT|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="http_username">HTTP Username</label>
|
|
<input type="text" id="http_username" name="HTTPUsername" value="${headphones.CONFIG.HTTP_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="http_password">HTTP Password</label>
|
|
<input type="password" id="http_password" name="HTTPPassword" value="${headphones.CONFIG.HTTP_PASSWORD|h}" autocomplete="new-password" /> <%-- Added autocomplete --%>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_https">Enable HTTPS</label>
|
|
<input type="checkbox" id="enable_https" name="EnableHTTPS" value="1" %if headphones.CONFIG.ENABLE_HTTPS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="https_cert">HTTPS Certificate</label>
|
|
<input type="text" id="https_cert" name="HTTPSCert" value="${headphones.CONFIG.HTTPS_CERT|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="https_key">HTTPS Key</label>
|
|
<input type="text" id="https_key" name="HTTPSKey" value="${headphones.CONFIG.HTTPS_KEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="api_key">API Key</label>
|
|
<input type="text" id="api_key" name="APIKey" value="${headphones.CONFIG.API_KEY|h}" readonly />
|
|
<button type="button" id="generate_apikey_btn" class="action-btn" data-action="generateAPIKey">Generate</button> <%-- Added data-action --%>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="check_for_updates">Check For Updates</label>
|
|
<input type="checkbox" id="check_for_updates" name="CheckForUpdates" value="1" %if headphones.CONFIG.CHECK_FOR_UPDATES: checked %endif />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Scheduling</legend>
|
|
<div class="form-row">
|
|
<label for="search_interval" title="How often to search for new albums/tracks (in minutes)">Search Interval (minutes)</label>
|
|
<input type="text" id="search_interval" name="SearchInterval" value="${headphones.CONFIG.SEARCH_INTERVAL|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="download_scan_interval" title="How often to scan your download folder for new content (in minutes)">Download Scan Interval (minutes)</label>
|
|
<input type="text" id="download_scan_interval" name="DownloadScanInterval" value="${headphones.CONFIG.DOWNLOAD_SCAN_INTERVAL|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="library_scan_interval" title="How often to scan your library for new content (in minutes)">Library Scan Interval (minutes)</label>
|
|
<input type="text" id="library_scan_interval" name="LibraryScanInterval" value="${headphones.CONFIG.LIBRARY_SCAN_INTERVAL|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="mb_update_interval" title="How often to update artists from MusicBrainz (in hours)">MusicBrainz Update Interval (hours)</label>
|
|
<input type="text" id="mb_update_interval" name="MBUpdateInterval" value="${headphones.CONFIG.MB_UPDATE_INTERVAL|h}" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="tabs-2" class="ui-tabs-panel">
|
|
<table class="configtable" summary="Download settings">
|
|
<tr>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Usenet</legend>
|
|
<div class="form-row">
|
|
<label for="usenet_provider">Usenet Provider</label>
|
|
<select id="usenet_provider" name="UsenetProvider">
|
|
<option value="none" %if headphones.CONFIG.USENET_PROVIDER == 'none': selected %endif>None</option>
|
|
<option value="sabnzbd" %if headphones.CONFIG.USENET_PROVIDER == 'sabnzbd': selected %endif>SABnzbd</option>
|
|
<option value="nzbget" %if headphones.CONFIG.USENET_PROVIDER == 'nzbget': selected %endif>NZBget</option>
|
|
<option value="blackhole" %if headphones.CONFIG.USENET_PROVIDER == 'blackhole': selected %endif>Black Hole</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="sabnzbd_host">SABnzbd Host</label>
|
|
<input type="text" id="sabnzbd_host" name="SABNZBDHost" value="${headphones.CONFIG.SABNZBD_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="sabnzbd_apikey">SABnzbd API Key</label>
|
|
<input type="text" id="sabnzbd_apikey" name="SABNZBDApikey" value="${headphones.CONFIG.SABNZBD_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="sabnzbd_username">SABnzbd Username</label>
|
|
<input type="text" id="sabnzbd_username" name="SABNZBDUsername" value="${headphones.CONFIG.SABNZBD_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="sabnzbd_password">SABnzbd Password</label>
|
|
<input type="password" id="sabnzbd_password" name="SABNZBDPassword" value="${headphones.CONFIG.SABNZBD_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="sabnzbd_category">SABnzbd Category</label>
|
|
<input type="text" id="sabnzbd_category" name="SABNZBDCategory" value="${headphones.CONFIG.SABNZBD_CATEGORY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="nzbget_host">NZBget Host</label>
|
|
<input type="text" id="nzbget_host" name="NZBGETHost" value="${headphones.CONFIG.NZBGET_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="nzbget_username">NZBget Username</label>
|
|
<input type="text" id="nzbget_username" name="NZBGETUsername" value="${headphones.CONFIG.NZBGET_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="nzbget_password">NZBget Password</label>
|
|
<input type="password" id="nzbget_password" name="NZBGETPassword" value="${headphones.CONFIG.NZBGET_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="nzbget_category">NZBget Category</label>
|
|
<input type="text" id="nzbget_category" name="NZBGETCategory" value="${headphones.CONFIG.NZBGET_CATEGORY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="blackhole_dir">Black Hole Directory</label>
|
|
<input type="text" id="blackhole_dir" name="BlackHoleDir" value="${headphones.CONFIG.BLACKHOLE_DIR|h}" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Torrents</legend>
|
|
<div class="form-row">
|
|
<label for="torrent_provider">Torrent Provider</label>
|
|
<select id="torrent_provider" name="TorrentProvider">
|
|
<option value="none" %if headphones.CONFIG.TORRENT_PROVIDER == 'none': selected %endif>None</option>
|
|
<option value="blackhole" %if headphones.CONFIG.TORRENT_PROVIDER == 'blackhole': selected %endif>Black Hole</option>
|
|
<option value="transmission" %if headphones.CONFIG.TORRENT_PROVIDER == 'transmission': selected %endif>Transmission</option>
|
|
<option value="utorrent" %if headphones.CONFIG.TORRENT_PROVIDER == 'utorrent': selected %endif>uTorrent</option>
|
|
<option value="deluge" %if headphones.CONFIG.TORRENT_PROVIDER == 'deluge': selected %endif>Deluge</option>
|
|
<option value="qbittorrent" %if headphones.CONFIG.TORRENT_PROVIDER == 'qbittorrent': selected %endif>qBittorrent</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torrent_host">Torrent Host</label>
|
|
<input type="text" id="torrent_host" name="TorrentHost" value="${headphones.CONFIG.TORRENT_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torrent_username">Torrent Username</label>
|
|
<input type="text" id="torrent_username" name="TorrentUsername" value="${headphones.CONFIG.TORRENT_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torrent_password">Torrent Password</label>
|
|
<input type="password" id="torrent_password" name="TorrentPassword" value="${headphones.CONFIG.TORRENT_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torrent_label">Torrent Label</label>
|
|
<input type="text" id="torrent_label" name="TorrentLabel" value="${headphones.CONFIG.TORRENT_LABEL|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torrent_dir">Torrent Black Hole Directory</label>
|
|
<input type="text" id="torrent_dir" name="TorrentDir" value="${headphones.CONFIG.TORRENT_DIR|h}" />
|
|
</div>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend>Music Download Directories</legend>
|
|
<div class="form-row">
|
|
<label for="usenet_music_dir">Usenet Music Directory</label>
|
|
<input type="text" id="usenet_music_dir" name="UsenetMusicDir" value="${headphones.CONFIG.USENET_MUSIC_DIR|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torrent_music_dir">Torrent Music Directory</label>
|
|
<input type="text" id="torrent_music_dir" name="TorrentMusicDir" value="${headphones.CONFIG.TORRENT_MUSIC_DIR|h}" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="tabs-3" class="ui-tabs-panel">
|
|
<table class="configtable" summary="Search providers">
|
|
<tr>
|
|
<td>
|
|
<fieldset>
|
|
<legend>NZB Search Providers</legend>
|
|
<div class="form-row">
|
|
<label for="enable_headphones_indexer">Enable Headphones Indexer</label>
|
|
<input type="checkbox" id="enable_headphones_indexer" name="EnableHeadphonesIndexer" value="1" %if headphones.CONFIG.ENABLE_HEADPHONES_INDEXER: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="newznab_host">Newznab Host</label>
|
|
<input type="text" id="newznab_host" name="NewznabHost" value="${headphones.CONFIG.NEWZNAB_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="newznab_apikey">Newznab API Key</label>
|
|
<input type="text" id="newznab_apikey" name="NewznabApikey" value="${headphones.CONFIG.NEWZNAB_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="nzbs_org_apikey">NZBs.org API Key</label>
|
|
<input type="text" id="nzbs_org_apikey" name="NZBSOrgApikey" value="${headphones.CONFIG.NZBS_ORG_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="omgwtfnzbs_username">omgwtfnzbs Username</label>
|
|
<input type="text" id="omgwtfnzbs_username" name="OMgwtfnzbsUsername" value="${headphones.CONFIG.OMWTFNZBS_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="omgwtfnzbs_password">omgwtfnzbs Password</label>
|
|
<input type="password" id="omgwtfnzbs_password" name="OMgwtfnzbsPassword" value="${headphones.CONFIG.OMWTFNZBS_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Torrent Search Providers</legend>
|
|
<div class="form-row">
|
|
<label for="enable_thepiratebay">Enable The Pirate Bay</label>
|
|
<input type="checkbox" id="enable_thepiratebay" name="EnableThePirateBay" value="1" %if headphones.CONFIG.ENABLE_THEPIRATEBAY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_rutracker_org">Enable rutracker.org</label>
|
|
<input type="checkbox" id="enable_rutracker_org" name="EnableRuTrackerOrg" value="1" %if headphones.CONFIG.ENABLE_RUTRACKER_ORG: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="rutracker_username">rutracker.org Username</label>
|
|
<input type="text" id="rutracker_username" name="RuTrackerUsername" value="${headphones.CONFIG.RUTRACKER_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="rutracker_password">rutracker.org Password</label>
|
|
<input type="password" id="rutracker_password" name="RuTrackerPassword" value="${headphones.CONFIG.RUTRACKER_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_orpheus_network">Enable Orpheus.network</label>
|
|
<input type="checkbox" id="enable_orpheus_network" name="EnableOrpheusNetwork" value="1" %if headphones.CONFIG.ENABLE_ORPHEUS_NETWORK: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="orpheus_apikey">Orpheus.network API Key</label>
|
|
<input type="text" id="orpheus_apikey" name="OrpheusApikey" value="${headphones.CONFIG.ORPHEUS_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_redacted">Enable Redacted</label>
|
|
<input type="checkbox" id="enable_redacted" name="EnableRedacted" value="1" %if headphones.CONFIG.ENABLE_REDACTED: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="redacted_apikey">Redacted API Key</label>
|
|
<input type="text" id="redacted_apikey" name="RedactedApikey" value="${headphones.CONFIG.REDACTED_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torznab_url">Torznab URL</label>
|
|
<input type="text" id="torznab_url" name="TorznabURL" value="${headphones.CONFIG.TORZNAB_URL|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torznab_apikey">Torznab API Key</label>
|
|
<input type="text" id="torznab_apikey" name="TorznabApikey" value="${headphones.CONFIG.TORZNAB_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="torznab_category">Torznab Category</label>
|
|
<input type="text" id="torznab_category" name="TorznabCategory" value="${headphones.CONFIG.TORZNAB_CATEGORY|h}" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<fieldset>
|
|
<legend>Other Download Methods</legend>
|
|
<div class="form-row">
|
|
<label for="enable_bandcamp">Enable Bandcamp</label>
|
|
<input type="checkbox" id="enable_bandcamp" name="EnableBandcamp" value="1" %if headphones.CONFIG.ENABLE_BANDCAMP: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_soulseek">Enable Soulseek</label>
|
|
<input type="checkbox" id="enable_soulseek" name="EnableSoulseek" value="1" %if headphones.CONFIG.ENABLE_SOULSEEK: checked %endif />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="tabs-4" class="ui-tabs-panel">
|
|
<table class="configtable" summary="Quality & Post Processing">
|
|
<tr>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Quality</legend>
|
|
<div class="form-row">
|
|
<label>Preferred Quality</label>
|
|
<div class="radio-group"> <%-- Added radio-group class --%>
|
|
<input type="radio" id="quality_highest_ex_lossless" name="PreferredQuality" value="highest_excluding_lossless" %if headphones.CONFIG.PREFERRED_QUALITY == 'highest_excluding_lossless': checked %endif />
|
|
<label for="quality_highest_ex_lossless">Highest Quality (excluding lossless)</label><br>
|
|
<input type="radio" id="quality_highest_inc_lossless" name="PreferredQuality" value="highest_including_lossless" %if headphones.CONFIG.PREFERRED_QUALITY == 'highest_including_lossless': checked %endif />
|
|
<label for="quality_highest_inc_lossless">Highest Quality (including lossless)</label><br>
|
|
<input type="radio" id="quality_lossless_only" name="PreferredQuality" value="lossless_only" %if headphones.CONFIG.PREFERRED_QUALITY == 'lossless_only': checked %endif />
|
|
<label for="quality_lossless_only">Lossless Only</label><br>
|
|
<input type="radio" id="quality_preferred_bitrate" name="PreferredQuality" value="preferred_bitrate" %if headphones.CONFIG.PREFERRED_QUALITY == 'preferred_bitrate': checked %endif />
|
|
<label for="quality_preferred_bitrate">Preferred Bitrate</label>
|
|
</div>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="preferred_bitrate">Preferred Bitrate (kbps)</label>
|
|
<input type="text" id="preferred_bitrate" name="PreferredBitrate" value="${headphones.CONFIG.PREFERRED_BITRATE|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="bitrate_deviation">Bitrate Deviation (%)</label>
|
|
<input type="text" id="bitrate_deviation" name="BitrateDeviation" value="${headphones.CONFIG.BITRATE_DEVIATION|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="reject_if_below_bitrate">Reject if below preferred bitrate</label>
|
|
<input type="checkbox" id="reject_if_below_bitrate" name="RejectIfBelowBitrate" value="1" %if headphones.CONFIG.REJECT_IF_BELOW_BITRATE: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="auto_detect_bitrate">Auto Detect Preferred Bitrate</label>
|
|
<input type="checkbox" id="auto_detect_bitrate" name="AutoDetectBitrate" value="1" %if headphones.CONFIG.AUTO_DETECT_BITRATE: checked %endif />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Post Processing</legend>
|
|
<div class="form-row">
|
|
<label for="post_process_method">Post Process Method</label>
|
|
<select id="post_process_method" name="PostProcessMethod">
|
|
<option value="copy" %if headphones.CONFIG.POST_PROCESS_METHOD == 'copy': selected %endif>Copy</option>
|
|
<option value="move" %if headphones.CONFIG.POST_PROCESS_METHOD == 'move': selected %endif>Move</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="post_process_dir">Post Process Directory</label>
|
|
<input type="text" id="post_process_dir" name="PostProcessDir" value="${headphones.CONFIG.POST_PROCESS_DIR|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="delete_original_after_post_process">Delete Original After Post Process</label>
|
|
<input type="checkbox" id="delete_original_after_post_process" name="DeleteOriginalAfterPostProcess" value="1" %if headphones.CONFIG.DELETE_ORIGINAL_AFTER_POST_PROCESS: checked %endif />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="tabs-5" class="ui-tabs-panel">
|
|
<table class="configtable" summary="Notifications">
|
|
<tr>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Notification Settings</legend>
|
|
<%-- Notification settings fields would go here --%>
|
|
<%-- Adding placeholders for existing settings identified in analysis or common patterns --%>
|
|
<div class="form-row">
|
|
<label for="notify_on_download">Notify on Download</label>
|
|
<input type="checkbox" id="notify_on_download" name="NotifyOnDownload" value="1" %if headphones.CONFIG.NOTIFY_ON_DOWNLOAD: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="notify_on_snatch">Notify on Snatched</label>
|
|
<input type="checkbox" id="notify_on_snatch" name="NotifyOnSnatch" value="1" %if headphones.CONFIG.NOTIFY_ON_SNATCH: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_notify">Email Notification</label>
|
|
<input type="checkbox" id="email_notify" name="EmailNotify" value="1" %if headphones.CONFIG.EMAIL_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_server">Email Server</label>
|
|
<input type="text" id="email_server" name="EmailServer" value="${headphones.CONFIG.EMAIL_SERVER|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_port">Email Port</label>
|
|
<input type="text" id="email_port" name="EmailPort" value="${headphones.CONFIG.EMAIL_PORT|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_username">Email Username</label>
|
|
<input type="text" id="email_username" name="EmailUsername" value="${headphones.CONFIG.EMAIL_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_password">Email Password</label>
|
|
<input type="password" id="email_password" name="EmailPassword" value="${headphones.CONFIG.EMAIL_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_from">Email From Address</label>
|
|
<input type="text" id="email_from" name="EmailFrom" value="${headphones.CONFIG.EMAIL_FROM|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_to">Email To Address</label>
|
|
<input type="text" id="email_to" name="EmailTo" value="${headphones.CONFIG.EMAIL_TO|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="email_tls">Email TLS/SSL</label>
|
|
<input type="checkbox" id="email_tls" name="EmailTLS" value="1" %if headphones.CONFIG.EMAIL_TLS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testEmail" class="action-btn" data-action="testEmail">Test Email</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="growl_notify">Growl Notification</label>
|
|
<input type="checkbox" id="growl_notify" name="GrowlNotify" value="1" %if headphones.CONFIG.GROWL_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="growl_host">Growl Host</label>
|
|
<input type="text" id="growl_host" name="GrowlHost" value="${headphones.CONFIG.GROWL_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="growl_password">Growl Password</label>
|
|
<input type="password" id="growl_password" name="GrowlPassword" value="${headphones.CONFIG.GROWL_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testGrowl" class="action-btn" data-action="testGrowl">Test Growl</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="prowl_notify">Prowl Notification</label>
|
|
<input type="checkbox" id="prowl_notify" name="ProwlNotify" value="1" %if headphones.CONFIG.PROWL_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="prowl_apikey">Prowl API Key</label>
|
|
<input type="text" id="prowl_apikey" name="ProwlApikey" value="${headphones.CONFIG.PROWL_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testProwl" class="action-btn" data-action="testProwl">Test Prowl</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="nma_notify">NMA Notification</label>
|
|
<input type="checkbox" id="nma_notify" name="NMANotify" value="1" %if headphones.CONFIG.NMA_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="nma_apikey">NMA API Key</label>
|
|
<input type="text" id="nma_apikey" name="NMAApikey" value="${headphones.CONFIG.NMA_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testNMA" class="action-btn" data-action="testNMA">Test NMA</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="pushbullet_notify">Pushbullet Notification</label>
|
|
<input type="checkbox" id="pushbullet_notify" name="PushbulletNotify" value="1" %if headphones.CONFIG.PUSHBULLET_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="pushbullet_apikey">Pushbullet API Key</label>
|
|
<input type="text" id="pushbullet_apikey" name="PushbulletApikey" value="${headphones.CONFIG.PUSHBULLET_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testPushbullet" class="action-btn" data-action="testPushbullet">Test Pushbullet</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="pushover_notify">Pushover Notification</label>
|
|
<input type="checkbox" id="pushover_notify" name="PushoverNotify" value="1" %if headphones.CONFIG.PUSHOVER_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="pushover_apikey">Pushover API Key</label>
|
|
<input type="text" id="pushover_apikey" name="PushoverApikey" value="${headphones.CONFIG.PUSHOVER_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="pushover_userkey">Pushover User Key</label>
|
|
<input type="text" id="pushover_userkey" name="PushoverUserkey" value="${headphones.CONFIG.PUSHOVER_USERKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testPushover" class="action-btn" data-action="testPushover">Test Pushover</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="telegram_notify">Telegram Notification</label>
|
|
<input type="checkbox" id="telegram_notify" name="TelegramNotify" value="1" %if headphones.CONFIG.TELEGRAM_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="telegram_bottoken">Telegram Bot Token</label>
|
|
<input type="text" id="telegram_bottoken" name="TelegramBotToken" value="${headphones.CONFIG.TELEGRAM_BOTTOKEN|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="telegram_chatid">Telegram Chat ID</label>
|
|
<input type="text" id="telegram_chatid" name="TelegramChatID" value="${headphones.CONFIG.TELEGRAM_CHATID|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testTelegram" class="action-btn" data-action="testTelegram">Test Telegram</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="discord_notify">Discord Notification</label>
|
|
<input type="checkbox" id="discord_notify" name="DiscordNotify" value="1" %if headphones.CONFIG.DISCORD_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="discord_webhook">Discord Webhook URL</label>
|
|
<input type="text" id="discord_webhook" name="DiscordWebhook" value="${headphones.CONFIG.DISCORD_WEBHOOK|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testDiscord" class="action-btn" data-action="testDiscord">Test Discord</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="slack_notify">Slack Notification</label>
|
|
<input type="checkbox" id="slack_notify" name="SlackNotify" value="1" %if headphones.CONFIG.SLACK_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="slack_webhook">Slack Webhook URL</label>
|
|
<input type="text" id="slack_webhook" name="SlackWebhook" value="${headphones.CONFIG.SLACK_WEBHOOK|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testSlack" class="action-btn" data-action="testSlack">Test Slack</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="kodi_notify">Kodi Notification</label>
|
|
<input type="checkbox" id="kodi_notify" name="KodiNotify" value="1" %if headphones.CONFIG.KODI_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="kodi_host">Kodi Host</label>
|
|
<input type="text" id="kodi_host" name="KodiHost" value="${headphones.CONFIG.KODI_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="kodi_username">Kodi Username</label>
|
|
<input type="text" id="kodi_username" name="KodiUsername" value="${headphones.CONFIG.KODI_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="kodi_password">Kodi Password</label>
|
|
<input type="password" id="kodi_password" name="KodiPassword" value="${headphones.CONFIG.KODI_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testKodi" class="action-btn" data-action="testKodi">Test Kodi</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="plex_notify">Plex Notification</label>
|
|
<input type="checkbox" id="plex_notify" name="PlexNotify" value="1" %if headphones.CONFIG.PLEX_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="plex_host">Plex Host</label>
|
|
<input type="text" id="plex_host" name="PlexHost" value="${headphones.CONFIG.PLEX_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="plex_token">Plex Token</label>
|
|
<input type="text" id="plex_token" name="PlexToken" value="${headphones.CONFIG.PLEX_TOKEN|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testPlex" class="action-btn" data-action="testPlex">Test Plex</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="twitter_notify">Twitter Notification</label>
|
|
<input type="checkbox" id="twitter_notify" name="TwitterNotify" value="1" %if headphones.CONFIG.TWITTER_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="twitter_consumer_key">Twitter Consumer Key</label>
|
|
<input type="text" id="twitter_consumer_key" name="TwitterConsumerKey" value="${headphones.CONFIG.TWITTER_CONSUMER_KEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="twitter_consumer_secret">Twitter Consumer Secret</label>
|
|
<input type="text" id="twitter_consumer_secret" name="TwitterConsumerSecret" value="${headphones.CONFIG.TWITTER_CONSUMER_SECRET|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="twitter_access_token">Twitter Access Token</label>
|
|
<input type="text" id="twitter_access_token" name="TwitterAccessToken" value="${headphones.CONFIG.TWITTER_ACCESS_TOKEN|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="twitter_access_secret">Twitter Access Secret</label>
|
|
<input type="text" id="twitter_access_secret" name="TwitterAccessSecret" value="${headphones.CONFIG.TWITTER_ACCESS_SECRET|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="twitterStep1_btn" class="action-btn" data-action="twitterStep1">Get Authorization URL</button>
|
|
<label for="twitter_key">PIN</label>
|
|
<input type="text" id="twitter_key" name="TwitterKey" />
|
|
<button type="button" id="twitterStep2_btn" class="action-btn" data-action="twitterStep2">Confirm Authorization</button>
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="testTwitter" class="action-btn" data-action="testTwitter">Test Twitter</button>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="osx_notify_notify">OSX Notification</label>
|
|
<input type="checkbox" id="osx_notify_notify" name="OSXNotifyNotify" value="1" %if headphones.CONFIG.OSX_NOTIFY_NOTIFY: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="osx_notify_reg">OSX Notify App</label>
|
|
<input type="text" id="osx_notify_reg" name="OSXNotifyReg" value="${headphones.CONFIG.OSX_NOTIFY_REG|h}" />
|
|
<button type="button" id="osxnotifyregister_btn" class="action-btn" data-action="osxnotifyregister">Register App</button>
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="tabs-6" class="ui-tabs-panel">
|
|
<table class="configtable" summary="Advanced Settings">
|
|
<tr>
|
|
<td>
|
|
<fieldset>
|
|
<legend>Advanced Options</legend>
|
|
<%-- Advanced settings fields would go here --%>
|
|
<%-- Adding placeholders based on typical advanced settings --%>
|
|
<div class="form-row">
|
|
<label for="log_level">Log Level</label>
|
|
<select id="log_level" name="LogLevel">
|
|
<option value="DEBUG" %if headphones.CONFIG.LOG_LEVEL == 'DEBUG': selected %endif>DEBUG</option>
|
|
<option value="INFO" %if headphones.CONFIG.LOG_LEVEL == 'INFO': selected %endif>INFO</option>
|
|
<option value="WARNING" %if headphones.CONFIG.LOG_LEVEL == 'WARNING': selected %endif>WARNING</option>
|
|
<option value="ERROR" %if headphones.CONFIG.LOG_LEVEL == 'ERROR': selected %endif>ERROR</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="proxy_host">Proxy Host</label>
|
|
<input type="text" id="proxy_host" name="ProxyHost" value="${headphones.CONFIG.PROXY_HOST|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="proxy_port">Proxy Port</label>
|
|
<input type="text" id="proxy_port" name="ProxyPort" value="${headphones.CONFIG.PROXY_PORT|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="proxy_username">Proxy Username</label>
|
|
<input type="text" id="proxy_username" name="ProxyUsername" value="${headphones.CONFIG.PROXY_USERNAME|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="proxy_password">Proxy Password</label>
|
|
<input type="password" id="proxy_password" name="ProxyPassword" value="${headphones.CONFIG.PROXY_PASSWORD|h}" autocomplete="new-password" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="folder_permissions">Folder Permissions (Octal)</label>
|
|
<input type="text" id="folder_permissions" name="FolderPermissions" value="${headphones.CONFIG.FOLDER_PERMISSIONS|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="file_permissions">File Permissions (Octal)</label>
|
|
<input type="text" id="file_permissions" name="FilePermissions" value="${headphones.CONFIG.FILE_PERMISSIONS|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="chown_downloads">Chown Downloads</label>
|
|
<input type="checkbox" id="chown_downloads" name="ChownDownloads" value="1" %if headphones.CONFIG.CHOWN_DOWNLOADS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="chmod_downloads">Chmod Downloads</label>
|
|
<input type="checkbox" id="chmod_downloads" name="ChmodDownloads" value="1" %if headphones.CONFIG.CHMOD_DOWNLOADS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="skip_failed_downloads">Skip Failed Downloads</label>
|
|
<input type="checkbox" id="skip_failed_downloads" name="SkipFailedDownloads" value="1" %if headphones.CONFIG.SKIP_FAILED_DOWNLOADS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="use_fancybox">Use Fancybox</label>
|
|
<input type="checkbox" id="use_fancybox" name="UseFancybox" value="1" %if headphones.CONFIG.USE_FANCYBOX: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_xem">Enable XEM</label>
|
|
<input type="checkbox" id="enable_xem" name="EnableXEM" value="1" %if headphones.CONFIG.ENABLE_XEM: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_metacritic">Enable Metacritic Scores</label>
|
|
<input type="checkbox" id="enable_metacritic" name="EnableMetacritic" value="1" %if headphones.CONFIG.ENABLE_METACRITIC: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_fanart_tv">Enable Fanart.tv</label>
|
|
<input type="checkbox" id="enable_fanart_tv" name="EnableFanartTv" value="1" %if headphones.CONFIG.ENABLE_FANART_TV: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="fanart_apikey">Fanart.tv API Key</label>
|
|
<input type="text" id="fanart_apikey" name="FanartApikey" value="${headphones.CONFIG.FANART_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_discogs">Enable Discogs</label>
|
|
<input type="checkbox" id="enable_discogs" name="EnableDiscogs" value="1" %if headphones.CONFIG.ENABLE_DISCOGS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="discogs_token">Discogs Token</label>
|
|
<input type="text" id="discogs_token" name="DiscogsToken" value="${headphones.CONFIG.DISCOGS_TOKEN|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_lastfm">Enable Last.fm</label>
|
|
<input type="checkbox" id="enable_lastfm" name="EnableLastFm" value="1" %if headphones.CONFIG.ENABLE_LAST_FM: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="lastfm_apikey">Last.fm API Key</label>
|
|
<input type="text" id="lastfm_apikey" name="LastFmApikey" value="${headphones.CONFIG.LAST_FM_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="lastfm_secret">Last.fm Secret</label>
|
|
<input type="text" id="lastfm_secret" name="LastFmSecret" value="${headphones.CONFIG.LAST_FM_SECRET|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_lyrics">Enable Lyrics</label>
|
|
<input type="checkbox" id="enable_lyrics" name="EnableLyrics" value="1" %if headphones.CONFIG.ENABLE_LYRICS: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_audiodb">Enable AudioDB</label>
|
|
<input type="checkbox" id="enable_audiodb" name="EnableAudioDb" value="1" %if headphones.CONFIG.ENABLE_AUDIODB: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="audiodb_apikey">AudioDB API Key</label>
|
|
<input type="text" id="audiodb_apikey" name="AudioDbApikey" value="${headphones.CONFIG.AUDIO_DB_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_gracenote">Enable Gracenote</label>
|
|
<input type="checkbox" id="enable_gracenote" name="EnableGracenote" value="1" %if headphones.CONFIG.ENABLE_GRACENOTE: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="gracenote_apikey">Gracenote API Key</label>
|
|
<input type="text" id="gracenote_apikey" name="GracenoteApikey" value="${headphones.CONFIG.GRACENOTE_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_last_fm_scrobbling">Enable Last.fm Scrobbling</label>
|
|
<input type="checkbox" id="enable_last_fm_scrobbling" name="EnableLastFmScrobbling" value="1" %if headphones.CONFIG.ENABLE_LAST_FM_SCROBBLING: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<button type="button" id="lastfm_auth_btn" class="action-btn" data-action="lastFmAuth">Authorize Last.fm</button>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="enable_songkick">Enable Songkick</label>
|
|
<input type="checkbox" id="enable_songkick" name="EnableSongkick" value="1" %if headphones.CONFIG.ENABLE_SONGKICK: checked %endif />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="songkick_apikey">Songkick API Key</label>
|
|
<input type="text" id="songkick_apikey" name="SongkickApikey" value="${headphones.CONFIG.SONGKICK_APIKEY|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="songkick_location">Songkick Location</label>
|
|
<input type="text" id="songkick_location" name="SongkickLocation" value="${headphones.CONFIG.SONGKICK_LOCATION|h}" />
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="songkick_filter_enabled">Filter by Songkick Location</label>
|
|
<input type="checkbox" id="songkick_filter_enabled" name="SongkickFilterEnabled" value="1" %if headphones.CONFIG.SONGKICK_FILTER_ENABLED: checked %endif />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="submit-buttons">
|
|
<button type="submit" class="save-btn"><i class="fa fa-save"></i> Save Changes</button>
|
|
<button type="reset" class="reset-btn"><i class="fa fa-undo"></i> Reset</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</%def>
|
|
|
|
<%def name="headIncludes()">
|
|
${parent.headIncludes()} <%-- Ensure parent head includes are kept --%>
|
|
<link rel="stylesheet" href="interfaces/default/css/data_table.css"> <%-- Kept for now, evaluate if still needed --%>
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
${parent.javascriptIncludes()} <%-- Ensure parent javascript includes are kept --%>
|
|
<script src="js/libs/jquery.dataTables.min.js"></script> <%-- Keep if DataTables is used on tables that remain --%>
|
|
|
|
<script>
|
|
// Define a global object for page-specific functions to avoid polluting global scope directly
|
|
var ConfigPage = ConfigPage || {};
|
|
|
|
ConfigPage.initTabs = function() {
|
|
// Initialize jQuery UI Tabs
|
|
$("#tabs").tabs({
|
|
activate: function(event, ui) {
|
|
// This callback fires when a new tab is selected
|
|
// If you have specific actions to perform when a tab becomes active, add them here.
|
|
// For example, if a tab's content is loaded via AJAX, you might trigger that load here.
|
|
console.log("Tab changed to: " + ui.newTab.text());
|
|
}
|
|
});
|
|
};
|
|
|
|
ConfigPage.initActionButtons = function() {
|
|
// Delegated event handler for all buttons with class 'action-btn'
|
|
// This handles API key generation, notification tests, and Twitter authorization steps
|
|
$('#configUpdateForm').on('click', '.action-btn', function(e) {
|
|
e.preventDefault();
|
|
var $this = $(this);
|
|
var action = $this.data('action');
|
|
var url = '/' + action; // Assuming actions map directly to API endpoints
|
|
|
|
var data = {}; // Data to send with the AJAX request
|
|
|
|
// Specific logic for different actions
|
|
if (action === 'generateAPIKey') {
|
|
// No specific data needed, API key is generated on server
|
|
} else if (action === 'testEmail') {
|
|
// Data for testing email might come from form fields, but usually handled server-side for security
|
|
} else if (action === 'twitterStep1') {
|
|
// Open a new window for Twitter authorization
|
|
window.open(url, '_blank');
|
|
return; // Prevent further AJAX call for twitterStep1
|
|
} else if (action === 'twitterStep2') {
|
|
data.key = $('#twitter_key').val();
|
|
} else if (action === 'osxnotifyregister') {
|
|
data.app = $('#osx_notify_reg').val();
|
|
}
|
|
|
|
// Generic AJAX call for actions
|
|
$.get(url, data, function(response) {
|
|
// Assuming common.js provides a way to show messages like 'doAjaxCall' did
|
|
// Or you can implement a simple feedback mechanism here
|
|
if (response) {
|
|
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>" + response + "</div>")
|
|
.addClass('success').fadeIn().delay(3000).fadeOut();
|
|
// For API key generation, update the field
|
|
if (action === 'generateAPIKey' && response) {
|
|
$('#api_key').val(response); // Assuming response directly contains the new API key
|
|
}
|
|
} else {
|
|
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-alert'></span>Action completed, but no specific response.</div>")
|
|
.addClass('warning').fadeIn().delay(3000).fadeOut();
|
|
}
|
|
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-alert'></span>Error: " + textStatus + " - " + errorThrown + "</div>")
|
|
.addClass('error').fadeIn().delay(5000).fadeOut();
|
|
});
|
|
});
|
|
};
|
|
|
|
ConfigPage.initFormSubmission = function() {
|
|
// Intercept form submission to use AJAX
|
|
$('#configUpdateForm').on('submit', function(e) {
|
|
e.preventDefault(); // Prevent default form submission
|
|
|
|
var $form = $(this);
|
|
var url = $form.attr('action');
|
|
var formData = $form.serialize(); // Get all form data
|
|
|
|
$.post(url, formData, function(response) {
|
|
// Assuming response is a success message or JSON
|
|
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>" + response + "</div>")
|
|
.addClass('success').fadeIn().delay(3000).fadeOut();
|
|
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
$('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-alert'></span>Error saving settings: " + textStatus + " - " + errorThrown + "</div>")
|
|
.addClass('error').fadeIn().delay(5000).fadeOut();
|
|
});
|
|
});
|
|
};
|
|
|
|
$(document).ready(function() {
|
|
// Assuming initActions() from common.js is called in parent.javascriptIncludes()
|
|
// If not, and it's essential, ensure it's called somewhere.
|
|
// initActions();
|
|
|
|
ConfigPage.initTabs();
|
|
ConfigPage.initActionButtons();
|
|
ConfigPage.initFormSubmission();
|
|
});
|
|
</script>
|
|
</%def>
|