Skip to content

Commit b41cd98

Browse files
committed
feat: add settings ui
1 parent ec46538 commit b41cd98

File tree

14 files changed

+417
-87
lines changed

14 files changed

+417
-87
lines changed

packages/router/src/Exceptions/local/bun.lock

Lines changed: 201 additions & 37 deletions
Large diffs are not rendered by default.

packages/router/src/Exceptions/local/dist/main.js

Lines changed: 53 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/router/src/Exceptions/local/dist/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/router/src/Exceptions/local/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "vue-tsc -b && vite build"
88
},
99
"devDependencies": {
10-
"@nuxt/ui": "^4.2.1",
10+
"@nuxt/ui": "^4.3.0",
1111
"@shikijs/langs-precompiled": "^3.20.0",
1212
"@tailwindcss/vite": "^4.1.18",
1313
"@vitejs/plugin-vue": "^6.0.3",
@@ -23,9 +23,9 @@
2323
"typescript": "~5.9.3",
2424
"vite": "8.0.0-beta.2",
2525
"vite-plugin-singlefile": "^2.3.0",
26-
"vue": "^3.5.25",
26+
"vue": "^3.5.26",
2727
"vue-router": "^4.6.4",
28-
"vue-tsc": "^3.1.8"
28+
"vue-tsc": "^3.2.0"
2929
},
3030
"trustedDependencies": [
3131
"@tailwindcss/oxide"

packages/router/src/Exceptions/local/src/components/stacktrace/code-snippet.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { computed } from 'vue'
3-
import { openFileInEditor } from '../../editor'
43
import { highlight } from '../../highlight'
4+
import { openFileInEditor } from '../../settings/settings'
55
import type { CodeSnippet } from './stacktrace'
66
77
const $props = defineProps<{

packages/router/src/Exceptions/local/src/components/stacktrace/file-label.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { computed } from 'vue'
3-
import { openFileInEditor } from '../../editor'
3+
import { openFileInEditor } from '../../settings/settings'
44
55
const $props = defineProps<{
66
absoluteFile: string

packages/router/src/Exceptions/local/src/components/stacktrace/stacktrace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface StacktraceFrame {
2525
}
2626

2727
export interface Stacktrace {
28-
message: string
28+
message?: string
2929
exceptionClass: string
3030
frames: StacktraceFrame[]
3131
line: number

packages/router/src/Exceptions/local/src/editor.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/router/src/Exceptions/local/src/renderer.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Headers from './sections/headers.vue'
88
import RequestBody from './sections/request-body.vue'
99
import Stacktrace from './sections/stacktrace.vue'
1010
import Summary from './sections/summary.vue'
11+
import { settingsDialog } from './settings/settings'
1112
import { store } from './store'
1213
1314
const background = useTemplateRef('background')
@@ -41,6 +42,14 @@ onMounted(() => background.value!.style.backgroundImage = `url("${noise}")`)
4142
:exception="store.exception"
4243
class="mt-12"
4344
/>
45+
<u-footer class="mt-12">
46+
<u-button
47+
icon="tabler:adjustments"
48+
variant="secondary"
49+
class="text-dimmed hover:text-highlighted"
50+
@click="settingsDialog.open()"
51+
/>
52+
</u-footer>
4453
</main>
4554
</u-container>
4655
</u-app>

packages/router/src/Exceptions/local/src/sections/context.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const json = computed(() => JSON.stringify($props.context ?? '', null, 2))
1111

1212
<template>
1313
<card title="Exception context" icon="tabler:info-circle">
14-
<div v-if="context" class="p-2" v-html="highlight(json, 'json')" />
14+
<div
15+
v-if="Object.values(context ?? {}).length > 0"
16+
class="p-2"
17+
v-html="highlight(json, 'json')"
18+
/>
1519
<div v-else class="flex justify-center items-center p-8 pt-4 font-mono uppercase">
1620
<span class="text-muted">No context</span>
1721
</div>

0 commit comments

Comments
 (0)