mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-24 15:15:59 +00:00
settings - default connection action
This commit is contained in:
@@ -27,9 +27,11 @@
|
|||||||
conid: connection._id,
|
conid: connection._id,
|
||||||
keepOpen: true,
|
keepOpen: true,
|
||||||
});
|
});
|
||||||
if (!config.runAsPortal) {
|
expandedConnections.update(x => _.uniq([...x, connection._id]));
|
||||||
expandedConnections.update(x => _.uniq([...x, connection._id]));
|
|
||||||
}
|
// if (!config.runAsPortal && getCurrentSettings()['defaultAction.connectionClick'] != 'connect') {
|
||||||
|
// expandedConnections.update(x => _.uniq([...x, connection._id]));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// closeMultipleTabs(x => x.tabComponent == 'ConnectionTab' && x.props?.conid == connection._id, true);
|
// closeMultipleTabs(x => x.tabComponent == 'ConnectionTab' && x.props?.conid == connection._id, true);
|
||||||
}
|
}
|
||||||
@@ -82,6 +84,7 @@
|
|||||||
extensions,
|
extensions,
|
||||||
getCurrentConfig,
|
getCurrentConfig,
|
||||||
getCurrentDatabase,
|
getCurrentDatabase,
|
||||||
|
getCurrentSettings,
|
||||||
getOpenedConnections,
|
getOpenedConnections,
|
||||||
getOpenedTabs,
|
getOpenedTabs,
|
||||||
openedConnections,
|
openedConnections,
|
||||||
@@ -101,6 +104,7 @@
|
|||||||
import ImportDatabaseDumpModal from '../modals/ImportDatabaseDumpModal.svelte';
|
import ImportDatabaseDumpModal from '../modals/ImportDatabaseDumpModal.svelte';
|
||||||
import { closeMultipleTabs } from '../widgets/TabsPanel.svelte';
|
import { closeMultipleTabs } from '../widgets/TabsPanel.svelte';
|
||||||
import AboutModal from '../modals/AboutModal.svelte';
|
import AboutModal from '../modals/AboutModal.svelte';
|
||||||
|
import { tick } from 'svelte';
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
export let passProps;
|
export let passProps;
|
||||||
@@ -128,9 +132,10 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = async () => {
|
||||||
const config = getCurrentConfig();
|
const config = getCurrentConfig();
|
||||||
if (config.runAsPortal) {
|
if (config.runAsPortal) {
|
||||||
|
await tick();
|
||||||
handleConnect();
|
handleConnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -142,7 +147,12 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOpenConnectionTab();
|
if (getCurrentSettings()['defaultAction.connectionClick'] == 'connect') {
|
||||||
|
await tick();
|
||||||
|
handleConnect();
|
||||||
|
} else {
|
||||||
|
handleOpenConnectionTab();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSqlRestore = () => {
|
const handleSqlRestore = () => {
|
||||||
|
|||||||
@@ -102,6 +102,18 @@ ORDER BY
|
|||||||
defaultValue="30"
|
defaultValue="30"
|
||||||
disabled={values['connection.autoRefresh'] === false}
|
disabled={values['connection.autoRefresh'] === false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="heading">Default actions</div>
|
||||||
|
<FormSelectField
|
||||||
|
label="Connection click"
|
||||||
|
name="defaultAction.connectionClick"
|
||||||
|
isNative
|
||||||
|
defaultValue='openDetails'
|
||||||
|
options={[
|
||||||
|
{ value: 'openDetails', label: 'Edit / open details' },
|
||||||
|
{ value: 'connect', label: 'Connect' },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
<svelte:fragment slot="2">
|
<svelte:fragment slot="2">
|
||||||
<div class="heading">Application theme</div>
|
<div class="heading">Application theme</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user