mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add library display settings
This commit is contained in:
parent
0bf7dcaa32
commit
d4f197006a
8 changed files with 107 additions and 7 deletions
54
dashboard-ui/scripts/librarydisplay.js
Normal file
54
dashboard-ui/scripts/librarydisplay.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
define(['globalize'], function (globalize) {
|
||||
|
||||
function getTabs() {
|
||||
return [
|
||||
{
|
||||
href: 'library.html',
|
||||
name: globalize.translate('TabFolders')
|
||||
},
|
||||
{
|
||||
href: 'librarydisplay.html',
|
||||
name: globalize.translate('TabDisplay')
|
||||
},
|
||||
{
|
||||
href: 'librarypathmapping.html',
|
||||
name: globalize.translate('TabPathSubstitution')
|
||||
},
|
||||
{
|
||||
href: 'librarysettings.html',
|
||||
name: globalize.translate('TabAdvanced')
|
||||
}];
|
||||
}
|
||||
|
||||
return function (view, params) {
|
||||
|
||||
var self = this;
|
||||
|
||||
view.querySelector('form').addEventListener('submit', function (e) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.EnableFolderView = form.querySelector('.chkFolderView').checked;
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
function loadData() {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
view.querySelector('.chkFolderView').checked = config.EnableFolderView;
|
||||
});
|
||||
}
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
LibraryMenu.setTabs('librarysetup', 1, getTabs);
|
||||
loadData();
|
||||
});
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue