|
|
@ -38,17 +38,18 @@ import ExpressXcTsRoutesHm from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoute |
|
|
|
import ExpressXcTsRoutesBt from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt"; |
|
|
|
import ExpressXcTsRoutesBt from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt"; |
|
|
|
import ExpressXcTsRoutes from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes"; |
|
|
|
import ExpressXcTsRoutes from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes"; |
|
|
|
import NcPluginMgr from "../plugins/NcPluginMgr"; |
|
|
|
import NcPluginMgr from "../plugins/NcPluginMgr"; |
|
|
|
|
|
|
|
import isDocker from 'is-docker'; |
|
|
|
// import packageInfo from '../../../../package.json'
|
|
|
|
// import packageInfo from '../../../../package.json'
|
|
|
|
// require('pkginfo')(module, 'version');
|
|
|
|
// require('pkginfo')(module, 'version');
|
|
|
|
|
|
|
|
|
|
|
|
const XC_PLUGIN_DET = 'XC_PLUGIN_DET'; |
|
|
|
const XC_PLUGIN_DET = 'XC_PLUGIN_DET'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let packageInfo:any = {}; |
|
|
|
let packageInfo: any = {}; |
|
|
|
try{ |
|
|
|
try { |
|
|
|
packageInfo = JSON.parse(fs.readFileSync('package.json','utf8')); |
|
|
|
packageInfo = JSON.parse(fs.readFileSync('package.json', 'utf8')); |
|
|
|
}catch (_e) {} |
|
|
|
} catch (_e) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default class NcMetaMgr { |
|
|
|
export default class NcMetaMgr { |
|
|
|
public projectConfigs = {}; |
|
|
|
public projectConfigs = {}; |
|
|
@ -1083,6 +1084,9 @@ export default class NcMetaMgr { |
|
|
|
case 'xcVirtualTableUpdate': |
|
|
|
case 'xcVirtualTableUpdate': |
|
|
|
result = await this.xcVirtualTableUpdate(args); |
|
|
|
result = await this.xcVirtualTableUpdate(args); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'ncProjectInfo': |
|
|
|
|
|
|
|
result = await this.ncProjectInfo(args); |
|
|
|
|
|
|
|
break; |
|
|
|
case 'xcVirtualTableDelete': |
|
|
|
case 'xcVirtualTableDelete': |
|
|
|
result = await this.xcVirtualTableDelete(args, req); |
|
|
|
result = await this.xcVirtualTableDelete(args, req); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -3106,6 +3110,19 @@ export default class NcMetaMgr { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected async ncProjectInfo(args) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const config = this.projectConfigs[this.getProjectId(args)]; |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
node: process.version, |
|
|
|
|
|
|
|
arch: process.arch, |
|
|
|
|
|
|
|
platform: process.platform, |
|
|
|
|
|
|
|
docker: isDocker(), |
|
|
|
|
|
|
|
database: config.envs?.[process.env.NODE_ENV || 'dev']?.db?.[0]?.client, |
|
|
|
|
|
|
|
packageVersion: packageInfo?.version |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected async xcVirtualTableList(args): Promise<any> { |
|
|
|
protected async xcVirtualTableList(args): Promise<any> { |
|
|
|
return (await this.xcMeta.metaList(this.getProjectId(args), this.getDbAlias(args), 'nc_models', { |
|
|
|
return (await this.xcMeta.metaList(this.getProjectId(args), this.getDbAlias(args), 'nc_models', { |
|
|
|
xcCondition: { |
|
|
|
xcCondition: { |
|
|
|