Skip to content

Commit

Permalink
feat: add server cache tab to devtool (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz authored Apr 17, 2024
1 parent 5bc98a7 commit 997ede6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function generateWrangler(hub: { kv: boolean, database: boolean, blob: bo
].flat().join('\n')
}

export function addDevtoolsCustomTabs(nuxt: Nuxt, hub: { kv: boolean, database: boolean, blob: boolean }) {
export function addDevtoolsCustomTabs(nuxt: Nuxt, hub: { kv: boolean, database: boolean, blob: boolean, cache: boolean, analytics: boolean }) {
nuxt.hook('listen', (_, { url }) => {
hub.database && addCustomTab({
category: 'server',
Expand Down Expand Up @@ -61,5 +61,16 @@ export function addDevtoolsCustomTabs(nuxt: Nuxt, hub: { kv: boolean, database:
src: `https://admin.hub.nuxt.com/embed/blob?url=${url}`,
},
})

hub.cache && addCustomTab({
category: 'server',
name: 'hub-cache',
title: 'Hub Cache',
icon: 'i-ph-lightning',
view: {
type: 'iframe',
src: `https://admin.hub.nuxt.com/embed/cache?url=${url}`,
},
})
})
}

0 comments on commit 997ede6

Please sign in to comment.