mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 06:43:59 +00:00
fix
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
"start:api": "yarn workspace dbgate-api start | pino-pretty",
|
"start:api": "yarn workspace dbgate-api start | pino-pretty",
|
||||||
"start:api:json": "yarn workspace dbgate-api start",
|
"start:api:json": "yarn workspace dbgate-api start",
|
||||||
"start:app": "cd app && yarn start | pino-pretty",
|
"start:app": "cd app && yarn start | pino-pretty",
|
||||||
|
"start:app:singledb": "CONNECTIONS=con1 SERVER_con1=localhost ENGINE_con1=mysql@dbgate-plugin-mysql USER_con1=root PASSWORD_con1=Pwd2020Db SINGLE_CONNECTION=con1 SINGLE_DATABASE=Chinook yarn start:app",
|
||||||
"start:api:debug": "cross-env DEBUG=* yarn workspace dbgate-api start",
|
"start:api:debug": "cross-env DEBUG=* yarn workspace dbgate-api start",
|
||||||
"start:app:debug": "cd app && cross-env DEBUG=* yarn start",
|
"start:app:debug": "cd app && cross-env DEBUG=* yarn start",
|
||||||
"start:api:debug:ssh": "cross-env DEBUG=ssh yarn workspace dbgate-api start",
|
"start:api:debug:ssh": "cross-env DEBUG=ssh yarn workspace dbgate-api start",
|
||||||
|
|||||||
@@ -47,6 +47,15 @@
|
|||||||
const values = writable({});
|
const values = writable({});
|
||||||
|
|
||||||
// $: console.log('recreates', recreates);
|
// $: console.log('recreates', recreates);
|
||||||
|
|
||||||
|
$: currentScript = $values.deleteReferencesCascade
|
||||||
|
? [
|
||||||
|
...deleteCascadesScripts
|
||||||
|
.filter(({ script, title }) => $values[`deleteReferencesFor_${title}`] !== false)
|
||||||
|
.map(({ script, title }) => script),
|
||||||
|
sql,
|
||||||
|
].join('\n')
|
||||||
|
: sql;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<FormProviderCore {values}>
|
<FormProviderCore {values}>
|
||||||
@@ -54,18 +63,7 @@
|
|||||||
<div slot="header">Save changes</div>
|
<div slot="header">Save changes</div>
|
||||||
|
|
||||||
<div class="editor">
|
<div class="editor">
|
||||||
<SqlEditor
|
<SqlEditor {engine} value={currentScript} readOnly />
|
||||||
{engine}
|
|
||||||
value={$values.deleteReferencesCascade
|
|
||||||
? [
|
|
||||||
...deleteCascadesScripts
|
|
||||||
.filter(({ script, title }) => $values[`deleteReferencesFor_${title}`] !== false)
|
|
||||||
.map(({ script, title }) => script),
|
|
||||||
sql,
|
|
||||||
].join('\n')
|
|
||||||
: sql}
|
|
||||||
readOnly
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if !_.isEmpty(deleteCascadesScripts)}
|
{#if !_.isEmpty(deleteCascadesScripts)}
|
||||||
@@ -146,16 +144,7 @@
|
|||||||
disabled={isRecreated && !$values.allowRecreate}
|
disabled={isRecreated && !$values.allowRecreate}
|
||||||
on:click={e => {
|
on:click={e => {
|
||||||
closeCurrentModal();
|
closeCurrentModal();
|
||||||
onConfirm(
|
onConfirm(currentScript);
|
||||||
e.detail.deleteReferencesCascade
|
|
||||||
? [
|
|
||||||
...deleteCascadesScripts
|
|
||||||
.filter(({ script, title }) => e.detail[`deleteReferencesFor_${title}`] !== false)
|
|
||||||
.map(({ script, title }) => script),
|
|
||||||
sql,
|
|
||||||
].join('\n')
|
|
||||||
: null
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<FormStyledButton type="button" value="Close" on:click={closeCurrentModal} />
|
<FormStyledButton type="button" value="Close" on:click={closeCurrentModal} />
|
||||||
@@ -164,7 +153,7 @@
|
|||||||
value="Open script"
|
value="Open script"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
newQuery({
|
newQuery({
|
||||||
initialData: sql,
|
initialData: currentScript,
|
||||||
});
|
});
|
||||||
|
|
||||||
closeCurrentModal();
|
closeCurrentModal();
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
} else {
|
} else {
|
||||||
showModal(ConfirmSqlModal, {
|
showModal(ConfirmSqlModal, {
|
||||||
sql,
|
sql,
|
||||||
onConfirm: sqlOverride => handleConfirmSql(sqlOverride || sql),
|
onConfirm: confirmedSql => handleConfirmSql(confirmedSql),
|
||||||
engine: driver.engine,
|
engine: driver.engine,
|
||||||
deleteCascadesScripts,
|
deleteCascadesScripts,
|
||||||
skipConfirmSettingKey: deleteCascadesScripts?.length ? null : 'skipConfirm.tableDataSave',
|
skipConfirmSettingKey: deleteCascadesScripts?.length ? null : 'skipConfirm.tableDataSave',
|
||||||
|
|||||||
Reference in New Issue
Block a user