Skip to content

Commit 847ede3

Browse files
committed
feat: improve dark mode support and enhance job display in UI components
1 parent e30c36a commit 847ede3

3 files changed

Lines changed: 31 additions & 45 deletions

File tree

custom/JobInfoPopup.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div class="flex flex-col w-full min-w-96">
33
<div class="flex items-center mb-1">
4-
<h2 class="text-lg font-semibold">{{ job.name }}</h2>
5-
<p class="ml-2 text-xs text-gray-600 h-full"> {{ getTimeAgoString(new Date(job.createdAt)) }}</p>
6-
<p class="ml-auto text-gray-800 h-full"> {{ t('Progress:') }} <span class="font-semibold" >{{ job.progress }}%</span></p>
4+
<h2 class="text-lg font-semibold dark:text-white">{{ job.name }}</h2>
5+
<p class="ml-2 text-xs text-gray-600 dark:text-gray-200 h-full"> {{ getTimeAgoString(new Date(job.createdAt)) }}</p>
6+
<p class="ml-auto text-gray-800 dark:text-white h-full"> {{ t('Progress:') }} <span class="font-semibold" >{{ job.progress }}%</span></p>
77
<StateToIcon :job="job" />
88
</div>
99
<div class="flex items-center gap-4 w-full">

custom/JobsList.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<template>
2-
<div class="w-1vw md:w-64 bg-white border border-gray-200 rounded-md">
2+
<div class="w-1vw md:w-64 bg-white border border-gray-200 dark:bg-gray-800 dark:border-gray-600 rounded-md">
33
<Modal
44
v-for="job in props.jobs" :key="job.id"
55
:beforeCloseFunction="onBeforeOpen"
66
:beforeOpenFunction="onBeforeClose"
77
removeFromDomOnClose
88
>
99
<template #trigger>
10-
<div class="flex items-center w-full px-4 py-3 border-b border-gray-200 hover:bg-gray-50 transition-colors">
10+
<div class="flex items-center w-full px-4 py-3 bg-white dark:bg-gray-700 dark:border-gray-600 border-b border-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors">
1111
<div class="flex flex-col w-full max-w-48">
1212
<p class="flex gap-2 items-end justify-between text-nowrap">
13-
<span class="text-sm h-full text truncate">{{ job.name }}</span>
14-
<span class="text-xs text-gray-600">{{ getTimeAgoString(new Date(job.createdAt)) }}</span>
13+
<span class="text-sm h-full text truncate dark:text-white">{{ job.name }}</span>
14+
<span class="text-xs dark:text-gray-200 text-gray-600">{{ getTimeAgoString(new Date(job.createdAt)) }}</span>
1515
</p>
1616
<ProgressBar
1717
class="mt-1"

custom/NavbarJobs.vue

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
<template>
22
<div ref="dropdownRef">
33
<div class="cursor-pointer hover:scale-110 transition-transform" @click="isDropdownOpen = !isDropdownOpen">
4-
<div v-if="isAlLeastOneJobRunning" class="relative">
5-
<div class="loader "></div>
6-
<div class="absolute -bottom-1 -right-1 rounded-full bg-lightPrimary w-4 h-4 text-xs flex items-center justify-center text-white"> {{ jobsCount }}</div>
7-
</div>
8-
<div class="flex items-center justify-center" v-else-if="jobs.length > 0">
4+
<div class="relative flex items-center justify-center" v-if="jobs.length > 0">
95
<Tooltip>
10-
<IconCheckCircleOutline class="w-8 h-8 text-green-500" />
6+
<IconBriefcaseSolid class="w-7 h-7 text-gray-600 hover:text-gray-700" />
117
<template #tooltip>
128
{{ t('All jobs completed') }}
139
</template>
1410
</Tooltip>
11+
<div
12+
v-if="isAlLeastOneJobRunning"
13+
class="ping-animation absolute -bottom-1 -right-1 rounded-full bg-lightPrimary w-4 h-4 text-xs flex items-center justify-center text-white"
14+
>
15+
{{ jobsCount }}
16+
</div>
17+
<div
18+
v-if="isAlLeastOneJobRunning"
19+
class="absolute -bottom-1 -right-1 rounded-full bg-lightPrimary w-4 h-4 text-xs flex items-center justify-center text-white"
20+
>
21+
{{ jobsCount }}
22+
</div>
1523
</div>
1624
</div>
1725
<Transition
@@ -40,7 +48,7 @@
4048
<script setup lang="ts">
4149
import type { AdminUser } from 'adminforth';
4250
import { onMounted, onUnmounted, ref, computed } from 'vue';
43-
import { IconCheckCircleOutline } from '@iconify-prerendered/vue-flowbite';
51+
import { IconCheckCircleOutline, IconBriefcaseSolid } from '@iconify-prerendered/vue-flowbite';
4452
import { Tooltip } from '@/afcl';
4553
import { useI18n } from 'vue-i18n';
4654
import JobsList from './JobsList.vue';
@@ -119,36 +127,14 @@
119127

120128

121129
<style scoped lang="scss">
122-
.loader {
123-
width: 28px;
124-
aspect-ratio: 1;
125-
border-radius: 50%;
126-
--spinner-color: #1a56db;
127-
128-
background:
129-
conic-gradient(
130-
from 120deg,
131-
var(--spinner-color) 0deg 40deg,
132-
transparent 40deg
133-
),
134-
135-
conic-gradient(#ccc 0deg 360deg);
136-
137-
-webkit-mask: radial-gradient(
138-
farthest-side,
139-
transparent calc(100% - 6px),
140-
#000 calc(100% - 5px)
141-
);
142-
mask: radial-gradient(
143-
farthest-side,
144-
transparent calc(100% - 6px),
145-
#000 calc(100% - 5px)
146-
);
147-
148-
animation: stepRotate 2s infinite;
149-
}
150-
151-
@keyframes stepRotate {
152-
to { transform: rotate(1turn); }
130+
.ping-animation {
131+
animation: ping 1s cubic-bezier(0, 0, 1, 1) infinite;
132+
}
133+
134+
@keyframes ping {
135+
75%, 100% {
136+
transform: scale(2);
137+
opacity: 0;
153138
}
139+
}
154140
</style>

0 commit comments

Comments
 (0)