move wizard and user preference routes to nested folders

This commit is contained in:
dkanada 2020-07-26 15:09:40 +09:00
parent a353812400
commit c0261ee487
30 changed files with 55 additions and 42 deletions

View file

@ -0,0 +1,35 @@
<div id="wizardSettingsPage" data-role="page" class="page standalonePage wizardPage">
<div class="padded-left padded-right padded-top">
<div class="ui-corner-all ui-shadow wizardContent">
<form class="wizardSettingsForm">
<h1>${HeaderConfigureRemoteAccess}</h1>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkRemoteAccess" checked />
<span>${AllowRemoteAccess}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${AllowRemoteAccessHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableUpnp" />
<span>${LabelEnableAutomaticPortMap}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelEnableAutomaticPortMapHelp}</div>
</div>
<br />
<div class="wizardNavigation">
<button is="emby-button" type="button" class="raised button-cancel" onclick="history.back();">
<span class="material-icons arrow_back"></span>
<span>${LabelPrevious}</span>
</button>
<button is="emby-button" type="submit" class="raised button-submit">
<span>${LabelNext}</span>
<span class="material-icons arrow_forward"></span>
</button>
</div>
</form>
</div>
</div>
</div>

View file

@ -0,0 +1,40 @@
import loading from 'loading';
import 'emby-checkbox';
import 'emby-button';
import 'emby-select';
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();
});
}
function navigateToNextPage() {
Dashboard.navigate('wizardfinish.html');
}
function onSubmit(e) {
save(this);
e.preventDefault();
return false;
}
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');
});
}