1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

added modular configuration

This commit is contained in:
Luke Pulverenti 2014-06-29 13:35:05 -04:00
parent 0a3876a9b1
commit 6c602e1ad7
5 changed files with 72 additions and 39 deletions

View file

@ -2,15 +2,15 @@
function loadPage(page, config, users) {
$('#chkEnableServer', page).checked(config.DlnaOptions.EnableServer).checkboxradio("refresh");
$('#chkBlastAliveMessages', page).checked(config.DlnaOptions.BlastAliveMessages).checkboxradio("refresh");
$('#txtBlastInterval', page).val(config.DlnaOptions.BlastAliveMessageIntervalSeconds);
$('#chkEnableServer', page).checked(config.EnableServer).checkboxradio("refresh");
$('#chkBlastAliveMessages', page).checked(config.BlastAliveMessages).checkboxradio("refresh");
$('#txtBlastInterval', page).val(config.BlastAliveMessageIntervalSeconds);
var usersHtml = users.map(function (u) {
return '<option value="' + u.Id + '">' + u.Name + '</option>';
}).join('');
$('#selectUser', page).html(usersHtml).val(config.DlnaOptions.DefaultUserId || '').selectmenu("refresh");
$('#selectUser', page).html(usersHtml).val(config.DefaultUserId || '').selectmenu("refresh");
Dashboard.hideLoadingMsg();
}
@ -21,7 +21,7 @@
var page = this;
var promise1 = ApiClient.getServerConfiguration();
var promise1 = ApiClient.getNamedConfiguration("dlna");
var promise2 = ApiClient.getUsers();
$.when(promise1, promise2).done(function (response1, response2) {
@ -38,14 +38,14 @@
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
ApiClient.getNamedConfiguration("dlna").done(function (config) {
config.DlnaOptions.EnableServer = $('#chkEnableServer', form).checked();
config.DlnaOptions.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
config.DlnaOptions.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
config.DlnaOptions.DefaultUserId = $('#selectUser', form).val();
config.EnableServer = $('#chkEnableServer', form).checked();
config.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
config.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
config.DefaultUserId = $('#selectUser', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("dlna", config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission