Skip to content

Commit a999b8b

Browse files
committed
feat: finish translating all pulse components to vue
1 parent 3fd2415 commit a999b8b

34 files changed

Lines changed: 1485 additions & 1242 deletions

app/Http/Controllers/Api/V1/AnalyticsController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use App\Traits\HasPeriod;
1313
use App\Traits\HttpResponses;
1414
use Illuminate\Http\Request;
15-
use Illuminate\Support\Facades\Auth;
1615

1716
class AnalyticsController extends Controller {
1817
use HasPeriod;

app/Jobs/IndexFiles.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,5 +602,4 @@ private function generatedChangesText($count, $type) {
602602
return 'Generated ' . $count . ' ' . $type . ' Changes';
603603
}
604604
}
605-
class BatchCancelledException extends \Exception {
606-
}
605+
class BatchCancelledException extends \Exception {}

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/components/cards/DashboardCard.vue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ const props = withDefaults(
1919
</script>
2020
<template>
2121
<div
22-
:class="`flex col-span-${cols} 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 ${props.class ?? ''}`"
22+
:class="[
23+
`flex col-span-full sm:col-span-${cols} 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`,
24+
props.class,
25+
]"
2326
>
24-
<header class="flex flex-wrap justify-between items-center gap-4 mb-3 @md:mb-6">
27+
<header class="flex flex-wrap justify-between items-center gap-4 mb-3">
2528
<div class="flex-1 basis-0 flex-grow-[10000] max-w-full">
2629
<div class="flex overflow-hidden gap-2 items-start">
2730
<div class="[&>svg]:flex-shrink-0 [&>svg]:w-6 [&>svg]:h-6 [&>svg]:stroke-gray-600/80 [&>svg]:dark:stroke-neutral-400/80 text-gray-400 dark:text-neutral-400/80">
2831
<slot name="icon"></slot>
2932
</div>
3033
<hgroup class="flex flex-wrap items-baseline gap-x-2 overflow-hidden">
31-
<h2 class="text-base font-bold text-gray-600 dark:text-gray-300 truncate" :title="props.title">
34+
<h2 class="text-base font-bold text-gray-600 dark:text-neutral-300 truncate" :title="props.title">
3235
{{ props.name }}
3336
</h2>
3437
<p v-if="props.details" class="text-gray-600/80 dark:text-neutral-400/80 font-medium truncate">
@@ -37,12 +40,10 @@ const props = withDefaults(
3740
</hgroup>
3841
</div>
3942
</div>
40-
<div class="flex flex-grow">
41-
<div class="w-full flex items-center gap-4">
42-
<slot name="actions"></slot>
43-
</div>
43+
<div class="flex flex-grow items-center">
44+
<slot name="actions"></slot>
4445
</div>
4546
</header>
46-
<slot name="slot"></slot>
47+
<slot></slot>
4748
</div>
4849
</template>

resources/js/components/dashboard/DashboardAnalytics.vue

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<script setup lang="ts">
2-
import type { BreadCrumbItem, PulseResponse } from '@/types/types';
2+
import type { BreadCrumbItem } from '@/types/types';
3+
import type { PulseResponse } from '@/types/pulseTypes';
34
4-
import { useGetPulse, useGetSiteAnalytics } from '@/service/queries';
55
import { computed, ref, useTemplateRef, watch } from 'vue';
6+
import { useGetPulse, useGetSiteAnalytics } from '@/service/queries';
67
import { handleStartTask } from '@/service/taskService';
78
import { periodForHumans } from '@/service/pulseUtil';
89
@@ -21,6 +22,12 @@ import ProiconsArrowSync from '~icons/proicons/arrow-sync';
2122
import ProiconsHome2 from '~icons/proicons/home-2';
2223
import ProiconsBolt from '~icons/proicons/bolt';
2324
import ProiconsAdd from '~icons/proicons/add';
25+
import PulseExceptions from '../pulseCards/PulseExceptions.vue';
26+
import PulseSlowRequests from '../pulseCards/PulseSlowRequests.vue';
27+
import PulseSlowJobs from '../pulseCards/PulseSlowJobs.vue';
28+
import PulseSlowOutgoingRequests from '../pulseCards/PulseSlowOutgoingRequests.vue';
29+
import PulseSlowQueries from '../pulseCards/PulseSlowQueries.vue';
30+
import PulseCache from '../pulseCards/PulseCache.vue';
2431
2532
const validPeriods: { key: string; value: string }[] = [
2633
{ key: '1h', value: '1_hour' },
@@ -97,20 +104,24 @@ watch(
97104
<template #icon>
98105
<LucideChartNoAxesCombined class="w-6 h-6" />
99106
</template>
100-
<template #slot>
101-
<span v-for="(stat, index) in stats?.changes" :key="index" class="flex gap-2 capitalize items-center flex-wrap">
102-
<h3 class="text-sm dark:text-slate-400 text-slate-500 w-full text-nowrap">{{ stat.title }}</h3>
103-
<span>
104-
<h3 class="text-lg">{{ stat.count ?? 0 }}</h3>
105-
</span>
106-
<h4 :class="`text-sm ${stat.change >= 0 ? 'text-green-700 dark:text-green-600' : 'text-rose-500'} ml-auto`">
107-
{{ `${stat.change === 0 ? 'no change' : `${stat.change >= 0 ? '+' : '-'}${stat.change}`}` }}
108-
</h4>
107+
<span v-for="(stat, index) in stats?.changes" :key="index" class="flex gap-2 capitalize items-center flex-wrap">
108+
<h3 class="text-sm dark:text-neutral-400 text-neutral-500 w-full text-nowrap">{{ stat.title }}</h3>
109+
<span>
110+
<h3 class="text-lg">{{ stat.count ?? 0 }}</h3>
109111
</span>
110-
</template>
112+
<h4 :class="`text-sm ${stat.change >= 0 ? 'text-green-700 dark:text-green-600' : 'text-rose-500'} ml-auto`">
113+
{{ `${stat.change === 0 ? 'no change' : `${stat.change >= 0 ? '+' : '-'}${stat.change}`}` }}
114+
</h4>
115+
</span>
111116
</DashboardCard>
112117
<PulseUsage :pulseData="pulseData" :isLoading="pulseLoading" :period="period" :rows="4" />
113118
<PulseQueues :pulseData="pulseData" :isLoading="pulseLoading" :period="period" :rows="2" />
114-
<PulseRequests :pulseData="pulseData" :isLoading="pulseLoading" :period="period" :rows="2" />
119+
<PulseRequests v-if="pulseData" :pulseData="pulseData" :isLoading="pulseLoading" :period="period" :rows="2" />
120+
<PulseSlowRequests v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" cols="3" />
121+
<PulseSlowJobs v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" />
122+
<PulseSlowQueries v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" />
123+
<PulseCache v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" />
124+
<PulseExceptions :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" />
125+
<PulseSlowOutgoingRequests v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" />
115126
</span>
116127
</template>

resources/js/components/pulse/PulseCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
const props = withDefaults(defineProps<{ cols?: number; rows?: number }>(), {
3-
cols: 6,
2+
const props = withDefaults(defineProps<{ cols?: number | string; rows?: number }>(), {
3+
cols: 'full',
44
rows: 1,
55
});
66
</script>

resources/js/components/pulse/PulseScroll.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ onMounted(async () => {
3030
@scroll.passive="scroll"
3131
class="flex-grow basis-full overflow-y-auto scrollbar:w-1.5 scrollbar:h-1.5 scrollbar:bg-transparent scrollbar-track:bg-gray-100 scrollbar-thumb:rounded scrollbar-thumb:bg-gray-300 scrollbar-track:rounded dark:scrollbar-track:bg-gray-500/10 dark:scrollbar-thumb:bg-gray-500/50 supports-scrollbars"
3232
>
33-
<slot name="slot"></slot>
33+
<slot></slot>
3434
<div ref="fade" class="h-6 origin-bottom fixed bottom-0 left-0 right-0 bg-gradient-to-t from-white dark:from-gray-900 pointer-events-none" wire:ignore></div>
3535
</div>
3636
</div>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
<table {{ $attributes->merge(['class' => 'w-full']) }}>
2-
{{ $slot }}
3-
</table>
1+
<template>
2+
<table class="w-full">
3+
<slot></slot>
4+
</table>
5+
</template>
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
@props(['numeric' => false])
2-
<td {{ $attributes->merge(['class' => 'first:rounded-l-md last:rounded-r-md text-sm bg-gray-50 dark:bg-gray-800/50 first:pl-3 last:pr-3 px-1 @sm:px-3 py-3' . ($numeric ? ' text-right tabular-nums whitespace-nowrap' : '')]) }}>
3-
{{ $slot }}
4-
</td>
1+
<script setup lang="ts">
2+
withDefaults(defineProps<{ numeric?: boolean }>(), { numeric: false });
3+
</script>
4+
<template>
5+
<td
6+
:class="[
7+
'first:rounded-l-md last:rounded-r-md text-sm dark:bg-primary-dark-800 bg-primary-900 ring-1 ring-gray-900/5 first:pl-3 last:pr-3 px-1 sm:px-3 py-3',
8+
{ 'text-right tabular-nums whitespace-nowrap': numeric },
9+
]"
10+
>
11+
<slot></slot>
12+
</td>
13+
</template>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
<th {{ $attributes->merge(['class' => 'text-xs text-gray-500 uppercase py-2 first:pl-3 last:pr-3 px-1 @sm:px-3 default:text-left']) }}>
2-
{{ $slot }}
3-
</th>
1+
<template>
2+
<th class="text-xs text-neutral-500 uppercase py-2 first:pl-3 last:pr-3 px-1 sm:px-3">
3+
<slot> </slot>
4+
</th>
5+
</template>

0 commit comments

Comments
 (0)