Browse Source

Merge branch 'master' into feat/i18n

pull/256/head
աɨռɢӄաօռɢ 3 years ago committed by GitHub
parent
commit
eef4c6be7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 498
      packages/nc-gui/components/project/spreadsheet/editColumn/editColumn.vue
  2. 28
      packages/nc-gui/layouts/default.vue
  3. 918
      packages/nc-gui/pages/projects/index.vue
  4. 2
      packages/nc-lib-gui/package.json
  5. 12
      packages/nocodb/package-lock.json
  6. 12
      packages/nocodb/package.json
  7. 27
      packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts
  8. 2
      packages/nocodb/src/lib/sqlMgr/SqlMgr.ts

498
packages/nc-gui/components/project/spreadsheet/editColumn/editColumn.vue

@ -22,252 +22,263 @@
</v-col>
<div :class="{
editDisabled : !isEditable
}">
<v-col cols="12" v-if="relation">
<div class="caption">
<p class="mb-1">Foreign Key </p>
<v-icon small class="mt-n1">mdi-table</v-icon>
<span class="text-capitalize font-weight-bold body-1"> {{ relation._rtn }}</span>
<v-icon small
class="ml-3 mt-n1"
@click="deleteRelation('showDialog', column)"
color="error"
v-ge="['columns','fk-delete']"
>mdi-delete-forever
</v-icon>
<span v-if="relation.type=== 'virtual'" class="caption">(v)</span>
</div>
</v-col>
<template v-else>
<v-col cols="12">
<v-autocomplete
@change="onUiTypeChange"
v-model="newColumn.uidt"
hide-details
item-value="name"
item-text="name"
class="caption ui-type"
:class="{'primary lighten-5' : newColumn.uidt }"
label="Column type"
dense
outlined
:items="uiTypes">
<template v-slot:selection="{item}">
<div>
<v-icon color="grey darken-4" small class="mr-1">{{ item.icon }}</v-icon>
<span class="caption grey--text text--darken-4"> {{ item.name }}</span>
</div>
</template>
<v-col cols="12" v-if="relation">
<div class="caption">
<p class="mb-1">Foreign Key </p>
<v-icon small class="mt-n1">mdi-table</v-icon>
<span class="text-capitalize font-weight-bold body-1"> {{ relation._rtn }}</span>
<v-icon small
class="ml-3 mt-n1"
@click="deleteRelation('showDialog', column)"
color="error"
v-ge="['columns','fk-delete']"
>mdi-delete-forever
</v-icon>
<span v-if="relation.type=== 'virtual'" class="caption">(v)</span>
</div>
</v-col>
<template v-else>
<v-col cols="12">
<v-autocomplete
@change="onUiTypeChange"
v-model="newColumn.uidt"
hide-details
item-value="name"
item-text="name"
class="caption ui-type"
:class="{'primary lighten-5' : newColumn.uidt }"
label="Column type"
dense
outlined
:items="uiTypes">
<template v-slot:selection="{item}">
<div>
<v-icon color="grey darken-4" small class="mr-1">{{ item.icon }}</v-icon>
<span class="caption grey--text text--darken-4"> {{ item.name }}</span>
</div>
</template>
<template v-slot:item="{item}">
<div class="caption">
<v-icon small class="mr-1">{{ item.icon }}</v-icon>
{{ item.name }}
</div>
</template>
</v-autocomplete>
<template v-slot:item="{item}">
<div class="caption">
<v-icon small class="mr-1">{{ item.icon }}</v-icon>
{{ item.name }}
</div>
</template>
</v-autocomplete>
<!-- <v-list dense max-height="calc(100vh - 300px)" style="overflow: auto">-->
<!-- <v-list-item v-for="item in uiTypes" @click.stop :key="item">-->
<!-- <span class="caption">{{ item }}</span>-->
<!-- </v-list-item>-->
<!-- </v-list>-->
</v-col>
<!-- <v-list dense max-height="calc(100vh - 300px)" style="overflow: auto">-->
<!-- <v-list-item v-for="item in uiTypes" @click.stop :key="item">-->
<!-- <span class="caption">{{ item }}</span>-->
<!-- </v-list-item>-->
<!-- </v-list>-->
</v-col>
<template v-if="newColumn.uidt !== 'Formula'">
<v-col cols="12"
v-if="isLinkToAnotherRecord">
<template v-if="newColumn.uidt !== 'Formula'">
<v-col cols="12"
v-if="isLinkToAnotherRecord">
<linked-to-another-options
ref="relation"
:column="newColumn"
:nodes="nodes"
@onColumnSelect="onRelColumnSelect"
></linked-to-another-options>
</v-col>
<v-col cols="12"
v-if="isRelation">
<relation-options
ref="relation"
:column="newColumn"
:nodes="nodes"
@onColumnSelect="onRelColumnSelect"
></relation-options>
</v-col>
<linked-to-another-options
ref="relation"
:column="newColumn"
:nodes="nodes"
@onColumnSelect="onRelColumnSelect"
></linked-to-another-options>
</v-col>
<v-col cols="12"
v-if="isRelation">
<relation-options
ref="relation"
:column="newColumn"
:nodes="nodes"
@onColumnSelect="onRelColumnSelect"
></relation-options>
</v-col>
<v-col cols="12" v-if="isSelect">
<custom-select-options
v-model="newColumn.dtxp"
@input="newColumn.altered = newColumn.altered || 2"
></custom-select-options>
</v-col>
<v-col cols="12" v-if="isSelect">
<custom-select-options
v-model="newColumn.dtxp"
@input="newColumn.altered = newColumn.altered || 2"
></custom-select-options>
</v-col>
<template v-if="newColumn.cn && newColumn.uidt && !isLinkToAnotherRecord">
<v-col cols="12">
<v-container fluid class="wrapper">
<v-row>
<v-col cols="12">
<div class="d-flex justify-space-between caption">
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox
:disabled="newColumn.pk || !sqlUi.columnEditable(newColumn)"
class="mr-2 mt-0" dense hide-details label="NN"
@input="newColumn.altered = newColumn.altered || 2"
v-model="newColumn.rqd">
<template v-slot:label>
<span class="caption font-weight-bold">NN</span>
</template>
</v-checkbox>
</div>
</template>
<span>Not Null</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox
v-model="newColumn.pk"
:disabled="!sqlUi.columnEditable(newColumn)"
@input="newColumn.altered = newColumn.altered || 2"
class="mr-2 mt-0" dense hide-details label="PK">
<template v-slot:label>
<span class="caption font-weight-bold">PK</span>
</template>
</v-checkbox>
</div>
</template>
<span>Primary Key</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox
<template v-if="newColumn.cn && newColumn.uidt && !isLinkToAnotherRecord">
<v-col cols="12">
<v-container fluid class="wrapper">
<v-row>
<v-col cols="12">
<div class="d-flex justify-space-between caption">
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox
:disabled="newColumn.pk || !sqlUi.columnEditable(newColumn)"
class="mr-2 mt-0" dense hide-details label="NN"
@input="newColumn.altered = newColumn.altered || 2"
v-model="newColumn.rqd">
<template v-slot:label>
<span class="caption font-weight-bold">NN</span>
</template>
</v-checkbox>
</div>
</template>
<span>Not Null</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox
v-model="newColumn.pk"
:disabled="!sqlUi.columnEditable(newColumn)"
@input="newColumn.altered = newColumn.altered || 2"
class="mr-2 mt-0" dense hide-details label="PK">
<template v-slot:label>
<span class="caption font-weight-bold">PK</span>
</template>
</v-checkbox>
</div>
</template>
<span>Primary Key</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox
@input="newColumn.altered = newColumn.altered || 2"
:disabled="sqlUi.colPropUNDisabled(newColumn) || !sqlUi.columnEditable(newColumn)"
class="mr-2 mt-0" dense hide-details label="AI"
v-model="newColumn.ai">
<template v-slot:label>
<span class="caption font-weight-bold">AI</span>
</template>
</v-checkbox>
</div>
</template>
<span>Auto Increment</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox class="mr-2 mt-0" dense hide-details label="UN"
@input="newColumn.altered = newColumn.altered || 2"
:disabled="sqlUi.colPropUNDisabled(newColumn) || !sqlUi.columnEditable(newColumn)"
v-model="newColumn.un">
<template v-slot:label>
<span class="caption font-weight-bold">UN</span>
</template>
</v-checkbox>
</div>
</template>
<span>Unsigned</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox class="mr-2 mt-0" dense hide-details label="UN"
@input="newColumn.altered = newColumn.altered || 2"
:disabled=" sqlUi.colPropAuDisabled(newColumn) || !sqlUi.columnEditable(newColumn)"
v-model="newColumn.au">
<template v-slot:label>
<span class="caption font-weight-bold">AU</span>
</template>
</v-checkbox>
</div>
</template>
<span>Auto Update Timestamp</span>
</v-tooltip>
</div>
</v-col>
<v-col cols="12">
<v-autocomplete
v-model="newColumn.dt"
hide-details
class="caption data-type"
label="Type in Database"
dense
outlined
:items="dataTypes">
</v-autocomplete>
</v-col>
<v-col :cols="sqlUi.showScale(newColumn) && !isSelect ? 6 : 12">
<v-text-field
v-if="!isSelect"
dense
:disabled="sqlUi.getDefaultLengthIsDisabled(newColumn.dt) || !sqlUi.columnEditable(newColumn)"
class="caption"
label="Length / Values"
outlined
hide-details v-model="newColumn.dtxp"
@input="newColumn.altered = newColumn.altered || 2"
></v-text-field>
</v-col>
<v-col :cols="isSelect ?12 : 6" v-if="sqlUi.showScale(newColumn)">
<v-text-field
dense
:disabled=" !sqlUi.columnEditable(newColumn)"
class="caption"
label="Scale"
outlined
@input="newColumn.altered = newColumn.altered || 2"
hide-details v-model="newColumn.dtxs"></v-text-field>
</v-col>
<v-col cols="12">
<v-textarea v-model="newColumn.cdf"
@input="newColumn.altered = newColumn.altered || 2"
label="Default value"
:hint="sqlUi.getDefaultValueForDatatype(newColumn.dt)"
persistent-hint
rows="3"
outlined dense class="caption"></v-textarea>
</v-col>
</v-row>
</v-container>
:disabled="sqlUi.colPropUNDisabled(newColumn) || !sqlUi.columnEditable(newColumn)"
class="mr-2 mt-0" dense hide-details label="AI"
v-model="newColumn.ai">
<template v-slot:label>
<span class="caption font-weight-bold">AI</span>
</template>
</v-checkbox>
</div>
</template>
<span>Auto Increment</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox class="mr-2 mt-0" dense hide-details label="UN"
@input="newColumn.altered = newColumn.altered || 2"
:disabled="sqlUi.colPropUNDisabled(newColumn) || !sqlUi.columnEditable(newColumn)"
v-model="newColumn.un">
<template v-slot:label>
<span class="caption font-weight-bold">UN</span>
</template>
</v-checkbox>
</div>
</template>
<span>Unsigned</span>
</v-tooltip>
<v-tooltip bottom z-index="99999">
<template v-slot:activator="{on}">
<div v-on="on">
<v-checkbox class="mr-2 mt-0" dense hide-details label="UN"
@input="newColumn.altered = newColumn.altered || 2"
:disabled=" sqlUi.colPropAuDisabled(newColumn) || !sqlUi.columnEditable(newColumn)"
v-model="newColumn.au">
<template v-slot:label>
<span class="caption font-weight-bold">AU</span>
</template>
</v-checkbox>
</div>
</template>
<span>Auto Update Timestamp</span>
</v-tooltip>
</div>
</v-col>
<v-col cols="12">
<v-autocomplete
v-model="newColumn.dt"
hide-details
class="caption data-type"
label="Type in Database"
dense
outlined
:items="dataTypes">
</v-autocomplete>
</v-col>
<v-col :cols="sqlUi.showScale(newColumn) && !isSelect ? 6 : 12">
<v-text-field
v-if="!isSelect"
dense
:disabled="sqlUi.getDefaultLengthIsDisabled(newColumn.dt) || !sqlUi.columnEditable(newColumn)"
class="caption"
label="Length / Values"
outlined
hide-details v-model="newColumn.dtxp"
@input="newColumn.altered = newColumn.altered || 2"
></v-text-field>
</v-col>
<v-col :cols="isSelect ?12 : 6" v-if="sqlUi.showScale(newColumn)">
<v-text-field
dense
:disabled=" !sqlUi.columnEditable(newColumn)"
class="caption"
label="Scale"
outlined
@input="newColumn.altered = newColumn.altered || 2"
hide-details v-model="newColumn.dtxs"></v-text-field>
</v-col>
<v-col cols="12">
<v-textarea v-model="newColumn.cdf"
@input="newColumn.altered = newColumn.altered || 2"
label="Default value"
:hint="sqlUi.getDefaultValueForDatatype(newColumn.dt)"
persistent-hint
rows="3"
outlined dense class="caption"></v-textarea>
</v-col>
</v-row>
</v-container>
</v-col>
</template>
</template>
<template v-else>
<v-col cols12>
<v-autocomplete
label="Formula"
hide-details
class="caption formula-type"
outlined
dense
:items="formulas"
>
<template v-slot:item="{item}">
<span class="green--text text--darken-2 caption font-weight-regular">{{ item }}</span>
</template>
</v-autocomplete>
</v-col>
</template>
</template>
<template v-else>
<v-col cols12>
<v-autocomplete
label="Formula"
hide-details
class="caption formula-type"
outlined
dense
:items="formulas"
>
<template v-slot:item="{item}">
<span class="green--text text--darken-2 caption font-weight-regular">{{ item }}</span>
</template>
<div class="disabled-info" :class="{'d-none':isEditable}">
<v-alert dense type="warning" icon="info" class="caption mx-2" outlined>
This spreadsheet is connected to an SQLite DB.<br>
For production please see <a href="https://github.com/nocodb/nocodb#production-setup"
target="_blank">here</a>.
</v-alert>
</div>
</div>
</v-autocomplete>
</v-col>
</template>
</template>
</v-row>
</v-container>
@ -288,6 +299,7 @@ import CustomSelectOptions from "@/components/project/spreadsheet/editColumn/cus
import RelationOptions from "@/components/project/spreadsheet/editColumn/relationOptions";
import DlgLabelSubmitCancel from "@/components/utils/dlgLabelSubmitCancel";
import LinkedToAnotherOptions from "@/components/project/spreadsheet/editColumn/linkedToAnotherOptions";
import {SqliteUi} from "@/helpers/SqliteUi";
export default {
name: "editColumn",
@ -476,6 +488,9 @@ export default {
this.focusInput()
},
computed: {
isEditable() {
return !this.editColumn && this.sqlUi === SqliteUi;
},
dataTypes() {
return this.sqlUi.getDataTypeListForUiType(this.newColumn)
},
@ -542,4 +557,25 @@ export default {
border-radius: 4px;
}
.editDisabled {
position: relative;
.disabled-info {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
height: 100%;
top: 0;
bottom: 0;
background: var(--v-backgroundColor-base);
opacity: .9;
& > * {
opacity: 1;
}
}
}
</style>

28
packages/nc-gui/layouts/default.vue

@ -25,7 +25,10 @@
</v-btn>
</template>
Home
<span class="caption ml-1 font-weight-light">(v{{$store.state.project.projectInfo && $store.state.project.projectInfo.version}})</span>
<span
class="caption ml-1 font-weight-light">(v{{
$store.state.project.projectInfo && $store.state.project.projectInfo.version
}})</span>
</v-tooltip>
<template><span class="title"> {{ brandName }}</span>
</template>
@ -235,7 +238,7 @@
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-icon @dblclick="showAppStore=true" @click="changeTheme" v-on="on" size="20"
class="ml-3"> {{$vuetify.theme.dark ? 'mdi-weather-sunny':'mdi-weather-night'}}
class="ml-3"> {{ $vuetify.theme.dark ? 'mdi-weather-sunny' : 'mdi-weather-night' }}
</v-icon>
</template>
<span class="caption">
@ -645,6 +648,13 @@
</v-list-item>
<v-list-item v-if="isDashboard" dense @click="copyProjectInfo" v-ge="['Sign Out','']">
<v-list-item-title>
<v-icon small>info</v-icon>&nbsp; <span class="font-weight-regular">Copy Project info</span>
</v-list-item-title>
</v-list-item>
<v-list-item dense @click="MtdSignOut" v-ge="['Sign Out','']">
<v-list-item-title>
@ -824,6 +834,7 @@ import 'splitpanes/dist/splitpanes.css'
import XBtn from "../components/global/xBtn";
import ChangeEnv from "../components/changeEnv";
import Discord from "@/components/discord";
import {copyTextToClipboard} from "@/helpers/xutils";
export default {
components: {
@ -971,7 +982,7 @@ export default {
'xc-auth': this.$store.state.users.token
}
})).data;
const obj = Object.values(info).find(v => v.apiType === 'rest' ? v.swaggerUrl : v.gqlApiUrl);
const obj = Object.values(info).find(v => v.apiType === 'rest' ? v.swaggerUrl : v.gqlApiUrl);
this.swaggerOrGraphiqlUrl = obj.apiType === 'rest' ? obj.swaggerUrl : obj.gqlApiUrl
} catch (e) {
}
@ -1296,6 +1307,15 @@ export default {
},
changeTheme() {
this.$store.dispatch('windows/ActToggleDarkMode', !this.$store.state.windows.darkTheme);
},
async copyProjectInfo() {
try {
const data = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'ncProjectInfo'])
copyTextToClipboard(Object.entries(data).map(([k, v]) => `${k}: **${v}**`).join('\n'));
this.$toast.info('Copied project info to clipboard').goAway(3000);
} catch (e) {
this.$toast.error(e.message).goAway(3000);
}
}
},
@ -1344,7 +1364,7 @@ a {
animation-iteration-count: infinite;
}
/deep/ .v-toolbar__items{
/deep/ .v-toolbar__items {
align-items: center;
}

918
packages/nc-gui/pages/projects/index.vue

File diff suppressed because it is too large Load Diff

2
packages/nc-lib-gui/package.json

@ -1,6 +1,6 @@
{
"name": "nc-lib-gui",
"version": "0.1.216",
"version": "0.1.217",
"description": "> TODO: description",
"author": "“pranavxc” <pranavxc@gmail.com>",
"homepage": "https://gitlab.com/xgenecloud-ts/xgenecloud-ts#readme",

12
packages/nocodb/package-lock.json generated

@ -11126,9 +11126,9 @@
"integrity": "sha512-3AryS9uwa5NfISLxMciUonrH7YfXp+nlahB9T7girXIsLQrmwX4MdnuKs32akduCOGpKmjTJSWmATULbuMkbfw=="
},
"nc-help": {
"version": "0.1.104",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.1.104.tgz",
"integrity": "sha512-Tbn+RrRg8ELwXZtu+Lu0cunNKyB8fj7d91JAd5U2sjV3r+02PExpZ0PWT7bFwkNcEVDItQtAvzNl7uoLgchzzw==",
"version": "0.1.107",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.1.107.tgz",
"integrity": "sha512-Lgqx9i1Oxt4WGTU+D35KyhKpwWgmHKzI7P1yPcqhsWNrLjnR7XHEumjKT1UovyJo5zkkiMCFnaxOGbWCnM9waA==",
"requires": {
"axios": "^0.21.1",
"boxen": "^4.2.0",
@ -11203,9 +11203,9 @@
}
},
"nc-lib-gui": {
"version": "0.1.216",
"resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.1.216.tgz",
"integrity": "sha512-zVQlsjK0fCZnlX8k0Rky8RKCfdMYmcVDwn1Kjff1JdXMduuFunjGAz7zFDBJNBY8DflmJSrLyDvZ9GR9i+kMUw==",
"version": "0.1.217",
"resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.1.217.tgz",
"integrity": "sha512-SA2RuY8g62qa9d9FwGsxd+lk5eE11EzKDQMSQyCcJhMgDeMrNUsbpoVPCB/zxo71kR3MqQa1tNYO5uIgwx6vtg==",
"requires": {
"axios": "^0.19.2",
"body-parser": "^1.19.0",

12
packages/nocodb/package.json

@ -1,6 +1,6 @@
{
"name": "nocodb",
"version": "0.9.25",
"version": "0.9.26",
"description": "xc-cli",
"main": "dist/bundle.js",
"repository": "https://github.com/nocodb/nocodb/nc-cli",
@ -54,8 +54,9 @@
"postbuild": "npm run copy-files",
"copy-files": "copyfiles -u 1 \"src/**/*.ejs\" build/main && copyfiles -u 1 \"src/**/*.ejs\" build/module && copyfiles -u 1 \"src/**/*.ejs\" docker",
"docker:build": "EE=\"true-xc-test\" webpack --config docker/webpack.config.js",
"docker:image:build": "docker build . -t nocodb/nocodb:latest -t nocodb/nocodb:0.9.25 --no-cache",
"docker:image:deploy": "docker push nocodb/nocodb:latest && docker push nocodb/nocodb:0.9.25",
"docker:image:build": "docker build . -t nocodb/nocodb:latest -t nocodb/nocodb:0.9.26 --no-cache",
"docker:image:buildx": "docker buildx build . --platform linux/arm64 -t nocodb/nocodb:arm64 --no-cache",
"docker:image:deploy": "docker push nocodb/nocodb:latest && docker push nocodb/nocodb:0.9.26",
"docker:build:publish:image": "npm run build && npm run docker:build && npm run docker:image:build && npm run docker:image:deploy",
"docker:s3:image:build": "docker build . --file litestream/Dockerfile -t xgenecloud/xc-s3:latest -t xgenecloud/xc-s3:0.0.1 --no-cache",
"docker:s3:image:deploy": "docker push xgenecloud/xc-s3:latest && docker push xgenecloud/xc-s3:0.0.1",
@ -123,6 +124,7 @@
"handlebars": "^4.7.6",
"import-fresh": "^3.2.1",
"inflection": "^1.12.0",
"is-docker": "^2.2.1",
"js-beautify": "^1.11.0",
"json2csv": "^5.0.6",
"jsonfile": "^6.1.0",
@ -140,8 +142,8 @@
"mysql2": "^2.2.5",
"nanoid": "^3.1.20",
"nc-common": "0.0.6",
"nc-help": "^0.1.104",
"nc-lib-gui": "^0.1.216",
"nc-help": "^0.1.107",
"nc-lib-gui": "^0.1.217",
"nc-plugin": "^0.1.1",
"nodemailer": "^6.4.10",
"ora": "^4.0.4",

27
packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts

@ -38,17 +38,18 @@ import ExpressXcTsRoutesHm from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoute
import ExpressXcTsRoutesBt from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt";
import ExpressXcTsRoutes from "../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes";
import NcPluginMgr from "../plugins/NcPluginMgr";
import isDocker from 'is-docker';
// import packageInfo from '../../../../package.json'
// require('pkginfo')(module, 'version');
const XC_PLUGIN_DET = 'XC_PLUGIN_DET';
let packageInfo:any = {};
try{
packageInfo = JSON.parse(fs.readFileSync('package.json','utf8'));
}catch (_e) {}
let packageInfo: any = {};
try {
packageInfo = JSON.parse(fs.readFileSync('package.json', 'utf8'));
} catch (_e) {
}
export default class NcMetaMgr {
public projectConfigs = {};
@ -1083,6 +1084,9 @@ export default class NcMetaMgr {
case 'xcVirtualTableUpdate':
result = await this.xcVirtualTableUpdate(args);
break;
case 'ncProjectInfo':
result = await this.ncProjectInfo(args);
break;
case 'xcVirtualTableDelete':
result = await this.xcVirtualTableDelete(args, req);
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> {
return (await this.xcMeta.metaList(this.getProjectId(args), this.getDbAlias(args), 'nc_models', {
xcCondition: {

2
packages/nocodb/src/lib/sqlMgr/SqlMgr.ts

@ -820,7 +820,7 @@ export default class SqlMgr {
migrationSteps: 9999,
folder: this.currentProjectFolder
};
console.log(`Migration up args for '${op}'`, migrationArgs);
// console.log(`Migration up args for '${op}'`, migrationArgs);
await this.migrator().migrationsUp(migrationArgs);
}

Loading…
Cancel
Save