2021-10-23 03:08:02 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-10-28 20:27:53 +02:00
|
|
|
<app-settings-content :header-text="$strings.HeaderUsers">
|
|
|
|
<template #header-items>
|
|
|
|
<ui-tooltip :text="$strings.LabelClickForMoreInfo" class="inline-flex ml-2">
|
|
|
|
<a href="https://www.audiobookshelf.org/guides/users" target="_blank" class="inline-flex">
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols text-xl w-5 text-gray-200">help_outline</span>
|
2023-10-28 20:27:53 +02:00
|
|
|
</a>
|
|
|
|
</ui-tooltip>
|
|
|
|
|
|
|
|
<div class="flex-grow" />
|
|
|
|
|
|
|
|
<ui-btn color="primary" small @click="setShowUserModal()">{{ $strings.ButtonAddUser }}</ui-btn>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<tables-users-table class="pt-2" @edit="setShowUserModal" />
|
2022-11-26 06:10:05 +01:00
|
|
|
</app-settings-content>
|
|
|
|
<modals-account-modal ref="accountModal" v-model="showAccountModal" :account="selectedAccount" />
|
2021-10-23 03:08:02 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2023-06-16 00:41:27 +02:00
|
|
|
asyncData({ store, redirect }) {
|
|
|
|
if (!store.getters['user/getIsAdminOrUp']) {
|
|
|
|
redirect('/')
|
|
|
|
}
|
|
|
|
},
|
2021-10-23 03:08:02 +02:00
|
|
|
data() {
|
2022-11-26 06:10:05 +01:00
|
|
|
return {
|
|
|
|
selectedAccount: null,
|
2022-11-26 18:08:09 +01:00
|
|
|
showAccountModal: false
|
2022-11-26 06:10:05 +01:00
|
|
|
}
|
2021-10-23 03:08:02 +02:00
|
|
|
},
|
|
|
|
computed: {},
|
2022-11-26 06:10:05 +01:00
|
|
|
methods: {
|
|
|
|
setShowUserModal(selectedAccount) {
|
|
|
|
this.selectedAccount = selectedAccount
|
|
|
|
this.showAccountModal = true
|
|
|
|
}
|
|
|
|
},
|
2024-08-10 22:46:04 +02:00
|
|
|
mounted() {},
|
|
|
|
beforeDestroy() {
|
|
|
|
if (this.$refs.accountModal) {
|
|
|
|
this.$refs.accountModal.close()
|
|
|
|
}
|
|
|
|
}
|
2021-10-23 03:08:02 +02:00
|
|
|
}
|
2024-08-10 22:46:04 +02:00
|
|
|
</script>
|