Skip to content

Commit

Permalink
Merge branch 'feature_addsource' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jincheny committed Nov 25, 2022
2 parents 5a704a2 + e33cf2f commit dc2f2d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion lcapWeb/src/pages/Data/NewData/components/Http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ import DataTable from '../../../components/NewTable';
import enums from '@/utils/enums.js';
import { toJS } from '@chaoswise/cw-mobx';
import { JSONEditor } from '@json-editor/json-editor';

const schemaTypeEnums = {
MySQL: 'mysql',
Postgres: 'postgresql',
达梦: 'dm',
MariaDB: 'mariadb',
SqlServer: 'sqlserver',
Oracle: 'oracle',
Clickhouse: 'clickhouse',
HTTP: 'HTTP',
};

export default Form.create({ name: 'FORM_IN_PROJECT_MODAL' })(function EditProjectModal({
form,
activeData = {},
Expand Down Expand Up @@ -76,7 +88,7 @@ export default Form.create({ name: 'FORM_IN_PROJECT_MODAL' })(function EditProje

let sendData = {
datasourceName: values.datasourceName,
schemaType: type,
schemaType: (schemaTypeEnums[type] || type === 'dm' ? type : enums[type])?.toLowerCase(),
connectData: JSON.stringify({
...values,
url,
Expand Down
2 changes: 1 addition & 1 deletion lcapWeb/src/pages/Data/NewData/components/nomal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default Form.create({ name: 'FORM_IN_PROJECT_MODAL' })(function EditProje
if (!err) {
let sendData = {
datasourceName: values.datasourceName,
schemaType: schemaTypeEnums[type] || type === 'dm' ? type : enums[type]?.toLowerCase(),
schemaType: (schemaTypeEnums[type] || type === 'dm' ? type : enums[type])?.toLowerCase(),
connectData: JSON.stringify(values),
};
setConnectState(true);
Expand Down

0 comments on commit dc2f2d2

Please sign in to comment.