project-nomad/admin/config/inertia.ts
Tom Boucher 4fadaecd33 fix: resolve hardcoded port references for Dozzle and update script
- Add DOZZLE_PORT env var (optional, defaults to 9999) so the admin
  app knows the actual Dozzle port when it's been remapped
- Pass DOZZLE_PORT through compose env → AdonisJS env → Inertia
  shared props → SettingsLayout sidebar link
- Remove hardcoded '9999' from SettingsLayout.tsx
- Fix update_nomad.sh success message to read admin port from the
  existing compose file instead of hardcoding 8080
- Also fixes the update script saying 'installation completed'
  instead of 'update completed'
2026-03-14 18:48:18 -04:00

39 lines
1.1 KiB
TypeScript

import KVStore from '#models/kv_store'
import { SystemService } from '#services/system_service'
import { defineConfig } from '@adonisjs/inertia'
import type { InferSharedProps } from '@adonisjs/inertia/types'
import env from '#start/env'
const inertiaConfig = defineConfig({
/**
* Path to the Edge view that will be used as the root view for Inertia responses
*/
rootView: 'inertia_layout',
/**
* Data that should be shared with all rendered pages
*/
sharedData: {
appVersion: () => SystemService.getAppVersion(),
environment: process.env.NODE_ENV || 'production',
aiAssistantName: async () => {
const customName = await KVStore.getValue('ai.assistantCustomName')
return (customName && customName.trim()) ? customName : 'AI Assistant'
},
dozzlePort: () => env.get('DOZZLE_PORT', 9999),
},
/**
* Options for the server-side rendering
*/
ssr: {
enabled: false,
entrypoint: 'inertia/app/ssr.tsx'
}
})
export default inertiaConfig
declare module '@adonisjs/inertia/types' {
export interface SharedProps extends InferSharedProps<typeof inertiaConfig> {}
}