mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 08:56:00 +00:00
configurable connection click, database click #959
This commit is contained in:
@@ -278,6 +278,30 @@ ORDER BY
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="4">
|
||||
<div class="heading">Default actions</div>
|
||||
|
||||
<FormSelectField
|
||||
label="Connection click"
|
||||
name="defaultAction.connectionClick"
|
||||
isNative
|
||||
defaultValue="connect"
|
||||
options={[
|
||||
{ value: 'openDetails', label: 'Edit / open details' },
|
||||
{ value: 'connect', label: 'Connect' },
|
||||
{ value: 'none', label: 'Do nothing' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<FormSelectField
|
||||
label="Database click"
|
||||
name="defaultAction.databaseClick"
|
||||
isNative
|
||||
defaultValue="switch"
|
||||
options={[
|
||||
{ value: 'switch', label: 'Switch database' },
|
||||
{ value: 'none', label: 'Do nothing' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<FormCheckboxField name="defaultAction.useLastUsedAction" label="Use last used action" defaultValue={true} />
|
||||
|
||||
<FormDefaultActionField
|
||||
|
||||
@@ -28,3 +28,11 @@ export function getStringSettingsValue(name, defaultValue) {
|
||||
if (res == null) return defaultValue;
|
||||
return res;
|
||||
}
|
||||
|
||||
export function getConnectionClickActionSetting(): 'connect' | 'openDetails' | 'none' {
|
||||
return getStringSettingsValue('defaultAction.connectionClick', 'connect');
|
||||
}
|
||||
|
||||
export function getDatabaseClickActionSetting(): 'switch' | 'none' {
|
||||
return getStringSettingsValue('defaultAction.databaseClick', 'switch');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user