-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Issue/#131 open in the new page
- Loading branch information
Showing
34 changed files
with
967 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<script lang="ts" setup> | ||
import { computed, onMounted, ref } from "vue"; | ||
import { RayPage } from "~/src/screens/ray"; | ||
import { useFetch, useHead, useNuxtApp, useRoute, useRouter } from "#app"; // eslint-disable-line @conarti/feature-sliced/layers-slices | ||
import { PageHeader } from "~/src/widgets/ui"; | ||
import { useRay } from "~/src/entities/ray"; | ||
import type { RayDump } from "~/src/entities/ray/types"; | ||
import { useEvents } from "~/src/shared/lib/use-events"; | ||
import type { EventId, ServerEvent } from "~/src/shared/types"; | ||
const { normalizeRayEvent } = useRay(); | ||
const { params } = useRoute(); | ||
const { $authToken } = useNuxtApp(); | ||
const router = useRouter(); | ||
const eventId = params.id as EventId; | ||
useHead({ | ||
title: `Ray Dump > ${eventId} | Buggregator`, | ||
}); | ||
const { events } = useEvents(); | ||
const isLoading = ref(false); | ||
const serverEvent = ref<ServerEvent<RayDump> | null>(null); | ||
const event = computed(() => | ||
serverEvent.value ? normalizeRayEvent(serverEvent.value) : null | ||
); | ||
const onDelete = () => { | ||
events.removeById(eventId); | ||
router.push("/"); | ||
}; | ||
const getEvent = async () => { | ||
isLoading.value = true; | ||
await useFetch(events.getUrl(eventId), { | ||
headers: { "X-Auth-Token": $authToken.token || "" }, | ||
onResponse({ response: { _data } }) { | ||
serverEvent.value = _data; | ||
isLoading.value = false; | ||
}, | ||
onResponseError() { | ||
router.push("/404"); | ||
}, | ||
onRequestError() { | ||
router.push("/404"); | ||
}, | ||
}); | ||
}; | ||
onMounted(getEvent); | ||
</script> | ||
|
||
<template> | ||
<main class="ray-dump"> | ||
<PageHeader | ||
class="ray-dump__head" | ||
button-title="Delete event" | ||
@delete="onDelete" | ||
> | ||
<NuxtLink to="/">Home</NuxtLink> / | ||
<NuxtLink to="/ray">Ray Dump</NuxtLink> / | ||
<NuxtLink :disabled="true">{{ eventId }}</NuxtLink> | ||
</PageHeader> | ||
|
||
<div v-if="isLoading && !event" class="ray-dump__loading"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
|
||
<div v-if="event" class="ray-dump__body"> | ||
<RayPage :event="event" /> | ||
</div> | ||
</main> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "src/assets/mixins"; | ||
.ray-dump { | ||
@include layout; | ||
} | ||
.ray-dump__head { | ||
@include layout-head; | ||
} | ||
.ray-dump__loading { | ||
@include loading; | ||
@include layout-body; | ||
} | ||
.ray-dump__body { | ||
@include layout-body; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script lang="ts" setup> | ||
import { PageLayout } from "~/src/widgets/ui/page-layout"; | ||
import { PAGE_TYPES } from "~/src/shared/constants"; | ||
</script> | ||
|
||
<template> | ||
<PageLayout :type="PAGE_TYPES.RAY_DUMP" title="Ray Dumps" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<script lang="ts" setup> | ||
import { computed, onMounted, ref } from "vue"; | ||
import { VarDumpPage } from "~/src/screens/var-dump"; | ||
import { useFetch, useHead, useNuxtApp, useRoute, useRouter } from "#app"; // eslint-disable-line @conarti/feature-sliced/layers-slices | ||
import { PageHeader } from "~/src/widgets/ui"; | ||
import { useVarDump } from "~/src/entities/var-dump"; | ||
import type { VarDump } from "~/src/entities/var-dump/types"; | ||
import { useEvents } from "~/src/shared/lib/use-events"; | ||
import type { EventId, ServerEvent } from "~/src/shared/types"; | ||
const { normalizeVarDumpEvent } = useVarDump(); | ||
const { params } = useRoute(); | ||
const { $authToken } = useNuxtApp(); | ||
const router = useRouter(); | ||
const eventId = params.id as EventId; | ||
useHead({ | ||
title: `Var Dump > ${eventId} | Buggregator`, | ||
}); | ||
const { events } = useEvents(); | ||
const isLoading = ref(false); | ||
const serverEvent = ref<ServerEvent<VarDump> | null>(null); | ||
const event = computed(() => | ||
serverEvent.value ? normalizeVarDumpEvent(serverEvent.value) : null | ||
); | ||
const onDelete = () => { | ||
events.removeById(eventId); | ||
router.push("/"); | ||
}; | ||
const getEvent = async () => { | ||
isLoading.value = true; | ||
await useFetch(events.getUrl(eventId), { | ||
headers: { "X-Auth-Token": $authToken.token || "" }, | ||
onResponse({ response: { _data } }) { | ||
serverEvent.value = _data; | ||
isLoading.value = false; | ||
}, | ||
onResponseError() { | ||
router.push("/404"); | ||
}, | ||
onRequestError() { | ||
router.push("/404"); | ||
}, | ||
}); | ||
}; | ||
onMounted(getEvent); | ||
</script> | ||
|
||
<template> | ||
<main class="var-dump"> | ||
<PageHeader | ||
class="var-dump__head" | ||
button-title="Delete event" | ||
@delete="onDelete" | ||
> | ||
<NuxtLink to="/">Home</NuxtLink> / | ||
<NuxtLink to="/var-dump">Var Dump</NuxtLink> / | ||
<NuxtLink :disabled="true">{{ eventId }}</NuxtLink> | ||
</PageHeader> | ||
|
||
<div v-if="isLoading && !event" class="var-dump__loading"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
|
||
<div v-if="event" class="var-dump__body"> | ||
<VarDumpPage :event="event" /> | ||
</div> | ||
</main> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "src/assets/mixins"; | ||
.var-dump { | ||
@include layout; | ||
} | ||
.var-dump__head { | ||
@include layout-head; | ||
} | ||
.var-dump__loading { | ||
@include loading; | ||
@include layout-body; | ||
} | ||
.var-dump__body { | ||
@include layout-body; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script lang="ts" setup> | ||
import { PageLayout } from "~/src/widgets/ui/page-layout"; | ||
import { PAGE_TYPES } from "~/src/shared/constants"; | ||
</script> | ||
|
||
<template> | ||
<PageLayout :type="PAGE_TYPES.VAR_DUMP" title="Var Dumps" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.