mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 23:03:58 +00:00
fixed scenario after save table
This commit is contained in:
@@ -39,7 +39,6 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import registerCommand from '../commands/registerCommand';
|
import registerCommand from '../commands/registerCommand';
|
||||||
|
|
||||||
|
|
||||||
import { extensions } from '../stores';
|
import { extensions } from '../stores';
|
||||||
import useEditorData from '../query/useEditorData';
|
import useEditorData from '../query/useEditorData';
|
||||||
import TableEditor from '../tableeditor/TableEditor.svelte';
|
import TableEditor from '../tableeditor/TableEditor.svelte';
|
||||||
@@ -56,6 +55,7 @@
|
|||||||
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
||||||
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
||||||
import hasPermission from '../utility/hasPermission';
|
import hasPermission from '../utility/hasPermission';
|
||||||
|
import { changeTab } from '../utility/common';
|
||||||
|
|
||||||
export let tabid;
|
export let tabid;
|
||||||
export let conid;
|
export let conid;
|
||||||
@@ -116,7 +116,16 @@
|
|||||||
} else {
|
} else {
|
||||||
await apiCall('database-connections/sync-model', { conid, database });
|
await apiCall('database-connections/sync-model', { conid, database });
|
||||||
showSnackbarSuccess('Saved to database');
|
showSnackbarSuccess('Saved to database');
|
||||||
|
const isCreateTable = $editorValue?.base == null;
|
||||||
|
const tableName = _.pick($editorValue.current, ['pureName', 'schemaName']);
|
||||||
clearEditorData();
|
clearEditorData();
|
||||||
|
if (isCreateTable) {
|
||||||
|
changeTab(tabid, tab => ({
|
||||||
|
...tab,
|
||||||
|
title: tableName.pureName,
|
||||||
|
props: { ...tab.props, ...tableName },
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user