11<script setup lang="ts">
22import { useHead } from ' #app/composables/head'
3- import PanelSideNav from ' @vitejs/devtools-ui/components/PanelSideNav.vue'
4- import { useSideNav } from ' @vitejs/devtools-ui/composables/nav'
3+ import { toggleDark } from ' @vitejs/devtools-ui/composables/dark'
54import { useRefresh } from ' ./composables/refresh'
65import { connect , connectionState } from ' ./composables/rpc'
76import ' ./styles/global.css'
8- import ' @vitejs/devtools-ui/composables/dark'
97
108useHead ({
119 title: ' DevTools Self Inspect' ,
1210})
1311
1412connect ()
1513
16- useSideNav ([
17- {
18- title: ' RPC Functions' ,
19- to: ' /rpc' ,
20- icon: ' i-ph-plugs-connected-duotone' ,
21- },
22- {
23- title: ' Docks' ,
24- to: ' /docks' ,
25- icon: ' i-ph-layout-duotone' ,
26- },
27- {
28- title: ' Client Scripts' ,
29- to: ' /scripts' ,
30- icon: ' i-ph-code-duotone' ,
31- },
32- {
33- title: ' DevTools Plugins' ,
34- to: ' /plugins' ,
35- icon: ' i-ph-puzzle-piece-duotone' ,
36- },
37- ])
14+ const navItems = [
15+ { title: ' RPC Functions' , to: ' /rpc' , icon: ' i-ph-plugs-connected-duotone' },
16+ { title: ' Docks' , to: ' /docks' , icon: ' i-ph-layout-duotone' },
17+ { title: ' Client Scripts' , to: ' /scripts' , icon: ' i-ph-code-duotone' },
18+ { title: ' Plugins' , to: ' /plugins' , icon: ' i-ph-puzzle-piece-duotone' },
19+ ]
3820
3921const { refresh, loading } = useRefresh ()
4022 </script >
@@ -47,25 +29,45 @@ const { refresh, loading } = useRefresh()
4729 v-else-if =" !connectionState.connected"
4830 text =" Connecting..."
4931 />
50- <div v-else h-vh w-screen max-w-screen max-h-screen of-hidden >
51- <PanelSideNav />
52- <div pl-12 h-full flex =" ~ col" of-hidden >
53- <div flex =" ~ items-center justify-end" border =" b base" px3 h8 shrink-0 >
54- <button
55- p1.5 rounded
56- hover:bg-active
57- op50 hover:op100
58- transition-colors
59- title =" Refresh"
60- :disabled =" loading"
61- @click =" refresh"
62- >
63- <span i-ph-arrow-clockwise text-sm :class =" loading ? 'animate-spin' : ''" />
64- </button >
65- </div >
66- <div flex-1 of-auto >
67- <NuxtPage />
68- </div >
32+ <div v-else h-vh flex =" ~ col" of-hidden >
33+ <div flex =" ~ items-center" border =" b base" h9 shrink-0 >
34+ <NuxtLink
35+ v-for =" item in navItems" :key =" item.to"
36+ :to =" item.to"
37+ flex =" ~ items-center gap-1.5"
38+ px3 h-full text-sm
39+ op50 hover:op100 transition-colors
40+ border =" b-2 transparent"
41+ active-class =" op100! border-b-primary!"
42+ >
43+ <span :class =" item.icon" text-base />
44+ <span >{{ item.title }}</span >
45+ </NuxtLink >
46+ <div flex-1 />
47+ <button
48+ mr2 p1.5 rounded
49+ hover:bg-active
50+ op50 hover:op100
51+ transition-colors
52+ title =" Refresh"
53+ :disabled =" loading"
54+ @click =" refresh"
55+ >
56+ <span i-ph-arrow-clockwise text-sm :class =" loading ? 'animate-spin' : ''" />
57+ </button >
58+ <button
59+ mr2 p1.5 rounded
60+ hover:bg-active
61+ op50 hover:op100
62+ transition-colors
63+ title =" Toggle dark mode"
64+ @click =" toggleDark"
65+ >
66+ <span class =" i-ph-sun-duotone dark:i-ph-moon-duotone" text-sm />
67+ </button >
68+ </div >
69+ <div flex-1 of-auto >
70+ <NuxtPage />
6971 </div >
7072 </div >
7173</template >
0 commit comments