|
@@ -4,6 +4,7 @@ import Toast from "toasters";
|
|
import { useWebsocketsStore } from "@/stores/websockets";
|
|
import { useWebsocketsStore } from "@/stores/websockets";
|
|
import { useLongJobsStore } from "@/stores/longJobs";
|
|
import { useLongJobsStore } from "@/stores/longJobs";
|
|
import { useModalsStore } from "@/stores/modals";
|
|
import { useModalsStore } from "@/stores/modals";
|
|
|
|
+import { useUserAuthStore } from "@/stores/userAuth";
|
|
import {
|
|
import {
|
|
TableColumn,
|
|
TableColumn,
|
|
TableFilter,
|
|
TableFilter,
|
|
@@ -25,6 +26,9 @@ const { setJob } = useLongJobsStore();
|
|
|
|
|
|
const { socket } = useWebsocketsStore();
|
|
const { socket } = useWebsocketsStore();
|
|
|
|
|
|
|
|
+const userAuthStore = useUserAuthStore();
|
|
|
|
+const { hasPermission } = userAuthStore;
|
|
|
|
+
|
|
const columnDefault = ref(<TableColumn>{
|
|
const columnDefault = ref(<TableColumn>{
|
|
sortable: true,
|
|
sortable: true,
|
|
hidable: true,
|
|
hidable: true,
|
|
@@ -42,8 +46,16 @@ const columns = ref(<TableColumn[]>[
|
|
sortable: false,
|
|
sortable: false,
|
|
hidable: false,
|
|
hidable: false,
|
|
resizable: false,
|
|
resizable: false,
|
|
- minWidth: 129,
|
|
|
|
- defaultWidth: 129
|
|
|
|
|
|
+ minWidth:
|
|
|
|
+ (hasPermission("songs.create") || hasPermission("songs.update")) &&
|
|
|
|
+ hasPermission("youtube.removeVideos")
|
|
|
|
+ ? 129
|
|
|
|
+ : 85,
|
|
|
|
+ defaultWidth:
|
|
|
|
+ (hasPermission("songs.create") || hasPermission("songs.update")) &&
|
|
|
|
+ hasPermission("youtube.removeVideos")
|
|
|
|
+ ? 129
|
|
|
|
+ : 85
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "thumbnailImage",
|
|
name: "thumbnailImage",
|
|
@@ -184,12 +196,12 @@ const events = ref(<TableEvents>{
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const bulkActions = ref(<TableBulkActions>{ width: 200 });
|
|
const bulkActions = ref(<TableBulkActions>{ width: 200 });
|
|
-const jobs = ref([
|
|
|
|
- {
|
|
|
|
|
|
+const jobs = ref([]);
|
|
|
|
+if (hasPermission("media.recalculateAllRatings"))
|
|
|
|
+ jobs.value.push({
|
|
name: "Recalculate all ratings",
|
|
name: "Recalculate all ratings",
|
|
socket: "media.recalculateAllRatings"
|
|
socket: "media.recalculateAllRatings"
|
|
- }
|
|
|
|
-]);
|
|
|
|
|
|
+ });
|
|
|
|
|
|
const { openModal } = useModalsStore();
|
|
const { openModal } = useModalsStore();
|
|
|
|
|
|
@@ -315,6 +327,10 @@ const confirmAction = ({ message, action, params }) => {
|
|
open_in_full
|
|
open_in_full
|
|
</button>
|
|
</button>
|
|
<button
|
|
<button
|
|
|
|
+ v-if="
|
|
|
|
+ hasPermission('songs.create') ||
|
|
|
|
+ hasPermission('songs.update')
|
|
|
|
+ "
|
|
class="button is-primary icon-with-button material-icons"
|
|
class="button is-primary icon-with-button material-icons"
|
|
@click="editOne(slotProps.item)"
|
|
@click="editOne(slotProps.item)"
|
|
:disabled="slotProps.item.removed"
|
|
:disabled="slotProps.item.removed"
|
|
@@ -328,6 +344,7 @@ const confirmAction = ({ message, action, params }) => {
|
|
music_note
|
|
music_note
|
|
</button>
|
|
</button>
|
|
<button
|
|
<button
|
|
|
|
+ v-if="hasPermission('youtube.removeVideos')"
|
|
class="button is-danger icon-with-button material-icons"
|
|
class="button is-danger icon-with-button material-icons"
|
|
@click.prevent="
|
|
@click.prevent="
|
|
confirmAction({
|
|
confirmAction({
|
|
@@ -392,6 +409,10 @@ const confirmAction = ({ message, action, params }) => {
|
|
<template #bulk-actions="slotProps">
|
|
<template #bulk-actions="slotProps">
|
|
<div class="bulk-actions">
|
|
<div class="bulk-actions">
|
|
<i
|
|
<i
|
|
|
|
+ v-if="
|
|
|
|
+ hasPermission('songs.create') ||
|
|
|
|
+ hasPermission('songs.update')
|
|
|
|
+ "
|
|
class="material-icons create-songs-icon"
|
|
class="material-icons create-songs-icon"
|
|
@click.prevent="editMany(slotProps.item)"
|
|
@click.prevent="editMany(slotProps.item)"
|
|
content="Create/edit songs from videos"
|
|
content="Create/edit songs from videos"
|
|
@@ -401,6 +422,10 @@ const confirmAction = ({ message, action, params }) => {
|
|
music_note
|
|
music_note
|
|
</i>
|
|
</i>
|
|
<i
|
|
<i
|
|
|
|
+ v-if="
|
|
|
|
+ hasPermission('songs.create') ||
|
|
|
|
+ hasPermission('songs.update')
|
|
|
|
+ "
|
|
class="material-icons import-album-icon"
|
|
class="material-icons import-album-icon"
|
|
@click.prevent="importAlbum(slotProps.item)"
|
|
@click.prevent="importAlbum(slotProps.item)"
|
|
content="Import album from videos"
|
|
content="Import album from videos"
|
|
@@ -410,6 +435,7 @@ const confirmAction = ({ message, action, params }) => {
|
|
album
|
|
album
|
|
</i>
|
|
</i>
|
|
<i
|
|
<i
|
|
|
|
+ v-if="hasPermission('youtube.removeVideos')"
|
|
class="material-icons delete-icon"
|
|
class="material-icons delete-icon"
|
|
@click.prevent="
|
|
@click.prevent="
|
|
confirmAction({
|
|
confirmAction({
|