mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added library settings page
This commit is contained in:
parent
fac650a344
commit
e9ef2accdf
6 changed files with 165 additions and 80 deletions
|
@ -32,26 +32,6 @@
|
||||||
<input type="number" id="txtWebSocketPortNumber" name="txtWebSocketPortNumber" pattern="[0-9]*" required="required" min="1" />
|
<input type="number" id="txtWebSocketPortNumber" name="txtWebSocketPortNumber" pattern="[0-9]*" required="required" min="1" />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Images By Name Folder</h2>
|
|
||||||
<ul data-role="listview" class="ulForm">
|
|
||||||
<li>
|
|
||||||
<input type="checkbox" id="chkEnableCustomIBNPath" name="chkEnableCustomIBNPath" />
|
|
||||||
<label for="chkEnableCustomIBNPath">Use custom IBN path</label>
|
|
||||||
<div class="fieldDescription">
|
|
||||||
This folder contains actor, artist, genre and studio images.
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li id="fieldEnterIBNPath" style="display: none;">
|
|
||||||
<label for="txtItemsByNamePath">Images by name path: </label>
|
|
||||||
<div style="display: inline-block; width: 92%;">
|
|
||||||
<input type="text" id="txtItemsByNamePath" name="txtItemsByNamePath" />
|
|
||||||
</div>
|
|
||||||
<button id="btnSelectIBNPath" type="button" data-icon="folder-close" data-iconpos="notext" data-inline="true">Select Directory</button>
|
|
||||||
<div class="fieldDescription">
|
|
||||||
Supply a custom path for images by name. MB server must have write access to this folder.
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2>Miscellaneous</h2>
|
<h2>Miscellaneous</h2>
|
||||||
<ul data-role="listview" class="ulForm">
|
<ul data-role="listview" class="ulForm">
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title> </title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="mediaLibraryPage" data-role="page" class="page type-interior mediaLibraryPage">
|
<div id="mediaLibraryPage" data-role="page" class="page type-interior mediaLibraryPage">
|
||||||
|
@ -14,6 +14,10 @@
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('updatepassword.html', true);">Password</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('updatepassword.html', true);">Password</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Media Library</a>
|
<a href="#" data-role="button" class="ui-btn-active">Media Library</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" id="defaultNavigation" style="display: none;" data-mini="true">
|
||||||
|
<a href="#" data-role="button" class="ui-btn-active">Collections</a>
|
||||||
|
<a href="librarysettings.html" data-role="button">Settings</a>
|
||||||
|
</div>
|
||||||
<div class="readOnlyContent">
|
<div class="readOnlyContent">
|
||||||
<p id="fldUseDefaultLibrary" style="display: none;">
|
<p id="fldUseDefaultLibrary" style="display: none;">
|
||||||
<input type="checkbox" id="chkUseDefaultLibrary" name="chkUseDefaultLibrary" onchange="MediaLibraryPage.setUseDefaultMediaLibrary(this.checked);" />
|
<input type="checkbox" id="chkUseDefaultLibrary" name="chkUseDefaultLibrary" onchange="MediaLibraryPage.setUseDefaultMediaLibrary(this.checked);" />
|
||||||
|
|
56
dashboard-ui/librarysettings.html
Normal file
56
dashboard-ui/librarysettings.html
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Media Library</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="librarySettingsPage" data-role="page" class="page type-interior">
|
||||||
|
|
||||||
|
<div data-role="content">
|
||||||
|
<div class="content-primary">
|
||||||
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
|
<a href="library.html" data-role="button">Collections</a>
|
||||||
|
<a href="#" data-role="button" class="ui-btn-active">Settings</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form id="librarySettingsForm">
|
||||||
|
|
||||||
|
<ul data-role="listview" class="ulForm">
|
||||||
|
<li>
|
||||||
|
<input type="checkbox" id="chkEnableCustomIBNPath" name="chkEnableCustomIBNPath" />
|
||||||
|
<label for="chkEnableCustomIBNPath">Use custom images by name path</label>
|
||||||
|
<div class="fieldDescription">
|
||||||
|
This folder contains actor, artist, genre and studio images.
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li id="fieldEnterIBNPath" style="display: none;">
|
||||||
|
<label for="txtItemsByNamePath">Images by name path: </label>
|
||||||
|
<div style="display: inline-block; width: 92%;">
|
||||||
|
<input type="text" id="txtItemsByNamePath" name="txtItemsByNamePath" />
|
||||||
|
</div>
|
||||||
|
<button id="btnSelectIBNPath" type="button" data-icon="folder-close" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||||
|
<div class="fieldDescription">
|
||||||
|
Supply a custom path for images by name. MB server must have write access to this folder.
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="submit" data-theme="b" data-icon="ok">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('#librarySettingsForm').on('submit', LibrarySettingsPage.onSubmit);
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -12,19 +12,6 @@
|
||||||
$('#selectAutomaticUpdateLevel', page).val(config.SystemUpdateLevel).selectmenu('refresh');
|
$('#selectAutomaticUpdateLevel', page).val(config.SystemUpdateLevel).selectmenu('refresh');
|
||||||
$('#txtWebSocketPortNumber', page).val(config.LegacyWebSocketPortNumber);
|
$('#txtWebSocketPortNumber', page).val(config.LegacyWebSocketPortNumber);
|
||||||
|
|
||||||
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath);
|
|
||||||
|
|
||||||
var customIbn = config.ItemsByNamePath ? true : false;
|
|
||||||
$('#chkEnableCustomIBNPath', page).checked(customIbn).checkboxradio("refresh");
|
|
||||||
|
|
||||||
if (customIbn) {
|
|
||||||
$('#fieldEnterIBNPath', page).show();
|
|
||||||
$('#txtItemsByNamePath', page).attr("required", "required");
|
|
||||||
} else {
|
|
||||||
$('#fieldEnterIBNPath', page).hide();
|
|
||||||
$('#txtItemsByNamePath', page).removeAttr("required");
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#txtPortNumber', page).val(config.HttpServerPortNumber);
|
$('#txtPortNumber', page).val(config.HttpServerPortNumber);
|
||||||
$('#chkDebugLog', page).checked(config.EnableDebugLevelLogging).checkboxradio("refresh");
|
$('#chkDebugLog', page).checked(config.EnableDebugLevelLogging).checkboxradio("refresh");
|
||||||
|
|
||||||
|
@ -44,50 +31,11 @@
|
||||||
|
|
||||||
var promise2 = ApiClient.getSystemInfo();
|
var promise2 = ApiClient.getSystemInfo();
|
||||||
|
|
||||||
$('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
|
|
||||||
|
|
||||||
Dashboard.selectDirectory({
|
|
||||||
|
|
||||||
callback: function (path) {
|
|
||||||
|
|
||||||
if (path) {
|
|
||||||
$('#txtItemsByNamePath', page).val(path);
|
|
||||||
}
|
|
||||||
$('#popupDirectoryPicker', page).popup("close");
|
|
||||||
},
|
|
||||||
|
|
||||||
header: "Select Items By Name Path",
|
|
||||||
|
|
||||||
instruction: "Browse or enter the path to your items by name folder. The folder must be writeable."
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#chkEnableCustomIBNPath', page).on("change.showIBNText", function() {
|
|
||||||
|
|
||||||
if (this.checked) {
|
|
||||||
$('#fieldEnterIBNPath', page).show();
|
|
||||||
$('#txtItemsByNamePath', page).attr("required", "required");
|
|
||||||
} else {
|
|
||||||
$('#fieldEnterIBNPath', page).hide();
|
|
||||||
$('#txtItemsByNamePath', page).removeAttr("required");
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$.when(promise1, promise2).done(function (response1, response2) {
|
$.when(promise1, promise2).done(function (response1, response2) {
|
||||||
|
|
||||||
loadPage(page, response1[0], response2[0]);
|
loadPage(page, response1[0], response2[0]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagehide', "#advancedConfigurationPage", function () {
|
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
|
||||||
|
|
||||||
var page = this;
|
|
||||||
|
|
||||||
$('#chkEnableCustomIBNPath', page).off("change.showIBNText");
|
|
||||||
$('#btnSelectIBNPath', page).off("click.selectDirectory");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function advancedConfigurationPage() {
|
function advancedConfigurationPage() {
|
||||||
|
@ -110,12 +58,6 @@
|
||||||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||||
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
|
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
|
||||||
|
|
||||||
if ($('#chkEnableCustomIBNPath', form).checked()) {
|
|
||||||
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
|
||||||
} else {
|
|
||||||
config.ItemsByNamePath = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
100
dashboard-ui/scripts/librarysettings.js
Normal file
100
dashboard-ui/scripts/librarysettings.js
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
(function ($, document, window) {
|
||||||
|
|
||||||
|
function loadPage(page, config) {
|
||||||
|
|
||||||
|
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath);
|
||||||
|
|
||||||
|
var customIbn = config.ItemsByNamePath ? true : false;
|
||||||
|
$('#chkEnableCustomIBNPath', page).checked(customIbn).checkboxradio("refresh");
|
||||||
|
|
||||||
|
if (customIbn) {
|
||||||
|
$('#fieldEnterIBNPath', page).show();
|
||||||
|
$('#txtItemsByNamePath', page).attr("required", "required");
|
||||||
|
} else {
|
||||||
|
$('#fieldEnterIBNPath', page).hide();
|
||||||
|
$('#txtItemsByNamePath', page).removeAttr("required");
|
||||||
|
}
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('pageshow', "#librarySettingsPage", function () {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
|
||||||
|
|
||||||
|
Dashboard.selectDirectory({
|
||||||
|
|
||||||
|
callback: function (path) {
|
||||||
|
|
||||||
|
if (path) {
|
||||||
|
$('#txtItemsByNamePath', page).val(path);
|
||||||
|
}
|
||||||
|
$('#popupDirectoryPicker', page).popup("close");
|
||||||
|
},
|
||||||
|
|
||||||
|
header: "Select Items By Name Path",
|
||||||
|
|
||||||
|
instruction: "Browse or enter the path to your items by name folder. The folder must be writeable."
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#chkEnableCustomIBNPath', page).on("change.showIBNText", function () {
|
||||||
|
|
||||||
|
if (this.checked) {
|
||||||
|
$('#fieldEnterIBNPath', page).show();
|
||||||
|
$('#txtItemsByNamePath', page).attr("required", "required");
|
||||||
|
} else {
|
||||||
|
$('#fieldEnterIBNPath', page).hide();
|
||||||
|
$('#txtItemsByNamePath', page).removeAttr("required");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
ApiClient.getServerConfiguration().done(function (config) {
|
||||||
|
|
||||||
|
loadPage(page, config);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on('pagehide', "#librarySettingsPage", function () {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('#chkEnableCustomIBNPath', page).off("change.showIBNText");
|
||||||
|
$('#btnSelectIBNPath', page).off("click.selectDirectory");
|
||||||
|
});
|
||||||
|
|
||||||
|
function librarySettingsPage() {
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
self.onSubmit = function () {
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var form = this;
|
||||||
|
|
||||||
|
ApiClient.getServerConfiguration().done(function (config) {
|
||||||
|
|
||||||
|
if ($('#chkEnableCustomIBNPath', form).checked()) {
|
||||||
|
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
||||||
|
} else {
|
||||||
|
config.ItemsByNamePath = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Disable default form submission
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
window.LibrarySettingsPage = new librarySettingsPage();
|
||||||
|
|
||||||
|
})(jQuery, document, window);
|
|
@ -16,6 +16,7 @@
|
||||||
if (userId) {
|
if (userId) {
|
||||||
|
|
||||||
$('#userProfileNavigation', page).show();
|
$('#userProfileNavigation', page).show();
|
||||||
|
$('#defaultNavigation', page).hide();
|
||||||
|
|
||||||
ApiClient.getUser(userId).done(function (user) {
|
ApiClient.getUser(userId).done(function (user) {
|
||||||
Dashboard.setPageTitle(user.Name);
|
Dashboard.setPageTitle(user.Name);
|
||||||
|
@ -42,7 +43,9 @@
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$('#userProfileNavigation', page).hide();
|
$('#userProfileNavigation', page).hide();
|
||||||
ApiClient.getVirtualFolders().done(function(result) {
|
$('#defaultNavigation', page).show();
|
||||||
|
|
||||||
|
ApiClient.getVirtualFolders().done(function (result) {
|
||||||
MediaLibraryPage.reloadVirtualFolders(page, result);
|
MediaLibraryPage.reloadVirtualFolders(page, result);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue