2021-08-18 00:01:11 +02:00
|
|
|
<template>
|
|
|
|
<div class="w-full my-2">
|
|
|
|
<div class="w-full bg-primary px-6 py-2 flex items-center cursor-pointer" @click.stop="clickBar">
|
2021-08-19 01:31:19 +02:00
|
|
|
<p class="pr-4">Other Audio Files</p>
|
|
|
|
<span class="bg-black-400 rounded-xl py-1 px-2 text-sm font-mono">{{ files.length }}</span>
|
2021-08-18 00:01:11 +02:00
|
|
|
<div class="flex-grow" />
|
2022-03-14 01:34:31 +01:00
|
|
|
<nuxt-link v-if="userCanUpdate" :to="`/item/${audiobookId}/edit`" class="mr-4">
|
2021-08-19 01:31:19 +02:00
|
|
|
<ui-btn small color="primary">Manage Tracks</ui-btn>
|
2021-08-18 00:01:11 +02:00
|
|
|
</nuxt-link>
|
|
|
|
<div class="cursor-pointer h-10 w-10 rounded-full hover:bg-black-400 flex justify-center items-center duration-500" :class="showTracks ? 'transform rotate-180' : ''">
|
|
|
|
<span class="material-icons text-4xl">expand_more</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<transition name="slide">
|
|
|
|
<div class="w-full" v-show="showTracks">
|
|
|
|
<table class="text-sm tracksTable">
|
|
|
|
<tr class="font-book">
|
|
|
|
<th class="text-left">Filename</th>
|
|
|
|
<th class="text-left">Size</th>
|
|
|
|
<th class="text-left">Duration</th>
|
2021-08-19 01:31:19 +02:00
|
|
|
<th class="text-left">Notes</th>
|
2021-08-18 00:01:11 +02:00
|
|
|
</tr>
|
2021-08-19 01:31:19 +02:00
|
|
|
<template v-for="track in files">
|
|
|
|
<tr :key="track.path">
|
|
|
|
<td class="font-book pl-2">
|
2021-09-27 14:02:31 +02:00
|
|
|
{{ track.filename }}
|
2021-08-18 00:01:11 +02:00
|
|
|
</td>
|
|
|
|
<td class="font-mono">
|
|
|
|
{{ $bytesPretty(track.size) }}
|
|
|
|
</td>
|
|
|
|
<td class="font-mono">
|
|
|
|
{{ $secondsToTimestamp(track.duration) }}
|
|
|
|
</td>
|
2021-08-19 01:31:19 +02:00
|
|
|
<td class="text-xs">
|
|
|
|
<p>{{ track.error || '' }}</p>
|
|
|
|
</td>
|
2021-08-18 00:01:11 +02:00
|
|
|
</tr>
|
|
|
|
</template>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-08-19 01:31:19 +02:00
|
|
|
files: {
|
2021-08-18 00:01:11 +02:00
|
|
|
type: Array,
|
|
|
|
default: () => []
|
|
|
|
},
|
|
|
|
audiobookId: String
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showTracks: false
|
|
|
|
}
|
|
|
|
},
|
2021-09-07 00:42:15 +02:00
|
|
|
computed: {
|
|
|
|
userCanUpdate() {
|
|
|
|
return this.$store.getters['user/getUserCanUpdate']
|
|
|
|
}
|
|
|
|
},
|
2021-08-18 00:01:11 +02:00
|
|
|
methods: {
|
|
|
|
clickBar() {
|
|
|
|
this.showTracks = !this.showTracks
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|