2020-08-14 08:46:34 +02:00
|
|
|
import loading from '../../../components/loading/loading';
|
|
|
|
import '../../../elements/emby-checkbox/emby-checkbox';
|
|
|
|
import '../../../elements/emby-button/emby-button';
|
|
|
|
import '../../../elements/emby-select/emby-select';
|
2022-04-10 02:22:13 -04:00
|
|
|
import Dashboard from '../../../utils/dashboard';
|
2018-10-23 01:05:09 +03:00
|
|
|
|
2020-07-17 19:04:56 +01:00
|
|
|
function save(page) {
|
|
|
|
loading.show();
|
|
|
|
const apiClient = ApiClient;
|
2022-10-12 14:44:10 -04:00
|
|
|
const config = {
|
2024-12-15 12:56:55 +03:00
|
|
|
EnableRemoteAccess: page.querySelector('#chkRemoteAccess').checked
|
2022-10-12 14:44:10 -04:00
|
|
|
};
|
|
|
|
|
2020-07-17 19:04:56 +01:00
|
|
|
apiClient.ajax({
|
|
|
|
type: 'POST',
|
2020-08-12 21:17:07 +02:00
|
|
|
data: JSON.stringify(config),
|
2020-08-31 15:48:24 +02:00
|
|
|
url: apiClient.getUrl('Startup/RemoteAccess'),
|
|
|
|
contentType: 'application/json'
|
2020-07-17 19:04:56 +01:00
|
|
|
}).then(function () {
|
|
|
|
loading.hide();
|
|
|
|
navigateToNextPage();
|
|
|
|
});
|
|
|
|
}
|
2018-10-23 01:05:09 +03:00
|
|
|
|
2020-07-17 19:04:56 +01:00
|
|
|
function navigateToNextPage() {
|
2025-03-17 15:39:21 -04:00
|
|
|
Dashboard.navigate('wizardfinish');
|
2020-07-17 19:04:56 +01:00
|
|
|
}
|
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
|
|
|
|
2021-01-26 22:20:12 -05:00
|
|
|
export default function (view) {
|
2020-07-17 19:04:56 +01:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
}
|