Add error handler in all unhandled places
This commit is contained in:
parent
c1494c8894
commit
ee975e5854
|
@ -1,22 +1,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Track } from '~/types'
|
import type { Track } from '~/types'
|
||||||
|
|
||||||
import AudioPlayer from '~/components/audio/Player.vue'
|
import { useIntervalFn, useToggle, useWindowSize } from '@vueuse/core'
|
||||||
import Queue from '~/components/Queue.vue'
|
import { computed, nextTick, onMounted, ref, watchEffect } from 'vue'
|
||||||
import PlaylistModal from '~/components/playlists/PlaylistModal.vue'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import ChannelUploadModal from '~/components/channels/UploadModal.vue'
|
import ChannelUploadModal from '~/components/channels/UploadModal.vue'
|
||||||
import Sidebar from '~/components/Sidebar.vue'
|
import PlaylistModal from '~/components/playlists/PlaylistModal.vue'
|
||||||
import ServiceMessages from '~/components/ServiceMessages.vue'
|
|
||||||
import SetInstanceModal from '~/components/SetInstanceModal.vue'
|
|
||||||
import ShortcutsModal from '~/components/ShortcutsModal.vue'
|
|
||||||
import FilterModal from '~/components/moderation/FilterModal.vue'
|
import FilterModal from '~/components/moderation/FilterModal.vue'
|
||||||
import ReportModal from '~/components/moderation/ReportModal.vue'
|
import ReportModal from '~/components/moderation/ReportModal.vue'
|
||||||
import { useIntervalFn, useToggle, useWindowSize } from '@vueuse/core'
|
import SetInstanceModal from '~/components/SetInstanceModal.vue'
|
||||||
|
import ServiceMessages from '~/components/ServiceMessages.vue'
|
||||||
|
import ShortcutsModal from '~/components/ShortcutsModal.vue'
|
||||||
|
import AudioPlayer from '~/components/audio/Player.vue'
|
||||||
|
import Sidebar from '~/components/Sidebar.vue'
|
||||||
|
import Queue from '~/components/Queue.vue'
|
||||||
|
|
||||||
import { computed, nextTick, onMounted, ref, watchEffect } from 'vue'
|
|
||||||
import onKeyboardShortcut from '~/composables/onKeyboardShortcut'
|
import onKeyboardShortcut from '~/composables/onKeyboardShortcut'
|
||||||
import useQueue from '~/composables/audio/useQueue'
|
import useQueue from '~/composables/audio/useQueue'
|
||||||
import { useStore } from '~/store'
|
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
|
||||||
import axios from 'axios'
|
|
||||||
import { uniq } from 'lodash-es'
|
|
||||||
import { useVModel } from '@vueuse/core'
|
|
||||||
import { ref, computed, watch, nextTick } from 'vue'
|
import { ref, computed, watch, nextTick } from 'vue'
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useVModel } from '@vueuse/core'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
import { uniq } from 'lodash-es'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
show: boolean
|
show: boolean
|
||||||
|
|
|
@ -8,6 +8,8 @@ import { refDebounced } from '@vueuse/core'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import AlbumCard from '~/components/audio/album/Card.vue'
|
import AlbumCard from '~/components/audio/album/Card.vue'
|
||||||
import ArtistCard from '~/components/audio/artist/Card.vue'
|
import ArtistCard from '~/components/audio/artist/Card.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useLogger from '~/composables/useLogger'
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -47,7 +49,7 @@ const search = async () => {
|
||||||
results.artists = response.data.artists
|
results.artists = response.data.artists
|
||||||
results.albums = response.data.albums
|
results.albums = response.data.albums
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Album } from '~/types'
|
import type { Album } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import { reactive, ref, watch } from 'vue'
|
import { reactive, ref, watch } from 'vue'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import AlbumCard from '~/components/audio/album/Card.vue'
|
import AlbumCard from '~/components/audio/album/Card.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
filters: Record<string, string | boolean>
|
filters: Record<string, string | boolean>
|
||||||
showCount?: boolean
|
showCount?: boolean
|
||||||
|
@ -43,7 +46,7 @@ const fetchData = async (url = 'albums/') => {
|
||||||
count.value = response.data.count
|
count.value = response.data.count
|
||||||
albums.push(...response.data.results)
|
albums.push(...response.data.results)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Artist } from '~/types'
|
import type { Artist } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import { reactive, ref, watch } from 'vue'
|
import { reactive, ref, watch } from 'vue'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import ArtistCard from '~/components/audio/artist/Card.vue'
|
import ArtistCard from '~/components/audio/artist/Card.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
filters: Record<string, string | boolean>
|
filters: Record<string, string | boolean>
|
||||||
search?: boolean
|
search?: boolean
|
||||||
|
@ -43,7 +46,7 @@ const fetchData = async (url = 'artists/') => {
|
||||||
count.value = response.data.count
|
count.value = response.data.count
|
||||||
artists.push(...response.data.results)
|
artists.push(...response.data.results)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,10 +2,14 @@
|
||||||
import type { Track, Artist, Album, Playlist, Library, Channel, Actor, /* Track, */ Cover } from '~/types'
|
import type { Track, Artist, Album, Playlist, Library, Channel, Actor, /* Track, */ Cover } from '~/types'
|
||||||
import type { PlayOptionsProps } from '~/composables/audio/usePlayOptions'
|
import type { PlayOptionsProps } from '~/composables/audio/usePlayOptions'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import PlayButton from '~/components/audio/PlayButton.vue'
|
|
||||||
import usePlayOptions from '~/composables/audio/usePlayOptions'
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import PlayButton from '~/components/audio/PlayButton.vue'
|
||||||
|
|
||||||
|
import usePlayOptions from '~/composables/audio/usePlayOptions'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useQueue from '~/composables/audio/useQueue'
|
import useQueue from '~/composables/audio/useQueue'
|
||||||
|
|
||||||
interface Props extends PlayOptionsProps {
|
interface Props extends PlayOptionsProps {
|
||||||
|
@ -43,7 +47,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get(`tracks/${props.track.id}/`)
|
const response = await axios.get(`tracks/${props.track.id}/`)
|
||||||
description.value = response.data.description.text
|
description.value = response.data.description.text
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Track } from '~/types'
|
import type { Track } from '~/types'
|
||||||
|
|
||||||
import { ref, computed } from 'vue'
|
import { useElementByPoint, useMouse } from '@vueuse/core'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { clone, uniqBy } from 'lodash-es'
|
import { clone, uniqBy } from 'lodash-es'
|
||||||
import { useElementByPoint, useMouse } from '@vueuse/core'
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import TrackRow from '~/components/audio/track/Row.vue'
|
|
||||||
import TrackMobileRow from '~/components/audio/track/MobileRow.vue'
|
import TrackMobileRow from '~/components/audio/track/MobileRow.vue'
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
import TrackRow from '~/components/audio/track/Row.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
tracks?: Track[]
|
tracks?: Track[]
|
||||||
|
@ -114,7 +118,7 @@ const fetchData = async () => {
|
||||||
totalTracks.value = response.data.count
|
totalTracks.value = response.data.count
|
||||||
emit('fetched')
|
emit('fetched')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,15 +2,18 @@
|
||||||
import type { Track, Listening } from '~/types'
|
import type { Track, Listening } from '~/types'
|
||||||
|
|
||||||
// TODO (wvffle): Fix websocket update (#1534)
|
// TODO (wvffle): Fix websocket update (#1534)
|
||||||
import axios from 'axios'
|
|
||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch } from 'vue'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
import { clone } from 'lodash-es'
|
import { clone } from 'lodash-es'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import useWebSocketHandler from '~/composables/useWebSocketHandler'
|
import useWebSocketHandler from '~/composables/useWebSocketHandler'
|
||||||
import PlayButton from '~/components/audio/PlayButton.vue'
|
import PlayButton from '~/components/audio/PlayButton.vue'
|
||||||
import TagsList from '~/components/tags/List.vue'
|
import TagsList from '~/components/tags/List.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'count', count: number): void
|
(e: 'count', count: number): void
|
||||||
}
|
}
|
||||||
|
@ -60,7 +63,7 @@ const fetchData = async (url = props.url) => {
|
||||||
|
|
||||||
objects.push(...newObjects)
|
objects.push(...newObjects)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import axios from 'axios'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import ApplicationForm from '~/components/auth/ApplicationForm.vue'
|
import ApplicationForm from '~/components/auth/ApplicationForm.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: number
|
id: number
|
||||||
}
|
}
|
||||||
|
@ -27,7 +30,7 @@ const fetchApplication = async () => {
|
||||||
const response = await axios.get(`oauth/apps/${props.id}/`)
|
const response = await axios.get(`oauth/apps/${props.id}/`)
|
||||||
application.value = response.data
|
application.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -40,7 +43,7 @@ const refreshToken = async () => {
|
||||||
const response = await axios.post(`oauth/apps/${props.id}/refresh-token`)
|
const response = await axios.post(`oauth/apps/${props.id}/refresh-token`)
|
||||||
application.value = response.data
|
application.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -11,10 +11,12 @@ import { useStore } from '~/store'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
|
||||||
|
import UploadMetadataForm from '~/components/channels/UploadMetadataForm.vue'
|
||||||
|
import FileUploadWidget from '~/components/library/FileUploadWidget.vue'
|
||||||
import LicenseSelect from '~/components/channels/LicenseSelect.vue'
|
import LicenseSelect from '~/components/channels/LicenseSelect.vue'
|
||||||
import AlbumSelect from '~/components/channels/AlbumSelect.vue'
|
import AlbumSelect from '~/components/channels/AlbumSelect.vue'
|
||||||
import FileUploadWidget from '~/components/library/FileUploadWidget.vue'
|
|
||||||
import UploadMetadataForm from '~/components/channels/UploadMetadataForm.vue'
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'status', status: UploadStatus): void
|
(e: 'status', status: UploadStatus): void
|
||||||
|
@ -279,7 +281,7 @@ const remove = async (file: VueUploadItem) => {
|
||||||
try {
|
try {
|
||||||
await axios.delete(`uploads/${file.response.uuid}/`)
|
await axios.delete(`uploads/${file.response.uuid}/`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
upload.value.remove(file)
|
upload.value.remove(file)
|
||||||
|
|
|
@ -3,18 +3,22 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { Track } from '~/types'
|
import type { Track } from '~/types'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
|
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||||
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
|
||||||
|
import TrackTable from '~/components/audio/track/Table.vue'
|
||||||
import RadioButton from '~/components/radios/Button.vue'
|
import RadioButton from '~/components/radios/Button.vue'
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
import TrackTable from '~/components/audio/track/Table.vue'
|
|
||||||
import useLogger from '~/composables/useLogger'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
import useLogger from '~/composables/useLogger'
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
defaultPage?: number
|
defaultPage?: number
|
||||||
|
@ -87,7 +91,7 @@ const fetchFavorites = async () => {
|
||||||
nextLink.value = response.data.next
|
nextLink.value = response.data.next
|
||||||
previousLink.value = response.data.previous
|
previousLink.value = response.data.previous
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
} finally {
|
} finally {
|
||||||
logger.timeEnd('Loading user favorites')
|
logger.timeEnd('Loading user favorites')
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -4,8 +4,11 @@ import type { Library } from '~/types'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import LibraryCard from '~/views/content/remote/Card.vue'
|
import LibraryCard from '~/views/content/remote/Card.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'loaded', libraries: Library[]): void
|
(e: 'loaded', libraries: Library[]): void
|
||||||
}
|
}
|
||||||
|
@ -34,7 +37,7 @@ const fetchData = async (url = props.url) => {
|
||||||
libraries.push(...response.data.results)
|
libraries.push(...response.data.results)
|
||||||
emit('loaded', libraries)
|
emit('loaded', libraries)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Track, Album, Artist, Library } from '~/types'
|
import type { Track, Album, Artist, Library } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
import { momentFormat } from '~/utils/filters'
|
||||||
import { sum } from 'lodash-es'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { sum } from 'lodash-es'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ArtistLabel from '~/components/audio/ArtistLabel.vue'
|
||||||
import PlayButton from '~/components/audio/PlayButton.vue'
|
import PlayButton from '~/components/audio/PlayButton.vue'
|
||||||
import TagsList from '~/components/tags/List.vue'
|
import TagsList from '~/components/tags/List.vue'
|
||||||
import ArtistLabel from '~/components/audio/ArtistLabel.vue'
|
|
||||||
import AlbumDropdown from './AlbumDropdown.vue'
|
import AlbumDropdown from './AlbumDropdown.vue'
|
||||||
import { momentFormat } from '~/utils/filters'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
|
@ -83,13 +87,13 @@ const remove = async () => {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
try {
|
try {
|
||||||
await axios.delete(`albums/${object.value?.id}`)
|
await axios.delete(`albums/${object.value?.id}`)
|
||||||
isLoading.value = false
|
|
||||||
emit('deleted')
|
emit('deleted')
|
||||||
router.push({ name: 'library.artists.detail', params: { id: artist.value?.id } })
|
router.push({ name: 'library.artists.detail', params: { id: artist.value?.id } })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
isLoading.value = false
|
useErrorHandler(error as Error)
|
||||||
// TODO (wvffle): Handle error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,23 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import qs from 'qs'
|
|
||||||
import axios from 'axios'
|
|
||||||
import $ from 'jquery'
|
|
||||||
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
import $ from 'jquery'
|
||||||
|
import qs from 'qs'
|
||||||
|
|
||||||
|
import TagsSelector from '~/components/library/TagsSelector.vue'
|
||||||
import AlbumCard from '~/components/audio/album/Card.vue'
|
import AlbumCard from '~/components/audio/album/Card.vue'
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
import TagsSelector from '~/components/library/TagsSelector.vue'
|
|
||||||
import useLogger from '~/composables/useLogger'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
import { useStore } from '~/store'
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
defaultPage?: number
|
defaultPage?: number
|
||||||
|
@ -91,7 +95,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
logger.timeEnd('Fetching albums')
|
logger.timeEnd('Fetching albums')
|
||||||
|
|
|
@ -7,9 +7,11 @@ import { useStore } from '~/store'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import AlbumCard from '~/components/audio/album/Card.vue'
|
|
||||||
import TrackTable from '~/components/audio/track/Table.vue'
|
|
||||||
import LibraryWidget from '~/components/federation/LibraryWidget.vue'
|
import LibraryWidget from '~/components/federation/LibraryWidget.vue'
|
||||||
|
import TrackTable from '~/components/audio/track/Table.vue'
|
||||||
|
import AlbumCard from '~/components/audio/album/Card.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
object: Artist
|
object: Artist
|
||||||
|
@ -42,7 +44,7 @@ const loadMoreAlbums = async () => {
|
||||||
additionalAlbums.push(...additionalAlbums.concat(response.data.results))
|
additionalAlbums.push(...additionalAlbums.concat(response.data.results))
|
||||||
loadMoreAlbumsUrl.value = response.data.next
|
loadMoreAlbumsUrl.value = response.data.next
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoadingMoreAlbums.value = false
|
isLoadingMoreAlbums.value = false
|
||||||
|
|
|
@ -2,20 +2,23 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import qs from 'qs'
|
|
||||||
import axios from 'axios'
|
|
||||||
import $ from 'jquery'
|
|
||||||
|
|
||||||
import ArtistCard from '~/components/audio/artist/Card.vue'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import TagsSelector from '~/components/library/TagsSelector.vue'
|
|
||||||
import useLogger from '~/composables/useLogger'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, reactive, ref, watch, onMounted } from 'vue'
|
import { computed, reactive, ref, watch, onMounted } from 'vue'
|
||||||
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
import $ from 'jquery'
|
||||||
|
import qs from 'qs'
|
||||||
|
|
||||||
|
import TagsSelector from '~/components/library/TagsSelector.vue'
|
||||||
|
import ArtistCard from '~/components/audio/artist/Card.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
defaultPage?: number
|
defaultPage?: number
|
||||||
|
@ -95,7 +98,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
logger.timeEnd('Fetching artists')
|
logger.timeEnd('Fetching artists')
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { useStore } from '~/store'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import useEditConfigs from '~/composables/moderation/useEditConfigs'
|
import useEditConfigs from '~/composables/moderation/useEditConfigs'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'approved', isApproved: boolean): void
|
(e: 'approved', isApproved: boolean): void
|
||||||
|
@ -126,7 +127,7 @@ const remove = async () => {
|
||||||
await axios.delete(`mutations/${props.obj.uuid}/`)
|
await axios.delete(`mutations/${props.obj.uuid}/`)
|
||||||
emit('deleted')
|
emit('deleted')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -144,7 +145,7 @@ const approve = async (approved: boolean) => {
|
||||||
emit('approved', approved)
|
emit('approved', approved)
|
||||||
store.commit('ui/incrementNotifications', { count: -1, type: 'pendingReviewEdits' })
|
store.commit('ui/incrementNotifications', { count: -1, type: 'pendingReviewEdits' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
import type { EditObject, EditObjectType } from '~/composables/moderation/useEditConfigs'
|
import type { EditObject, EditObjectType } from '~/composables/moderation/useEditConfigs'
|
||||||
import type { ReviewState } from '~/types'
|
import type { ReviewState } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import useEditConfigs from '~/composables/moderation/useEditConfigs'
|
|
||||||
import EditCard from '~/components/library/EditCard.vue'
|
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import EditCard from '~/components/library/EditCard.vue'
|
||||||
|
|
||||||
|
import useEditConfigs from '~/composables/moderation/useEditConfigs'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
object: EditObject
|
object: EditObject
|
||||||
objectType: EditObjectType
|
objectType: EditObjectType
|
||||||
|
@ -32,7 +36,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get(`mutations/${props.editId}/`)
|
const response = await axios.get(`mutations/${props.editId}/`)
|
||||||
obj.value = response.data
|
obj.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,14 @@ import { useStore } from '~/store'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import LibraryFilesTable from '~/views/content/libraries/FilesTable.vue'
|
import LibraryFilesTable from '~/views/content/libraries/FilesTable.vue'
|
||||||
import useWebSocketHandler from '~/composables/useWebSocketHandler'
|
|
||||||
import updateQueryString from '~/composables/updateQueryString'
|
|
||||||
import FileUploadWidget from './FileUploadWidget.vue'
|
import FileUploadWidget from './FileUploadWidget.vue'
|
||||||
import FsBrowser from './FsBrowser.vue'
|
import FsBrowser from './FsBrowser.vue'
|
||||||
import FsLogs from './FsLogs.vue'
|
import FsLogs from './FsLogs.vue'
|
||||||
|
|
||||||
|
import useWebSocketHandler from '~/composables/useWebSocketHandler'
|
||||||
|
import updateQueryString from '~/composables/updateQueryString'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'uploads-finished', delta: number):void
|
(e: 'uploads-finished', delta: number):void
|
||||||
}
|
}
|
||||||
|
@ -111,7 +113,7 @@ const fetchStatus = async () => {
|
||||||
|
|
||||||
uploads[status as keyof typeof uploads] = response.data.count
|
uploads[status as keyof typeof uploads] = response.data.count
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,7 +186,7 @@ const fetchQuota = async () => {
|
||||||
const response = await axios.get('users/me/')
|
const response = await axios.get('users/me/')
|
||||||
quotaStatus.value = response.data.quota_status
|
quotaStatus.value = response.data.quota_status
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoadingQuota.value = false
|
isLoadingQuota.value = false
|
||||||
|
@ -216,7 +218,7 @@ const fetchFilesystem = async (updateLoading: boolean) => {
|
||||||
const response = await axios.get('libraries/fs-import', { params: { path: fsPath.join('/') } })
|
const response = await axios.get('libraries/fs-import', { params: { path: fsPath.join('/') } })
|
||||||
fsStatus.value = response.data
|
fsStatus.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateLoading) isLoadingFs.value = false
|
if (updateLoading) isLoadingFs.value = false
|
||||||
|
@ -252,7 +254,7 @@ const cancelFsScan = async () => {
|
||||||
await axios.delete('libraries/fs-import')
|
await axios.delete('libraries/fs-import')
|
||||||
fetchFilesystem(false)
|
fetchFilesystem(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import ChannelsWidget from '~/components/audio/ChannelsWidget.vue'
|
import ChannelsWidget from '~/components/audio/ChannelsWidget.vue'
|
||||||
|
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
||||||
import TrackWidget from '~/components/audio/track/Widget.vue'
|
import TrackWidget from '~/components/audio/track/Widget.vue'
|
||||||
import AlbumWidget from '~/components/audio/album/Widget.vue'
|
import AlbumWidget from '~/components/audio/album/Widget.vue'
|
||||||
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useLogger from '~/composables/useLogger'
|
import useLogger from '~/composables/useLogger'
|
||||||
import { ref, computed } from 'vue'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
scope?: string
|
scope?: string
|
||||||
|
@ -39,7 +43,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get('artists/', { params })
|
const response = await axios.get('artists/', { params })
|
||||||
artists.value = response.data.results
|
artists.value = response.data.results
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,22 +2,25 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import qs from 'qs'
|
|
||||||
import axios from 'axios'
|
|
||||||
import $ from 'jquery'
|
|
||||||
|
|
||||||
import ArtistCard from '~/components/audio/artist/Card.vue'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import TagsSelector from '~/components/library/TagsSelector.vue'
|
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
|
||||||
import RemoteSearchForm from '~/components/RemoteSearchForm.vue'
|
|
||||||
import useLogger from '~/composables/useLogger'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, reactive, ref, watch, onMounted } from 'vue'
|
import { computed, reactive, ref, watch, onMounted } from 'vue'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
import $ from 'jquery'
|
||||||
|
import qs from 'qs'
|
||||||
|
|
||||||
|
import TagsSelector from '~/components/library/TagsSelector.vue'
|
||||||
|
import RemoteSearchForm from '~/components/RemoteSearchForm.vue'
|
||||||
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
|
import ArtistCard from '~/components/audio/artist/Card.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
defaultPage?: number
|
defaultPage?: number
|
||||||
|
@ -97,7 +100,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
logger.timeEnd('Fetching podcasts')
|
logger.timeEnd('Fetching podcasts')
|
||||||
|
|
|
@ -2,17 +2,21 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||||
import $ from 'jquery'
|
|
||||||
import RadioCard from '~/components/radios/Card.vue'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import useLogger from '~/composables/useLogger'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, ref, watch, onMounted } from 'vue'
|
import { computed, ref, watch, onMounted } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
import $ from 'jquery'
|
||||||
|
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
import RadioCard from '~/components/radios/Card.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
defaultPage?: number
|
defaultPage?: number
|
||||||
|
@ -78,7 +82,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
logger.timeEnd('Fetching radios')
|
logger.timeEnd('Fetching radios')
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Track, Artist, Library } from '~/types'
|
import type { Track, Artist, Library } from '~/types'
|
||||||
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
import axios from 'axios'
|
|
||||||
import PlayButton from '~/components/audio/PlayButton.vue'
|
|
||||||
import TrackFavoriteIcon from '~/components/favorites/TrackFavoriteIcon.vue'
|
|
||||||
import TrackPlaylistIcon from '~/components/playlists/TrackPlaylistIcon.vue'
|
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
|
||||||
import EmbedWizard from '~/components/audio/EmbedWizard.vue'
|
|
||||||
import { momentFormat } from '~/utils/filters'
|
import { momentFormat } from '~/utils/filters'
|
||||||
import updateQueryString from '~/composables/updateQueryString'
|
import { computed, ref, watch } from 'vue'
|
||||||
import useReport from '~/composables/moderation/useReport'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useLogger from '~/composables/useLogger'
|
import { useRouter } from 'vue-router'
|
||||||
import { getDomain } from '~/utils'
|
import { getDomain } from '~/utils'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import TrackFavoriteIcon from '~/components/favorites/TrackFavoriteIcon.vue'
|
||||||
|
import TrackPlaylistIcon from '~/components/playlists/TrackPlaylistIcon.vue'
|
||||||
|
import EmbedWizard from '~/components/audio/EmbedWizard.vue'
|
||||||
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
|
import PlayButton from '~/components/audio/PlayButton.vue'
|
||||||
|
|
||||||
|
import updateQueryString from '~/composables/updateQueryString'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useReport from '~/composables/moderation/useReport'
|
||||||
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
|
@ -96,7 +100,7 @@ const fetchData = async () => {
|
||||||
const artistResponse = await axios.get(`artists/${trackResponse.data.artist.id}/`)
|
const artistResponse = await axios.get(`artists/${trackResponse.data.artist.id}/`)
|
||||||
artist.value = artistResponse.data
|
artist.value = artistResponse.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
|
@ -111,7 +115,7 @@ const remove = async () => {
|
||||||
emit('deleted')
|
emit('deleted')
|
||||||
router.push({ name: 'library.artists.detail', params: { id: artist.value?.id } })
|
router.push({ name: 'library.artists.detail', params: { id: artist.value?.id } })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -11,6 +11,8 @@ import LibraryWidget from '~/components/federation/LibraryWidget.vue'
|
||||||
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
import PlaylistWidget from '~/components/playlists/Widget.vue'
|
||||||
import TagsList from '~/components/tags/List.vue'
|
import TagsList from '~/components/tags/List.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
track: Track
|
track: Track
|
||||||
}
|
}
|
||||||
|
@ -32,7 +34,7 @@ const fetchLicense = async (licenseId: string) => {
|
||||||
const response = await axios.get(`licenses/${licenseId}`)
|
const response = await axios.get(`licenses/${licenseId}`)
|
||||||
license.value = response.data
|
license.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,16 @@ import type { Track } from '~/types'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
|
||||||
import { clone } from 'lodash-es'
|
|
||||||
import { ref, onMounted, watch } from 'vue'
|
|
||||||
import { useCurrentElement } from '@vueuse/core'
|
import { useCurrentElement } from '@vueuse/core'
|
||||||
|
import { ref, onMounted, watch } from 'vue'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
import { clone } from 'lodash-es'
|
||||||
|
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
import TrackTable from '~/components/audio/track/Table.vue'
|
import TrackTable from '~/components/audio/track/Table.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
index: number
|
index: number
|
||||||
|
|
||||||
|
@ -111,7 +113,7 @@ const fetchCandidates = async () => {
|
||||||
const response = await axios.post('radios/radios/validate/', params)
|
const response = await axios.post('radios/radios/validate/', params)
|
||||||
checkResult.value = (response.data as ResponseType).filters[0]
|
checkResult.value = (response.data as ResponseType).filters[0]
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,16 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
|
@ -64,7 +68,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -3,15 +3,19 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): Remove from EVERY SINGLE component that does not use it at all
|
// TODO (wvffle): Remove from EVERY SINGLE component that does not use it at all
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -76,7 +80,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -3,14 +3,18 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -73,7 +77,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,19 +1,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
|
||||||
import type { EditObjectType } from '~/composables/moderation/useEditConfigs'
|
import type { EditObjectType } from '~/composables/moderation/useEditConfigs'
|
||||||
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
|
import { ref, reactive, watch, computed } from 'vue'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { uniq } from 'lodash-es'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { uniq } from 'lodash-es'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
import EditCard from '~/components/library/EditCard.vue'
|
import EditCard from '~/components/library/EditCard.vue'
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { ref, reactive, watch, computed } from 'vue'
|
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
|
||||||
import useEditConfigs from '~/composables/moderation/useEditConfigs'
|
import useEditConfigs from '~/composables/moderation/useEditConfigs'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -84,7 +88,7 @@ const fetchTargets = async () => {
|
||||||
hidden: 'null'
|
hidden: 'null'
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const payload of response?.data?.results ?? []) {
|
for (const payload of response?.data?.results ?? []) {
|
||||||
|
@ -119,7 +123,7 @@ const fetchData = async () => {
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
fetchTargets()
|
fetchTargets()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,18 +1,21 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PrivacyLevel } from '~/types'
|
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
import type { PrivacyLevel } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
filters?: object
|
filters?: object
|
||||||
|
@ -76,7 +79,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -3,16 +3,20 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
import { computed, ref, watch } from 'vue'
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import ImportStatusModal from '~/components/library/ImportStatusModal.vue'
|
|
||||||
import { truncate } from '~/utils/filters'
|
import { truncate } from '~/utils/filters'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ImportStatusModal from '~/components/library/ImportStatusModal.vue'
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
import { computed, ref, watch } from 'vue'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -78,7 +82,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -73,7 +77,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,19 +1,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ImportStatus, PrivacyLevel, Upload } from '~/types'
|
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
import type { ImportStatus, PrivacyLevel, Upload } from '~/types'
|
||||||
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import ImportStatusModal from '~/components/library/ImportStatusModal.vue'
|
|
||||||
import { humanSize, truncate } from '~/utils/filters'
|
import { humanSize, truncate } from '~/utils/filters'
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ImportStatusModal from '~/components/library/ImportStatusModal.vue'
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -81,7 +85,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -3,14 +3,18 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -74,7 +78,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,14 +2,18 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
import { watchDebounced } from '@vueuse/core'
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { watchDebounced } from '@vueuse/core'
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -88,7 +92,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Note } from '~/types'
|
import type { Note } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import { useMarkdownRaw } from '~/composables/useMarkdown'
|
import { useMarkdownRaw } from '~/composables/useMarkdown'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
notes: Note[]
|
notes: Note[]
|
||||||
}
|
}
|
||||||
|
@ -20,7 +23,7 @@ const remove = async (note: Note) => {
|
||||||
await axios.delete(`manage/moderation/notes/${note.uuid}/`)
|
await axios.delete(`manage/moderation/notes/${note.uuid}/`)
|
||||||
emit('deleted', note.uuid)
|
emit('deleted', note.uuid)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Report } from '~/types'
|
import type { Report } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import useReportConfigs from '~/composables/moderation/useReportConfigs'
|
|
||||||
import useMarkdown from '~/composables/useMarkdown'
|
|
||||||
import { ref, computed, reactive } from 'vue'
|
import { ref, computed, reactive } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import NoteForm from '~/components/manage/moderation/NoteForm.vue'
|
import axios from 'axios'
|
||||||
import NotesThread from '~/components/manage/moderation/NotesThread.vue'
|
|
||||||
import ReportCategoryDropdown from '~/components/moderation/ReportCategoryDropdown.vue'
|
|
||||||
import InstancePolicyModal from '~/components/manage/moderation/InstancePolicyModal.vue'
|
import InstancePolicyModal from '~/components/manage/moderation/InstancePolicyModal.vue'
|
||||||
|
import ReportCategoryDropdown from '~/components/moderation/ReportCategoryDropdown.vue'
|
||||||
|
import NotesThread from '~/components/manage/moderation/NotesThread.vue'
|
||||||
|
import NoteForm from '~/components/manage/moderation/NoteForm.vue'
|
||||||
|
|
||||||
|
import useReportConfigs from '~/composables/moderation/useReportConfigs'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useMarkdown from '~/composables/useMarkdown'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'updated', updating: { type: string }): void
|
(e: 'updated', updating: { type: string }): void
|
||||||
|
@ -79,7 +82,7 @@ const actions = computed(() => {
|
||||||
resolveReport(true)
|
resolveReport(true)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error while deleting target', error)
|
console.log('Error while deleting target', error)
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
@ -96,7 +99,7 @@ const update = async (type: string) => {
|
||||||
await axios.patch(`manage/moderation/reports/${obj.value.uuid}/`, { type })
|
await axios.patch(`manage/moderation/reports/${obj.value.uuid}/`, { type })
|
||||||
emit('updated', { type })
|
emit('updated', { type })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
updating.type = false
|
updating.type = false
|
||||||
|
@ -122,7 +125,7 @@ const resolveReport = async (isHandled: boolean) => {
|
||||||
count: isHandled ? -1 : 1
|
count: isHandled ? -1 : 1
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { UserRequest, UserRequestStatus } from '~/types'
|
import type { UserRequest, UserRequestStatus } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import NoteForm from '~/components/manage/moderation/NoteForm.vue'
|
|
||||||
import NotesThread from '~/components/manage/moderation/NotesThread.vue'
|
import NotesThread from '~/components/manage/moderation/NotesThread.vue'
|
||||||
|
import NoteForm from '~/components/manage/moderation/NoteForm.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'handled', status: UserRequestStatus): void
|
(e: 'handled', status: UserRequestStatus): void
|
||||||
|
@ -48,7 +51,7 @@ const approve = async (isApproved: boolean) => {
|
||||||
count: -1
|
count: -1
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,14 +2,18 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import moment from 'moment'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
|
||||||
import { watchDebounced } from '@vueuse/core'
|
import { watchDebounced } from '@vueuse/core'
|
||||||
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
|
import moment from 'moment'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
|
@ -69,7 +73,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -2,15 +2,19 @@
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
|
||||||
import { watchDebounced } from '@vueuse/core'
|
import { watchDebounced } from '@vueuse/core'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
filters?: object
|
filters?: object
|
||||||
|
@ -75,7 +79,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
import type { BackendError } from '~/types'
|
||||||
|
|
||||||
|
import { gettext } from '~/init/locale'
|
||||||
|
import { COOKIE } from '~/init/sentry'
|
||||||
|
|
||||||
|
import useLogger from '~/composables/useLogger'
|
||||||
|
import store from '~/store'
|
||||||
|
|
||||||
|
const { $pgettext } = gettext
|
||||||
|
const logger = useLogger()
|
||||||
|
|
||||||
|
export default async (error: Error | BackendError) => {
|
||||||
|
const title = 'backendErrors' in error
|
||||||
|
? 'Unexpected API error'
|
||||||
|
: 'Unexpected error'
|
||||||
|
|
||||||
|
if ('backendErrors' in error) {
|
||||||
|
logger.error(title, error, error.backendErrors)
|
||||||
|
} else {
|
||||||
|
logger.error(title, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
const date = new Date()
|
||||||
|
const actions = []
|
||||||
|
|
||||||
|
if (import.meta.env.FUNKWHALE_SENTRY_DSN) {
|
||||||
|
const [Sentry, { useCookies }] = await Promise.all([
|
||||||
|
import('@sentry/vue'),
|
||||||
|
import('@vueuse/integrations/useCookies')
|
||||||
|
])
|
||||||
|
|
||||||
|
const { get } = useCookies()
|
||||||
|
if (get(COOKIE) === 'yes') {
|
||||||
|
const eventId = Sentry.captureException(error)
|
||||||
|
|
||||||
|
const user = store.state.auth.authenticated
|
||||||
|
? {
|
||||||
|
name: store.state.auth.username,
|
||||||
|
email: store.state.auth.profile?.email
|
||||||
|
}
|
||||||
|
: undefined
|
||||||
|
|
||||||
|
actions.push({
|
||||||
|
text: $pgettext('App/Message/Paragraph', 'Leave feedback'),
|
||||||
|
class: 'basic red',
|
||||||
|
click: () => Sentry.showReportDialog({ eventId, user })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
store.commit('ui/addMessage', {
|
||||||
|
content: $pgettext('App/Message/Paragraph', 'An unexpected error occured.'),
|
||||||
|
date,
|
||||||
|
class: 'error',
|
||||||
|
key: `error-${date}`,
|
||||||
|
classActions: 'bottom attached opaque',
|
||||||
|
actions
|
||||||
|
})
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ import type { Router } from 'vue-router'
|
||||||
import type { Store } from 'vuex'
|
import type { Store } from 'vuex'
|
||||||
import { watchEffect, type App } from 'vue'
|
import { watchEffect, type App } from 'vue'
|
||||||
|
|
||||||
const COOKIE = 'allow-tracing'
|
export const COOKIE = 'allow-tracing'
|
||||||
|
|
||||||
const initSentry = async (app: App, router: Router, store: Store<RootState>) => {
|
const initSentry = async (app: App, router: Router, store: Store<RootState>) => {
|
||||||
const [{ default: useLogger }, { BrowserTracing }, Sentry] = await Promise.all([
|
const [{ default: useLogger }, { BrowserTracing }, Sentry] = await Promise.all([
|
||||||
|
|
|
@ -1,58 +1,59 @@
|
||||||
import type { InjectionKey } from 'vue'
|
|
||||||
import type { State as FavoritesState } from './favorites'
|
|
||||||
import type { State as ChannelsState } from './channels'
|
|
||||||
import type { State as LibrariesState } from './libraries'
|
|
||||||
import type { State as AuthState } from './auth'
|
|
||||||
import type { State as InstanceState } from './instance'
|
|
||||||
import type { State as ModerationState } from './moderation'
|
import type { State as ModerationState } from './moderation'
|
||||||
import type { State as QueueState } from './queue'
|
import type { State as PlaylistsState } from './playlists'
|
||||||
|
import type { State as FavoritesState } from './favorites'
|
||||||
|
import type { State as LibrariesState } from './libraries'
|
||||||
|
import type { State as ChannelsState } from './channels'
|
||||||
|
import type { State as InstanceState } from './instance'
|
||||||
import type { State as RadiosState } from './radios'
|
import type { State as RadiosState } from './radios'
|
||||||
import type { State as PlayerState } from './player'
|
import type { State as PlayerState } from './player'
|
||||||
import type { State as PlaylistsState } from './playlists'
|
import type { State as QueueState } from './queue'
|
||||||
|
import type { State as AuthState } from './auth'
|
||||||
import type { State as UiState } from './ui'
|
import type { State as UiState } from './ui'
|
||||||
|
import type { InjectionKey } from 'vue'
|
||||||
|
|
||||||
import { createStore, Store, useStore as baseUseStore } from 'vuex'
|
import { createStore, Store, useStore as baseUseStore } from 'vuex'
|
||||||
|
|
||||||
import createPersistedState from 'vuex-persistedstate'
|
import createPersistedState from 'vuex-persistedstate'
|
||||||
import favorites from './favorites'
|
|
||||||
import channels from './channels'
|
|
||||||
import libraries from './libraries'
|
|
||||||
import auth from './auth'
|
|
||||||
import instance from './instance'
|
|
||||||
import moderation from './moderation'
|
import moderation from './moderation'
|
||||||
import queue from './queue'
|
import playlists from './playlists'
|
||||||
|
import favorites from './favorites'
|
||||||
|
import libraries from './libraries'
|
||||||
|
import channels from './channels'
|
||||||
|
import instance from './instance'
|
||||||
import radios from './radios'
|
import radios from './radios'
|
||||||
import player from './player'
|
import player from './player'
|
||||||
import playlists from './playlists'
|
import queue from './queue'
|
||||||
|
import auth from './auth'
|
||||||
import ui from './ui'
|
import ui from './ui'
|
||||||
|
|
||||||
export interface RootState {
|
export interface RootState {
|
||||||
ui: UiState
|
|
||||||
auth: AuthState
|
|
||||||
channels: ChannelsState
|
|
||||||
libraries: LibrariesState
|
|
||||||
favorites: FavoritesState
|
|
||||||
instance: InstanceState
|
|
||||||
moderation: ModerationState
|
moderation: ModerationState
|
||||||
queue: QueueState
|
|
||||||
radios: RadiosState
|
|
||||||
playlists: PlaylistsState
|
playlists: PlaylistsState
|
||||||
|
favorites: FavoritesState
|
||||||
|
libraries: LibrariesState
|
||||||
|
channels: ChannelsState
|
||||||
|
instance: InstanceState
|
||||||
|
radios: RadiosState
|
||||||
player: PlayerState
|
player: PlayerState
|
||||||
|
queue: QueueState
|
||||||
|
auth: AuthState
|
||||||
|
ui: UiState
|
||||||
}
|
}
|
||||||
|
|
||||||
export const key: InjectionKey<Store<RootState>> = Symbol('vuex state injection key')
|
export const key: InjectionKey<Store<RootState>> = Symbol('vuex state injection key')
|
||||||
export default createStore<RootState>({
|
export default createStore<RootState>({
|
||||||
modules: {
|
modules: {
|
||||||
ui,
|
|
||||||
auth,
|
|
||||||
channels,
|
|
||||||
libraries,
|
|
||||||
favorites,
|
|
||||||
instance,
|
|
||||||
moderation,
|
moderation,
|
||||||
queue,
|
|
||||||
radios,
|
|
||||||
playlists,
|
playlists,
|
||||||
player
|
favorites,
|
||||||
|
libraries,
|
||||||
|
channels,
|
||||||
|
instance,
|
||||||
|
radios,
|
||||||
|
player,
|
||||||
|
queue,
|
||||||
|
auth,
|
||||||
|
ui
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
createPersistedState({
|
createPersistedState({
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Notification } from '~/types'
|
import type { Notification } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import { ref, reactive, computed, watch, markRaw } from 'vue'
|
import { ref, reactive, computed, watch, markRaw } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
import useMarkdown from '~/composables/useMarkdown'
|
|
||||||
import useWebSocketHandler from '~/composables/useWebSocketHandler'
|
|
||||||
|
|
||||||
import NotificationRow from '~/components/notifications/NotificationRow.vue'
|
import NotificationRow from '~/components/notifications/NotificationRow.vue'
|
||||||
|
|
||||||
|
import useWebSocketHandler from '~/composables/useWebSocketHandler'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useMarkdown from '~/composables/useMarkdown'
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const supportMessage = useMarkdown(() => store.state.instance.settings.instance.support_message.value)
|
const supportMessage = useMarkdown(() => store.state.instance.settings.instance.support_message.value)
|
||||||
const { $pgettext } = useGettext()
|
const { $pgettext } = useGettext()
|
||||||
|
@ -38,7 +40,7 @@ const fetchData = async () => {
|
||||||
notifications.count = response.data.count
|
notifications.count = response.data.count
|
||||||
notifications.results = response.data.results.map(markRaw)
|
notifications.results = response.data.results.map(markRaw)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -64,7 +66,7 @@ const setDisplayDate = async (field: string, days: number) => {
|
||||||
|
|
||||||
store.commit('auth/profilePartialUpdate', response.data)
|
store.commit('auth/profilePartialUpdate', response.data)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +84,7 @@ const markAllAsRead = async () => {
|
||||||
store.commit('ui/notifications', { type: 'inbox', count: 0 })
|
store.commit('ui/notifications', { type: 'inbox', count: 0 })
|
||||||
notifications.results = notifications.results.map(notification => ({ ...notification, is_read: true }))
|
notifications.results = notifications.results.map(notification => ({ ...notification, is_read: true }))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,12 +4,14 @@ import type { SettingsGroup as SettingsGroupType } from '~/types'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
|
||||||
|
import { ref, nextTick, onMounted, computed, watch } from 'vue'
|
||||||
|
import { useCurrentElement } from '@vueuse/core'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
import SettingsGroup from '~/components/admin/SettingsGroup.vue'
|
import SettingsGroup from '~/components/admin/SettingsGroup.vue'
|
||||||
|
|
||||||
import { useCurrentElement } from '@vueuse/core'
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import { ref, nextTick, onMounted, computed, watch } from 'vue'
|
|
||||||
import { useRoute } from 'vue-router'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
|
|
||||||
const current = ref()
|
const current = ref()
|
||||||
const settingsData = ref()
|
const settingsData = ref()
|
||||||
|
@ -150,7 +152,7 @@ const fetchSettings = async () => {
|
||||||
const response = await axios.get('instance/admin/settings/')
|
const response = await axios.get('instance/admin/settings/')
|
||||||
settingsData.value = response.data
|
settingsData.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { humanSize, truncate } from '~/utils/filters'
|
import { humanSize, truncate } from '~/utils/filters'
|
||||||
import { ref, computed } from 'vue'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import FetchButton from '~/components/federation/FetchButton.vue'
|
import FetchButton from '~/components/federation/FetchButton.vue'
|
||||||
import TagsList from '~/components/tags/List.vue'
|
import TagsList from '~/components/tags/List.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: number
|
id: number
|
||||||
}
|
}
|
||||||
|
@ -28,7 +31,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get(`manage/library/tracks/${props.id}/`)
|
const response = await axios.get(`manage/library/tracks/${props.id}/`)
|
||||||
track.value = response.data
|
track.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -43,7 +46,7 @@ const fetchStats = async () => {
|
||||||
const response = await axios.get(`manage/library/tracks/${props.id}/stats/`)
|
const response = await axios.get(`manage/library/tracks/${props.id}/stats/`)
|
||||||
stats.value = response.data
|
stats.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoadingStats.value = false
|
isLoadingStats.value = false
|
||||||
|
@ -60,7 +63,7 @@ const remove = async () => {
|
||||||
await axios.delete(`manage/library/tracks/${props.id}/`)
|
await axios.delete(`manage/library/tracks/${props.id}/`)
|
||||||
await router.push({ name: 'manage.library.tracks' })
|
await router.push({ name: 'manage.library.tracks' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ReportCard from '~/components/manage/moderation/ReportCard.vue'
|
|
||||||
import ReportCategoryDropdown from '~/components/moderation/ReportCategoryDropdown.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ReportCategoryDropdown from '~/components/moderation/ReportCategoryDropdown.vue'
|
||||||
|
import ReportCard from '~/components/manage/moderation/ReportCard.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find more types
|
// TODO (wvffle): find more types
|
||||||
|
@ -70,7 +74,7 @@ const fetchData = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -3,16 +3,20 @@ import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import UserRequestCard from '~/components/manage/moderation/UserRequestCard.vue'
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import UserRequestCard from '~/components/manage/moderation/UserRequestCard.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO(wvffle): Remove after https://github.com/vuejs/core/pull/4512 is merged
|
// TODO(wvffle): Remove after https://github.com/vuejs/core/pull/4512 is merged
|
||||||
orderingConfigName: RouteWithPreferences | null
|
orderingConfigName: RouteWithPreferences | null
|
||||||
|
@ -65,7 +69,7 @@ const fetchData = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Actor } from '~/types'
|
import type { Actor } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import useReport from '~/composables/moderation/useReport'
|
|
||||||
import { onBeforeRouteUpdate } from 'vue-router'
|
import { onBeforeRouteUpdate } from 'vue-router'
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useReport from '~/composables/moderation/useReport'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
username: string
|
username: string
|
||||||
|
@ -51,7 +54,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get(`federation/actors/${fullUsername.value}/`)
|
const response = await axios.get(`federation/actors/${fullUsername.value}/`)
|
||||||
object.value = response.data
|
object.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Channel } from '~/types'
|
import type { Channel } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import PlayButton from '~/components/audio/PlayButton.vue'
|
|
||||||
import EmbedWizard from '~/components/audio/EmbedWizard.vue'
|
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
|
||||||
import TagsList from '~/components/tags/List.vue'
|
|
||||||
import SubscribeButton from '~/components/channels/SubscribeButton.vue'
|
|
||||||
import useReport from '~/composables/moderation/useReport'
|
|
||||||
import ChannelForm from '~/components/audio/ChannelForm.vue'
|
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router'
|
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router'
|
||||||
import { computed, ref, reactive, watch, watchEffect } from 'vue'
|
import { computed, ref, reactive, watch, watchEffect } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import SubscribeButton from '~/components/channels/SubscribeButton.vue'
|
||||||
|
import ChannelForm from '~/components/audio/ChannelForm.vue'
|
||||||
|
import EmbedWizard from '~/components/audio/EmbedWizard.vue'
|
||||||
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
|
import PlayButton from '~/components/audio/PlayButton.vue'
|
||||||
|
import TagsList from '~/components/tags/List.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useReport from '~/composables/moderation/useReport'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
|
@ -75,7 +79,7 @@ const fetchData = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -104,7 +108,7 @@ const remove = async () => {
|
||||||
emit('deleted')
|
emit('deleted')
|
||||||
return router.push({ name: 'profile.overview', params: { username: store.state.auth.username } })
|
return router.push({ name: 'profile.overview', params: { username: store.state.auth.username } })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Channel } from '~/types'
|
import type { Channel } from '~/types'
|
||||||
|
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
|
||||||
import ChannelsWidget from '~/components/audio/ChannelsWidget.vue'
|
import ChannelsWidget from '~/components/audio/ChannelsWidget.vue'
|
||||||
import RemoteSearchForm from '~/components/RemoteSearchForm.vue'
|
import RemoteSearchForm from '~/components/RemoteSearchForm.vue'
|
||||||
import { ref, computed } from 'vue'
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
defaultQuery?: string
|
defaultQuery?: string
|
||||||
|
@ -39,7 +44,7 @@ const fetchData = async () => {
|
||||||
channels.value.push(...response.data.results)
|
channels.value.push(...response.data.results)
|
||||||
count.value = response.data.count
|
count.value = response.data.count
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ImportStatus } from '~/types'
|
|
||||||
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
import type { RouteWithPreferences, OrderingField } from '~/store/ui'
|
||||||
import type { OrderingProps } from '~/composables/useOrdering'
|
|
||||||
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
import type { SmartSearchProps } from '~/composables/useSmartSearch'
|
||||||
|
import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
import type { ImportStatus } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import time from '~/utils/time'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import ActionTable from '~/components/common/ActionTable.vue'
|
|
||||||
import ImportStatusModal from '~/components/library/ImportStatusModal.vue'
|
|
||||||
import { humanSize, truncate } from '~/utils/filters'
|
import { humanSize, truncate } from '~/utils/filters'
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
|
||||||
|
import time from '~/utils/time'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import ImportStatusModal from '~/components/library/ImportStatusModal.vue'
|
||||||
|
import ActionTable from '~/components/common/ActionTable.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useSmartSearch from '~/composables/useSmartSearch'
|
import useSmartSearch from '~/composables/useSmartSearch'
|
||||||
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
|
||||||
interface Props extends SmartSearchProps, OrderingProps {
|
interface Props extends SmartSearchProps, OrderingProps {
|
||||||
// TODO (wvffle): find object type
|
// TODO (wvffle): find object type
|
||||||
|
@ -101,7 +105,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Library } from '~/types'
|
import type { Library } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import RadioButton from '~/components/radios/Button.vue'
|
|
||||||
import useReport from '~/composables/moderation/useReport'
|
|
||||||
import { useTimeoutFn } from '@vueuse/core'
|
import { useTimeoutFn } from '@vueuse/core'
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import RadioButton from '~/components/radios/Button.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
import useReport from '~/composables/moderation/useReport'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
initialLibrary: Library
|
initialLibrary: Library
|
||||||
|
@ -60,7 +64,7 @@ const launchScan = async () => {
|
||||||
: $pgettext('Content/Library/Message', 'Scan launched')
|
: $pgettext('Content/Library/Message', 'Scan launched')
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +120,7 @@ const fetchScanStatus = async () => {
|
||||||
stopFetching()
|
stopFetching()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,19 @@
|
||||||
// TODO (wvffle): Rename to LibraryBase
|
// TODO (wvffle): Rename to LibraryBase
|
||||||
import type { Library } from '~/types'
|
import type { Library } from '~/types'
|
||||||
|
|
||||||
|
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router'
|
||||||
|
import { computed, ref, watch, watchEffect } from 'vue'
|
||||||
|
import { humanSize } from '~/utils/filters'
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import LibraryFollowButton from '~/components/audio/LibraryFollowButton.vue'
|
import LibraryFollowButton from '~/components/audio/LibraryFollowButton.vue'
|
||||||
import RadioButton from '~/components/radios/Button.vue'
|
import RadioButton from '~/components/radios/Button.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useReport from '~/composables/moderation/useReport'
|
import useReport from '~/composables/moderation/useReport'
|
||||||
import { humanSize } from '~/utils/filters'
|
|
||||||
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router'
|
|
||||||
import { useStore } from '~/store'
|
|
||||||
import { useGettext } from 'vue3-gettext'
|
|
||||||
import { computed, ref, watch, watchEffect } from 'vue'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
|
@ -57,7 +61,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get(`libraries/${props.id}`)
|
const response = await axios.get(`libraries/${props.id}`)
|
||||||
object.value = response.data
|
object.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Library, LibraryFollow } from '~/types'
|
import type { Library, LibraryFollow } from '~/types'
|
||||||
|
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
import LibraryFilesTable from '~/views/content/libraries/FilesTable.vue'
|
import LibraryFilesTable from '~/views/content/libraries/FilesTable.vue'
|
||||||
import LibraryForm from '~/views/content/libraries/Form.vue'
|
import LibraryForm from '~/views/content/libraries/Form.vue'
|
||||||
import { ref } from 'vue'
|
|
||||||
import axios from 'axios'
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
object: Library
|
object: Library
|
||||||
|
@ -23,7 +27,7 @@ const fetchData = async () => {
|
||||||
const response = await axios.get(`libraries/${props.object.uuid}/follows/`)
|
const response = await axios.get(`libraries/${props.object.uuid}/follows/`)
|
||||||
follows.value = response.data
|
follows.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -39,7 +43,7 @@ const updateApproved = async (follow: LibraryFollow, approved: boolean) => {
|
||||||
await axios.post(`federation/follows/library/${follow.uuid}/${approved ? 'accept' : 'reject'}/`)
|
await axios.post(`federation/follows/library/${follow.uuid}/${approved ? 'accept' : 'reject'}/`)
|
||||||
follow.approved = approved
|
follow.approved = approved
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
follow.isLoading = false
|
follow.isLoading = false
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PlaylistTrack, Playlist } from '~/types'
|
import type { PlaylistTrack, Playlist } from '~/types'
|
||||||
|
|
||||||
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import TrackTable from '~/components/audio/track/Table.vue'
|
|
||||||
import PlayButton from '~/components/audio/PlayButton.vue'
|
|
||||||
import PlaylistEditor from '~/components/playlists/Editor.vue'
|
import PlaylistEditor from '~/components/playlists/Editor.vue'
|
||||||
import EmbedWizard from '~/components/audio/EmbedWizard.vue'
|
import EmbedWizard from '~/components/audio/EmbedWizard.vue'
|
||||||
import SemanticModal from '~/components/semantic/Modal.vue'
|
import SemanticModal from '~/components/semantic/Modal.vue'
|
||||||
import { ref, computed } from 'vue'
|
import TrackTable from '~/components/audio/track/Table.vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import PlayButton from '~/components/audio/PlayButton.vue'
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { useStore } from '~/store'
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
|
@ -50,7 +54,7 @@ const fetchData = async () => {
|
||||||
playlist.value = playlistResponse.data
|
playlist.value = playlistResponse.data
|
||||||
playlistTracks.value = tracksResponse.data.results
|
playlistTracks.value = tracksResponse.data.results
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -64,7 +68,7 @@ const deletePlaylist = async () => {
|
||||||
store.dispatch('playlists/fetchOwn')
|
store.dispatch('playlists/fetchOwn')
|
||||||
return router.push({ path: '/library' })
|
return router.push({ path: '/library' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,15 +4,18 @@ import type { OrderingProps } from '~/composables/useOrdering'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
import { computed, ref, watch, onMounted } from 'vue'
|
|
||||||
import { useRouter, onBeforeRouteUpdate } from 'vue-router'
|
import { useRouter, onBeforeRouteUpdate } from 'vue-router'
|
||||||
|
import { computed, ref, watch, onMounted } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
|
|
||||||
import PlaylistCardList from '~/components/playlists/CardList.vue'
|
import PlaylistCardList from '~/components/playlists/CardList.vue'
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
import useLogger from '~/composables/useLogger'
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
import useOrdering from '~/composables/useOrdering'
|
import useOrdering from '~/composables/useOrdering'
|
||||||
|
import useLogger from '~/composables/useLogger'
|
||||||
|
|
||||||
interface Props extends OrderingProps {
|
interface Props extends OrderingProps {
|
||||||
defaultPage?: number
|
defaultPage?: number
|
||||||
|
@ -79,7 +82,7 @@ const fetchData = async () => {
|
||||||
|
|
||||||
result.value = response.data
|
result.value = response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
result.value = null
|
result.value = null
|
||||||
} finally {
|
} finally {
|
||||||
logger.timeEnd('Fetching albums')
|
logger.timeEnd('Fetching albums')
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Track, Radio } from '~/types'
|
import type { Track, Radio } from '~/types'
|
||||||
|
|
||||||
import axios from 'axios'
|
|
||||||
import TrackTable from '~/components/audio/track/Table.vue'
|
|
||||||
import RadioButton from '~/components/radios/Button.vue'
|
|
||||||
import Pagination from '~/components/vui/Pagination.vue'
|
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import TrackTable from '~/components/audio/track/Table.vue'
|
||||||
|
import RadioButton from '~/components/radios/Button.vue'
|
||||||
|
import Pagination from '~/components/vui/Pagination.vue'
|
||||||
|
|
||||||
|
import useErrorHandler from '~/composables/useErrorHandler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
}
|
}
|
||||||
|
@ -39,7 +43,7 @@ const fetchData = async () => {
|
||||||
totalTracks.value = tracksResponse.data.count
|
totalTracks.value = tracksResponse.data.count
|
||||||
tracks.value = tracksResponse.data.results
|
tracks.value = tracksResponse.data.results
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
|
@ -53,7 +57,7 @@ const deleteRadio = async () => {
|
||||||
await axios.delete(`radios/radios/${props.id}/`)
|
await axios.delete(`radios/radios/${props.id}/`)
|
||||||
return router.push({ path: '/library' })
|
return router.push({ path: '/library' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// TODO (wvffle): Handle error
|
useErrorHandler(error as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue