mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 10:36:01 +00:00
last used actions changed in switch button
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
import _ from 'lodash';
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
|
||||
import { extensions } from '../stores';
|
||||
import { extensions, lastUsedDefaultActions } from '../stores';
|
||||
import useEditorData from '../query/useEditorData';
|
||||
import TableEditor from '../tableeditor/TableEditor.svelte';
|
||||
import createActivator, { getActiveComponent } from '../utility/createActivator';
|
||||
@@ -56,6 +56,7 @@
|
||||
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
||||
import hasPermission from '../utility/hasPermission';
|
||||
import { changeTab, markTabSaved, markTabUnsaved } from '../utility/common';
|
||||
import { getBoolSettingsValue } from '../settings/settingsTools';
|
||||
|
||||
export let tabid;
|
||||
export let conid;
|
||||
@@ -63,6 +64,7 @@
|
||||
export let schemaName;
|
||||
export let pureName;
|
||||
export let objectTypeField = 'tables';
|
||||
export let tabPreviewMode;
|
||||
let domEditor;
|
||||
|
||||
let savedName;
|
||||
@@ -174,6 +176,13 @@
|
||||
icon={'icon table'}
|
||||
iconAfter="icon arrow-link"
|
||||
on:click={() => {
|
||||
if (tabPreviewMode && getBoolSettingsValue('defaultAction.useLastUsedAction', true)) {
|
||||
lastUsedDefaultActions.update(actions => ({
|
||||
...actions,
|
||||
[objectTypeField]: 'openTable',
|
||||
}));
|
||||
}
|
||||
|
||||
openNewTab({
|
||||
title: pureName,
|
||||
icon: objectTypeField == 'tables' ? 'img table' : 'img view',
|
||||
@@ -195,6 +204,13 @@
|
||||
icon="img sql-file"
|
||||
iconAfter="icon arrow-link"
|
||||
on:click={() => {
|
||||
if (tabPreviewMode && getBoolSettingsValue('defaultAction.useLastUsedAction', true)) {
|
||||
lastUsedDefaultActions.update(actions => ({
|
||||
...actions,
|
||||
[objectTypeField]: 'showSql',
|
||||
}));
|
||||
}
|
||||
|
||||
openNewTab({
|
||||
title: pureName,
|
||||
icon: 'img sql-file',
|
||||
|
||||
Reference in New Issue
Block a user