project-nomad/admin/app/models/service.ts
Chris Sherwood 24f10ea3d5 feat: Use friendly app names on Dashboard with open source attribution
Updates the Dashboard to use the same user-friendly names as the Easy Setup
Wizard, giving credit to the open source projects powering each capability:

- Kiwix → Information Library (Powered by Kiwix)
- Kolibri → Education Platform (Powered by Kolibri)
- Open WebUI → AI Assistant (Powered by Open WebUI + Ollama)
- FlatNotes → Notes (Powered by FlatNotes)
- CyberChef → Data Tools (Powered by CyberChef)

Also reorders Dashboard cards to prioritize Core Capabilities first, with
Maps promoted to Core Capability status, followed by Additional Tools,
then system items (Easy Setup, Install Apps, Docs, Settings).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 16:43:32 -08:00

82 lines
1.9 KiB
TypeScript

import { BaseModel, belongsTo, column, hasMany, SnakeCaseNamingStrategy } from '@adonisjs/lucid/orm'
import type { BelongsTo, HasMany } from '@adonisjs/lucid/types/relations'
import { DateTime } from 'luxon'
export default class Service extends BaseModel {
static namingStrategy = new SnakeCaseNamingStrategy()
@column({ isPrimary: true })
declare id: number
@column()
declare service_name: string
@column()
declare container_image: string
@column()
declare container_command: string | null
@column()
declare container_config: string | null
@column()
declare friendly_name: string | null
@column()
declare description: string | null
@column()
declare powered_by: string | null
@column()
declare display_order: number | null
@column()
declare icon: string | null // must be a TablerIcons name to be properly rendered in the UI (e.g. "IconBrandDocker")
@column({
serialize(value) {
return Boolean(value)
},
})
declare installed: boolean
@column()
declare installation_status: 'idle' | 'installing' | 'error'
@column()
declare depends_on: string | null
// For services that are dependencies for other services - not intended to be installed directly by users
@column({
serialize(value) {
return Boolean(value)
},
})
declare is_dependency_service: boolean
@column()
declare ui_location: string | null
@column()
declare metadata: string | null
@column.dateTime({ autoCreate: true })
declare created_at: DateTime
@column.dateTime({ autoCreate: true, autoUpdate: true })
declare updated_at: DateTime | null
// Define a self-referential relationship for dependencies
@belongsTo(() => Service, {
foreignKey: 'depends_on',
})
declare dependency: BelongsTo<typeof Service>
@hasMany(() => Service, {
foreignKey: 'depends_on',
})
declare dependencies: HasMany<typeof Service>
}