Skip to content

Commit 0efc318

Browse files
authored
Merge pull request #75 from buggregator/hotfix/inspector-colors
Fixes colors in timeline for inspector module
2 parents 3625071 + ff8fc3a commit 0efc318

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

src/screens/inspector/ui/inspector-page-timeline/inspector-page-timeline.vue

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import { computed, Ref } from "vue";
2+
import {computed, Ref} from "vue";
33
import {
44
InspectorSegment,
55
InspectorTransaction,
@@ -30,7 +30,7 @@ const transaction: Ref<InspectorTransaction> = computed(
3030
);
3131
3232
const grid = computed(() => {
33-
let { duration } = transaction.value;
33+
let {duration} = transaction.value;
3434
3535
const totalCells = 5;
3636
const width = duration / totalCells + 1;
@@ -59,10 +59,10 @@ const segments: Ref<InspectorSegment[]> = computed(() =>
5959
.filter(
6060
(
6161
<T extends keyof InspectorItemType>(type: T) =>
62-
(
63-
action: InspectorItemType[keyof InspectorItemType]
64-
): action is InspectorItemType[T] =>
65-
action.model === type
62+
(
63+
action: InspectorItemType[keyof InspectorItemType]
64+
): action is InspectorItemType[T] =>
65+
action.model === type
6666
)("segment")
6767
)
6868
.filter(
@@ -73,13 +73,13 @@ const segments: Ref<InspectorSegment[]> = computed(() =>
7373
7474
const segmentTypes = computed(() =>
7575
[...new Set(segments.value.map((data) => data.type))].map((type) => ({
76-
color: `bg-${segmentColor(type)}-600`,
76+
color: segmentColor(type),
7777
type,
7878
}))
7979
);
8080
8181
const series = computed(() => {
82-
const { duration } = transaction.value;
82+
const {duration} = transaction.value;
8383
8484
return segments.value.map((segment: InspectorSegment) => {
8585
const widthPercent = Math.max(
@@ -93,7 +93,7 @@ const series = computed(() => {
9393
widthPercent,
9494
marginPercent,
9595
segment,
96-
color: `bg-${segmentColor(segment.type)}-600`,
96+
color: segmentColor(segment.type),
9797
};
9898
});
9999
});
@@ -153,7 +153,7 @@ const series = computed(() => {
153153
class="inspector-page-timeline__series-segment-start"
154154
>
155155
<span class="inspector-page-timeline__series-segment-start-label"
156-
>{{ row.segment.start }} ms</span
156+
>{{ row.segment.start }} ms</span
157157
>
158158
</div>
159159
<div
@@ -200,10 +200,6 @@ const series = computed(() => {
200200
@apply w-4 h-4 rounded mr-2;
201201
}
202202
203-
.inspector-page-timeline__segment-type__label {
204-
@apply text-xs font-bold;
205-
}
206-
207203
.inspector-page-timeline__segments {
208204
@apply overflow-x-scroll border border-gray-50 dark:border-gray-600;
209205
}
@@ -222,23 +218,24 @@ const series = computed(() => {
222218
223219
.dark .inspector-page-timeline__series {
224220
background-image: linear-gradient(
225-
to right,
226-
rgba(255, 255, 255, 0.04) 1px,
227-
transparent 1px
221+
to right,
222+
rgba(255, 255, 255, 0.04) 1px,
223+
transparent 1px
228224
);
229225
}
230226
231227
.inspector-page-timeline__series-segment {
232-
@apply mt-5 text-right;
228+
@apply mt-4 text-right;
233229
}
234230
235231
.inspector-page-timeline__series-segment-label {
236-
@apply text-2xs md:text-xs font-bold whitespace-nowrap;
232+
@apply text-2xs md:text-xs font-bold whitespace-nowrap pr-2 pb-1;
237233
}
238234
239235
.inspector-page-timeline__series-segment-start {
240236
@apply flex items-center justify-end;
241237
}
238+
242239
.inspector-page-timeline__series-segment-end,
243240
.inspector-page-timeline__series-segment-start {
244241
background-color: rgba(177 177 177 / 17%);
@@ -275,4 +272,29 @@ const series = computed(() => {
275272
.inspector-page-timeline__no-segments-placeholder {
276273
@apply text-lg md:text-xl lg:text-3xl mt-5 font-bold text-gray-300;
277274
}
275+
276+
277+
.inspector-page-timeline__series-segment-time,
278+
.inspector-page-timeline__segment-type__color-box {
279+
@apply bg-gray-600;
280+
}
281+
282+
.inspector-page-timeline__series-segment-time.orange,
283+
.inspector-page-timeline__segment-type__color-box.orange {
284+
@apply bg-orange-600;
285+
}
286+
287+
.inspector-page-timeline__series-segment-time.blue,
288+
.inspector-page-timeline__segment-type__color-box.blue {
289+
@apply bg-blue-600;
290+
}
291+
292+
.inspector-page-timeline__series-segment-time.purple,
293+
.inspector-page-timeline__segment-type__color-box.purple {
294+
@apply bg-purple-600;
295+
}
296+
297+
.inspector-page-timeline__segment-type__label {
298+
@apply text-xs font-bold;
299+
}
278300
</style>

0 commit comments

Comments
 (0)