Skip to content

A self-hosted media server and file management system

chore: fix remaining eslint errors

aminnausin637cda5289d2
diff --git a/eslint.config.ts b/eslint.config.ts
index 7edf0ec1..107557ba 100644
--- a/eslint.config.ts
+++ b/eslint.config.ts
@@ -24,7 +24,7 @@ export default defineConfigWithVueTs(
},
},
- globalIgnores(['**/node_modules/**', 'vendor', '**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/.output/**', 'public/**', '.vite/**']),
+ globalIgnores(['**/node_modules/**', 'vendor', '**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/.output/**', 'public/**', '.vite/**', '**/pulse/**', '**/pulseCards/**']),
pluginVue.configs['flat/essential'],
vueTsConfigs.recommended,
diff --git a/resources/js/components/cards/TaskCard.vue b/resources/js/components/cards/TaskCard.vue
index 3cc06422..02f04822 100644
--- a/resources/js/components/cards/TaskCard.vue
+++ b/resources/js/components/cards/TaskCard.vue
@@ -278,25 +278,10 @@ watch(
<section
:class="`scrollbar-hide flex flex-col gap-1 transition-all duration-300 ease-in-out rounded-xl px-1 ${expanded ? `py-1 max-h-[800px] overflow-y-auto` : 'overflow-hidden max-h-0'}`"
>
- <div
- v-if="(subTasks.length ?? 0) == 0"
- class="col-span-full flex items-center justify-center text-center text-gray-500 dark:text-gray-400 uppercase tracking-wider w-full gap-2 text-sm my-2"
- >
- {{ 'No Sub Tasks Found' }}
- </div>
- <SubTaskCard
- v-if="subTasks.length <= 8"
- v-for="subTask in subTasks.slice(0, Math.min(subTasks.length, 8))"
- :key="subTask.id"
- :data="subTask"
- :isScreenSmall="isScreenLarge"
- @click-action="$emit('clickAction', 'subTask', subTask.id)"
- />
<TableBase
- v-else
:class="'p-1'"
:pagination-class="'sm:pe-10 -mt-2 text-sm'"
- :use-pagination="true"
+ :use-pagination="subTasks.length > 8"
:data="subTasks"
:row="SubTaskCard"
:row-attributes="{ isScreenLarge }"
@@ -309,6 +294,7 @@ watch(
$emit('clickAction', 'subTask', id);
}
"
+ no-results-message="No Sub Tasks Found"
/>
</section>
</div>
diff --git a/resources/js/components/dashboard/DashboardTaskMenu.vue b/resources/js/components/dashboard/DashboardTaskMenu.vue
index b10090c2..c766e099 100644
--- a/resources/js/components/dashboard/DashboardTaskMenu.vue
+++ b/resources/js/components/dashboard/DashboardTaskMenu.vue
@@ -10,7 +10,9 @@ import LucideFolderSync from '~icons/lucide/folder-sync';
const props = withDefaults(defineProps<{ showScanAll?: boolean }>(), { showScanAll: true });
-const emit = defineEmits({ handleClose: () => {} });
+const emit = defineEmits({
+ handleClose: () => true,
+});
const handleClose = (job: 'index' | 'sync' | 'verify' | 'scan' | 'verifyFolders') => {
handleStartTask(job).then(() => emit('handleClose'));
diff --git a/resources/js/components/pinesUI/Accordion.vue b/resources/js/components/pinesUI/BaseAccordion.vue
similarity index 84%
rename from resources/js/components/pinesUI/Accordion.vue
rename to resources/js/components/pinesUI/BaseAccordion.vue
index adadd376..efa5e006 100644
--- a/resources/js/components/pinesUI/Accordion.vue
+++ b/resources/js/components/pinesUI/BaseAccordion.vue
@@ -1,8 +1,6 @@
<script setup lang="ts">
import { ref } from 'vue';
-const props = defineProps();
-
const activeAccordion = ref<string>('');
const accordions = ref<{ id: string; key: string; value: string }[]>([
{ id: '1', key: 'What is Pines?', value: 'Pines is a UI library built for AlpineJS and TailwindCSS.' },
@@ -24,14 +22,9 @@ function setActiveAccordion(id: string) {
</script>
<template>
<!-- :class="{ 'rotate-180': activeAccordion == id }" -->
- <div
- class="relative w-full mx-auto overflow-hidden text-sm font-normal bg-white border border-gray-200 divide-y divide-gray-200 rounded-md"
- >
+ <div class="relative w-full mx-auto overflow-hidden text-sm font-normal bg-white border border-gray-200 divide-y divide-gray-200 rounded-md">
<div v-for="accordion in accordions" :key="accordion.id" class="cursor-pointer group">
- <button
- @click="setActiveAccordion(accordion.id)"
- class="flex items-center justify-between w-full p-4 text-left select-none group-hover:underline"
- >
+ <button @click="setActiveAccordion(accordion.id)" class="flex items-center justify-between w-full p-4 text-left select-none group-hover:underline">
<span>{{ accordion.key }}</span>
<svg
:class="`w-4 h-4 duration-200 ease-out ${activeAccordion == accordion.id ? 'rotate-180' : ''}`"
diff --git a/resources/js/components/pinesUI/ContextMenu.vue b/resources/js/components/pinesUI/ContextMenu.vue
index 5954f137..97f2277e 100644
--- a/resources/js/components/pinesUI/ContextMenu.vue
+++ b/resources/js/components/pinesUI/ContextMenu.vue
@@ -124,8 +124,7 @@ defineExpose({ contextMenuToggle, contextMenuOpen });
>
<slot name="content">
<ContextMenuItem
- v-if="items"
- v-for="(item, index) in items"
+ v-for="(item, index) in items ?? []"
v-bind="item"
:key="index"
:class="itemStyle"
@@ -135,7 +134,8 @@ defineExpose({ contextMenuToggle, contextMenuOpen });
}
"
/>
- <span v-else>
+ <!-- Defaults (Not needed) -->
+ <span v-if="!items">
<div
@click="(e: any) => contextMenuToggle(e, false)"
class="relative flex cursor-default select-none group items-center rounded px-2 py-1.5 hover:bg-neutral-100 outline-none pl-8 data-[disabled]:opacity-50 data-[disabled]:pointer-events-none"
diff --git a/resources/js/components/pinesUI/DatePicker.vue b/resources/js/components/pinesUI/DatePicker.vue
index 37cf7fa0..aba0fbe5 100644
--- a/resources/js/components/pinesUI/DatePicker.vue
+++ b/resources/js/components/pinesUI/DatePicker.vue
@@ -2,7 +2,7 @@
import { useTemplateRef } from 'vue';
import { OnClickOutside } from '@vueuse/components';
-import DatePickerValueButton from './DatePickerValueButton.vue';
+import DatePickerValueButton from '@/components/pinesUI/DatePickerValueButton.vue';
import useDatePicker from '@/composables/useDatePicker';
const { field } = defineProps(['field']);
@@ -31,7 +31,7 @@ const {
datePickerBlankDaysInMonth,
datePickerValueClicked,
showDatePickerPanel,
-} = useDatePicker(model ? { model } : {}, datePickerInput, datePickerCalendar);
+} = useDatePicker(model.value ? { model } : {}, datePickerInput, datePickerCalendar);
</script>
<template>
@@ -159,6 +159,7 @@ const {
<div v-if="datePickerPanel === 'M'" class="grid grid-cols-3 gap-2">
<DatePickerValueButton
v-for="(month, index) in datePickerMonthNames"
+ :key="month"
:value="index"
:is-selected="datePickerMonth === index"
@click="datePickerValueClicked(index)"
@@ -169,7 +170,13 @@ const {
</DatePickerValueButton>
</div>
<div v-if="datePickerPanel === 'Y'" class="grid grid-cols-3 grid-rows-4 gap-2 px-4">
- <DatePickerValueButton v-for="year in datePickerDecade" :value="year" :is-selected="datePickerYear === year" @click="datePickerValueClicked(year)" />
+ <DatePickerValueButton
+ v-for="year in datePickerDecade"
+ :key="year"
+ :value="year"
+ :is-selected="datePickerYear === year"
+ @click="datePickerValueClicked(year)"
+ />
</div>
</div>
</Transition>
diff --git a/resources/js/components/table/TableBase.vue b/resources/js/components/table/TableBase.vue
index 8212f9ee..452df031 100755
--- a/resources/js/components/table/TableBase.vue
+++ b/resources/js/components/table/TableBase.vue
@@ -25,6 +25,7 @@ const props = withDefaults(defineProps<TableProps<T>>(), {
searchQuery: '',
usePaginationIcons: false,
maxVisiblePages: 5,
+ noResultsMessage: 'No Results',
});
const emit = defineEmits<{
@@ -114,27 +115,28 @@ onMounted(() => {
</ButtonIcon>
</span>
</section>
- <section :class="`${useGrid ? useGrid : `flex w-full flex-wrap gap-2 ${tableStyles ?? ''}`}`">
+ <section :class="[useGrid || `flex w-full flex-wrap gap-2 ${tableStyles ?? ''}`]">
<div
v-if="loading || tableData.filteredPage.length === 0"
class="col-span-full flex items-center justify-center text-center text-lg text-gray-500 dark:text-gray-400 uppercase tracking-wider w-full gap-2"
>
- <p>{{ loading ? '...Loading' : 'No Results' }}</p>
+ <p>{{ loading ? '...Loading' : noResultsMessage }}</p>
<SvgSpinners90RingWithBg v-show="loading" />
</div>
- <template v-else v-for="(row, index) in tableData.filteredPage" :key="row?.id ?? index">
- <slot name="row" :row="row" :index="index" :selectedID="props.selectedID">
- <component
- :is="props.row"
- :key="row?.id ?? index"
- :data="row"
- :index="index"
- :currentID="props.selectedID ?? null"
- v-bind="rowAttributes"
- @clickAction="(...args: any[]) => props.clickAction?.(row?.id, ...args)"
- @otherAction="(...args: any[]) => props.otherAction?.(row?.id, ...args)"
- ></component>
- </slot>
+ <template v-else>
+ <template v-for="(row, index) in tableData.filteredPage" :key="row?.id ?? index">
+ <slot name="row" :row="row" :index="index" :selectedID="props.selectedID">
+ <component
+ :is="props.row"
+ :data="row"
+ :index="index"
+ :currentID="props.selectedID ?? null"
+ v-bind="rowAttributes"
+ @clickAction="(...args: any[]) => props.clickAction?.(row?.id, ...args)"
+ @otherAction="(...args: any[]) => props.otherAction?.(row?.id, ...args)"
+ ></component>
+ </slot>
+ </template>
</template>
</section>
<!-- <hr class="p-0" /> -->
diff --git a/resources/js/service/mutations.ts b/resources/js/service/mutations.ts
index 579fb8e7..b5af5a27 100644
--- a/resources/js/service/mutations.ts
+++ b/resources/js/service/mutations.ts
@@ -1,8 +1,7 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
import { useMutation, useQueryClient } from '@tanstack/vue-query';
-import { API } from './api';
+import { API } from '@/service/api';
-import mediaAPI from './mediaAPI';
+import mediaAPI from '@/service/mediaAPI';
export const UseCreatePlayback = () => {
const queryClient = useQueryClient();
diff --git a/resources/js/stores/AppStore.ts b/resources/js/stores/AppStore.ts
index ce8ce40f..b8df4ac4 100644
--- a/resources/js/stores/AppStore.ts
+++ b/resources/js/stores/AppStore.ts
@@ -35,7 +35,13 @@ export const useAppStore = defineStore('App', () => {
if (!rootHTML) return;
localStorage.setItem('lightMode', booleanToString(lightMode.value));
- lightMode.value ? rootHTML.classList.remove('dark') : rootHTML.classList.add('dark');
+
+ if (lightMode.value) {
+ rootHTML.classList.remove('dark');
+ return;
+ }
+
+ rootHTML.classList.add('dark');
}
function initDarkMode() {
diff --git a/resources/js/stores/DashboardStore.ts b/resources/js/stores/DashboardStore.ts
index 2a918478..baa44d80 100644
--- a/resources/js/stores/DashboardStore.ts
+++ b/resources/js/stores/DashboardStore.ts
@@ -32,7 +32,7 @@ export const useDashboardStore = defineStore('Dashboard', () => {
stateLibraries.value = v?.data ?? [];
if (!v?.data) return;
- let totalSize = v.data.reduce((total: number, library: CategoryResource) => total + library.total_size, 0);
+ const totalSize = v.data.reduce((total: number, library: CategoryResource) => total + library.total_size, 0);
if (!isNaN(totalSize)) stateTotalLibrariesSize.value = formatFileSize(totalSize);
});
diff --git a/resources/js/types/pinesTypes.ts b/resources/js/types/pinesTypes.ts
index 0f91b8b5..3fc80c7e 100644
--- a/resources/js/types/pinesTypes.ts
+++ b/resources/js/types/pinesTypes.ts
@@ -27,7 +27,7 @@ export interface ToastControllerProps {
export interface ToastProps {
id: string;
- stack: Function;
+ stack: (...args: unknown[]) => unknown;
position: string;
toastCount: number;
diff --git a/resources/js/types/types.ts b/resources/js/types/types.ts
index 93421ff2..ee38c42c 100644
--- a/resources/js/types/types.ts
+++ b/resources/js/types/types.ts
@@ -293,6 +293,7 @@ export interface TableProps<T> {
startAscending?: boolean;
paginationClass?: string;
maxVisiblePages?: number;
+ noResultsMessage?: string;
}
export interface DropdownMenuItem {
@@ -319,6 +320,16 @@ export interface BreadCrumbItem {
icon?: Component;
}
+export interface LrcLibResult {
+ id: number;
+ name: string;
+ trackName: string;
+ artistName: string;
+ albumName: string;
+ duration: number;
+ syncedLyrics?: string;
+}
+
export interface RawLyricItem {
text: string;
time?: number;
diff --git a/resources/js/views/DashboardView.vue b/resources/js/views/DashboardView.vue
index d61dc185..86adab51 100644
--- a/resources/js/views/DashboardView.vue
+++ b/resources/js/views/DashboardView.vue
@@ -89,7 +89,7 @@ watch(
() => route?.params?.tab,
(URL_TAB) => {
if (!URL_TAB) return;
- let defaultTab = dashboardTabs.value.find((tab) => tab.title === URL_TAB || tab.name === URL_TAB) ?? dashboardTabs.value[0];
+ const defaultTab = dashboardTabs.value.find((tab) => tab.title === URL_TAB || tab.name === URL_TAB) ?? dashboardTabs.value[0];
pageTitle.value = defaultTab.title ?? defaultTab.name;
dashboardTab.value = defaultTab;
@@ -167,7 +167,6 @@ watch(
ring-inset ring-purple-600 hover:ring-purple-600/50 hover:ring-[0.125rem]
aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60
`"
- @click=""
:aria-disabled="false"
>
<template #header>
diff --git a/resources/js/views/HistoryView.vue b/resources/js/views/HistoryView.vue
index 56e8ae52..ed194d24 100755
--- a/resources/js/views/HistoryView.vue
+++ b/resources/js/views/HistoryView.vue
@@ -25,10 +25,10 @@ const { pageTitle, selectedSideBar } = storeToRefs(appStore);
const { stateRecords } = storeToRefs(ContentStore);
const filteredRecords = computed<RecordResource[]>(() => {
- let tempList = searchQuery.value
+ const tempList = searchQuery.value
? stateRecords.value.filter((record: RecordResource) => {
try {
- let strRepresentation = [record.relationships?.video_name ?? record.relationships.file_name, record.relationships?.folder?.name, record.attributes.created_at]
+ const strRepresentation = [record.relationships?.video_name ?? record.relationships.file_name, record.relationships?.folder?.name, record.attributes.created_at]
.join(' ')
.toLowerCase();
return strRepresentation.includes(searchQuery.value.toLowerCase());
@@ -48,7 +48,7 @@ const handleDelete = (id: number) => {
const submitDelete = async () => {
if (cachedID.value) {
- let request = await deleteRecord(cachedID.value);
+ const request = await deleteRecord(cachedID.value);
if (request) toast.add('Success', { type: 'success', description: 'Record Deleted Successfully!', life: 3000 });
else toast.add('Error', { type: 'warning', description: 'Unable to delete record. Please try again.', life: 3000 });
}
diff --git a/resources/js/views/VideoView.vue b/resources/js/views/VideoView.vue
index d85c7de4..0bffc785 100755
--- a/resources/js/views/VideoView.vue
+++ b/resources/js/views/VideoView.vue
@@ -130,7 +130,7 @@ const handleSearch = (query: string) => {
const handleVideoAction = (e: Event, id: number, action: 'edit' | 'share') => {
if (!stateFolder.value?.videos) return;
- let video = stateFolder.value.videos.find((video: VideoResource) => video.id === id);
+ const video = stateFolder.value.videos.find((video: VideoResource) => video.id === id);
if (video) cachedVideo.value = video; // idk what this does as removing it does not change functionality
if (action === 'edit') editVideoModal.toggleModal();