109 lines
6.4 KiB
HTML
109 lines
6.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Media Cleaner</title>
|
|
</head>
|
|
<body>
|
|
<div id="MediaCleanerConfigPage" data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-select,emby-checkbox">
|
|
<div data-role="content">
|
|
<div class="content-primary">
|
|
<form id="MediaCleanerConfigForm">
|
|
<div class="inputContainer">
|
|
<label class="inputLabel inputLabelUnfocused" for="RadarrAPIKey">Radarr API Key</label>
|
|
<input id="RadarrAPIKey" name="RadarrAPIKey" type="text" is="emby-input" />
|
|
<div class="fieldDescription">The api key used by your radarr instance</div>
|
|
</div>
|
|
<div class="inputContainer">
|
|
<label class="inputLabel inputLabelUnfocused" for="SonarrAPIKey">Sonarr API Key</label>
|
|
<input id="SonarrAPIKey" name="SonarrAPIKey" type="text" is="emby-input" />
|
|
<div class="fieldDescription">The api key used by your sonarr instance</div>
|
|
</div>
|
|
<div class="inputContainer">
|
|
<label class="inputLabel inputLabelUnfocused" for="StaleMediaCutoff">Stale Media Cutoff</label>
|
|
<input id="StaleMediaCutoff" name="StaleMediaCutoff" type="number" is="emby-input" style="width: 20%;"/>
|
|
<div class="fieldDescription">How many days to wait before marking files as stale</div>
|
|
</div>
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
<label class="emby-checkbox-label">
|
|
<input id="DebugMode" name="DebugMode" type="checkbox" is="emby-checkbox" />
|
|
<span>Debug Mode</span>
|
|
</label>
|
|
</div>
|
|
<!-- <div class="selectContainer">
|
|
<label class="selectLabel" for="Options">Several Options</label>
|
|
<select is="emby-select" id="Options" name="Options" class="emby-select-withcolor emby-select">
|
|
<option id="optOneOption" value="OneOption">One Option</option>
|
|
<option id="optAnotherOption" value="AnotherOption">Another Option</option>
|
|
</select>
|
|
</div>
|
|
<div class="inputContainer">
|
|
<label class="inputLabel inputLabelUnfocused" for="AnInteger">An Integer</label>
|
|
<input id="AnInteger" name="AnInteger" type="number" is="emby-input" min="0" />
|
|
<div class="fieldDescription">A Description</div>
|
|
</div>
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
<label class="emby-checkbox-label">
|
|
<input id="TrueFalseSetting" name="TrueFalseCheckBox" type="checkbox" is="emby-checkbox" />
|
|
<span>A Checkbox</span>
|
|
</label>
|
|
</div>
|
|
<div class="inputContainer">
|
|
<label class="inputLabel inputLabelUnfocused" for="AString">A String</label>
|
|
<input id="AString" name="AString" type="text" is="emby-input" />
|
|
<div class="fieldDescription">Another Description</div>
|
|
</div> -->
|
|
<div>
|
|
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
|
|
<span>Save</span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
var MediaCleanerConfig = {
|
|
pluginUniqueId: 'fef007a8-3e8f-4aa8-a22e-486a387f4192'
|
|
};
|
|
|
|
document.querySelector('#MediaCleanerConfigPage')
|
|
.addEventListener('pageshow', function() {
|
|
Dashboard.showLoadingMsg();
|
|
ApiClient.getPluginConfiguration(MediaCleanerConfig.pluginUniqueId).then(function (config) {
|
|
// document.querySelector('#Options').value = config.Options;
|
|
// document.querySelector('#AnInteger').value = config.AnInteger;
|
|
// document.querySelector('#TrueFalseSetting').checked = config.TrueFalseSetting;
|
|
// document.querySelector('#AString').value = config.AString;
|
|
document.querySelector('#RadarrAPIKey').value = config.RadarrAPIKey;
|
|
document.querySelector('#SonarrAPIKey').value = config.SonarrAPIKey;
|
|
document.querySelector('#StaleMediaCutoff').value = config.StaleMediaCutoff;
|
|
document.querySelector('#DebugMode').checked = config.DebugMode;
|
|
Dashboard.hideLoadingMsg();
|
|
});
|
|
});
|
|
|
|
document.querySelector('#MediaCleanerConfigForm')
|
|
.addEventListener('submit', function(e) {
|
|
Dashboard.showLoadingMsg();
|
|
ApiClient.getPluginConfiguration(MediaCleanerConfig.pluginUniqueId).then(function (config) {
|
|
// config.Options = document.querySelector('#Options').value;
|
|
// config.AnInteger = document.querySelector('#AnInteger').value;
|
|
// config.TrueFalseSetting = document.querySelector('#TrueFalseSetting').checked;
|
|
// config.AString = document.querySelector('#AString').value;
|
|
config.RadarrAPIKey = document.querySelector('#RadarrAPIKey').value;
|
|
config.SonarrAPIKey = document.querySelector('#SonarrAPIKey').value;
|
|
config.StaleMediaCutoff = document.querySelector('#StaleMediaCutoff').value;
|
|
config.DebugMode = document.querySelector('#DebugMode').checked;
|
|
ApiClient.updatePluginConfiguration(MediaCleanerConfig.pluginUniqueId, config).then(function (result) {
|
|
Dashboard.processPluginConfigurationUpdateResult(result);
|
|
});
|
|
});
|
|
|
|
e.preventDefault();
|
|
return false;
|
|
});
|
|
</script>
|
|
</div>
|
|
</body>
|
|
</html>
|