mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-07-12 19:10:26 +00:00
feat: Show the current users name in the sidebar (#2821)
Co-authored-by: Oleg Lobanov <oleg@lobanov.me> Co-authored-by: Henrique Dias <mail@hacdias.com>
This commit is contained in:
parent
fbe169b84f
commit
528ce92fad
@ -2,6 +2,10 @@
|
||||
<div v-show="active" @click="closeHovers" class="overlay"></div>
|
||||
<nav :class="{ active }">
|
||||
<template v-if="isLoggedIn">
|
||||
<button @click="toAccountSettings" class="action">
|
||||
<i class="material-icons">person</i>
|
||||
<span>{{ user.username }}</span>
|
||||
</button>
|
||||
<button
|
||||
class="action"
|
||||
@click="toRoot"
|
||||
@ -34,7 +38,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div v-if="user.perm.admin">
|
||||
<button
|
||||
class="action"
|
||||
@click="toSettings"
|
||||
@ -44,7 +48,7 @@
|
||||
<i class="material-icons">settings_applications</i>
|
||||
<span>{{ $t("sidebar.settings") }}</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<button
|
||||
v-if="canLogout"
|
||||
@click="logout"
|
||||
@ -56,7 +60,6 @@
|
||||
<i class="material-icons">exit_to_app</i>
|
||||
<span>{{ $t("sidebar.logout") }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<router-link
|
||||
@ -190,8 +193,12 @@ export default {
|
||||
this.$router.push({ path: "/files" });
|
||||
this.closeHovers();
|
||||
},
|
||||
toSettings() {
|
||||
this.$router.push({ path: "/settings" });
|
||||
toAccountSettings() {
|
||||
this.$router.push({ path: "/settings/profile" });
|
||||
this.closeHovers();
|
||||
},
|
||||
toGlobalSettings() {
|
||||
this.$router.push({ path: "/settings/global" });
|
||||
this.closeHovers();
|
||||
},
|
||||
help() {
|
||||
|
@ -30,6 +30,7 @@ type userInfo struct {
|
||||
LockPassword bool `json:"lockPassword"`
|
||||
HideDotfiles bool `json:"hideDotfiles"`
|
||||
DateFormat bool `json:"dateFormat"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type authToken struct {
|
||||
@ -198,6 +199,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use
|
||||
Commands: user.Commands,
|
||||
HideDotfiles: user.HideDotfiles,
|
||||
DateFormat: user.DateFormat,
|
||||
Username: user.Username,
|
||||
},
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user