removed icon server and finished profile page

This commit is contained in:
Maieul BOYER 2025-12-10 17:06:53 +01:00 committed by apetitco
parent 23baa4af56
commit a8fa9f984d
26 changed files with 881 additions and 325 deletions

View file

@ -1,4 +1,4 @@
import { addRoute, handleRoute, navigateTo, setTitle } from "@app/routing";
import { addRoute, getRoute, handleRoute, navigateTo, setTitle } from "@app/routing";
import { showError, showSuccess } from "@app/toast";
import page from "./profile.html?raw";
import { updateUser } from "@app/auth";
@ -159,7 +159,7 @@ async function route(url: string, _args: { [k: string]: string }) {
} else if (!isNullish(user.selfInfo?.loginName)) {
loginNameWrapper.hidden = false;
loginNameBox.innerText = user.selfInfo.loginName;
totpWrapper.hidden =false;
totpWrapper.hidden = false;
passwordWrapper.hidden = false;
accountTypeBox.innerText = "Normal";
@ -244,6 +244,19 @@ async function route(url: string, _args: { [k: string]: string }) {
showError(`Failed to update: ${req.msg}`);
}
};
passwordButton.onclick = async () => {
let req = await client.changePassword({
changePasswordRequest: {
newPassword: passwordBox.value,
},
});
if (req.kind === "success") {
showSuccess("Successfully changed password");
handleRoute();
} else {
showError(`Failed to update: ${req.msg}`);
}
};
// Initialize UI state
refreshTotpUI();