Skip to content

Commit

Permalink
Merge pull request #169 from buggregator/issue/#168-http-dump-page
Browse files Browse the repository at this point in the history
Issue/#168 http dump page
  • Loading branch information
butschster authored Jun 13, 2024
2 parents 1036758 + 466472c commit 59d3e9b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion middleware/auth.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useProfileStore } from "~/src/shared/stores/profile"
export default defineNuxtRouteMiddleware(async (to) => {
const app = useNuxtApp()

if (!app.$appSettings.auth.enabled) {
if (!app.$appSettings?.auth?.enabled) {
return undefined
}

Expand Down
14 changes: 7 additions & 7 deletions pages/http-dumps/[id].vue → pages/http-dump/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,37 @@ onMounted(getEvent);
</script>

<template>
<main class="http-dumps-event">
<main class="http-dump-event">
<PageEventHeader title="Http dumps" :event-id="eventId" />

<div v-if="isLoading && !event" class="http-dumps-event__loading">
<div v-if="isLoading && !event" class="http-dump-event__loading">
<div></div>
<div></div>
<div></div>
</div>

<div class="http-dumps-event__body">
<div class="http-dump-event__body">
<HttpDumpPage v-if="event" :event="event" />
</div>
</main>
</template>

<style lang="scss" scoped>
@import "src/assets/mixins";
.http-dumps-event {
.http-dump-event {
@include layout;
}
.http-dumps-event__head {
.http-dump-event__head {
@include layout-head;
}
.http-dumps-event__loading {
.http-dump-event__loading {
@include loading;
@include layout-body;
}
.http-dumps-event__body {
.http-dump-event__body {
@include layout-body;
}
</style>
File renamed without changes.
2 changes: 1 addition & 1 deletion plugins/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineNuxtPlugin(async () => {
console.error('Server is not available!')
}

if (!settings.auth.enabled) {
if (!settings?.auth?.enabled) {
return {
provide: {
appSettings: settings,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/icon-svg/icon-svg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ defineProps<Props>();
</svg>

<svg
v-else-if="name === 'http-dumps'"
v-else-if="name === 'http-dump'"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 26 22"
>
Expand Down
10 changes: 6 additions & 4 deletions src/widgets/ui/layout-sidebar/layout-sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const logout = () => {
};
const path = computed(() => useRoute().path);
const isAuthEnabled = computed(() => app?.$appSettings?.auth?.enabled);
</script>

<template>
Expand Down Expand Up @@ -102,12 +104,12 @@ const path = computed(() => useRoute().path);
</NuxtLink>

<NuxtLink
to="/http-dumps"
to="/http-dump"
title="Http dumps"
class="layout-sidebar__link"
:class="{ 'router-link-active': path.includes('/http-dumps') }"
:class="{ 'router-link-active': path.includes('/http-dump') }"
>
<IconSvg class="layout-sidebar__link-icon" name="http-dumps" />
<IconSvg class="layout-sidebar__link-icon" name="http-dump" />
</NuxtLink>

<NuxtLink
Expand Down Expand Up @@ -152,7 +154,7 @@ const path = computed(() => useRoute().path);
</nav>

<div>
<div v-if="app.$appSettings.auth.enabled" class="layout-sidebar__profile">
<div v-if="isAuthEnabled" class="layout-sidebar__profile">
<div v-if="!isHidden" class="layout-sidebar__profile-dropdown">
<div class="profile-dropdown-item profile-dropdown-item--email">
{{ profile.email }}
Expand Down

0 comments on commit 59d3e9b

Please sign in to comment.