1414
1515 <v-divider ></v-divider >
1616
17+
1718 <v-list dense nav mini >
18- <v-list-item link >
19- <v-list-item-icon >
20- <v-icon >mdi-account-question</v-icon >
21- </v-list-item-icon >
22- <v-list-item-content >
23- <router-link to =" /factoids" >Factoids</router-link >
24- </v-list-item-content >
25- </v-list-item >
19+ <router-link to =" /factoids" tag =" div" >
20+ <v-list-item link >
21+ <v-list-item-icon >
22+ <v-icon >mdi-account-question</v-icon >
23+ </v-list-item-icon >
24+ <v-list-item-content >
25+ <span >Factoids</span >
26+ </v-list-item-content >
27+ </v-list-item >
28+ </router-link >
2629
27- <v-list-item link >
28- <v-list-item-icon >
29- <v-icon >mdi-bug</v-icon >
30- </v-list-item-icon >
31- <v-list-item-content >
32- <router-link to =" /hjt" >HJT</router-link >
33- </v-list-item-content >
34- </v-list-item >
30+ <router-link to =" /hjt" tag =" div" >
31+ <v-list-item link >
32+ <v-list-item-icon >
33+ <v-icon >mdi-bug</v-icon >
34+ </v-list-item-icon >
35+ <v-list-item-content >
36+ <span >HJT</span >
37+ </v-list-item-content >
38+ </v-list-item >
39+ </router-link >
3540
36- <v-list-item link v-if =" canEditUsers" >
37- <v-list-item-icon >
38- <v-icon >mdi-account-group</v-icon >
39- </v-list-item-icon >
40- <v-list-item-content >
41- <router-link to =" /users" >Users</router-link >
42- </v-list-item-content >
43- </v-list-item >
41+ <router-link to =" /users" tag =" div" v-if =" canEditUsers" >
42+ <v-list-item link >
43+ <v-list-item-icon >
44+ <v-icon >mdi-account-group</v-icon >
45+ </v-list-item-icon >
46+ <v-list-item-content >
47+ <span >Users</span >
48+ </v-list-item-content >
49+ </v-list-item >
50+ </router-link >
4451
4552 <v-divider ></v-divider >
4653
47- <v-list-item link v-if =" loggedIn" >
54+ <v-list-item link v-if =" loggedIn" v-on:click = " logout " >
4855 <v-list-item-icon >
4956 <v-icon >mdi-account-arrow-right</v-icon >
5057 </v-list-item-icon >
5158 <v-list-item-content >
52- <a href = " # " v-on:click = " logout " >Logout</a >
59+ <span >Logout</span >
5360 </v-list-item-content >
5461 </v-list-item >
55- <v-list-item link v-else >
62+ <v-list-item link v-else v-on:click = " login " >
5663 <v-list-item-icon >
5764 <v-icon >mdi-account-arrow-right</v-icon >
5865 </v-list-item-icon >
5966 <v-list-item-content >
60- <a href = " /login " >Login</a >
67+ <span >Login</span >
6168 </v-list-item-content >
6269 </v-list-item >
6370 </v-list >
9299import axios from " axios" ;
93100
94101export default {
95- data () {
102+ data () {
96103 return {
97104 canEditUsers: false ,
98105 loggedIn: false
@@ -105,24 +112,27 @@ export default {
105112 }
106113 },
107114 mounted () {
108- if (this .$cookies .get (" perms" ).split (" +" ).includes (" user.manage" )) {
115+ if (this .$cookies .get (" perms" )? .split (" +" ).includes (" user.manage" )) {
109116 this .canEditUsers = true ;
110117 }
111- if (this .$cookies .get (" perms " )) {
118+ if (this .$cookies .get (" panelsession " )) {
112119 this .loggedIn = true
113120 }
114121 },
115122 methods: {
116- toggleTheme : function () {
117- localStorage .setItem (" dark-theme" , ! this .$vuetify .theme .dark ? " dark" : " light" );
123+ toggleTheme : function () {
124+ localStorage .setItem (" dark-theme" , ! this .$vuetify .theme .dark ? " dark" : " light" );
118125 this .$vuetify .theme .dark = ! this .$vuetify .theme .dark ;
119126 },
120- logout : function () {
127+ logout : function () {
121128 axios .post (' /logout' ).then (() => {
122129 this .loggedIn = false
123130 this .$cookies .remove (" perms" )
124131 this .$cookies .remove (" panelsession" )
125132 })
133+ },
134+ login : function () {
135+ window .location .href = " /login" ;
126136 }
127137 }
128138}
0 commit comments