1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/controllers/wizard/remote/index.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-07-17 19:04:56 +01:00
import loading from 'loading';
import 'emby-checkbox';
import 'emby-button';
import 'emby-select';
2018-10-23 01:05:09 +03:00
2020-07-17 19:04:56 +01:00
function save(page) {
loading.show();
const apiClient = ApiClient;
const config = {};
config.EnableRemoteAccess = page.querySelector('#chkRemoteAccess').checked;
config.EnableAutomaticPortMapping = page.querySelector('#chkEnableUpnp').checked;
apiClient.ajax({
type: 'POST',
data: config,
url: apiClient.getUrl('Startup/RemoteAccess')
}).then(function () {
loading.hide();
navigateToNextPage();
});
}
2018-10-23 01:05:09 +03:00
2020-07-17 19:04:56 +01:00
function navigateToNextPage() {
Dashboard.navigate('wizardfinish.html');
}
2018-10-23 01:05:09 +03:00
2020-07-17 19:04:56 +01:00
function onSubmit(e) {
save(this);
e.preventDefault();
return false;
}
2019-10-08 01:28:30 +03:00
2020-07-17 19:04:56 +01:00
export default function (view, params) {
view.querySelector('.wizardSettingsForm').addEventListener('submit', onSubmit);
view.addEventListener('viewshow', function () {
document.querySelector('.skinHeader').classList.add('noHomeButtonHeader');
});
view.addEventListener('viewhide', function () {
document.querySelector('.skinHeader').classList.remove('noHomeButtonHeader');
});
}