mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add code suggestions
This commit is contained in:
parent
a08d142db2
commit
3047b12382
2 changed files with 1 additions and 1 deletions
39
src/controllers/wizard/remoteaccess.js
Normal file
39
src/controllers/wizard/remoteaccess.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
define(["loading", "emby-checkbox", "emby-button", "emby-select"], function (loading) {
|
||||
"use strict";
|
||||
|
||||
function save(page) {
|
||||
loading.show();
|
||||
var apiClient = ApiClient;
|
||||
var 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;
|
||||
}
|
||||
|
||||
return 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");
|
||||
});
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue