Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions src/client/components/NavBar.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<script setup lang="ts">
import {
toggleDark,
} from '../logic'
import { toggleDark } from '../logic'
import { usePayloadStore } from '../stores/payload'

const payload = usePayloadStore()
</script>

<template>
<nav h-54px flex="~ none gap-2" border="b main" pl-4 pr-4 font-light children:my-auto>
<slot />
<slot name="actions">
<div mx1 h-full w-0 border="r main" />
<a
text-lg icon-btn
href="https://github.com/antfu/vite-plugin-inspect"
target="_blank"
>
<div i-carbon-logo-github />
</a>
<button class="text-lg icon-btn" title="Toggle Dark Mode" @click="toggleDark()">
<span i-carbon-sun dark:i-carbon-moon />
</button>
<template v-if="!payload.metadata.embedded">
<div mx1 h-full w-0 border="r main" />
<a
text-lg icon-btn
href="https://github.com/antfu/vite-plugin-inspect"
target="_blank"
>
<div i-carbon-logo-github />
</a>
<button class="text-lg icon-btn" title="Toggle Dark Mode" @click="toggleDark()">
<span i-carbon-sun dark:i-carbon-moon />
</button>
</template>
</slot>
</nav>
</template>
4 changes: 3 additions & 1 deletion src/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export default defineConfig({
dts: join(__dirname, 'components.d.ts'),
}),
Unocss(),
Inspect(),
Inspect({
// embedded: true,
}),
AutoImport({
dts: join(__dirname, 'auto-imports.d.ts'),
imports: [
Expand Down
1 change: 1 addition & 0 deletions src/node/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class InspectContext {
}),
),
})),
embedded: this.options.embedded,
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/node/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,25 @@ export interface ViteInspectOptions {
* @default false
*/
silent?: boolean

/**
* Automatically open inspect page
*
* @default false
*/
open?: boolean

/**
* Remove version query `?v=xxx` and treat them as the same module
*
* @default true
*/
removeVersionQuery?: boolean

/**
* Enable embedded mode
*
* @default false
*/
embedded?: boolean
}
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface InstanceInfo {

export interface Metadata {
instances: InstanceInfo[]
embedded?: boolean
}

export interface RpcFunctions {
Expand Down