Merge 1729787ae2
into 35d1c09243
commit
498637cab2
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-show="active" @click="closeHovers" class="overlay"></div>
|
<div v-show="active" @click="closeHovers" class="overlay"></div>
|
||||||
<nav :class="{ active }">
|
<nav :class="{ active }">
|
||||||
|
<button v-if="user.username" @click="toAccountSettings" class="action">
|
||||||
|
<i class="material-icons">person</i>
|
||||||
|
<span>{{ user.username }}</span>
|
||||||
|
</button>
|
||||||
<template v-if="isLoggedIn">
|
<template v-if="isLoggedIn">
|
||||||
<button
|
<button
|
||||||
class="action"
|
class="action"
|
||||||
|
@ -34,7 +38,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div v-if="user.perm.admin">
|
||||||
<button
|
<button
|
||||||
class="action"
|
class="action"
|
||||||
@click="toSettings"
|
@click="toSettings"
|
||||||
|
@ -44,19 +48,18 @@
|
||||||
<i class="material-icons">settings_applications</i>
|
<i class="material-icons">settings_applications</i>
|
||||||
<span>{{ $t("sidebar.settings") }}</span>
|
<span>{{ $t("sidebar.settings") }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
|
||||||
v-if="canLogout"
|
|
||||||
@click="logout"
|
|
||||||
class="action"
|
|
||||||
id="logout"
|
|
||||||
:aria-label="$t('sidebar.logout')"
|
|
||||||
:title="$t('sidebar.logout')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">exit_to_app</i>
|
|
||||||
<span>{{ $t("sidebar.logout") }}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
v-if="canLogout"
|
||||||
|
@click="logout"
|
||||||
|
class="action"
|
||||||
|
id="logout"
|
||||||
|
:aria-label="$t('sidebar.logout')"
|
||||||
|
:title="$t('sidebar.logout')"
|
||||||
|
>
|
||||||
|
<i class="material-icons">exit_to_app</i>
|
||||||
|
<span>{{ $t("sidebar.logout") }}</span>
|
||||||
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<router-link
|
<router-link
|
||||||
|
@ -181,8 +184,12 @@ export default {
|
||||||
this.$router.push({ path: "/files" });
|
this.$router.push({ path: "/files" });
|
||||||
this.closeHovers();
|
this.closeHovers();
|
||||||
},
|
},
|
||||||
|
toAccountSettings() {
|
||||||
|
this.$router.push({ path: "/settings/profile" });
|
||||||
|
this.$store.commit("closeHovers");
|
||||||
|
},
|
||||||
toSettings() {
|
toSettings() {
|
||||||
this.$router.push({ path: "/settings" });
|
this.$router.push({ path: "/settings/global" });
|
||||||
this.closeHovers();
|
this.closeHovers();
|
||||||
},
|
},
|
||||||
help() {
|
help() {
|
||||||
|
|
|
@ -30,6 +30,7 @@ type userInfo struct {
|
||||||
LockPassword bool `json:"lockPassword"`
|
LockPassword bool `json:"lockPassword"`
|
||||||
HideDotfiles bool `json:"hideDotfiles"`
|
HideDotfiles bool `json:"hideDotfiles"`
|
||||||
DateFormat bool `json:"dateFormat"`
|
DateFormat bool `json:"dateFormat"`
|
||||||
|
Username string `json:"username"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type authToken struct {
|
type authToken struct {
|
||||||
|
@ -195,6 +196,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use
|
||||||
Commands: user.Commands,
|
Commands: user.Commands,
|
||||||
HideDotfiles: user.HideDotfiles,
|
HideDotfiles: user.HideDotfiles,
|
||||||
DateFormat: user.DateFormat,
|
DateFormat: user.DateFormat,
|
||||||
|
Username: user.Username,
|
||||||
},
|
},
|
||||||
RegisteredClaims: jwt.RegisteredClaims{
|
RegisteredClaims: jwt.RegisteredClaims{
|
||||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||||
|
|
Loading…
Reference in New Issue