diff --git a/src/client/components/AppDetail.tsx b/src/client/components/AppDetail.tsx index f99da5b..77f5079 100644 --- a/src/client/components/AppDetail.tsx +++ b/src/client/components/AppDetail.tsx @@ -45,8 +45,8 @@ const OpenEmojiPicker = define('OpenEmojiPicker', { }) export function AppDetail({ app, render }: { app: App, render: () => void }) { - // Find global tools (shown as tabs on every app) - const tools = apps.filter(a => a.tool && a.global) + // Find tools that show on app pages (apps !== false) + const tools = apps.filter(a => a.tool && a.apps !== false) const selectedTab = getSelectedTab(app.name) return ( diff --git a/src/client/components/Nav.tsx b/src/client/components/Nav.tsx index d6d4942..930ceef 100644 --- a/src/client/components/Nav.tsx +++ b/src/client/components/Nav.tsx @@ -16,8 +16,8 @@ export function Nav({ app, render }: { app: App; render: () => void }) { navigate(tab === 'overview' ? `/app/${app.name}` : `/app/${app.name}/${tab}`) } - // Find global tools (shown as tabs on every app) - const tools = apps.filter(a => a.tool && a.global) + // Find tools that show on app pages (apps !== false) + const tools = apps.filter(a => a.tool && a.apps !== false) const titlecase = (s: string) => s.split(' ').map(part => part[0]?.toUpperCase() + part.slice(1)) return ( diff --git a/src/client/index.tsx b/src/client/index.tsx index e004c2f..5d14d03 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -10,7 +10,7 @@ const render = () => { renderApp(, document.getElementById('app')!) // Update tool iframes after DOM settles requestAnimationFrame(() => { - const tools = apps.filter(a => a.tool && a.global) + const tools = apps.filter(a => a.tool && a.apps !== false) updateToolIframes(getSelectedTab(selectedApp), tools, selectedApp) }) } diff --git a/src/server/api/apps.ts b/src/server/api/apps.ts index 6c9ee6c..863c193 100644 --- a/src/server/api/apps.ts +++ b/src/server/api/apps.ts @@ -26,9 +26,9 @@ function convert(app: BackendApp): SharedApp { router.sse('/stream', (send) => { const broadcast = () => { const apps: SharedApp[] = allApps().map(({ - name, state, icon, error, port, started, logs, tool, global: global_, tunnelEnabled, tunnelUrl + name, state, icon, error, port, started, logs, tool, apps: apps_, dashboard, tunnelEnabled, tunnelUrl }) => ({ - name, state, icon, error, port, started, logs, tool, global: global_, tunnelEnabled, tunnelUrl, + name, state, icon, error, port, started, logs, tool, apps: apps_, dashboard, tunnelEnabled, tunnelUrl, })) send(apps) } diff --git a/src/server/apps.ts b/src/server/apps.ts index 210325d..03de5df 100644 --- a/src/server/apps.ts +++ b/src/server/apps.ts @@ -159,8 +159,9 @@ export function registerApp(dir: string) { const state: AppState = error ? 'invalid' : 'stopped' const icon = pkg.toes?.icon ?? DEFAULT_EMOJI const tool = pkg.toes?.tool - const global_ = pkg.toes?.global - _apps.set(dir, { name: dir, state, icon, error, tool, global: global_ }) + const apps = pkg.toes?.apps + const dashboard = pkg.toes?.dashboard + _apps.set(dir, { name: dir, state, icon, error, tool, apps, dashboard }) update() emit({ type: 'app:create', app: dir }) if (!error) { @@ -380,8 +381,9 @@ function discoverApps() { const state: AppState = error ? 'invalid' : 'stopped' const icon = pkg.toes?.icon ?? DEFAULT_EMOJI const tool = pkg.toes?.tool - const global_ = pkg.toes?.global - _apps.set(dir, { name: dir, state, icon, error, tool, global: global_ }) + const apps = pkg.toes?.apps + const dashboard = pkg.toes?.dashboard + _apps.set(dir, { name: dir, state, icon, error, tool, apps, dashboard }) } update() } diff --git a/src/shared/types.ts b/src/shared/types.ts index a24b714..64984da 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -28,7 +28,8 @@ export type App = { started?: number logs?: LogLine[] tool?: boolean | string - global?: boolean + apps?: boolean + dashboard?: boolean tunnelEnabled?: boolean tunnelUrl?: string }