Merge pull request #168 from dkanada/settings

Lots of changes to the server configuration pages
This commit is contained in:
Joshua M. Boniface 2019-03-11 23:37:14 -04:00 committed by GitHub
commit 96e4296256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 287 additions and 396 deletions

View File

@ -1,21 +0,0 @@
<div id="appServicesPage" data-role="page" class="page type-interior appServicesPage withTabs fullWidthContent" data-require="scripts/appservices">
<div>
<div class="content-primary">
<div class="verticalSection">
<div class="sectionTitleContainer sectionTitleContainer-cards flex align-items-center">
<h2 class="sectionTitle sectionTitle-cards">${HeaderInstalledServices}</h2>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Plugins">${Help}</a>
</div>
<div class="installedPlugins"></div>
</div>
<div class="verticalSection">
<h2 class="sectionTitle sectionTitle-cards">${HeaderAvailableServices}</h2>
<div class="catalog"></div>
</div>
</div>
</div>
</div>

View File

@ -143,7 +143,8 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function(appSett
features.push("displaylanguage");
features.push("otherapppromotions");
features.push("targetblank");
features.push("multiserver");
// allows users to connect to more than one server
//features.push("multiserver");
browser.orsay || browser.tizen || browser.msie || !(browser.firefox || browser.ps4 || browser.edge || cueSupported()) || features.push("subtitleappearancesettings");
browser.orsay || browser.tizen || features.push("subtitleburnsettings");
browser.tv || browser.ps4 || browser.xboxOne || features.push("fileinput");

View File

@ -18,18 +18,18 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'emby-b
if (path && typeof path !== 'string') {
throw new Error("invalid path");
}
loading.show();
var promises = [];
if ("Network" === path) {
promises.push(ApiClient.getNetworkDevices())
} else {
if (path) {
if (path) {
promises.push(ApiClient.getDirectoryContents(path, fileOptions));
promises.push(ApiClient.getParentPath(path));
} else {
} else {
promises.push(ApiClient.getDrives());
}
}
@ -42,7 +42,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'emby-b
page.querySelector(".results").scrollTop = 0;
page.querySelector("#txtDirectoryPickerPath").value = path || "";
if (path) {
html += getItem("lnkPath lnkDirectory", "", parentPath, "...");
}
@ -51,7 +51,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'emby-b
var cssClass = "File" === folder.Type ? "lnkPath lnkFile" : "lnkPath lnkDirectory";
html += getItem(cssClass, folder.Type, folder.Path, folder.Name);
}
if (!path) {
html += getItem("lnkPath lnkDirectory", "", "Network", Globalize.translate("ButtonNetwork"));
}
@ -128,7 +128,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'emby-b
html += '<button type="button" is="paper-icon-button-light" class="btnRefreshDirectories emby-input-iconbutton" title="' + Globalize.translate("ButtonRefresh") + '"><i class="md-icon">search</i></button>';
}
html += "</div>";
if (!readOnlyAttribute) {
if (!readOnlyAttribute) {
html += '<div class="results paperList" style="max-height: 200px; overflow-y: auto;"></div>';
}
if (options.enableNetworkSharePath) {
@ -222,11 +222,7 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'emby-b
var networkSharePath = this.querySelector("#txtNetworkPath");
networkSharePath = networkSharePath ? networkSharePath.value : null;
var path = this.querySelector("#txtDirectoryPickerPath").value;
validatePath(path, options.validateWriteable, ApiClient).then(
function() {
options.callback(path, networkSharePath);
}
);
validatePath(path, options.validateWriteable, ApiClient).then(options.callback(path, networkSharePath));
}
e.preventDefault();
e.stopPropagation();

View File

@ -50,10 +50,8 @@
<h3 style="margin:0;">${HeaderActiveDevices}</h3>
<i class="md-icon">&#xE5CC;</i>
</a>
<div class="activeDevices itemsContainer vertical-wrap">
</div>
</div>
</div>
@ -76,7 +74,6 @@
</div>
<div class="dashboardSection serverActivitySection hide activityContainer">
<a is="emby-linkbutton" href="serveractivity.html?useractivity=false" class="button-flat sectionTitleTextButton">
<h3>${Alerts}</h3>
<i class="md-icon">&#xE5CC;</i>
@ -84,8 +81,12 @@
<div class="paperList serverActivityItems" data-activitylimit="4" data-useractivity="false">
</div>
</div>
<div class="dashboardSection">
<h3>${HeaderPaths}</h3>
<a is="emby-linkbutton" href="dashboardgeneral.html" class="button-flat sectionTitleTextButton">
<h3>${HeaderPaths}</h3>
<i class="md-icon">&#xE5CC;</i>
</a>
<div class="paperList">
<div class="listItem listItem-border">
<div class="listItemBody two-line">

View File

@ -2,9 +2,36 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb
"use strict";
function loadPage(page, config, languageOptions, systemInfo) {
systemInfo.CanLaunchWebBrowser ? page.querySelector("#fldRunWebAppAtStartup").classList.remove("hide") : page.querySelector("#fldRunWebAppAtStartup").classList.add("hide"), page.querySelector("#txtCachePath").value = config.CachePath || "", $("#selectLocalizationLanguage", page).html(languageOptions.map(function(l) {
return '<option value="' + l.Value + '">' + l.Name + "</option>"
})).val(config.UICulture), currentLanguage = config.UICulture, systemInfo.CanSelfUpdate ? page.querySelector(".fldAutomaticUpdates").classList.remove("hide") : page.querySelector(".fldAutomaticUpdates").classList.add("hide"), $("#chkEnableAutomaticServerUpdates", page).checked(config.EnableAutoUpdate), $("#chkEnableAutomaticRestart", page).checked(config.EnableAutomaticRestart), systemInfo.CanSelfRestart ? page.querySelector("#fldEnableAutomaticRestart").classList.remove("hide") : page.querySelector("#fldEnableAutomaticRestart").classList.add("hide"), systemInfo.CanSelfRestart || systemInfo.CanSelfUpdate ? $(".autoUpdatesContainer", page).removeClass("hide") : $(".autoUpdatesContainer", page).addClass("hide"), loading.hide()
if (systemInfo.CanLaunchWebBrowser) {
page.querySelector("#fldRunWebAppAtStartup").classList.remove("hide");
} else {
page.querySelector("#fldRunWebAppAtStartup").classList.add("hide");
}
page.querySelector("#txtCachePath").value = config.CachePath || "";
$("#txtMetadataPath", page).val(config.MetadataPath || "");
$("#txtMetadataNetworkPath", page).val(config.MetadataNetworkPath || "");
$("#selectLocalizationLanguage", page).html(languageOptions.map(function(language) {
return '<option value="' + language.Value + '">' + language.Name + "</option>"
})).val(config.UICulture);
currentLanguage = config.UICulture;
if (systemInfo.CanSelfUpdate) {
page.querySelector(".fldAutomaticUpdates").classList.remove("hide");
} else {
page.querySelector(".fldAutomaticUpdates").classList.add("hide");
}
$("#chkEnableAutomaticServerUpdates", page).checked(config.EnableAutoUpdate);
$("#chkEnableAutomaticRestart", page).checked(config.EnableAutomaticRestart);
if (systemInfo.CanSelfRestart) {
page.querySelector("#fldEnableAutomaticRestart").classList.remove("hide");
} else {
page.querySelector("#fldEnableAutomaticRestart").classList.add("hide");
}
if (systemInfo.CanSelfRestart || systemInfo.CanSelfUpdate) {
$(".autoUpdatesContainer", page).removeClass("hide");
} else {
$(".autoUpdatesContainer", page).addClass("hide");
}
loading.hide();
}
function onSubmit() {
@ -12,40 +39,89 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb
var form = this;
$(form).parents(".page");
return ApiClient.getServerConfiguration().then(function(config) {
config.UICulture = $("#selectLocalizationLanguage", form).val(), config.CachePath = form.querySelector("#txtCachePath").value;
var requiresReload = !1;
config.UICulture !== currentLanguage && (requiresReload = !0), config.EnableAutomaticRestart = $("#chkEnableAutomaticRestart", form).checked(), config.EnableAutoUpdate = $("#chkEnableAutomaticServerUpdates", form).checked(), ApiClient.updateServerConfiguration(config).then(function() {
config.UICulture = $("#selectLocalizationLanguage", form).val();
config.CachePath = form.querySelector("#txtCachePath").value;
config.MetadataPath = $("#txtMetadataPath", form).val();
config.MetadataNetworkPath = $("#txtMetadataNetworkPath", form).val();
var requiresReload = (config.UICulture !== currentLanguage);
config.EnableAutomaticRestart = $("#chkEnableAutomaticRestart", form).checked();
config.EnableAutoUpdate = $("#chkEnableAutomaticServerUpdates", form).checked();
ApiClient.updateServerConfiguration(config).then(function() {
ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig) {
brandingConfig.LoginDisclaimer = form.querySelector("#txtLoginDisclaimer").value, brandingConfig.CustomCss = form.querySelector("#txtCustomCss").value, currentBrandingOptions && brandingConfig.CustomCss !== currentBrandingOptions.CustomCss && (requiresReload = !0), ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).then(function() {
Dashboard.processServerConfigurationUpdateResult(), requiresReload && !AppInfo.isNativeApp && window.location.reload(!0)
})
brandingConfig.LoginDisclaimer = form.querySelector("#txtLoginDisclaimer").value;
brandingConfig.CustomCss = form.querySelector("#txtCustomCss").value;
if (currentBrandingOptions && brandingConfig.CustomCss !== currentBrandingOptions.CustomCss) {
requiresReload = true;
}
ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).then(function() {
Dashboard.processServerConfigurationUpdateResult();
if (requiresReload && !AppInfo.isNativeApp) {
window.location.reload(true);
}
});
})
})
}), !1
}
var currentBrandingOptions, currentLanguage, brandingConfigKey = "branding";
var currentBrandingOptions;
var currentLanguage;
var brandingConfigKey = "branding";
return function(view, params) {
$("#btnSelectCachePath", view).on("click.selectDirectory", function() {
require(["directorybrowser"], function(directoryBrowser) {
var picker = new directoryBrowser;
picker.show({
callback: function(path) {
path && (view.querySelector("#txtCachePath").value = path), picker.close()
if (path) {
view.querySelector("#txtCachePath").value = path;
}
picker.close();
},
validateWriteable: !0,
validateWriteable: true,
header: Globalize.translate("HeaderSelectServerCachePath"),
instruction: Globalize.translate("HeaderSelectServerCachePathHelp")
})
})
}), $(".dashboardGeneralForm", view).off("submit", onSubmit).on("submit", onSubmit), view.addEventListener("viewshow", function() {
var promise1 = ApiClient.getServerConfiguration(),
promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options")),
promise3 = ApiClient.getSystemInfo();
Promise.all([promise1, promise2, promise3]).then(function(responses) {
loadPage(view, responses[0], responses[1], responses[2])
}), ApiClient.getNamedConfiguration(brandingConfigKey).then(function(config) {
currentBrandingOptions = config, view.querySelector("#txtLoginDisclaimer").value = config.LoginDisclaimer || "", view.querySelector("#txtCustomCss").value = config.CustomCss || ""
});
$("#btnSelectMetadataPath", view).on("click.selectDirectory", function() {
require(["directorybrowser"], function(directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
path: $("#txtMetadataPath", view).val(),
networkSharePath: $("#txtMetadataNetworkPath", view).val(),
callback: function(path, networkPath) {
if (path) {
$("#txtMetadataPath", view).val(path);
}
if (networkPath) {
$("#txtMetadataNetworkPath", view).val(networkPath));
}
picker.close();
},
validateWriteable: true,
header: Globalize.translate("HeaderSelectMetadataPath"),
instruction: Globalize.translate("HeaderSelectMetadataPathHelp"),
enableNetworkSharePath: true
})
})
})
});
$(".dashboardGeneralForm", view).off("submit", onSubmit).on("submit", onSubmit);
view.addEventListener("viewshow", function() {
var promiseConfig = ApiClient.getServerConfiguration();
var promiseLanguageOptions = ApiClient.getJSON(ApiClient.getUrl("Localization/Options"));
var promiseSystemInfo = ApiClient.getSystemInfo();
Promise.all([promiseConfig, promiseLanguageOptions, promiseSystemInfo]).then(function(responses) {
loadPage(view, responses[0], responses[1], responses[2]);
});
ApiClient.getNamedConfiguration(brandingConfigKey).then(function(config) {
currentBrandingOptions = config;
view.querySelector("#txtLoginDisclaimer").value = config.LoginDisclaimer || "";
view.querySelector("#txtCustomCss").value = config.CustomCss || "";
});
});
}
});

