|
|
|
@ -402,11 +402,14 @@ export class RestApiBuilder extends BaseApiBuilder<Noco> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tables = args.tableNames.map(({ tn, _tn }) => ({ |
|
|
|
|
tn, |
|
|
|
|
type: args.type, |
|
|
|
|
_tn |
|
|
|
|
})); |
|
|
|
|
tables = args.tableNames |
|
|
|
|
.sort((a, b) => (a.tn || a._tn).localeCompare(b.tn || b._tn)) |
|
|
|
|
.map(({ tn, _tn }) => ({ |
|
|
|
|
tn, |
|
|
|
|
type: args.type, |
|
|
|
|
_tn, |
|
|
|
|
order: ++order |
|
|
|
|
})); |
|
|
|
|
tables.push(...relatedTableList.map(t => ({ tn: t }))); |
|
|
|
|
} else { |
|
|
|
|
tables = (await this.sqlClient.tableList())?.data?.list?.filter( |
|
|
|
@ -416,10 +419,14 @@ export class RestApiBuilder extends BaseApiBuilder<Noco> {
|
|
|
|
|
// enable extra
|
|
|
|
|
tables.push( |
|
|
|
|
...(await this.sqlClient.viewList())?.data?.list |
|
|
|
|
?.sort((a, b) => |
|
|
|
|
(a.view_name || a.tn).localeCompare(b.view_name || b.tn) |
|
|
|
|
) |
|
|
|
|
?.map(v => { |
|
|
|
|
this.viewsCount++; |
|
|
|
|
v.type = 'view'; |
|
|
|
|
v.tn = v.view_name; |
|
|
|
|
v.order = ++order; |
|
|
|
|
return v; |
|
|
|
|
}) |
|
|
|
|
.filter(v => { |
|
|
|
@ -523,7 +530,7 @@ export class RestApiBuilder extends BaseApiBuilder<Noco> {
|
|
|
|
|
this.dbAlias, |
|
|
|
|
'nc_models', |
|
|
|
|
{ |
|
|
|
|
order: ++order, |
|
|
|
|
order: table.order || ++order, |
|
|
|
|
view_order: 1, |
|
|
|
|
title: table.tn, |
|
|
|
|
alias: meta._tn, |
|
|
|
|