File tree Expand file tree Collapse file tree
dev-demo/resources/cars_resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,12 +25,22 @@ import { logger } from '../../../adminforth/modules/logger.js';
2525import { afLogger } from '../../../adminforth/modules/logger.js' ;
2626import ForeignInlineListPlugin from '../../../plugins/adminforth-foreign-inline-list/index.js' ;
2727
28- export default function carsResourseTemplate ( resourceId : string , dataSource : string , pkFileldName : string ) {
28+ const CAR_RESOURCE_DB_LABELS = {
29+ sqlite : 'SQLite' ,
30+ mysql : 'MySQL' ,
31+ postgres : 'PostgreSQL' ,
32+ mongo : 'MongoDB' ,
33+ clickhouse : 'ClickHouse' ,
34+ } as const ;
35+
36+ type CarResourceDataSource = keyof typeof CAR_RESOURCE_DB_LABELS ;
37+
38+ export default function carsResourseTemplate ( resourceId : string , dataSource : CarResourceDataSource , pkFileldName : string ) {
2939 return {
3040 dataSource : dataSource ,
3141 table : 'cars' ,
3242 resourceId : resourceId ,
33- label : 'Cars' ,
43+ label : `Car - ${ CAR_RESOURCE_DB_LABELS [ dataSource ] } ` ,
3444 recordLabel : ( r ) => `🚘 ${ r . model } 🚗` ,
3545
3646 /*********************************************************************************
You can’t perform that action at this time.
0 commit comments