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

fixes #1537 - [Feature Request] Provide option to select which interface(s) to bind to

This commit is contained in:
Luke Pulverenti 2016-06-07 15:46:55 -04:00
parent 78d18d058c
commit 0750007cfe
7 changed files with 92 additions and 52 deletions

View file

@ -4,25 +4,48 @@
Dashboard.showLoadingMsg();
var form = this;
var localAddress = form.querySelector('#txtLocalAddress').value;
var enableUpnp = $('#chkEnableUpnp', form).checked();
ApiClient.getServerConfiguration().then(function (config) {
confirmSelections(localAddress, enableUpnp, function () {
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
config.PublicPort = $('#txtPublicPort', form).val();
config.PublicHttpsPort = $('#txtPublicHttpsPort', form).val();
config.EnableHttps = $('#chkEnableHttps', form).checked();
config.HttpsPortNumber = $('#txtHttpsPort', form).val();
config.EnableUPnP = $('#chkEnableUpnp', form).checked();
config.WanDdns = $('#txtDdns', form).val();
config.CertificatePath = $('#txtCertificatePath', form).val();
ApiClient.getServerConfiguration().then(function (config) {
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, Dashboard.processErrorResponse);
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
config.PublicPort = $('#txtPublicPort', form).val();
config.PublicHttpsPort = $('#txtPublicHttpsPort', form).val();
config.EnableHttps = $('#chkEnableHttps', form).checked();
config.HttpsPortNumber = $('#txtHttpsPort', form).val();
config.EnableUPnP = enableUpnp;
config.WanDdns = $('#txtDdns', form).val();
config.CertificatePath = $('#txtCertificatePath', form).val();
config.LocalNetworkAddresses = localAddress ? [localAddress] : [];
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, Dashboard.processErrorResponse);
});
});
// Disable default form submission
return false;
}
function confirmSelections(localAddress, enableUpnp, callback) {
if (localAddress) {
require(['alert'], function (alert) {
alert({
title: Globalize.translate('TitleHostingSettings'),
text: Globalize.translate('SettingsWarning')
}).then(callback);
});
} else {
callback();
}
}
function getTabs() {
return [
{
@ -45,6 +68,8 @@
$('#txtPublicPort', page).val(config.PublicPort);
$('#txtPublicHttpsPort', page).val(config.PublicHttpsPort);
page.querySelector('#txtLocalAddress').value = config.LocalNetworkAddresses[0] || '';
var chkEnableHttps = page.querySelector('#chkEnableHttps');
chkEnableHttps.checked = config.EnableHttps;