View File

@ -2,45 +2,47 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked", "emby-checkbox", "emby-
"use strict";
function loadPage(page, config) {
config.MergeMetadataAndImagesByName ? $(".fldImagesByName", page).hide() : $(".fldImagesByName", page).show(), $("#chkSaveMetadataHidden", page).checked(config.SaveMetadataHidden), $("#txtMetadataPath", page).val(config.MetadataPath || ""), $("#txtMetadataNetworkPath", page).val(config.MetadataNetworkPath || ""), loading.hide()
$("#chkSaveMetadataHidden", page).checked(config.SaveMetadataHidden);
loading.hide();
}
function loadMetadataConfig(page, config) {
$("#selectDateAdded", page).val(config.UseFileCreationTimeForDateAdded ? "1" : "0")
$("#selectDateAdded", page).val(config.UseFileCreationTimeForDateAdded ? "1" : "0");
}
function loadFanartConfig(page, config) {
$("#txtFanartApiKey", page).val(config.UserApiKey || "")
$("#txtFanartApiKey", page).val(config.UserApiKey || "");
}
function saveFanart(form) {
ApiClient.getNamedConfiguration("fanart").then(function(config) {
config.UserApiKey = $("#txtFanartApiKey", form).val(), ApiClient.updateNamedConfiguration("fanart", config)
})
config.UserApiKey = $("#txtFanartApiKey", form).val(), ApiClient.updateNamedConfiguration("fanart", config);
});
}
function saveMetadata(form) {
ApiClient.getNamedConfiguration("metadata").then(function(config) {
config.UseFileCreationTimeForDateAdded = "1" === $("#selectDateAdded", form).val(), ApiClient.updateNamedConfiguration("metadata", config)
config.UseFileCreationTimeForDateAdded = "1" === $("#selectDateAdded", form).val(), ApiClient.updateNamedConfiguration("metadata", config);
})
}
function alertText(options) {
require(["alert"], function(alert) {
alert(options)
})
}
function onSubmitFail(response) {
loading.hide(), response && 404 === response.status ? alertText("The metadata path entered could not be found. Please ensure the path is valid and try again.") : response && 500 === response.status && alertText("The metadata path entered is not valid. Please ensure the path exists and that Jellyfin server has write access to the folder.")
alert(options);
});
}
function onSubmit() {
loading.show();
var form = this;
return ApiClient.getServerConfiguration().then(function(config) {
config.SaveMetadataHidden = $("#chkSaveMetadataHidden", form).checked(), config.EnableTvDbUpdates = $("#chkEnableTvdbUpdates", form).checked(), config.EnableTmdbUpdates = $("#chkEnableTmdbUpdates", form).checked(), config.EnableFanArtUpdates = $("#chkEnableFanartUpdates", form).checked(), config.MetadataPath = $("#txtMetadataPath", form).val(), config.MetadataNetworkPath = $("#txtMetadataNetworkPath", form).val(), config.FanartApiKey = $("#txtFanartApiKey", form).val(), ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, onSubmitFail)
}), saveMetadata(form), saveFanart(form), !1
ApiClient.getServerConfiguration().then(function(config) {
config.SaveMetadataHidden = $("#chkSaveMetadataHidden", form).checked();
config.FanartApiKey = $("#txtFanartApiKey", form).val();
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
saveMetadata(form);
saveFanart(form);
return false;
}
function getTabs() {
@ -61,34 +63,29 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked", "emby-checkbox", "emby-
name: Globalize.translate("TabAdvanced")
}]
}
return function(view, params) {
$("#btnSelectMetadataPath", view).on("click.selectDirectory", function() {
require(["directorybrowser"], function(directoryBrowser) {
var picker = new directoryBrowser;
picker.show({
path: $("#txtMetadataPath", view).val(),
networkSharePath: $("#txtMetadataNetworkPath", view).val(),
callback: function(path, networkPath) {
path && ($("#txtMetadataPath", view).val(path), $("#txtMetadataNetworkPath", view).val(networkPath)), picker.close()
},
validateWriteable: !0,
header: Globalize.translate("HeaderSelectMetadataPath"),
instruction: Globalize.translate("HeaderSelectMetadataPathHelp"),
enableNetworkSharePath: !0
})
})
}), $(".librarySettingsForm").off("submit", onSubmit).on("submit", onSubmit), view.addEventListener("viewshow", function() {
libraryMenu.setTabs("librarysetup", 4, getTabs), loading.show();
$(".librarySettingsForm").off("submit", onSubmit).on("submit", onSubmit);
view.addEventListener("viewshow", function() {
libraryMenu.setTabs("librarysetup", 4, getTabs);
loading.show();
var page = this;
ApiClient.getServerConfiguration().then(function(config) {
loadPage(page, config)
}), ApiClient.getNamedConfiguration("metadata").then(function(metadata) {
});
ApiClient.getNamedConfiguration("metadata").then(function(metadata) {
loadMetadataConfig(page, metadata)
}), ApiClient.getNamedConfiguration("fanart").then(function(metadata) {
});
ApiClient.getNamedConfiguration("fanart").then(function(metadata) {
loadFanartConfig(page, metadata)
}), ApiClient.getSystemInfo().then(function(info) {
"Windows" === info.OperatingSystem ? page.querySelector(".fldSaveMetadataHidden").classList.remove("hide") : page.querySelector(".fldSaveMetadataHidden").classList.add("hide")
})
})
});
ApiClient.getSystemInfo().then(function(info) {
if ("Windows" === info.OperatingSystem) {
page.querySelector(".fldSaveMetadataHidden").classList.remove("hide");
} else {
page.querySelector(".fldSaveMetadataHidden").classList.add("hide");
}
});
});
}
});

