Skip to content

A self-hosted media server and file management system

fix: manual class prop is applied on many components but vue applies it automatically

aminnausin8a67a24092c8
diff --git a/resources/js/components/cards/DashboardCard.vue b/resources/js/components/cards/DashboardCard.vue
index d6e4dec1..4e602cee 100644
--- a/resources/js/components/cards/DashboardCard.vue
+++ b/resources/js/components/cards/DashboardCard.vue
@@ -3,7 +3,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
name?: string;
title?: string;
details?: string | null;
@@ -22,7 +21,6 @@ const props = withDefaults(
:class="[
`flex col-span-full row-span-${rows} flex-col gap-2 p-3 rounded-xl shadow-lg dark:bg-primary-dark-800/70 bg-white ring-1 ring-gray-900/5 w-full`,
`${parseInt(`${cols}`) < 3 ? `sm:col-span-2 lg:col-span-${cols}` : `lg:col-span-${cols}`}`,
- props.class,
]"
>
<header class="flex flex-wrap justify-between items-center gap-4 mb-3">
diff --git a/resources/js/components/cards/SidebarCard.vue b/resources/js/components/cards/SidebarCard.vue
index b69398f5..58a9dd5b 100644
--- a/resources/js/components/cards/SidebarCard.vue
+++ b/resources/js/components/cards/SidebarCard.vue
@@ -11,7 +11,6 @@ const props = defineProps<{
link?: string;
to?: string;
title?: string;
- class?: string[];
}>();
const slots = useSlots();
@@ -29,7 +28,6 @@ const isCompleteElement = computed(() => !!slots.header && !!slots.body);
'dark:bg-primary-dark-800/70 bg-primary-800',
'dark:hover:bg-primary-dark-600 hover:bg-gray-200',
{ 'gap-4 lg:gap-2 ': isCompleteElement },
- ...(props.class ?? []),
]"
>
<section class="flex justify-between gap-4 w-full items-center">
@@ -81,7 +79,6 @@ const isCompleteElement = computed(() => !!slots.header && !!slots.body);
'dark:bg-primary-dark-800/70 bg-primary-800',
'dark:hover:bg-primary-dark-600 hover:bg-gray-200',
{ 'gap-4 lg:gap-2 ': isCompleteElement },
- `${props.class}`,
]"
>
<section class="flex justify-between gap-4 w-full items-center">
diff --git a/resources/js/components/cards/StatsCard.vue b/resources/js/components/cards/StatsCard.vue
index e12c5a9f..11960d19 100644
--- a/resources/js/components/cards/StatsCard.vue
+++ b/resources/js/components/cards/StatsCard.vue
@@ -1,8 +1,8 @@
<script setup lang="ts">
-const props = defineProps<{ title: string; data?: any[]; forceCount?: number; class?: string }>();
+const props = defineProps<{ title: string; data?: any[]; forceCount?: number }>();
</script>
<template>
- <div :class="`flex flex-col gap-2 p-3 overflow-clip rounded-xl shadow-lg dark:bg-primary-dark-800/70 bg-white ring-1 ring-gray-900/5 flex-1 w-1/3 ${props.class ?? ''}`">
+ <div :class="`flex flex-col gap-2 p-3 overflow-clip rounded-xl shadow-lg dark:bg-primary-dark-800/70 bg-white ring-1 ring-gray-900/5 flex-1 w-1/3`">
<span>
<slot name="icon"> </slot>
<p class="text-sm dark:text-slate-400 text-slate-500 max-w-full text-nowrap">{{ props.title }}</p>
diff --git a/resources/js/components/charts/PulseDoughnutChart.vue b/resources/js/components/charts/PulseDoughnutChart.vue
index 0ff29b44..b41f964d 100644
--- a/resources/js/components/charts/PulseDoughnutChart.vue
+++ b/resources/js/components/charts/PulseDoughnutChart.vue
@@ -5,7 +5,6 @@ import { Doughnut } from 'vue-chartjs';
Chart.register(...registerables);
const props = defineProps<{
- class: string;
chartData?: any;
chartOptions?: any;
}>();
@@ -37,9 +36,5 @@ const defaultChartOptions = {
};
</script>
<template>
- <Doughnut
- :class="`${props.class}`"
- :data="props.chartData ?? defaultChartData"
- :options="props.chartOptions ?? defaultChartOptions"
- ></Doughnut>
+ <Doughnut :data="props.chartData ?? defaultChartData" :options="props.chartOptions ?? defaultChartOptions"></Doughnut>
</template>
diff --git a/resources/js/components/charts/PulseLineChart.vue b/resources/js/components/charts/PulseLineChart.vue
index ef5dd345..01000141 100644
--- a/resources/js/components/charts/PulseLineChart.vue
+++ b/resources/js/components/charts/PulseLineChart.vue
@@ -62,7 +62,7 @@ const defaultChartOptions = {
<template>
<Line
- :class="`${props.class ?? ''} w-full ring-1 ring-gray-900/5 bg-white dark:bg-primary-dark-800 rounded-md shadow-sm`"
+ :class="`w-full ring-1 ring-gray-900/5 bg-white dark:bg-primary-dark-800 rounded-md shadow-sm`"
:data="props.chartData ?? defaultChartData"
:options="props.chartOptions ?? defaultChartOptions"
></Line>
diff --git a/resources/js/components/inputs/ButtonForm.vue b/resources/js/components/inputs/ButtonForm.vue
index 4179a53b..dec43b27 100644
--- a/resources/js/components/inputs/ButtonForm.vue
+++ b/resources/js/components/inputs/ButtonForm.vue
@@ -6,12 +6,10 @@ const props = withDefaults(
disabled?: boolean;
type?: 'button' | 'submit' | 'reset';
variant?: 'default' | 'submit' | 'reset' | 'auth';
- class?: string;
}>(),
{
disabled: false,
type: 'button',
- class: '',
},
);
const variantClass = computed(() => {
@@ -48,7 +46,7 @@ const variantClass = computed(() => {
});
</script>
<template>
- <button :type="type" :class="[...variantClass, props.class]" :disabled="disabled">
+ <button :type="type" :class="[...variantClass]" :disabled="disabled">
<slot name="text"></slot>
<slot></slot>
</button>
diff --git a/resources/js/components/inputs/ButtonIcon.vue b/resources/js/components/inputs/ButtonIcon.vue
index d4772afa..ae0a6e99 100755
--- a/resources/js/components/inputs/ButtonIcon.vue
+++ b/resources/js/components/inputs/ButtonIcon.vue
@@ -3,7 +3,6 @@ import { computed } from 'vue';
const props = withDefaults(
defineProps<{
- class?: string;
type?: 'reset' | 'submit' | 'button' | undefined;
disabled?: boolean;
title?: string;
@@ -49,7 +48,7 @@ const variantClass = computed(() => {
<router-link
v-if="to"
:to="to"
- :class="['flex items-center justify-center cursor-pointer', props.class, variantClass]"
+ :class="['flex items-center justify-center cursor-pointer', variantClass]"
:type="props.type"
:title="props.title ?? 'Button'"
:aria-disabled="disabled"
@@ -58,13 +57,7 @@ const variantClass = computed(() => {
<slot name="text"> </slot>
<slot name="icon"> </slot>
</router-link>
- <button
- v-else
- :class="['flex items-center justify-center cursor-pointer', props.class, variantClass]"
- :type="props.type"
- :disabled="props.disabled"
- :title="props.title ?? 'Icon'"
- >
+ <button v-else :class="['flex items-center justify-center cursor-pointer', variantClass]" :type="props.type" :disabled="props.disabled" :title="props.title ?? 'Icon'">
<slot name="text"> </slot>
<slot name="icon"> </slot>
</button>
diff --git a/resources/js/components/inputs/ButtonText.vue b/resources/js/components/inputs/ButtonText.vue
index 7394be83..46cb6197 100755
--- a/resources/js/components/inputs/ButtonText.vue
+++ b/resources/js/components/inputs/ButtonText.vue
@@ -3,7 +3,6 @@ import { computed } from 'vue';
const props = withDefaults(
defineProps<{
- class?: string;
type?: 'reset' | 'submit' | 'button' | undefined;
disabled?: boolean;
title?: string;
@@ -58,7 +57,7 @@ const variantClass = computed(() => {
<router-link
v-if="to"
:to="to"
- :class="['flex gap-2 items-center justify-center cursor-pointer', props.class, variantClass]"
+ :class="['flex gap-2 items-center justify-center cursor-pointer', variantClass]"
:type="type"
:title="title"
:aria-disabled="disabled"
@@ -69,7 +68,7 @@ const variantClass = computed(() => {
</slot>
<slot name="icon"> </slot>
</router-link>
- <button v-else :class="['flex gap-2 items-center justify-center cursor-pointer', props.class, variantClass]" :type="type" :disabled="disabled" :title="title ?? 'Button'">
+ <button v-else :class="['flex gap-2 items-center justify-center cursor-pointer', variantClass]" :type="type" :disabled="disabled" :title="title ?? 'Button'">
<slot name="text">
<p class="line-clamp-1 flex-1 text-left" v-if="text">{{ text }}</p>
</slot>
diff --git a/resources/js/components/labels/FormInputLabel.vue b/resources/js/components/labels/FormInputLabel.vue
index b4ad56df..4991d8ab 100755
--- a/resources/js/components/labels/FormInputLabel.vue
+++ b/resources/js/components/labels/FormInputLabel.vue
@@ -1,15 +1,14 @@
<script setup lang="ts">
import type { FormField } from '@/types/types';
-const props = defineProps<{
+defineProps<{
field: FormField;
textSize?: string;
- class?: string;
}>();
</script>
<template>
- <label :for="field?.name" :class="[`leading-none block font-medium text-gray-700 dark:text-neutral-200`, textSize ? textSize : 'text-sm', `${props.class ?? ''}`]">
+ <label :for="field?.name" :class="[`leading-none block font-medium text-gray-700 dark:text-neutral-200`, textSize ? textSize : 'text-sm']">
{{ field?.text }}
</label>
<p v-if="field?.subtext" class="text-sm/6 text-gray-500 dark:text-gray-400">{{ field.subtext }}</p>
diff --git a/resources/js/components/labels/InputLabel.vue b/resources/js/components/labels/InputLabel.vue
index c4d8a952..656f51c1 100644
--- a/resources/js/components/labels/InputLabel.vue
+++ b/resources/js/components/labels/InputLabel.vue
@@ -1,15 +1,14 @@
<script setup lang="ts">
-const props = defineProps<{
+defineProps<{
name?: string;
text?: string;
subtext?: string;
- class?: string;
subtextClass?: string;
}>();
</script>
<template>
- <label :for="name" :class="[`font-medium text-gray-700 dark:text-neutral-200`, props.class]">
+ <label :for="name" :class="[`font-medium text-gray-700 dark:text-neutral-200`]">
{{ text }}
</label>
<p v-if="subtext" :class="['text-sm/6 text-gray-500 dark:text-gray-400', subtextClass]">{{ subtext }}</p>
diff --git a/resources/js/components/pulseCards/PulseCache.vue b/resources/js/components/pulseCards/PulseCache.vue
index c012e6d3..78a9e5b8 100644
--- a/resources/js/components/pulseCards/PulseCache.vue
+++ b/resources/js/components/pulseCards/PulseCache.vue
@@ -20,7 +20,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData: PulseResponse;
isLoading?: boolean;
period: string;
@@ -43,7 +42,6 @@ const config = computed(() => {
<DashboardCard
:rows="rows"
:cols="cols"
- :class="props.class"
name="Cache"
:title="`Time: ${format_number(pulseData.slow_outgoing_requests?.time ?? 0)}ms; Run at: ${pulseData.slow_outgoing_requests?.runAt ? new Date(pulseData.slow_outgoing_requests?.runAt).toLocaleDateString() : ''};`"
:details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseExceptions.vue b/resources/js/components/pulseCards/PulseExceptions.vue
index beec3a2c..b900d187 100644
--- a/resources/js/components/pulseCards/PulseExceptions.vue
+++ b/resources/js/components/pulseCards/PulseExceptions.vue
@@ -28,7 +28,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData?: PulseResponse;
isLoading?: boolean;
period: string;
@@ -63,7 +62,6 @@ const exceptions = computed(() => {
<DashboardCard
:rows="rows"
:cols="cols"
- :class="props.class"
name="Exceptions"
:title="`Time: ${format_number(pulseData?.exceptions?.time ?? 0)}ms; Run at: ${pulseData?.exceptions?.runAt ? new Date(pulseData?.exceptions?.runAt).toLocaleDateString() : ''};`"
:details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseQueues.vue b/resources/js/components/pulseCards/PulseQueues.vue
index 60b39f98..c7c1b84f 100644
--- a/resources/js/components/pulseCards/PulseQueues.vue
+++ b/resources/js/components/pulseCards/PulseQueues.vue
@@ -16,7 +16,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData?: PulseResponse;
isLoading?: boolean;
period: string;
@@ -37,7 +36,6 @@ function scale(data: { [key: string]: any }) {
<template>
<DashboardCard
:rows="rows"
- :class="props.class"
name="Queues"
:title="`Time: ${format_number(pulseData?.queues?.time ?? 0)}ms; Run at: ${pulseData?.queues?.runAt ? new Date(pulseData?.queues?.runAt).toLocaleDateString() : ''};`"
:details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseRequests.vue b/resources/js/components/pulseCards/PulseRequests.vue
index 5dbdcc7d..84783ba5 100644
--- a/resources/js/components/pulseCards/PulseRequests.vue
+++ b/resources/js/components/pulseCards/PulseRequests.vue
@@ -16,7 +16,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData: PulseResponse;
isLoading?: boolean;
period: string;
@@ -42,7 +41,6 @@ function scale(data: { [key: string]: any }) {
<template>
<DashboardCard
:rows="rows"
- :class="props.class"
name="Requests"
:title="`Time: ${format_number(pulseData?.requests?.time ?? 0)}ms; Run at: ${pulseData?.requests?.runAt ? new Date(pulseData?.requests?.runAt).toLocaleDateString() : ''};`"
:details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseServers.vue b/resources/js/components/pulseCards/PulseServers.vue
index e3c4c5e8..49bdb672 100644
--- a/resources/js/components/pulseCards/PulseServers.vue
+++ b/resources/js/components/pulseCards/PulseServers.vue
@@ -15,7 +15,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData?: PulseResponse;
isLoading?: boolean;
}>(),
@@ -43,7 +42,6 @@ watch(
`overflow-x-auto overflow-y-hidden scrollbar-minimal-x scrollbar-thumb:bg-gray-300 dark:scrollbar-thumb:bg-gray-500/50 scrollbar-track:rounded scrollbar-track:bg-gray-100 dark:scrollbar-track:bg-gray-500/10 supports-scrollbars
max-w-full pb-2`,
`default:col-span-full default:lg:col-span-${props.cols} default:row-span-${props.rows}`,
- props.class,
]"
>
<div
diff --git a/resources/js/components/pulseCards/PulseSlowJobs.vue b/resources/js/components/pulseCards/PulseSlowJobs.vue
index 5a60c51f..d7f97545 100644
--- a/resources/js/components/pulseCards/PulseSlowJobs.vue
+++ b/resources/js/components/pulseCards/PulseSlowJobs.vue
@@ -27,7 +27,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData: PulseResponse;
isLoading?: boolean;
period: string;
@@ -62,7 +61,6 @@ const config = computed(() => {
<DashboardCard
:rows="rows"
:cols="cols"
- :class="props.class"
name="Slow Jobs"
:title="`Time: ${format_number(pulseData.slow_jobs.time ?? 0)}ms; Run at: ${pulseData.slow_jobs.runAt ? new Date(pulseData.slow_jobs.runAt).toLocaleDateString() : ''};`"
:details="`${config.threshold ?? 1000}ms threshold, past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue b/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue
index bd10d902..86cc0533 100644
--- a/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue
+++ b/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue
@@ -29,7 +29,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData: PulseResponse;
isLoading?: boolean;
period: string;
@@ -72,7 +71,6 @@ function getDomainFromUrl(input: string): string | null {
<DashboardCard
:rows="rows"
:cols="cols"
- :class="props.class"
name="Slow Outgoing Requests"
:title="`Time: ${format_number(pulseData.slow_outgoing_requests?.time ?? 0)}ms; Run at: ${pulseData.slow_outgoing_requests?.runAt ? new Date(pulseData.slow_outgoing_requests?.runAt).toLocaleDateString() : ''};`"
:details="`${config?.threshold ?? 1000}ms threshold, past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseSlowQueries.vue b/resources/js/components/pulseCards/PulseSlowQueries.vue
index 48d43734..6db5d991 100644
--- a/resources/js/components/pulseCards/PulseSlowQueries.vue
+++ b/resources/js/components/pulseCards/PulseSlowQueries.vue
@@ -27,7 +27,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData: PulseResponse;
isLoading?: boolean;
period: string;
@@ -62,7 +61,6 @@ const config = computed(() => {
<DashboardCard
:rows="rows"
:cols="cols"
- :class="props.class"
name="Slow Queries"
:title="`Time: ${format_number(pulseData.slow_queries.time ?? 0)}ms; Run at: ${pulseData.slow_queries.runAt ? new Date(pulseData.slow_queries.runAt).toLocaleDateString() : ''};`"
:details="`${config.threshold ?? 1000}ms threshold, past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseSlowRequests.vue b/resources/js/components/pulseCards/PulseSlowRequests.vue
index e8bd31b8..2f0c229c 100644
--- a/resources/js/components/pulseCards/PulseSlowRequests.vue
+++ b/resources/js/components/pulseCards/PulseSlowRequests.vue
@@ -28,7 +28,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData: PulseResponse;
isLoading?: boolean;
period: string;
@@ -63,7 +62,6 @@ const config = computed(() => {
<DashboardCard
:rows="rows"
:cols="cols"
- :class="props.class"
name="Slow Requests"
:title="`Time: ${format_number(pulseData.slow_requests?.time ?? 0)}ms; Run at: ${pulseData.slow_requests?.runAt ? new Date(pulseData.slow_requests?.runAt).toLocaleDateString() : ''};`"
:details="`${pulseData.slow_requests.config?.threshold ?? 1000}ms threshold, past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"
diff --git a/resources/js/components/pulseCards/PulseUsage.vue b/resources/js/components/pulseCards/PulseUsage.vue
index 219cc9c5..7d7afee5 100644
--- a/resources/js/components/pulseCards/PulseUsage.vue
+++ b/resources/js/components/pulseCards/PulseUsage.vue
@@ -27,7 +27,6 @@ const props = withDefaults(
defineProps<{
cols?: number | string;
rows?: number;
- class?: string;
pulseData?: PulseResponse;
isLoading?: boolean;
period: string;
@@ -74,7 +73,7 @@ const sampleRate = () => {
<DashboardCard
:cols="cols"
:rows="rows"
- :class="`${props.class ?? ''} col-span-2 lg:col-span-4`"
+ :class="`col-span-2 lg:col-span-4`"
:name="`${'Application Usage'}`"
:title="`Time: ${format_number(pulseData?.queues?.time ?? 0)}ms; Run at: ${pulseData?.servers?.runAt ? new Date(pulseData?.servers?.runAt).toLocaleDateString() : ''};`"
:details="`past ${validPeriods.indexOf(period) !== -1 ? periodForHumans(period) : periodForHumans(validPeriods[0])}`"