mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-03-20 10:26:40 +01:00
Add: user column to ereaders
This commit is contained in:
parent
5bbcb9cac3
commit
4e40dbc3a5
@ -70,6 +70,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="text-left">{{ $strings.LabelName }}</th>
|
<th class="text-left">{{ $strings.LabelName }}</th>
|
||||||
<th class="text-left">{{ $strings.LabelEmail }}</th>
|
<th class="text-left">{{ $strings.LabelEmail }}</th>
|
||||||
|
<th class="text-left">{{ $strings.LabelAccessibleBy }}</th>
|
||||||
<th class="w-40"></th>
|
<th class="w-40"></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="device in existingEReaderDevices" :key="device.name">
|
<tr v-for="device in existingEReaderDevices" :key="device.name">
|
||||||
@ -79,6 +80,9 @@
|
|||||||
<td class="text-left">
|
<td class="text-left">
|
||||||
<p class="text-sm md:text-base text-gray-100">{{ device.email }}</p>
|
<p class="text-sm md:text-base text-gray-100">{{ device.email }}</p>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="text-left">
|
||||||
|
<p class="text-sm md:text-base text-gray-100">{{ getAccessibleBy(device) }}</p>
|
||||||
|
</td>
|
||||||
<td class="w-40">
|
<td class="w-40">
|
||||||
<div class="flex justify-end items-center h-10">
|
<div class="flex justify-end items-center h-10">
|
||||||
<ui-icon-btn icon="edit" borderless :size="8" icon-font-size="1.1rem" :disabled="deletingDeviceName === device.name" class="mx-1" @click="editDeviceClick(device)" />
|
<ui-icon-btn icon="edit" borderless :size="8" icon-font-size="1.1rem" :disabled="deletingDeviceName === device.name" class="mx-1" @click="editDeviceClick(device)" />
|
||||||
@ -105,6 +109,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
users: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
savingSettings: false,
|
savingSettings: false,
|
||||||
sendingTest: false,
|
sendingTest: false,
|
||||||
@ -146,6 +151,29 @@ export default {
|
|||||||
...this.settings
|
...this.settings
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async loadUsers() {
|
||||||
|
this.users = await this.$axios
|
||||||
|
.$get('/api/users')
|
||||||
|
.then((res) => {
|
||||||
|
return res.users.sort((a, b) => {
|
||||||
|
return a.createdAt - b.createdAt
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Failed', error)
|
||||||
|
return []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAccessibleBy(device) {
|
||||||
|
const user = device.availabilityOption
|
||||||
|
if (user === 'userOrUp') return 'Users (excluding Guests)'
|
||||||
|
if (user === 'guestOrUp') return 'Users (including Guests)'
|
||||||
|
if (user === 'specificUsers') {
|
||||||
|
this.loadUsers()
|
||||||
|
return device.users.map((id) => this.users.find((u) => u.id === id)?.username).join(', ')
|
||||||
|
}
|
||||||
|
return 'Admins Only'
|
||||||
|
},
|
||||||
editDeviceClick(device) {
|
editDeviceClick(device) {
|
||||||
this.selectedEReaderDevice = device
|
this.selectedEReaderDevice = device
|
||||||
this.showEReaderDeviceModal = true
|
this.showEReaderDeviceModal = true
|
||||||
|
@ -191,6 +191,7 @@
|
|||||||
"LabelAbridged": "Abridged",
|
"LabelAbridged": "Abridged",
|
||||||
"LabelAbridgedChecked": "Abridged (checked)",
|
"LabelAbridgedChecked": "Abridged (checked)",
|
||||||
"LabelAbridgedUnchecked": "Unabridged (unchecked)",
|
"LabelAbridgedUnchecked": "Unabridged (unchecked)",
|
||||||
|
"LabelAccessibleBy": "Accessible by",
|
||||||
"LabelAccountType": "Account Type",
|
"LabelAccountType": "Account Type",
|
||||||
"LabelAccountTypeAdmin": "Admin",
|
"LabelAccountTypeAdmin": "Admin",
|
||||||
"LabelAccountTypeGuest": "Guest",
|
"LabelAccountTypeGuest": "Guest",
|
||||||
|
Loading…
Reference in New Issue
Block a user