View File

@ -2,31 +2,57 @@ define(["globalize", "loading", "libraryMenu", "dom", "emby-input", "emby-button
"use strict";
function isM3uVariant(type) {
return -1 !== ["nextpvr"].indexOf(type || "")
return ["nextpvr"].indexOf(type || "") !== -1;
}
function fillTypes(view, currentId) {
return ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Types")).then(function(types) {
ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Types")).then(function(types) {
var selectType = view.querySelector(".selectType");
selectType.innerHTML = types.map(function(t) {
return '<option value="' + t.Id + '">' + t.Name + "</option>"
}).join("") + '<option value="other">' + globalize.translate("TabOther") + "</option>", selectType.disabled = null != currentId, selectType.value = "", onTypeChange.call(selectType)
})
var html = "";
html += types.map(function(tuner) {
return '<option value="' + tuner.Id + '">' + tuner.Name + "</option>";
}).join("");
html += '<option value="other">';
html += globalize.translate("TabOther");
html += "</option>";
selectType.innerHTML = html;
selectType.disabled = null != currentId;
selectType.value = "";
onTypeChange.call(selectType);
});
}
function reload(view, providerId) {
view.querySelector(".txtDevicePath").value = "", view.querySelector(".chkFavorite").checked = !1, view.querySelector(".txtDevicePath").value = "", providerId && ApiClient.getNamedConfiguration("livetv").then(function(config) {
var info = config.TunerHosts.filter(function(i) {
return i.Id === providerId
})[0];
fillTunerHostInfo(view, info)
})
view.querySelector(".txtDevicePath").value = "";
view.querySelector(".chkFavorite").checked = false;
view.querySelector(".txtDevicePath").value = "";
if (providerId) {
ApiClient.getNamedConfiguration("livetv").then(function(config) {
var info = config.TunerHosts.filter(function(i) {
return i.Id === providerId;
})[0];
fillTunerHostInfo(view, info);
});
}
}
function fillTunerHostInfo(view, info) {
var selectType = view.querySelector(".selectType"),
type = info.Type || "";
info.Source && isM3uVariant(info.Source) && (type = info.Source), selectType.value = type, onTypeChange.call(selectType), view.querySelector(".txtDevicePath").value = info.Url || "", view.querySelector(".txtFriendlyName").value = info.FriendlyName || "", view.querySelector(".txtUserAgent").value = info.UserAgent || "", view.querySelector(".fldDeviceId").value = info.DeviceId || "", view.querySelector(".chkFavorite").checked = info.ImportFavoritesOnly, view.querySelector(".chkTranscode").checked = info.AllowHWTranscoding, view.querySelector(".chkStreamLoop").checked = info.EnableStreamLooping, view.querySelector(".txtTunerCount").value = info.TunerCount || "0"
var selectType = view.querySelector(".selectType");
var type = info.Type || "";
if (info.Source && isM3uVariant(info.Source)) {
type = info.Source;
}
selectType.value = type;
onTypeChange.call(selectType);
view.querySelector(".txtDevicePath").value = info.Url || "";
view.querySelector(".txtFriendlyName").value = info.FriendlyName || "";
view.querySelector(".txtUserAgent").value = info.UserAgent || "";
view.querySelector(".fldDeviceId").value = info.DeviceId || "";
view.querySelector(".chkFavorite").checked = info.ImportFavoritesOnly;
view.querySelector(".chkTranscode").checked = info.AllowHWTranscoding;
view.querySelector(".chkStreamLoop").checked = info.EnableStreamLooping;
view.querySelector(".txtTunerCount").value = info.TunerCount || "0";
}
function submitForm(page) {
@ -74,16 +100,6 @@ define(["globalize", "loading", "libraryMenu", "dom", "emby-input", "emby-button
})
}
function getTabs() {
return [{
href: "livetvstatus.html",
name: globalize.translate("TabDevices")
}, {
href: "appservices.html?context=livetv",
name: globalize.translate("TabServices")
}]
}
function onTypeChange() {
var value = this.value,
view = dom.parentWithClass(this, "page"),
@ -102,7 +118,6 @@ define(["globalize", "loading", "libraryMenu", "dom", "emby-input", "emby-button
}
return function(view, params) {
params.id || view.querySelector(".btnDetect").classList.remove("hide"), view.addEventListener("viewshow", function() {
libraryMenu.setTabs("livetvadmin", 0, getTabs);
var currentId = params.id;
fillTypes(view, currentId).then(function() {
reload(view, currentId)

View File

@ -34,7 +34,7 @@
</div>
<div class="verticalSection verticalSection-extrabottompadding">
<h2>${Advanced}</h2>
<h2>${HeaderPaths}</h2>
<div class="inputContainer">
<div style="display: flex; align-items: center;">
<div style="flex-grow:1;">
@ -44,6 +44,17 @@
</div>
<div class="fieldDescription">${LabelCachePathHelp}</div>
</div>
<div class="inputContainer">
<div style="display: flex; align-items: center;">
<div style="flex-grow:1;">
<input is="emby-input" id="txtMetadataPath" label="${LabelMetadataPath}" autocomplete="off" />
</div>
<button type="button" is="paper-icon-button-light" id="btnSelectMetadataPath" title="${ButtonSelectDirectory}" class="emby-input-iconbutton"><i class="md-icon">search</i></button>
</div>
<div class="fieldDescription">${LabelMetadataPathHelp}</div>
<input type="hidden" id="txtMetadataNetworkPath" />
</div>
</div>
<div class="verticalSection autoUpdatesContainer hide">
@ -62,6 +73,7 @@
</div>
<div class="verticalSection">
<h2>${HeaderBranding}</h2>
<div class="inputContainer">
<input is="emby-input" type="text" id="txtLoginDisclaimer" label="${LabelLoginDisclaimer}" />
<div class="fieldDescription">${LabelLoginDisclaimerHelp}</div>

View File

@ -1,8 +1,6 @@
<div id="devicesPage" data-role="page" class="page type-interior devicesPage noSecondaryNavPage">
<div>
<div class="content-primary">
<div class="verticalSection verticalSection">
<div class="sectionTitleContainer sectionTitleContainer-cards flex align-items-center">
<h2 class="sectionTitle sectionTitle-cards">${TabDevices}</h2>
@ -11,9 +9,6 @@
</div>
<div is="emby-itemscontainer" class="devicesList vertical-wrap" data-multiselect="false">
</div>
</div>
</div>

View File

@ -10,11 +10,6 @@
<h2 class="sectionTitle">${TabSettings}</h2>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Dlna-settings">${Help}</a>
</div>
<div class="inputContainer">
<input is="emby-input" type="number" id="txtRemoteClientBitrateLimit" pattern="[0-9]*" min="0" step=".25" label="${LabelRemoteClientBitrateLimit}" />
<div class="fieldDescription">${LabelRemoteClientBitrateLimitHelp}</div>
</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">

View File

@ -1,5 +1,4 @@
<div id="librarySettingsPage" data-role="page" class="page type-interior librarySectionPage withTabs">
<div>
<div class="content-primary">
<form class="librarySettingsForm">
@ -11,16 +10,7 @@
</select>
<div class="fieldDescription">${LabelDateAddedBehaviorHelp}</div>
</div>
<div class="inputContainer">
<div style="display: flex; align-items: center;">
<div style="flex-grow:1;">
<input is="emby-input" id="txtMetadataPath" label="${LabelMetadataPath}" autocomplete="off" />
</div>
<button type="button" is="paper-icon-button-light" id="btnSelectMetadataPath" title="${ButtonSelectDirectory}" class="emby-input-iconbutton"><i class="md-icon">search</i></button>
</div>
<div class="fieldDescription">${LabelMetadataPathHelp}</div>
<input type="hidden" id="txtMetadataNetworkPath" />
</div>
<div class="checkboxContainer checkboxContainer-withDescription fldSaveMetadataHidden hide">
<label>
<input type="checkbox" is="emby-checkbox" class="chkAirDays" id="chkSaveMetadataHidden" data-filter="Sunday" />
@ -43,7 +33,6 @@
<button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button>
</form>
</div>
</div>
</div>

View File

@ -1,11 +1,7 @@
<div id="liveTvStatusPage" data-role="page" class="page type-interior liveTvSettingsPage withTabs" data-require="scripts/livetvstatus,emby-button">
<div id="liveTvStatusPage" data-role="page" class="page type-interior liveTvSettingsPage" data-require="scripts/livetvstatus,emby-button">
<div>
<div class="content-primary">
<div class="verticalSection verticalSection-extrabottompadding">
<div class="verticalSection verticalSection-extrabottompadding">
<div class="sectionTitleContainer sectionTitleContainer-cards">
<h2 class="sectionTitle sectionTitle-cards">
@ -31,8 +27,8 @@
<div class="providerList">
</div>
<div>
<div>
<button is="emby-button" type="button" class="raised btnRefresh block button-cancel">
<span>${ButtonRefreshGuideData}</span>
</button>

View File

@ -1,8 +1,6 @@
<div id="liveTvTunerPage" data-role="page" class="page type-interior liveTvSettingsPage withTabs">
<div id="liveTvTunerPage" data-role="page" class="page type-interior liveTvSettingsPage">
<div>
<div class="content-primary">
<form>
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
@ -47,6 +45,7 @@
</label>
<div class="fieldDescription checkboxFieldDescription">${ImportFavoriteChannelsHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription fldTranscode hide">
<label>
<input type="checkbox" is="emby-checkbox" class="chkTranscode" />
@ -54,6 +53,7 @@
</label>
<div class="fieldDescription checkboxFieldDescription">${AllowHWTranscodingHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription fldStreamLoop hide">
<label>
<input type="checkbox" is="emby-checkbox" class="chkStreamLoop" />
@ -61,6 +61,7 @@
</label>
<div class="fieldDescription checkboxFieldDescription">${EnableStreamLoopingHelp}</div>
</div>
<p class="drmMessage hide">${DrmChannelsNotImported}</p>
<p class="otherOptionsMessage hide" style="margin:2em 0;">${ForAdditionalLiveTvOptions}</p>
<br />

View File

@ -82,6 +82,16 @@
</div>
</a>
</div>
<div>
<a is="emby-linkbutton" href="edititemmetadata.html" style="display: block; padding: 0; margin:0;" class="listItem-border">
<div class="listItem">
<i class="md-icon listItemIcon listItemIcon-transparent">mode_edit</i>
<div class="listItemBody">
<div class="listItemBodyText">${Metadata}</div>
</div>
</div>
</a>
</div>
</div>
</div>
</div>

View File

@ -1,13 +1,9 @@
<div id="notificationSettingsPage" data-role="page" class="page type-interior notificationConfigurationPage withTabs">
<div id="notificationSettingsPage" data-role="page" class="page type-interior notificationConfigurationPage">
<div>
<div class="content-primary">
<div class="readOnlyContent">
<div class="notificationList">
</div>
</div>
</div>
</div>

View File

@ -1,27 +0,0 @@
<div id="openSubtitlesPage" data-role="page" class="page type-interior metadataConfigurationPage" data-require="scripts/opensubtitles,emby-input,emby-button,emby-linkbutton">
<div>
<div class="content-primary">
<form class="metadataSubtitlesForm">
<div style="height:0; overflow: hidden;"><input type="text" name="fakeusernameremembered" tabindex="-1" /><input type="password" name="fakepasswordremembered" tabindex="-1" /></div>
<div style="display: none;">
<input type="text" id="PreventChromeAutocomplete" name="PreventChromeAutocomplete" autocomplete="address-level4" />
</div>
<br />
<div class="inputContainer">
<input is="emby-input" type="text" id="txtOpenSubtitleUsername" autocomplete="off" label="${LabelOpenSubtitlesUsername}" />
<div class="fieldDescription">
<a is="emby-linkbutton" class="button-link" target="_blank" href="http://www.opensubtitles.org/">${ButtonRegister}</a>
</div>
</div>
<div class="inputContainer">
<input is="emby-input" type="password" id="txtOpenSubtitlePassword" autocomplete="off" label="${LabelOpenSubtitlesPassword}" />
</div>
<div>
<button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button>
</div>
<div class="fieldDescription">${SubtitleDownloadInstructions}</div>
</form>
</div>
</div>
</div>

View File

@ -1,56 +0,0 @@
define(["loading", "libraryMenu"], function(loading, libraryMenu) {
"use strict";
function reloadList(page) {
loading.show();
var promise1 = ApiClient.getAvailablePlugins({
TargetSystems: "Server"
}),
promise2 = ApiClient.getInstalledPlugins();
Promise.all([promise1, promise2]).then(function(responses) {
renderInstalled(page, responses[0], responses[1]), renderCatalog(page, responses[0], responses[1])
})
}
function getCategories() {
var context = getParameterByName("context"),
categories = [];
return "sync" == context ? categories.push("Sync") : "livetv" == context ? categories.push("Live TV") : "notifications" == context && categories.push("Notifications"), categories
}
function renderInstalled(page, availablePlugins, installedPlugins) {
requirejs(["scripts/pluginspage"], function() {
var category = getCategories()[0];
installedPlugins = installedPlugins.filter(function(i) {
var catalogEntry = availablePlugins.filter(function(a) {
return (a.guid || "").toLowerCase() == (i.Id || "").toLowerCase()
})[0];
return !!catalogEntry && catalogEntry.category == category
}), PluginsPage.renderPlugins(page, installedPlugins)
})
}
function renderCatalog(page, availablePlugins, installedPlugins) {
requirejs(["scripts/plugincatalogpage"], function() {
var categories = getCategories();
PluginCatalog.renderCatalog({
catalogElement: page.querySelector(".catalog"),
availablePlugins: availablePlugins,
installedPlugins: installedPlugins,
categories: categories,
showCategory: !1,
context: getParameterByName("context"),
targetSystem: "Server"
})
})
}
function onPageShow() {
var page = this,
context = getParameterByName("context");
"sync" == context ? (libraryMenu.setTitle(Globalize.translate("TitleSync")), page.querySelector(".headerHelpButton").setAttribute("href", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Sync")) : "livetv" == context ? (libraryMenu.setTitle(Globalize.translate("TitleLiveTV")), page.querySelector(".headerHelpButton").setAttribute("href", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Live-TV")) : "notifications" == context && (libraryMenu.setTitle(Globalize.translate("TitleNotifications")), page.querySelector(".headerHelpButton").setAttribute("href", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications"))
}
pageIdOn("pagebeforeshow", "appServicesPage", onPageShow), pageIdOn("pageshow", "appServicesPage", onPageShow), pageIdOn("pageshow", "appServicesPage", function() {
reloadList(this)
})
});

View File

@ -189,6 +189,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
html += globalize.translate("HeaderAdmin");
html += "</h3>";
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder lnkManageServer" data-itemid="dashboard" href="dashboard.html"><i class="md-icon navMenuOptionIcon">dashboard</i><span class="navMenuOptionText">' + globalize.translate("TabDashboard") + "</span></a>";
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder editorViewMenu" data-itemid="editor" href="edititemmetadata.html"><i class="md-icon navMenuOptionIcon">mode_edit</i><span class="navMenuOptionText">' + globalize.translate("Metadata") + "</span></a>";
html += "</div>";
}
@ -198,7 +199,9 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
html += "</h3>";
if (user.localUser) {
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder lnkMySettings" href="mypreferencesmenu.html"><i class="md-icon navMenuOptionIcon">settings</i><span class="navMenuOptionText">' + globalize.translate("ButtonSettings") + "</span></a>";
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder" data-itemid="selectserver" href="selectserver.html?showuser=1"><i class="md-icon navMenuOptionIcon">wifi</i><span class="navMenuOptionText">' + globalize.translate("ButtonSelectServer") + "</span></a>";
if (appHost.supports("multiserver")) {
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder" data-itemid="selectserver" href="selectserver.html?showuser=1"><i class="md-icon navMenuOptionIcon">wifi</i><span class="navMenuOptionText">' + globalize.translate("ButtonSelectServer") + "</span></a>";
}
if (!user.localUser.EnableAutoLogin) {
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnLogout" data-itemid="logout" href="#"><i class="md-icon navMenuOptionIcon">exit_to_app</i><span class="navMenuOptionText">' + globalize.translate("ButtonSignOut") + "</span></a>";
}
@ -271,7 +274,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
pageIds: ["dashboardPage", "serverActivityPage"],
icon: "dashboard"
}, {
name: globalize.translate("TabSettings"),
name: globalize.translate("General"),
href: "dashboardgeneral.html",
pageIds: ["dashboardGeneralPage"],
icon: "settings"
@ -297,11 +300,6 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
icon: "swap_horiz",
href: "encodingsettings.html",
pageIds: ["encodingSettingsPage"]
}, {
name: "Open Subtitles",
href: "opensubtitles.html",
pageIds: ["openSubtitlesPage"],
icon: "closed_caption"
}];
addPluginPagesToMainMenu(links, pluginItems, "server");
links.push({
@ -373,12 +371,6 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
pageIds: ["scheduledTasksPage", "scheduledTaskPage"],
icon: "schedule"
});
links.push({
name: globalize.translate("MetadataManager"),
href: "edititemmetadata.html",
pageIds: [],
icon: "mode_edit"
});
addPluginPagesToMainMenu(links, pluginItems);
return links;
}

View File

@ -188,16 +188,6 @@ define(["jQuery", "globalize", "scripts/taskbutton", "dom", "libraryMenu", "layo
Dashboard.navigate("livetvtuner.html")
}
function getTabs() {
return [{
href: "livetvstatus.html",
name: globalize.translate("TabDevices")
}, {
href: "appservices.html?context=livetv",
name: globalize.translate("TabServices")
}]
}
function showDeviceMenu(button, tunerDeviceId) {
var items = [];
items.push({
@ -240,7 +230,6 @@ define(["jQuery", "globalize", "scripts/taskbutton", "dom", "libraryMenu", "layo
addProvider(this)
}), page.querySelector(".devicesList").addEventListener("click", onDevicesListClick)
}).on("pageshow", "#liveTvStatusPage", function() {
libraryMenu.setTabs("livetvadmin", 0, getTabs);
var page = this;
reload(page), taskButton({
mode: "on",

View File

@ -2,29 +2,59 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-linkbutton
"use strict";
function reload(page) {
loading.show(), ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list) {
var html = "",
lastCategory = "",
showHelp = !0;
html += list.map(function(i) {
loading.show();
ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list) {
var html = "";
var lastCategory = "";
var showHelp = true;
html += list.map(function(notification) {
var itemHtml = "";
return i.Category != lastCategory && (lastCategory = i.Category, lastCategory && (itemHtml += "</div>", itemHtml += "</div>"), itemHtml += '<div class="verticalSection verticalSection-extrabottompadding">', itemHtml += '<div class="sectionTitleContainer" style="margin-bottom:1em;">', itemHtml += '<h2 class="sectionTitle">', itemHtml += i.Category, itemHtml += "</h2>", showHelp && (showHelp = !1, itemHtml += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications">' + globalize.translate("Help") + "</a>"), itemHtml += "</div>", itemHtml += '<div class="paperList">'), itemHtml += '<a class="listItem listItem-border" is="emby-linkbutton" data-ripple="false" href="notificationsetting.html?type=' + i.Type + '">', i.Enabled ? itemHtml += '<i class="listItemIcon md-icon">notifications_active</i>' : itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>', itemHtml += '<div class="listItemBody">', itemHtml += '<div class="listItemBodyText">' + i.Name + "</div>", itemHtml += "</div>", itemHtml += '<button type="button" is="paper-icon-button-light"><i class="md-icon">mode_edit</i></button>', itemHtml += "</a>"
}).join(""), list.length && (html += "</div>", html += "</div>"), page.querySelector(".notificationList").innerHTML = html, loading.hide()
if (notification.Category !== lastCategory) {
lastCategory = notification.Category;
if (lastCategory) {
itemHtml += "</div>";
itemHtml += "</div>";
}
itemHtml += '<div class="verticalSection verticalSection-extrabottompadding">';
itemHtml += '<div class="sectionTitleContainer" style="margin-bottom:1em;">';
itemHtml += '<h2 class="sectionTitle">';
itemHtml += notification.Category;
itemHtml += "</h2>";
if (showHelp) {
showHelp = false;
itemHtml += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications">';
itemHtml += globalize.translate("Help");
itemHtml += "</a>";
}
itemHtml += "</div>";
itemHtml += '<div class="paperList">';
}
itemHtml += '<a class="listItem listItem-border" is="emby-linkbutton" data-ripple="false" href="notificationsetting.html?type=' + notification.Type + '">';
if (notification.Enabled) {
itemHtml += '<i class="listItemIcon md-icon">notifications_active</i>';
} else {
itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>';
}
itemHtml += '<div class="listItemBody">';
itemHtml += '<div class="listItemBodyText">' + notification.Name + "</div>";
itemHtml += "</div>";
itemHtml += '<button type="button" is="paper-icon-button-light"><i class="md-icon">mode_edit</i></button>';
itemHtml += "</a>";
return itemHtml;
}).join("");
if (list.length) {
html += "</div>";
html += "</div>";
}
page.querySelector(".notificationList").innerHTML = html;
loading.hide();
})
}
function getTabs() {
return [{
href: "notificationsettings.html",
name: globalize.translate("TabNotifications")
}, {
href: "appservices.html?context=notifications",
name: globalize.translate("TabServices")
}]
}
return function(view, params) {
view.addEventListener("viewshow", function() {
libraryMenu.setTabs("notifications", 0, getTabs), reload(view)
})
reload(view);
});
}
});
});

View File

@ -1,36 +0,0 @@
define(["loading", "fnchecked", "emby-linkbutton", "emby-input", "emby-checkbox", "emby-button"], function (loading) {
"use strict";
function loadPage(page, config) {
page.querySelector("#txtOpenSubtitleUsername").value = config.OpenSubtitlesUsername;
page.querySelector("#txtOpenSubtitlePassword").value = config.OpenSubtitlesPasswordHash || "";
loading.hide();
}
function onSubmit(evt) {
evt.preventDefault();
loading.show();
var form = this;
ApiClient.getNamedConfiguration("subtitles").then(function (config) {
config.OpenSubtitlesUsername = form.querySelector("#txtOpenSubtitleUsername").value;
var newPassword = form.querySelector("#txtOpenSubtitlePassword").value;
if (newPassword) {
config.OpenSubtitlesPasswordHash = newPassword;
}
ApiClient.updateNamedConfiguration("subtitles", config).then(Dashboard.processServerConfigurationUpdateResult);
});
return false;
}
$(document).on("pageinit", "#openSubtitlesPage", function() {
$(".metadataSubtitlesForm").off("submit", onSubmit).on("submit", onSubmit)
}).on("pageshow", "#openSubtitlesPage", function() {
loading.show();
var page = this;
ApiClient.getNamedConfiguration("subtitles").then(function (response) {
loadPage(page, response);
});
});
});

View File

@ -41,84 +41,37 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
if (!options.targetSystem || plugin.targetSystem == options.targetSystem) {
return "UserInstalled" == plugin.type;
}
return false;
}
return false;
});
availablePlugins = allPlugins.sort(function (a__e, b__r) {
var aName = a__e.category;
var bName = b__r.category;
if (aName > bName) {
availablePlugins = allPlugins.sort(function (a, b) {
if (a.category > b.category) {
return 1;
}
if (bName > aName) {
} else if (b.category > a.category) {
return -1;
}
aName = a__e.name;
bName = b__r.name;
if (aName > bName) {
if (a.name > b.name) {
return 1;
}
if (bName > aName) {
} else if (b.name > a.name) {
return -1;
}
return 0;
});
var i__q;
var length;
var plugin;
var currentCategory;
var html = "";
if (!options.categories) {
currentCategory = globalize.translate("HeaderTopPlugins");
html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards">' + currentCategory + "</h2>";
var topPlugins = allPlugins.slice(0).sort(function (a__t, b__y) {
if (a__t.installs > b__y.installs) {
return -1;
}
if (b__y.installs > a__t.installs) {
return 1;
}
var aName = a__t.name;
var bName = b__y.name;
if (aName > bName) {
return 1;
}
if (bName > aName) {
return -1;
}
return 0;
});
html += '<div class="itemsContainer vertical-wrap">';
var limit = screen.availWidth >= 1920 ? 15 : 12;
for (i__q = 0, length = Math.min(topPlugins.length, limit); i__q < length; i__q++) {
html += getPluginHtml(topPlugins[i__q], options, installedPlugins);
}
html += "</div>";
html += "</div>";
}
var hasOpenTag = false;
for (currentCategory = null, false === options.showCategory && (html += '<div class="itemsContainer vertical-wrap">', hasOpenTag = true), i__q = 0, length = availablePlugins.length; i__q < length; i__q++) {
plugin = availablePlugins[i__q];
currentCategory = null;
if (options.showCategory === false) {
html += '<div class="itemsContainer vertical-wrap">';
hasOpenTag = true;
}
for (var i = 0; i < availablePlugins.length; i++) {
plugin = availablePlugins[i];
var category = plugin.categoryDisplayName;
if (category != currentCategory) {
@ -128,16 +81,13 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
html += "</div>";
html += "</div>";
}
html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>";
html += '<div class="itemsContainer vertical-wrap">';
hasOpenTag = true;
}
currentCategory = category;
}
html += getPluginHtml(plugin, options, installedPlugins);
}

View File

@ -423,11 +423,6 @@ var Dashboard = {
autoFocus: !1,
roles: "admin",
controller: "scripts/addpluginpage"
}), defineRoute({
path: "/appservices.html",
dependencies: [],
autoFocus: !1,
roles: "admin"
}), defineRoute({
path: "/autoorganizelog.html",
dependencies: [],
@ -503,11 +498,6 @@ var Dashboard = {
dependencies: [],
autoFocus: !1,
roles: "admin"
}), defineRoute({
path: "/opensubtitles.html",
dependencies: [],
autoFocus: !1,
roles: "admin"
}), defineRoute({
path: "/forgotpassword.html",
dependencies: ["emby-input", "emby-button"],

View File

@ -563,7 +563,7 @@
"HeaderGuideProviders": "TV Guide Data Providers",
"HeaderHomePage": "Home Page",
"HeaderHomeScreen": "Home Screen",
"HeaderHomeScreenSettings": "Home Screen settings",
"HeaderHomeScreenSettings": "Home Screen Settings",
"HeaderHttpHeaders": "Http Headers",
"HeaderIdentification": "Identification",
"HeaderIdentificationCriteriaHelp": "Enter at least one identification criteria.",