mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-28 23:06:19 +02:00
Make logout button reactive, improve dropdown menu css
This commit is contained in:
parent
a391576285
commit
07c0801ad5
@ -321,6 +321,8 @@ export default {
|
||||
// Set it to empty if done
|
||||
this.saveSettings(() => {
|
||||
this.password.currentPassword = "";
|
||||
this.$root.username = null;
|
||||
this.$root.socket.token = "autoLogin";
|
||||
}, this.password.currentPassword);
|
||||
},
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
<font-awesome-icon icon="cog" /> {{ $t("Settings") }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li v-if="$root.loggedIn && $root.storage().token !== 'autoLogin'">
|
||||
<li v-if="$root.loggedIn && $root.socket.token !== 'autoLogin'">
|
||||
<button class="dropdown-item" @click="$root.logout">
|
||||
<font-awesome-icon icon="sign-out-alt" />
|
||||
{{ $t("Logout") }}
|
||||
@ -235,8 +235,10 @@ main {
|
||||
.dropdown-menu {
|
||||
transition: all 0.2s;
|
||||
padding-left: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 8px !important;
|
||||
border-radius: 20px;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
|
||||
.dropdown-divider {
|
||||
margin: 0;
|
||||
|
@ -103,8 +103,8 @@ export default {
|
||||
|
||||
socket.on("autoLogin", (monitorID, data) => {
|
||||
this.loggedIn = true;
|
||||
this.username = "No Auth";
|
||||
this.storage().token = "autoLogin";
|
||||
this.socket.token = "autoLogin";
|
||||
this.allowLoginDialog = false;
|
||||
});
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
</router-link>
|
||||
|
||||
<!-- Logout Button -->
|
||||
<a v-if="$root.isMobile && $root.loggedIn && $root.storage().token !== 'autoLogin'" class="logout" @click.prevent="$root.logout">
|
||||
<a v-if="$root.isMobile && $root.loggedIn && $root.socket.token !== 'autoLogin'" class="logout" @click.prevent="$root.logout">
|
||||
<div class="menu-item">
|
||||
<font-awesome-icon icon="sign-out-alt" />
|
||||
{{ $t("Logout") }}
|
||||
|
Loading…
Reference in New Issue
Block a user