|
@ -26,20 +26,32 @@ |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
alert("Trying to " + (is2faEnabled ? "disable" : "enable") + " 2FA"); |
|
|
alert("Trying to " + (is2faEnabled ? "disable" : "enable") + " 2FA"); |
|
|
} |
|
|
} |
|
|
|
|
|
function submitAvatar() { |
|
|
|
|
|
let form: HTMLFormElement = <HTMLFormElement>( |
|
|
|
|
|
document.getElementById("upload_avatar") |
|
|
|
|
|
); |
|
|
|
|
|
form.submit(); |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<div class="overlay"> |
|
|
<div class="overlay"> |
|
|
<div class="profile" on:click|stopPropagation on:keydown|stopPropagation> |
|
|
<div class="profile" on:click|stopPropagation on:keydown|stopPropagation> |
|
|
<div class="profile-header"> |
|
|
<div class="profile-header"> |
|
|
<img class="profile-img" src={API_URL + "/avatar"} alt="avatar" /> |
|
|
|
|
|
<h3>{realname}</h3> |
|
|
<h3>{realname}</h3> |
|
|
<form |
|
|
|
|
|
action={API_URL + "/avatar"} |
|
|
<form action={API_URL + "/avatar"} method="post" |
|
|
method="post" |
|
|
enctype="multipart/form-data" id= "upload_avatar"> |
|
|
enctype="multipart/form-data" |
|
|
<div class=input-avatar> |
|
|
> |
|
|
<label for="avatar-input"> |
|
|
<input type="file" id="avatar-input" name="avatar" /> |
|
|
<img src={API_URL + "/avatar"} alt="avatar" class="profile-img" /> |
|
|
<input type="submit" /> |
|
|
</label> |
|
|
|
|
|
<input |
|
|
|
|
|
type="file" |
|
|
|
|
|
id="avatar-input" |
|
|
|
|
|
name="avatar" |
|
|
|
|
|
on:change={submitAvatar} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
<div class="profile-body"> |
|
|
<div class="profile-body"> |
|
@ -97,12 +109,16 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.profile-img { |
|
|
.profile-img { |
|
|
width: 50px; |
|
|
width: 80px; |
|
|
height: 50px; |
|
|
height: 80px; |
|
|
margin-right: 1rem; |
|
|
margin-right: 1rem; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.two-factor-auth { |
|
|
.two-factor-auth { |
|
|
margin-top: 1rem; |
|
|
margin-top: 1rem; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.input-avatar > input { |
|
|
|
|
|
display: none; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |
|
|