From d04e10a85cf5e2a601d5306c298c3eeddac5b0e6 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Fri, 7 Jun 2024 19:55:35 +0400 Subject: [PATCH 1/5] update event colors --- src/shared/ui/preview-card/preview-card-header.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/shared/ui/preview-card/preview-card-header.vue b/src/shared/ui/preview-card/preview-card-header.vue index 7f33c7b..ddf27d3 100644 --- a/src/shared/ui/preview-card/preview-card-header.vue +++ b/src/shared/ui/preview-card/preview-card-header.vue @@ -180,9 +180,10 @@ $eventTypeColorsMap: ( "smtp" "orange", "sentry" "pink", "profiler" "purple", - "monolog" "gray", - "inspector" "gray", - "ray" "gray", + "ray" "cyan", + "inspector" "yellow", + "http-dump" "lime", + "monolog" "zinc", "unknown" "gray" ); @@ -206,9 +207,10 @@ $eventTypeColorsMap: ( 'Smtp' 'bg-orange-50 dark:bg-orange-700 text-orange-800 dark:text-orange-50 dark:border-orange-600' 'bg-orange-100 dark:bg-orange-500', 'Sentry' 'bg-pink-50 dark:bg-pink-700 text-pink-800 dark:text-pink-50 dark:border-pink-600' 'bg-pink-100 dark:bg-pink-500', 'profiler' 'bg-purple-50 dark:bg-purple-700 text-purple-800 dark:text-purple-50 dark:border-purple-600' 'bg-purple-100 dark:bg-purple-500', - 'monolog' 'bg-gray-50 dark:bg-gray-700 text-gray-800 dark:text-gray-50 dark:border-gray-600' 'bg-gray-100 dark:bg-gray-500', - 'inspector' 'bg-gray-50 dark:bg-gray-700 text-gray-800 dark:text-gray-50 dark:border-gray-600' 'bg-gray-100 dark:bg-gray-500', - 'ray' 'bg-gray-50 dark:bg-gray-700 text-gray-800 dark:text-gray-50 dark:border-gray-600' 'bg-gray-100 dark:bg-gray-500' */ + 'ray' 'bg-cyan-50 dark:bg-cyan-700 text-cyan-800 dark:text-cyan-50 dark:border-cyan-600' 'bg-cyan-100 dark:bg-cyan-500', + 'inspector' 'bg-yellow-50 dark:bg-yellow-700 text-yellow-800 dark:text-yellow-50 dark:border-yellow-600' 'bg-yellow-100 dark:bg-yellow-500', + 'monolog' 'bg-zinc-50 dark:bg-zinc-700 text-zinc-800 dark:text-zinc-50 dark:border-zinc-600' 'bg-zinc-100 dark:bg-zinc-500' + 'http-dump' 'bg-lime-50 dark:bg-lime-700 text-lime-800 dark:text-lime-50 dark:border-lime-600' 'bg-lime-100 dark:bg-lime-500' */ @each $map in $eventTypeColorsMap { $name: nth($map, 1); From f00910f383ebedb283cfefdd3f013c6c9d721c2f Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Fri, 7 Jun 2024 20:20:34 +0400 Subject: [PATCH 2/5] create monolog event page --- pages/monolog/[id].vue | 101 +++++++++++++++ pages/monolog/index.vue | 8 ++ src/entities/monolog/types.ts | 2 +- src/screens/monolog/index.ts | 1 + src/screens/monolog/ui/index.ts | 1 + src/screens/monolog/ui/monolog-page/index.ts | 1 + .../ui/monolog-page/monolog-page.stories.ts | 18 +++ .../monolog/ui/monolog-page/monolog-page.vue | 119 ++++++++++++++++++ src/shared/ui/code-snippet/code-snippet.vue | 2 +- .../icon-svg/icon-svg-originals/monolog.svg | 13 ++ src/shared/ui/icon-svg/icon-svg.vue | 41 ++++++ 11 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 pages/monolog/[id].vue create mode 100644 pages/monolog/index.vue create mode 100644 src/screens/monolog/index.ts create mode 100644 src/screens/monolog/ui/index.ts create mode 100644 src/screens/monolog/ui/monolog-page/index.ts create mode 100644 src/screens/monolog/ui/monolog-page/monolog-page.stories.ts create mode 100644 src/screens/monolog/ui/monolog-page/monolog-page.vue create mode 100644 src/shared/ui/icon-svg/icon-svg-originals/monolog.svg diff --git a/pages/monolog/[id].vue b/pages/monolog/[id].vue new file mode 100644 index 0000000..48f651e --- /dev/null +++ b/pages/monolog/[id].vue @@ -0,0 +1,101 @@ + + + + + diff --git a/pages/monolog/index.vue b/pages/monolog/index.vue new file mode 100644 index 0000000..9f32473 --- /dev/null +++ b/pages/monolog/index.vue @@ -0,0 +1,8 @@ + + + diff --git a/src/entities/monolog/types.ts b/src/entities/monolog/types.ts index c9c4337..cf034da 100644 --- a/src/entities/monolog/types.ts +++ b/src/entities/monolog/types.ts @@ -12,6 +12,6 @@ export interface Monolog { level_name: string, channel: string, datetime: string, - extra: object, + extra: Record | [], } diff --git a/src/screens/monolog/index.ts b/src/screens/monolog/index.ts new file mode 100644 index 0000000..ed58495 --- /dev/null +++ b/src/screens/monolog/index.ts @@ -0,0 +1 @@ +export * from './ui' diff --git a/src/screens/monolog/ui/index.ts b/src/screens/monolog/ui/index.ts new file mode 100644 index 0000000..2879ff5 --- /dev/null +++ b/src/screens/monolog/ui/index.ts @@ -0,0 +1 @@ +export * from './monolog-page' diff --git a/src/screens/monolog/ui/monolog-page/index.ts b/src/screens/monolog/ui/monolog-page/index.ts new file mode 100644 index 0000000..a27558c --- /dev/null +++ b/src/screens/monolog/ui/monolog-page/index.ts @@ -0,0 +1 @@ +export { default as MonologPage } from './monolog-page.vue'; diff --git a/src/screens/monolog/ui/monolog-page/monolog-page.stories.ts b/src/screens/monolog/ui/monolog-page/monolog-page.stories.ts new file mode 100644 index 0000000..88bbffb --- /dev/null +++ b/src/screens/monolog/ui/monolog-page/monolog-page.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from "@storybook/vue3"; +import { useMonolog } from "~/src/entities/monolog"; +import { monologMock } from '~/src/entities/monolog/mocks'; +import Monolog from './monolog-page.vue'; + +const { normalizeMonologEvent } = useMonolog(); + +export default { + title: "Screens/Monolog/MonologPage", + component: Monolog +} as Meta; + + +export const Default: StoryObj = { + args: { + event: normalizeMonologEvent(monologMock), + } +} diff --git a/src/screens/monolog/ui/monolog-page/monolog-page.vue b/src/screens/monolog/ui/monolog-page/monolog-page.vue new file mode 100644 index 0000000..3d2090a --- /dev/null +++ b/src/screens/monolog/ui/monolog-page/monolog-page.vue @@ -0,0 +1,119 @@ + + + + + diff --git a/src/shared/ui/code-snippet/code-snippet.vue b/src/shared/ui/code-snippet/code-snippet.vue index 9346539..fdb27cd 100644 --- a/src/shared/ui/code-snippet/code-snippet.vue +++ b/src/shared/ui/code-snippet/code-snippet.vue @@ -7,7 +7,7 @@ import { IconSvg } from "../icon-svg"; const CodeHighlight = highlightPlugin.component; type Props = { - code?: string; + code?: string | Record | Array | null; language?: string; }; diff --git a/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg b/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg new file mode 100644 index 0000000..b96ea23 --- /dev/null +++ b/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg @@ -0,0 +1,13 @@ + + + + + + + LOG + + + + + + diff --git a/src/shared/ui/icon-svg/icon-svg.vue b/src/shared/ui/icon-svg/icon-svg.vue index ea9f63d..70f4aa8 100644 --- a/src/shared/ui/icon-svg/icon-svg.vue +++ b/src/shared/ui/icon-svg/icon-svg.vue @@ -230,6 +230,47 @@ defineProps(); + + + + + + + LOG + + + + + + + Date: Fri, 7 Jun 2024 20:31:39 +0400 Subject: [PATCH 3/5] add monolog events page to sidebar --- .../icon-svg/icon-svg-originals/monolog.svg | 6 +++--- src/shared/ui/icon-svg/icon-svg.vue | 21 ++++++------------- .../ui/layout-sidebar/layout-sidebar.vue | 9 ++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg b/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg index b96ea23..ca191a6 100644 --- a/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg +++ b/src/shared/ui/icon-svg/icon-svg-originals/monolog.svg @@ -2,11 +2,11 @@ - - + + LOG - + diff --git a/src/shared/ui/icon-svg/icon-svg.vue b/src/shared/ui/icon-svg/icon-svg.vue index 70f4aa8..6f73871 100644 --- a/src/shared/ui/icon-svg/icon-svg.vue +++ b/src/shared/ui/icon-svg/icon-svg.vue @@ -235,25 +235,17 @@ defineProps(); viewBox="0 0 162 149" xmlns="http://www.w3.org/2000/svg" > - - - + + + (); LOG diff --git a/src/widgets/ui/layout-sidebar/layout-sidebar.vue b/src/widgets/ui/layout-sidebar/layout-sidebar.vue index 5320fe5..7dd6299 100644 --- a/src/widgets/ui/layout-sidebar/layout-sidebar.vue +++ b/src/widgets/ui/layout-sidebar/layout-sidebar.vue @@ -128,6 +128,15 @@ const path = computed(() => useRoute().path); + + + + Date: Fri, 7 Jun 2024 20:37:35 +0400 Subject: [PATCH 4/5] update logo link title --- src/widgets/ui/layout-sidebar/layout-sidebar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/ui/layout-sidebar/layout-sidebar.vue b/src/widgets/ui/layout-sidebar/layout-sidebar.vue index 7dd6299..50fb73c 100644 --- a/src/widgets/ui/layout-sidebar/layout-sidebar.vue +++ b/src/widgets/ui/layout-sidebar/layout-sidebar.vue @@ -64,7 +64,7 @@ const path = computed(() => useRoute().path);
diff --git a/pages/inspector/[id].vue b/pages/inspector/[id].vue index 1c014ac..a0357bb 100644 --- a/pages/inspector/[id].vue +++ b/pages/inspector/[id].vue @@ -2,7 +2,7 @@ import { onMounted, computed, ref } from "vue"; import { InspectorPage } from "~/src/screens/inspector"; import { useFetch, useHead, useRoute, useRouter, useNuxtApp } from "#app"; // eslint-disable-line @conarti/feature-sliced/layers-slices -import { PageHeader } from "~/src/widgets/ui"; +import { PageEventHeader } from "~/src/widgets/ui"; import { useInspector } from "~/src/entities/inspector"; import type { Inspector } from "~/src/entities/inspector/types"; import { useEvents } from "~/src/shared/lib/use-events"; @@ -32,12 +32,6 @@ const event = computed(() => : null ); -const onDelete = () => { - events.removeById(eventId); - - router.push("/"); -}; - const getEvent = async () => { isLoading.value = true; @@ -61,15 +55,7 @@ onMounted(getEvent);