返回提交历史
Modified
static/webui/index.html
+1
-0
Modified
static/webui/script.js
+12
-2
Modified
static/webui/translations/de.js
+1
-0
Modified
static/webui/translations/en.js
+1
-0
Modified
static/webui/translations/es.js
+1
-0
Modified
static/webui/translations/fr.js
+1
-0
Modified
static/webui/translations/ru.js
+1
-0
Modified
static/webui/translations/zh.js
+1
-0
XFEstudio/SpaceNinjaServer
feat(webui): register (#1779)
Closes #740 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1779 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
3aa853f9
代码差异
8 个文件
+19
-2
@@ -85,6 +85,7 @@
85
85
<input class="form-control" type="password" id="password" required />
86
86
<br />
87
87
<button class="btn btn-primary" type="submit" data-loc="login_loginButton"></button>
88
<button class="btn btn-secondary" type="submit" onclick="registerSubmit = true;" data-loc="login_registerButton"></button>
88
89
</form>
89
90
</div>
90
91
<div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
@@ -1,8 +1,15 @@
1
let loginOrRegisterPending = false;
2
window.registerSubmit = false;
3
1
4
function doLogin() {
5
if (loginOrRegisterPending) {
6
return;
7
}
8
loginOrRegisterPending = true;
2
9
localStorage.setItem("email", $("#email").val());
3
10
localStorage.setItem("password", $("#password").val());
4
$("#email, #password").val("");
5
11
loginFromLocalStorage();
12
registerSubmit = false;
6
13
}
7
14
8
15
function loginFromLocalStorage() {
@@ -37,12 +44,15 @@ function doLoginRequest(succ_cb, fail_cb) {
37
44
s: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==", // signature of some kind
38
45
lang: "en",
39
46
date: 1501230947855458660, // ???
40
ClientType: "webui",
47
ClientType: registerSubmit ? "" : "webui",
41
48
PS: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==" // anti-cheat data
42
49
})
43
50
});
44
51
req.done(succ_cb);
45
52
req.fail(fail_cb);
53
req.always(() => {
54
loginOrRegisterPending = false;
55
});
46
56
}
47
57
48
58
function revalidateAuthz(succ_cb) {
@@ -60,6 +60,7 @@ dict = {
60
60
login_emailLabel: `E-Mail-Adresse`,
61
61
login_passwordLabel: `Passwort`,
62
62
login_loginButton: `Anmelden`,
63
login_registerButton: `[UNTRANSLATED] Register`,
63
64
navbar_logout: `Abmelden`,
64
65
navbar_renameAccount: `Account umbenennen`,
65
66
navbar_deleteAccount: `Account löschen`,
@@ -59,6 +59,7 @@ dict = {
59
59
login_emailLabel: `Email address`,
60
60
login_passwordLabel: `Password`,
61
61
login_loginButton: `Login`,
62
login_registerButton: `Register`,
62
63
navbar_logout: `Logout`,
63
64
navbar_renameAccount: `Rename Account`,
64
65
navbar_deleteAccount: `Delete Account`,
@@ -60,6 +60,7 @@ dict = {
60
60
login_emailLabel: `Dirección de correo electrónico`,
61
61
login_passwordLabel: `Contraseña`,
62
62
login_loginButton: `Iniciar sesión`,
63
login_registerButton: `[UNTRANSLATED] Register`,
63
64
navbar_logout: `Cerrar sesión`,
64
65
navbar_renameAccount: `Renombrar cuenta`,
65
66
navbar_deleteAccount: `Eliminar cuenta`,
@@ -60,6 +60,7 @@ dict = {
60
60
login_emailLabel: `Email`,
61
61
login_passwordLabel: `Mot de passe`,
62
62
login_loginButton: `Connexion`,
63
login_registerButton: `[UNTRANSLATED] Register`,
63
64
navbar_logout: `Déconnexion`,
64
65
navbar_renameAccount: `Renommer le compte`,
65
66
navbar_deleteAccount: `Supprimer le compte`,
@@ -60,6 +60,7 @@ dict = {
60
60
login_emailLabel: `Адрес электронной почты`,
61
61
login_passwordLabel: `Пароль`,
62
62
login_loginButton: `Войти`,
63
login_registerButton: `[UNTRANSLATED] Register`,
63
64
navbar_logout: `Выйти`,
64
65
navbar_renameAccount: `Переименовать аккаунт`,
65
66
navbar_deleteAccount: `Удалить аккаунт`,
@@ -60,6 +60,7 @@ dict = {
60
60
login_emailLabel: `电子邮箱`,
61
61
login_passwordLabel: `密码`,
62
62
login_loginButton: `登录`,
63
login_registerButton: `[UNTRANSLATED] Register`,
63
64
navbar_logout: `退出登录`,
64
65
navbar_renameAccount: `重命名账户`,
65
66
navbar_deleteAccount: `删除账户`,