feat: add Admin Console icon
This commit is contained in:
parent
b5a39e32c3
commit
84a24c389f
2 changed files with 21 additions and 0 deletions
|
|
@ -138,6 +138,7 @@ window.LNbits = {
|
||||||
user: function (data) {
|
user: function (data) {
|
||||||
var obj = {
|
var obj = {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
|
admin: data.admin,
|
||||||
email: data.email,
|
email: data.email,
|
||||||
extensions: data.extensions,
|
extensions: data.extensions,
|
||||||
wallets: data.wallets
|
wallets: data.wallets
|
||||||
|
|
@ -326,6 +327,12 @@ window.windowMixin = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
isAdminUser: function () {
|
||||||
|
return this.g.user?.admin
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
changeColor: function (newValue) {
|
changeColor: function (newValue) {
|
||||||
document.body.setAttribute('data-theme', newValue)
|
document.body.setAttribute('data-theme', newValue)
|
||||||
|
|
@ -335,6 +342,9 @@ window.windowMixin = {
|
||||||
this.$q.dark.toggle()
|
this.$q.dark.toggle()
|
||||||
this.$q.localStorage.set('lnbits.darkMode', this.$q.dark.isActive)
|
this.$q.localStorage.set('lnbits.darkMode', this.$q.dark.isActive)
|
||||||
},
|
},
|
||||||
|
goToAdminConsole: function () {
|
||||||
|
window.location.href = '/admin?usr=' + this.g.user.id
|
||||||
|
},
|
||||||
copyText: function (text, message, position) {
|
copyText: function (text, message, position) {
|
||||||
var notify = this.$q.notify
|
var notify = this.$q.notify
|
||||||
Quasar.utils.copyToClipboard(text).then(function () {
|
Quasar.utils.copyToClipboard(text).then(function () {
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,17 @@
|
||||||
>
|
>
|
||||||
<q-tooltip>Toggle Dark Mode</q-tooltip>
|
<q-tooltip>Toggle Dark Mode</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
v-if="isAdminUser"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
@click="goToAdminConsole"
|
||||||
|
icon="admin_panel_settings"
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
|
<q-tooltip>Admin Console</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
</q-header>
|
</q-header>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue