1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Added frontend support for a password field on setup

This commit is contained in:
Justin Suess 2019-01-28 20:03:54 -06:00
parent 0474bcfa8f
commit a72fce15a6
5 changed files with 20 additions and 3 deletions

View file

@ -26,7 +26,9 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em
apiClient.ajax({
type: "POST",
data: {
Name: form.querySelector("#txtUsername").value
Name: form.querySelector("#txtUsername").value,
Password: form.querySelector("#txtManualPassword").value
},
url: apiClient.getUrl("Startup/User"),
dataType: "json"
@ -36,7 +38,12 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em
}
function onSubmit(e) {
return submit(this), e.preventDefault(), !1
var form = this;
return form.querySelector("#txtManualPassword").value != form.querySelector("#txtPasswordConfirm").value ? require(["toast"], function(toast) {
toast(Globalize.translate("PasswordMatchError"))
}) : submit(this), e.preventDefault(), !1
}
function onViewShow() {
@ -45,6 +52,7 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em
apiClient = getApiClient();
apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) {
page.querySelector("#txtUsername").value = user.Name || "", loading.hide()
page.querySelector("#txtManualPassword").value = user.Password || "", loading.hide()
})
}
return function(view, params) {