diff --git a/pages/ray/[id].vue b/pages/ray/[id].vue new file mode 100644 index 00000000..b5bbce44 --- /dev/null +++ b/pages/ray/[id].vue @@ -0,0 +1,101 @@ + + + + + diff --git a/pages/ray/index.vue b/pages/ray/index.vue new file mode 100644 index 00000000..313ba239 --- /dev/null +++ b/pages/ray/index.vue @@ -0,0 +1,8 @@ + + + diff --git a/pages/var-dump/[id].vue b/pages/var-dump/[id].vue new file mode 100644 index 00000000..e6b4793d --- /dev/null +++ b/pages/var-dump/[id].vue @@ -0,0 +1,101 @@ + + + + + diff --git a/pages/var-dump/index.vue b/pages/var-dump/index.vue new file mode 100644 index 00000000..1d4f563b --- /dev/null +++ b/pages/var-dump/index.vue @@ -0,0 +1,8 @@ + + + diff --git a/src/entities/http-dump/ui/preview-card/preview-card.vue b/src/entities/http-dump/ui/preview-card/preview-card.vue index cba68b0b..cfe418a4 100644 --- a/src/entities/http-dump/ui/preview-card/preview-card.vue +++ b/src/entities/http-dump/ui/preview-card/preview-card.vue @@ -9,18 +9,17 @@ type Props = { const props = defineProps(); -const eventLink = `/http-dumps/${props.event.id}`; const uri = decodeURI(props.event.payload.request.uri); @@ -31,8 +30,8 @@ const uri = decodeURI(props.event.payload.request.uri); @apply flex flex-col text-2xs md:text-xs; } -.preview-card__link { - @apply cursor-pointer p-2 md:p-3 bg-gray-200 dark:bg-gray-800; +.preview-card__content { + @apply p-2 md:p-3 bg-gray-200 dark:bg-gray-800; } .preview-card__method { diff --git a/src/entities/inspector/ui/preview-card/preview-card.vue b/src/entities/inspector/ui/preview-card/preview-card.vue index 869f1213..7f364f7d 100644 --- a/src/entities/inspector/ui/preview-card/preview-card.vue +++ b/src/entities/inspector/ui/preview-card/preview-card.vue @@ -1,5 +1,5 @@ @@ -29,7 +27,7 @@ const eventLink = computed(() => `/inspector/${props.event.id}`); @apply flex flex-col; } -.preview-card__link { - @apply cursor-pointer pb-2 flex-grow; +.preview-card__content { + @apply pb-2 flex-grow; } diff --git a/src/entities/profiler/ui/preview-card/preview-card.vue b/src/entities/profiler/ui/preview-card/preview-card.vue index 91bdd194..15e295b5 100644 --- a/src/entities/profiler/ui/preview-card/preview-card.vue +++ b/src/entities/profiler/ui/preview-card/preview-card.vue @@ -1,5 +1,4 @@ @@ -29,6 +26,6 @@ const eventLink = computed(() => `/profiler/${props.event.id}`); } .profiler-preview__link { - @apply cursor-pointer pb-2 flex-grow; + @apply pb-2 flex-grow; } diff --git a/src/entities/ray/lib/use-ray/config.ts b/src/entities/ray/lib/use-ray/config.ts new file mode 100644 index 00000000..3d3288a2 --- /dev/null +++ b/src/entities/ray/lib/use-ray/config.ts @@ -0,0 +1,145 @@ +import { computed } from "vue"; +import type { OneOfValues } from "~/src/shared/types"; +import { + RAY_EVENT_TYPES, + type RayContentApplicationLog, + type RayContentCarbon, + type RayContentCustom, + type RayContentEloquent, + type RayContentEvent, + type RayContentException, + type RayContentFrame, + type RayContentFrames, + type RayContentJob, + type RayContentLock, + type RayContentLog, + type RayContentMail, + type RayContentMeasure, + type RayContentObject, + type RayContentSQL, + type RayContentView, + type RayPayload +} from "../../types"; +import { RayApplicationLog } from "../../ui/ray-application-log"; +import { RayCarbon } from "../../ui/ray-carbon"; +import { RayCustom } from "../../ui/ray-custom"; +import { RayEloquent } from "../../ui/ray-eloquent"; +import { RayEvent } from "../../ui/ray-event"; +import { RayException } from "../../ui/ray-exception"; +import { RayFrame } from "../../ui/ray-frame"; +import { RayJob } from "../../ui/ray-job"; +import { RayLock } from "../../ui/ray-lock"; +import { RayLog } from "../../ui/ray-log"; +import { RayMail } from "../../ui/ray-mail"; +import { RayMeasure } from "../../ui/ray-measure"; +import { RayOrigin } from "../../ui/ray-origin"; +import { RayQuery } from "../../ui/ray-query"; +import { RayTable } from "../../ui/ray-table"; +import { RayTrace } from "../../ui/ray-trace"; +import { RayView } from "../../ui/ray-view"; + +export const COMPONENT_TYPE_MAP: Record Record +}> = { + [RAY_EVENT_TYPES.LOG]: { + view: RayLog, + getProps: (payload: RayPayload) => ({ + log: (payload.content as RayContentLog).values[0], + }), + }, + [RAY_EVENT_TYPES.CUSTOM]: { + view: RayCustom, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentCustom, + }), + }, + [RAY_EVENT_TYPES.CALLER]: { + view: RayFrame, + getProps: (payload: RayPayload) => ({ + frame: (payload.content as RayContentFrame).frame, + }), + }, + [RAY_EVENT_TYPES.CARBON]: { + view: RayCarbon, + getProps: (payload: RayPayload) => ({ + carbon: payload.content as RayContentCarbon, + }), + }, + [RAY_EVENT_TYPES.TRACE]: { + view: RayTrace, + getProps: (payload: RayPayload) => ({ + frames: (payload.content as RayContentFrames).frames, + }), + }, + [RAY_EVENT_TYPES.EXCEPTION]: { + view: RayException, + getProps: (payload: RayPayload) => ({ + exception: payload.content as RayContentException, + }), + }, + [RAY_EVENT_TYPES.TABLE]: { + view: RayTable, + getProps: (payload: RayPayload) => ({ + table: payload.content as RayContentObject, + }), + }, + [RAY_EVENT_TYPES.MEASURE]: { + view: RayMeasure, + getProps: (payload: RayPayload) => ({ + measure: payload.content as RayContentMeasure, + }), + }, + [RAY_EVENT_TYPES.QUERY]: { + view: RayQuery, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentSQL, + }), + }, + [RAY_EVENT_TYPES.ELOQUENT]: { + view: RayEloquent, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentEloquent, + }), + }, + [RAY_EVENT_TYPES.APPLICATION_LOG]: { + view: RayApplicationLog, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentApplicationLog, + }), + }, + [RAY_EVENT_TYPES.VIEW]: { + view: RayView, + getProps: (payload: RayPayload) => ({ + view: payload.content as RayContentView, + }), + }, + [RAY_EVENT_TYPES.EVENT]: { + view: RayEvent, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentEvent, + }), + }, + [RAY_EVENT_TYPES.JOB]: { + view: RayJob, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentJob, + }), + }, + [RAY_EVENT_TYPES.LOCK]: { + view: RayLock, + getProps: (payload: RayPayload) => ({ + name: (payload.content as RayContentLock).name, + }), + }, + [RAY_EVENT_TYPES.MAILABLE]: { + view: RayMail, + getProps: (payload: RayPayload) => ({ + content: payload.content as RayContentMail, + }), + }, + [RAY_EVENT_TYPES.NOTIFY]: { + view: RayOrigin, + getProps: (payload: RayPayload) => ({ origin: payload.origin }), + }, +}; diff --git a/src/entities/ray/lib/use-ray/use-ray.ts b/src/entities/ray/lib/use-ray/use-ray.ts index 58c80f31..28b7a1fa 100644 --- a/src/entities/ray/lib/use-ray/use-ray.ts +++ b/src/entities/ray/lib/use-ray/use-ray.ts @@ -1,11 +1,14 @@ import type { ServerEvent } from '~/src/shared/types'; import type { EnhancedRayEvent, RayDump } from "../../types"; +import { COMPONENT_TYPE_MAP } from "./config"; import { normalizeRayEvent } from "./normalize-ray-event"; type TUseRay = () => { normalizeRayEvent: (event: ServerEvent) => EnhancedRayEvent + COMPONENT_TYPE_MAP: typeof COMPONENT_TYPE_MAP } export const useRay: TUseRay = () => ({ - normalizeRayEvent + normalizeRayEvent, + COMPONENT_TYPE_MAP }) diff --git a/src/entities/ray/types.ts b/src/entities/ray/types.ts index 5a656d6b..e0a6749b 100644 --- a/src/entities/ray/types.ts +++ b/src/entities/ray/types.ts @@ -1,5 +1,29 @@ import type { NormalizedEvent } from "~/src/shared/types"; +export enum RAY_EVENT_TYPES { + LOG = "log", + // SIZE = "size", + CUSTOM = "custom", + // LABEL = "label", + CALLER = "caller", + CARBON = "carbon", + // COLOR = "color", + EXCEPTION = "exception", + // HIDE = "hide", + MEASURE = "measure", + NOTIFY = "notify", + MAILABLE = "mailable", + TABLE = "table", + TRACE = "trace", + QUERY = "executed_query", + APPLICATION_LOG = "application_log", + ELOQUENT = "eloquent_model", + VIEW = "view", + EVENT = "event", + JOB = "job_event", + LOCK = "create_lock", +} + export interface RayFrame { file_name: string, line_number: number, @@ -138,7 +162,7 @@ export interface RayContentCustom { } export interface RayPayload { - type: string, + type: RAY_EVENT_TYPES | string, origin?: RayPayloadOrigin, content: RayContentException | RayContent @@ -184,27 +208,3 @@ export interface EnhancedRayEvent extends NormalizedEvent { size: 'sm' | 'md' | 'lg' | 'xl', } } - -export enum RAY_EVENT_TYPES { - LOG = "log", - // SIZE = "size", - CUSTOM = "custom", - // LABEL = "label", - CALLER = "caller", - CARBON = "carbon", - // COLOR = "color", - EXCEPTION = "exception", - // HIDE = "hide", - MEASURE = "measure", - NOTIFY = "notify", - MAILABLE = "mailable", - TABLE = "table", - TRACE = "trace", - QUERY = "executed_query", - APPLICATION_LOG = "application_log", - ELOQUENT = "eloquent_model", - VIEW = "view", - EVENT = "event", - JOB = "job_event", - LOCK = "create_lock", -} diff --git a/src/entities/ray/ui/preview-card/preview-card.vue b/src/entities/ray/ui/preview-card/preview-card.vue index ca6ab1d5..0575420f 100644 --- a/src/entities/ray/ui/preview-card/preview-card.vue +++ b/src/entities/ray/ui/preview-card/preview-card.vue @@ -1,46 +1,10 @@ - - diff --git a/src/entities/ray/ui/ray-exception/ray-exception.vue b/src/entities/ray/ui/ray-exception/ray-exception.vue index 7af15f4e..1fceb65d 100644 --- a/src/entities/ray/ui/ray-exception/ray-exception.vue +++ b/src/entities/ray/ui/ray-exception/ray-exception.vue @@ -11,14 +11,15 @@ defineProps(); @@ -68,8 +66,8 @@ const exception: Ref = computed(() => @apply flex flex-col; } -.preview-card__link { - @apply cursor-pointer block dark:bg-gray-900 bg-gray-100 p-3 rounded-t-md border border-purple-300 dark:border-gray-400; +.preview-card__content { + @apply block dark:bg-gray-900 bg-gray-100 p-3 rounded-t-md border border-purple-300 dark:border-gray-400; } .preview-card__title { diff --git a/src/entities/sentry/ui/sentry-exception/sentry-exception.vue b/src/entities/sentry/ui/sentry-exception/sentry-exception.vue index 6bfaf955..7ce911f6 100644 --- a/src/entities/sentry/ui/sentry-exception/sentry-exception.vue +++ b/src/entities/sentry/ui/sentry-exception/sentry-exception.vue @@ -71,6 +71,6 @@ const exceptionFrames = computed(() => { } .sentry-exception__frames { - @apply border border-purple-200 dark:border-gray-600 flex-col justify-center w-full border border-purple-300 dark:border-gray-400 border-t-0 rounded-b-md overflow-hidden; + @apply flex-col justify-center w-full border border-purple-300 dark:border-gray-400 border-t-0 rounded-b-md overflow-hidden; } diff --git a/src/entities/smtp/ui/preview-card/preview-card.vue b/src/entities/smtp/ui/preview-card/preview-card.vue index 68244c14..84d9394e 100644 --- a/src/entities/smtp/ui/preview-card/preview-card.vue +++ b/src/entities/smtp/ui/preview-card/preview-card.vue @@ -13,8 +13,6 @@ const props = defineProps(); const dateFormat = computed(() => moment(props.event.date).fromNow()); -const eventLink = computed(() => `/smtp/${props.event.id}`); - const emailRecipient = computed( () => props?.event?.payload?.to?.[0]?.email || null ); @@ -22,7 +20,7 @@ const emailRecipient = computed( diff --git a/src/entities/var-dump/types.ts b/src/entities/var-dump/types.ts index bdef55a7..a509c1b9 100644 --- a/src/entities/var-dump/types.ts +++ b/src/entities/var-dump/types.ts @@ -5,10 +5,16 @@ export interface VarDump { }, context: { timestamp: number, - cli: { + cli?: { command_line: string, identifier: string }, + request?: { + identifier?: string, + method?: string, + uri?: string, + controller?: string, + }, source: { name: string, file: string, diff --git a/src/screens/ray/index.ts b/src/screens/ray/index.ts new file mode 100644 index 00000000..ed584959 --- /dev/null +++ b/src/screens/ray/index.ts @@ -0,0 +1 @@ +export * from './ui' diff --git a/src/screens/ray/ui/index.ts b/src/screens/ray/ui/index.ts new file mode 100644 index 00000000..33e1479b --- /dev/null +++ b/src/screens/ray/ui/index.ts @@ -0,0 +1 @@ +export * from './ray-page' diff --git a/src/screens/ray/ui/ray-page/index.ts b/src/screens/ray/ui/ray-page/index.ts new file mode 100644 index 00000000..31da5ef9 --- /dev/null +++ b/src/screens/ray/ui/ray-page/index.ts @@ -0,0 +1 @@ +export { default as RayPage } from './ray-page.vue'; diff --git a/src/screens/ray/ui/ray-page/ray-page.stories.ts b/src/screens/ray/ui/ray-page/ray-page.stories.ts new file mode 100644 index 00000000..9cd30116 --- /dev/null +++ b/src/screens/ray/ui/ray-page/ray-page.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from "@storybook/vue3"; +import { useRay } from "~/src/entities/ray"; +import { rayCallerMock } from '~/src/entities/ray/mocks'; +import RayPage from './ray-page.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "Screens/Ray/RayPage", + component: RayPage +} as Meta; + + +export const Default: StoryObj = { + args: { + event: normalizeRayEvent(rayCallerMock), + } +} diff --git a/src/screens/ray/ui/ray-page/ray-page.vue b/src/screens/ray/ui/ray-page/ray-page.vue new file mode 100644 index 00000000..f02c0e47 --- /dev/null +++ b/src/screens/ray/ui/ray-page/ray-page.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/screens/var-dump/index.ts b/src/screens/var-dump/index.ts new file mode 100644 index 00000000..ed584959 --- /dev/null +++ b/src/screens/var-dump/index.ts @@ -0,0 +1 @@ +export * from './ui' diff --git a/src/screens/var-dump/ui/index.ts b/src/screens/var-dump/ui/index.ts new file mode 100644 index 00000000..489079ec --- /dev/null +++ b/src/screens/var-dump/ui/index.ts @@ -0,0 +1 @@ +export * from './var-dump-page' diff --git a/src/screens/var-dump/ui/var-dump-page/index.ts b/src/screens/var-dump/ui/var-dump-page/index.ts new file mode 100644 index 00000000..72e59de8 --- /dev/null +++ b/src/screens/var-dump/ui/var-dump-page/index.ts @@ -0,0 +1 @@ +export { default as VarDumpPage } from './var-dump-page.vue'; diff --git a/src/screens/var-dump/ui/var-dump-page/var-dump-page.stories.ts b/src/screens/var-dump/ui/var-dump-page/var-dump-page.stories.ts new file mode 100644 index 00000000..344dc9e1 --- /dev/null +++ b/src/screens/var-dump/ui/var-dump-page/var-dump-page.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from "@storybook/vue3"; +import { useVarDump } from "~/src/entities/var-dump"; +import { varDumpObjectMock } from '~/src/entities/var-dump/mocks'; +import VarDump from './var-dump-page.vue'; + +const { normalizeVarDumpEvent } = useVarDump(); + +export default { + title: "Screens/VarDump/VarDumpPage", + component: VarDump +} as Meta; + + +export const Default: StoryObj = { + args: { + event: normalizeVarDumpEvent(varDumpObjectMock), + } +} diff --git a/src/screens/var-dump/ui/var-dump-page/var-dump-page.vue b/src/screens/var-dump/ui/var-dump-page/var-dump-page.vue new file mode 100644 index 00000000..4d538c6d --- /dev/null +++ b/src/screens/var-dump/ui/var-dump-page/var-dump-page.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/src/shared/ui/code-snippet/code-snippet.vue b/src/shared/ui/code-snippet/code-snippet.vue index a8ab3fbf..93465393 100644 --- a/src/shared/ui/code-snippet/code-snippet.vue +++ b/src/shared/ui/code-snippet/code-snippet.vue @@ -7,12 +7,13 @@ import { IconSvg } from "../icon-svg"; const CodeHighlight = highlightPlugin.component; type Props = { - code: string | unknown; - language: string; + code?: string; + language?: string; }; const props = withDefaults(defineProps(), { language: "plaintext", + code: "", }); const isCopied = ref(false); @@ -51,7 +52,7 @@ const copyCode = (): void => { :class="{ 'code-snippet__copy--active': isCopied }" @click="copyCode" > - + Copy diff --git a/src/shared/ui/icon-svg/icon-svg-originals/ray.svg b/src/shared/ui/icon-svg/icon-svg-originals/ray.svg new file mode 100644 index 00000000..b68ee46c --- /dev/null +++ b/src/shared/ui/icon-svg/icon-svg-originals/ray.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/shared/ui/icon-svg/icon-svg-originals/var_dump.svg b/src/shared/ui/icon-svg/icon-svg-originals/var_dump.svg new file mode 100644 index 00000000..d34553ad --- /dev/null +++ b/src/shared/ui/icon-svg/icon-svg-originals/var_dump.svg @@ -0,0 +1,17 @@ + + + + Artboard + Created with Sketch. + + + + + + + VAR + + + + + \ No newline at end of file diff --git a/src/shared/ui/icon-svg/icon-svg.vue b/src/shared/ui/icon-svg/icon-svg.vue index 49237ecc..ea9f63d8 100644 --- a/src/shared/ui/icon-svg/icon-svg.vue +++ b/src/shared/ui/icon-svg/icon-svg.vue @@ -154,6 +154,82 @@ defineProps(); /> + + + + + + + + + + + + + + + + + + + VAR + + + + + + (); + + + + + + + + diff --git a/src/shared/ui/preview-card/preview-card-header.vue b/src/shared/ui/preview-card/preview-card-header.vue index c7ef9b8b..7f33c7be 100644 --- a/src/shared/ui/preview-card/preview-card-header.vue +++ b/src/shared/ui/preview-card/preview-card-header.vue @@ -1,6 +1,6 @@ + +
@@ -216,6 +232,11 @@ $eventTypeColorsMap: ( } } +.preview-card-header__open { + @apply flex justify-end; + @apply h-4 md:h-5; +} + .preview-card-header__buttons { @apply flex justify-end; @apply gap-2 md:gap-3; diff --git a/src/shared/ui/value-dump/value-dump.vue b/src/shared/ui/value-dump/value-dump.vue index 3c56dd84..f13ccb16 100644 --- a/src/shared/ui/value-dump/value-dump.vue +++ b/src/shared/ui/value-dump/value-dump.vue @@ -1,13 +1,13 @@