mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 17:36:01 +00:00
last used actions changed in switch button
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
import createActivator, { getActiveComponent } from '../utility/createActivator';
|
||||
import ToolStripContainer from '../buttons/ToolStripContainer.svelte';
|
||||
import { useConnectionInfo, useDatabaseInfo } from '../utility/metadataLoaders';
|
||||
import { extensions } from '../stores';
|
||||
import { extensions, lastUsedDefaultActions } from '../stores';
|
||||
import { findEngineDriver } from 'dbgate-tools';
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
import applyScriptTemplate, { getSupportedScriptTemplates } from '../utility/applyScriptTemplate';
|
||||
@@ -30,6 +30,7 @@
|
||||
import { changeTab } from '../utility/common';
|
||||
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
||||
import openNewTab from '../utility/openNewTab';
|
||||
import { getBoolSettingsValue } from '../settings/settingsTools';
|
||||
|
||||
export let tabid;
|
||||
export let appObjectData;
|
||||
@@ -40,6 +41,7 @@
|
||||
export let conid;
|
||||
export let database;
|
||||
export let objectTypeField;
|
||||
export let tabPreviewMode;
|
||||
|
||||
$: appObjectData = {
|
||||
schemaName,
|
||||
@@ -99,6 +101,13 @@
|
||||
icon="icon structure"
|
||||
iconAfter="icon arrow-link"
|
||||
on:click={() => {
|
||||
if (tabPreviewMode && getBoolSettingsValue('defaultAction.useLastUsedAction', true)) {
|
||||
lastUsedDefaultActions.update(actions => ({
|
||||
...actions,
|
||||
[objectTypeField]: 'openStructure',
|
||||
}));
|
||||
}
|
||||
|
||||
openNewTab({
|
||||
title: pureName,
|
||||
icon: 'img table-structure',
|
||||
@@ -119,6 +128,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',
|
||||
|
||||
@@ -82,13 +82,12 @@
|
||||
import ErrorMessageModal from '../modals/ErrorMessageModal.svelte';
|
||||
import { useConnectionInfo, useDatabaseInfo } from '../utility/metadataLoaders';
|
||||
import { scriptToSql } from 'dbgate-sqltree';
|
||||
import { extensions } from '../stores';
|
||||
import { extensions, lastUsedDefaultActions } from '../stores';
|
||||
import ConfirmSqlModal from '../modals/ConfirmSqlModal.svelte';
|
||||
import createActivator, { getActiveComponent } from '../utility/createActivator';
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
import { registerMenu } from '../utility/contextMenu';
|
||||
import { showSnackbarSuccess } from '../utility/snackbar';
|
||||
import StatusBarTabItem from '../widgets/StatusBarTabItem.svelte';
|
||||
import openNewTab from '../utility/openNewTab';
|
||||
import { onDestroy, setContext } from 'svelte';
|
||||
import { apiCall } from '../utility/api';
|
||||
@@ -109,6 +108,7 @@
|
||||
export let schemaName;
|
||||
export let pureName;
|
||||
export let isRawMode = false;
|
||||
export let tabPreviewMode;
|
||||
|
||||
export const activator = createActivator('TableDataTab', true);
|
||||
|
||||
@@ -266,6 +266,13 @@
|
||||
icon="icon structure"
|
||||
iconAfter="icon arrow-link"
|
||||
on:click={() => {
|
||||
if (tabPreviewMode && getBoolSettingsValue('defaultAction.useLastUsedAction', true)) {
|
||||
lastUsedDefaultActions.update(actions => ({
|
||||
...actions,
|
||||
tables: 'openStructure',
|
||||
}));
|
||||
}
|
||||
|
||||
openNewTab({
|
||||
title: pureName,
|
||||
icon: 'img table-structure',
|
||||
@@ -287,6 +294,13 @@
|
||||
icon="img sql-file"
|
||||
iconAfter="icon arrow-link"
|
||||
on:click={() => {
|
||||
if (tabPreviewMode && getBoolSettingsValue('defaultAction.useLastUsedAction', true)) {
|
||||
lastUsedDefaultActions.update(actions => ({
|
||||
...actions,
|
||||
tables: 'showSql',
|
||||
}));
|
||||
}
|
||||
|
||||
openNewTab({
|
||||
title: pureName,
|
||||
icon: 'img sql-file',
|
||||
|
||||
@@ -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