mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 10:25:59 +00:00
Merge branch 'master' of https://github.com/dbgate/dbgate
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
createQuickExportHandlerRef,
|
||||
registerQuickExportHandler,
|
||||
} from '../buttons/ToolStripExportButton.svelte';
|
||||
import { _t } from '../translations';
|
||||
|
||||
let loadedRows = [];
|
||||
let loadedAll = false;
|
||||
@@ -191,8 +192,8 @@
|
||||
<SelectField
|
||||
isNative
|
||||
options={[
|
||||
{ label: 'Recent logs', value: 'recent' },
|
||||
{ label: 'Choose date', value: 'date' },
|
||||
{ label: _t('logs.recentLogs', { defaultMessage: 'Recent logs' }), value: 'recent' },
|
||||
{ label: _t('logs.chooseDate', { defaultMessage: 'Choose date' }), value: 'date' },
|
||||
]}
|
||||
value={mode}
|
||||
on:change={e => {
|
||||
@@ -202,7 +203,7 @@
|
||||
/>
|
||||
|
||||
{#if mode === 'recent'}
|
||||
<div class="filter-label ml-2">Auto-scroll</div>
|
||||
<div class="filter-label ml-2">{_t('logs.autoScroll', { defaultMessage: 'Auto-scroll' })}</div>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={autoScroll}
|
||||
@@ -213,7 +214,7 @@
|
||||
{/if}
|
||||
|
||||
{#if mode === 'date'}
|
||||
<div class="filter-label">Date:</div>
|
||||
<div class="filter-label">{_t('logs.date', { defaultMessage: 'Date:' })}</div>
|
||||
<DateRangeSelector
|
||||
onChange={value => {
|
||||
dateFilter = value;
|
||||
@@ -225,12 +226,12 @@
|
||||
data-testid="AdminAuditLogTab_addFilter"
|
||||
icon="icon filter"
|
||||
menu={[
|
||||
{ text: 'Connection ID', onClick: () => filterBy('conid') },
|
||||
{ text: 'Database', onClick: () => filterBy('database') },
|
||||
{ text: 'Engine', onClick: () => filterBy('engine') },
|
||||
{ text: 'Message code', onClick: () => filterBy('msgcode') },
|
||||
{ text: 'Caller', onClick: () => filterBy('caller') },
|
||||
{ text: 'Name', onClick: () => filterBy('name') },
|
||||
{ text: _t('logs.connectionId', { defaultMessage: 'Connection ID' }), onClick: () => filterBy('conid') },
|
||||
{ text: _t('logs.database', { defaultMessage: 'Database' }), onClick: () => filterBy('database') },
|
||||
{ text: _t('logs.engine', { defaultMessage: 'Engine' }), onClick: () => filterBy('engine') },
|
||||
{ text: _t('logs.messageCode', { defaultMessage: 'Message code' }), onClick: () => filterBy('msgcode') },
|
||||
{ text: _t('logs.caller', { defaultMessage: 'Caller' }), onClick: () => filterBy('caller') },
|
||||
{ text: _t('logs.name', { defaultMessage: 'Name' }), onClick: () => filterBy('name') },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
@@ -259,15 +260,15 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80px">Date</th>
|
||||
<th>Time</th>
|
||||
<th>Code</th>
|
||||
<th>Message</th>
|
||||
<th>Connection</th>
|
||||
<th>Database</th>
|
||||
<th>Engine</th>
|
||||
<th>Caller</th>
|
||||
<th>Name</th>
|
||||
<th style="width:80px">{_t('logs.dateTab', { defaultMessage: 'Date' })}</th>
|
||||
<th>{_t('logs.timeTab', { defaultMessage: 'Time' })}</th>
|
||||
<th>{_t('logs.codeTab', { defaultMessage: 'Code' })}</th>
|
||||
<th>{_t('logs.messageTab', { defaultMessage: 'Message' })}</th>
|
||||
<th>{_t('logs.connectionTab', { defaultMessage: 'Connection' })}</th>
|
||||
<th>{_t('logs.databaseTab', { defaultMessage: 'Database' })}</th>
|
||||
<th>{_t('logs.engineTab', { defaultMessage: 'Engine' })}</th>
|
||||
<th>{_t('logs.callerTab', { defaultMessage: 'Caller' })}</th>
|
||||
<th>{_t('logs.nameTab', { defaultMessage: 'Name' })}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -299,14 +300,14 @@
|
||||
<TabControl
|
||||
isInline
|
||||
tabs={_.compact([
|
||||
{ label: 'Details', slot: 1 },
|
||||
{ label: _t('logs.details', { defaultMessage: 'Details' }), slot: 1 },
|
||||
{ label: 'JSON', slot: 2 },
|
||||
])}
|
||||
>
|
||||
<svelte:fragment slot="1">
|
||||
<div class="details-wrap">
|
||||
<div class="row">
|
||||
<div>Message code:</div>
|
||||
<div>{_t('logs.messageCode', { defaultMessage: 'Message code:' })}</div>
|
||||
{#if mode == 'date'}
|
||||
<Link onClick={() => doSetFilter('msgcode', [row.msgcode])}>{row.msgcode || 'N/A'}</Link>
|
||||
{:else}
|
||||
@@ -314,15 +315,15 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Message:</div>
|
||||
<div>{_t('logs.message', { defaultMessage: 'Message:' })}</div>
|
||||
{row.msg}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Time:</div>
|
||||
<div>{_t('logs.time', { defaultMessage: 'Time:' })}</div>
|
||||
<b>{row.time ? format(new Date(parseInt(row.time)), 'yyyy-MM-dd HH:mm:ss') : ''}</b>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Caller:</div>
|
||||
<div>{_t('logs.caller', { defaultMessage: 'Caller:' })}</div>
|
||||
{#if mode == 'date'}
|
||||
<Link onClick={() => doSetFilter('caller', [row.caller])}>{row.caller || 'N/A'}</Link>
|
||||
{:else}
|
||||
@@ -330,7 +331,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Name:</div>
|
||||
<div>{_t('logs.name', { defaultMessage: 'Name:' })}</div>
|
||||
{#if mode == 'date'}
|
||||
<Link onClick={() => doSetFilter('name', [row.name])}>{row.name || 'N/A'}</Link>
|
||||
{:else}
|
||||
@@ -339,7 +340,7 @@
|
||||
</div>
|
||||
{#if row.conid}
|
||||
<div class="row">
|
||||
<div>Connection ID:</div>
|
||||
<div>{_t('logs.connectionId', { defaultMessage: 'Connection ID:' })}</div>
|
||||
{#if mode == 'date'}
|
||||
<Link onClick={() => doSetFilter('conid', [row.conid])}
|
||||
>{formatPossibleUuid(row.conid)}</Link
|
||||
@@ -351,7 +352,7 @@
|
||||
{/if}
|
||||
{#if row.database}
|
||||
<div class="row">
|
||||
<div>Database:</div>
|
||||
<div>{_t('logs.database', { defaultMessage: 'Database:' })}</div>
|
||||
{#if mode == 'date'}
|
||||
<Link onClick={() => doSetFilter('database', [row.database])}>{row.database}</Link>
|
||||
{:else}
|
||||
@@ -361,7 +362,7 @@
|
||||
{/if}
|
||||
{#if row.engine}
|
||||
<div class="row">
|
||||
<div>Engine:</div>
|
||||
<div>{_t('logs.engine', { defaultMessage: 'Engine:' })}</div>
|
||||
{#if mode == 'date'}
|
||||
<Link onClick={() => doSetFilter('engine', [row.engine])}>{row.engine}</Link>
|
||||
{:else}
|
||||
@@ -381,13 +382,13 @@
|
||||
{/each}
|
||||
{#if !loadedRows?.length && mode === 'date'}
|
||||
<tr>
|
||||
<td colspan="6">No data for selected date</td>
|
||||
<td colspan="6">{_t('logs.noDataForSelectedDate', { defaultMessage: "No data for selected date" })}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{#if !loadedAll && mode === 'date'}
|
||||
{#key loadedRows}
|
||||
<tr>
|
||||
<td colspan="6" bind:this={domLoadNext}>Loading next rows... </td>
|
||||
<td colspan="6" bind:this={domLoadNext}>{_t('logs.loadingNextRows', { defaultMessage: "Loading next rows..." })}</td>
|
||||
</tr>
|
||||
{/key}
|
||||
{/if}
|
||||
@@ -402,7 +403,7 @@
|
||||
data-testid="AdminAuditLogTab_refreshButton"
|
||||
on:click={() => {
|
||||
reloadData();
|
||||
}}>Refresh</ToolStripButton
|
||||
}}>{_t('logs.refresh', { defaultMessage: 'Refresh' })}</ToolStripButton
|
||||
>
|
||||
<ToolStripExportButton {quickExportHandlerRef} />
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
import CommandModal from '../modals/CommandModal.svelte';
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import { commandsCustomized } from '../stores';
|
||||
import { _tval } from '../translations';
|
||||
|
||||
$: commandList = _.sortBy(_.values($commandsCustomized), ['category', 'name']);
|
||||
let filter;
|
||||
@@ -27,7 +28,9 @@
|
||||
<div class="table-wrapper">
|
||||
<TableControl
|
||||
clickable
|
||||
rows={commandList.filter(cmd => filterName(filter, cmd['category'], cmd['name'], cmd['keyText'], cmd['id']))}
|
||||
rows={commandList.filter(cmd =>
|
||||
filterName(filter, _tval(cmd['category']), _tval(cmd['name']), _tval(cmd['keyText']), cmd['id'])
|
||||
)}
|
||||
columns={[
|
||||
{ header: 'Category', fieldName: 'category' },
|
||||
{ header: 'Name', fieldName: 'name' },
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
folder: 'diagrams',
|
||||
format: 'json',
|
||||
fileExtension: 'diagram',
|
||||
defaultTeamFolder: true,
|
||||
|
||||
undoRedo: true,
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
fileExtension: 'impexp',
|
||||
|
||||
// undoRedo: true,
|
||||
defaultTeamFolder: true,
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -53,6 +54,7 @@
|
||||
import uuidv1 from 'uuid/v1';
|
||||
import { tick } from 'svelte';
|
||||
import { showSnackbarError } from '../utility/snackbar';
|
||||
import { _t } from '../translations';
|
||||
|
||||
let busy = false;
|
||||
let executeNumber = 0;
|
||||
@@ -288,21 +290,21 @@
|
||||
/>
|
||||
|
||||
{#if busy}
|
||||
<LoadingInfo wrapper message="Processing import/export ..." />
|
||||
<LoadingInfo wrapper message={_t('importExport.processingImportExport', { defaultMessage: "Processing import/export ..." })} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<svelte:fragment slot="2">
|
||||
<WidgetColumnBar>
|
||||
<WidgetColumnBarItem
|
||||
title="Output files"
|
||||
title={_t('importExport.outputFiles', { defaultMessage: "Output files" })}
|
||||
name="output"
|
||||
height="20%"
|
||||
data-testid="ImportExportTab_outputFiles"
|
||||
>
|
||||
<RunnerOutputFiles {runnerId} {executeNumber} />
|
||||
</WidgetColumnBarItem>
|
||||
<WidgetColumnBarItem title="Messages" name="messages">
|
||||
<WidgetColumnBarItem title={_t('importExport.messages', { defaultMessage: "Messages" })} name="messages">
|
||||
<SocketMessageView
|
||||
eventName={runnerId ? `runner-info-${runnerId}` : null}
|
||||
{executeNumber}
|
||||
@@ -311,16 +313,16 @@
|
||||
/>
|
||||
</WidgetColumnBarItem>
|
||||
<WidgetColumnBarItem
|
||||
title="Preview"
|
||||
title={_t('importExport.preview', { defaultMessage: "Preview" })}
|
||||
name="preview"
|
||||
skip={!$previewReaderStore}
|
||||
data-testid="ImportExportTab_preview"
|
||||
>
|
||||
<PreviewDataGrid reader={$previewReaderStore} />
|
||||
</WidgetColumnBarItem>
|
||||
<WidgetColumnBarItem title="Advanced configuration" name="config" collapsed>
|
||||
<FormTextField label="Schedule" name="schedule" />
|
||||
<FormTextField label="Start variable index" name="startVariableIndex" />
|
||||
<WidgetColumnBarItem title={_t('importExport.advancedConfiguration', { defaultMessage: "Advanced configuration" })} name="config" collapsed>
|
||||
<FormTextField label={_t('importExport.schedule', { defaultMessage: "Schedule" })} name="schedule" />
|
||||
<FormTextField label={_t('importExport.startVariableIndex', { defaultMessage: "Start variable index" })} name="startVariableIndex" />
|
||||
</WidgetColumnBarItem>
|
||||
</WidgetColumnBar>
|
||||
</svelte:fragment>
|
||||
@@ -329,15 +331,15 @@
|
||||
<svelte:fragment slot="toolstrip">
|
||||
{#if busy}
|
||||
<ToolStripButton icon="icon stop" on:click={handleCancel} data-testid="ImportExportTab_stopButton"
|
||||
>Stop</ToolStripButton
|
||||
>{_t('importExport.stop', { defaultMessage: "Stop" })}</ToolStripButton
|
||||
>
|
||||
{:else}
|
||||
<ToolStripButton on:click={handleExecute} icon="icon run" data-testid="ImportExportTab_executeButton"
|
||||
>Run</ToolStripButton
|
||||
>{_t('importExport.run', { defaultMessage: "Run" })}</ToolStripButton
|
||||
>
|
||||
{/if}
|
||||
<ToolStripButton icon="img shell" on:click={handleGenerateScript} data-testid="ImportExportTab_generateScriptButton"
|
||||
>Generate script</ToolStripButton
|
||||
>{_t('importExport.generateScript', { defaultMessage: "Generate script" })}</ToolStripButton
|
||||
>
|
||||
<ToolStripSaveButton idPrefix="impexp" />
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
findReplace: true,
|
||||
executeAdditionalCondition: () => getCurrentEditor()?.hasConnection() && hasPermission('dbops/query'),
|
||||
copyPaste: true,
|
||||
defaultTeamFolder: true,
|
||||
});
|
||||
registerCommand({
|
||||
id: 'query.executeCurrent',
|
||||
@@ -123,8 +124,9 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { getContext, onDestroy, onMount, tick } from 'svelte';
|
||||
import { getContext, onDestroy, onMount, setContext, tick } from 'svelte';
|
||||
import sqlFormatter from 'sql-formatter';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
import VerticalSplitter from '../elements/VerticalSplitter.svelte';
|
||||
import SqlEditor from '../query/SqlEditor.svelte';
|
||||
@@ -166,6 +168,7 @@
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import hasPermission from '../utility/hasPermission';
|
||||
import QueryAiAssistant from '../ai/QueryAiAssistant.svelte';
|
||||
import { getCurrentSettings } from '../stores';
|
||||
|
||||
export let tabid;
|
||||
export let conid;
|
||||
@@ -175,6 +178,9 @@
|
||||
|
||||
export const activator = createActivator('QueryTab', false);
|
||||
|
||||
const collapsedLeftColumnStore = writable(getCurrentSettings()['sqlEditor.hideColumnsPanel'] ?? false);
|
||||
setContext('collapsedLeftColumnStore', collapsedLeftColumnStore);
|
||||
|
||||
const QUERY_PARAMETER_STYLES = [
|
||||
{
|
||||
value: '',
|
||||
|
||||
121
packages/web/src/tabs/SettingsTab.svelte
Normal file
121
packages/web/src/tabs/SettingsTab.svelte
Normal file
@@ -0,0 +1,121 @@
|
||||
<script lang="ts" context="module">
|
||||
export const matchingProps = [];
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import SettingsMenuControl from "../elements/SettingsMenuControl.svelte";
|
||||
import GeneralSettings from "../settings/GeneralSettings.svelte";
|
||||
import SettingsFormProvider from "../forms/SettingsFormProvider.svelte";
|
||||
import ConnectionSettings from "../settings/ConnectionSettings.svelte";
|
||||
import ThemeSettings from "../settings/ThemeSettings.svelte";
|
||||
import DefaultActionsSettings from "../settings/DefaultActionsSettings.svelte";
|
||||
import BehaviourSettings from "../settings/BehaviourSettings.svelte";
|
||||
import ExternalToolsSettings from "../settings/ExternalToolsSettings.svelte";
|
||||
import OtherSettings from "../settings/OtherSettings.svelte";
|
||||
import LicenseSettings from "../settings/LicenseSettings.svelte";
|
||||
import { isProApp } from "../utility/proTools";
|
||||
import { _t } from "../translations";
|
||||
import CommandListTab from "./CommandListTab.svelte";
|
||||
import DataGridSettings from "../settings/DataGridSettings.svelte";
|
||||
import SQLEditorSettings from "../settings/SQLEditorSettings.svelte";
|
||||
import AiSettingsTab from "../settings/AiSettingsTab.svelte";
|
||||
|
||||
const menuItems = [
|
||||
{
|
||||
label: _t('settings.general', { defaultMessage: 'General' }),
|
||||
identifier: 'general',
|
||||
component: GeneralSettings,
|
||||
props: {},
|
||||
testid: 'settings-general',
|
||||
},
|
||||
{
|
||||
label: _t('settings.connection', { defaultMessage: 'Connection' }),
|
||||
identifier: 'connection',
|
||||
component: ConnectionSettings,
|
||||
props: {},
|
||||
testid: 'settings-connection',
|
||||
},
|
||||
{
|
||||
label: _t('settings.dataGrid.title', { defaultMessage: 'Data grid' }),
|
||||
identifier: 'data-grid',
|
||||
component: DataGridSettings,
|
||||
props: {},
|
||||
testid: 'settings-data-grid',
|
||||
},
|
||||
{
|
||||
label: _t('settings.sqlEditor.title', { defaultMessage: 'SQL Editor' }),
|
||||
identifier: 'sql-editor',
|
||||
component: SQLEditorSettings,
|
||||
props: {},
|
||||
testid: 'settings-sql-editor',
|
||||
},
|
||||
{
|
||||
label: _t('settings.theme', { defaultMessage: 'Themes' }),
|
||||
identifier: 'theme',
|
||||
component: ThemeSettings,
|
||||
props: {},
|
||||
testid: 'settings-themes',
|
||||
},
|
||||
{
|
||||
label: _t('settings.defaultActions', { defaultMessage: 'Default Actions' }),
|
||||
identifier: 'default-actions',
|
||||
component: DefaultActionsSettings,
|
||||
props: {},
|
||||
testid: 'settings-default-actions',
|
||||
},
|
||||
{
|
||||
label: _t('settings.behaviour', { defaultMessage: 'Behaviour' }),
|
||||
identifier: 'behaviour',
|
||||
component: BehaviourSettings,
|
||||
props: {},
|
||||
testid: 'settings-behaviour',
|
||||
},
|
||||
{
|
||||
label: _t('settings.externalTools', { defaultMessage: 'External Tools' }),
|
||||
identifier: 'external-tools',
|
||||
component: ExternalToolsSettings,
|
||||
props: {},
|
||||
testid: 'settings-external-tools',
|
||||
},
|
||||
{
|
||||
label: _t('command.settings.shortcuts', { defaultMessage: 'Keyboard shortcuts' }),
|
||||
identifier: 'shortcuts',
|
||||
component: CommandListTab,
|
||||
props: {},
|
||||
testid: 'settings-shortcuts',
|
||||
},
|
||||
isProApp() && {
|
||||
label: _t('settings.license', { defaultMessage: 'License' }),
|
||||
identifier: 'license',
|
||||
component: LicenseSettings,
|
||||
props: {},
|
||||
testid: 'settings-license',
|
||||
},
|
||||
isProApp() && {
|
||||
label: _t('settings.AI', { defaultMessage: 'AI'}),
|
||||
identifier: 'ai',
|
||||
component: AiSettingsTab,
|
||||
props: {},
|
||||
testid: 'settings-ai',
|
||||
},
|
||||
{
|
||||
label: _t('settings.other', { defaultMessage: 'Other' }),
|
||||
identifier: 'other',
|
||||
component: OtherSettings,
|
||||
props: {},
|
||||
testid: 'settings-other',
|
||||
},
|
||||
];
|
||||
|
||||
let selectedItem = 'general';
|
||||
</script>
|
||||
|
||||
<SettingsFormProvider>
|
||||
<SettingsMenuControl
|
||||
items={menuItems}
|
||||
bind:value={selectedItem}
|
||||
flex1={true}
|
||||
flexColContainer={true}
|
||||
scrollableContentContainer={true}
|
||||
/>
|
||||
</SettingsFormProvider>
|
||||
@@ -12,6 +12,7 @@
|
||||
execute: true,
|
||||
toggleComment: true,
|
||||
findReplace: true,
|
||||
defaultTeamFolder: true,
|
||||
executeAdditionalCondition: () => getCurrentConfig().allowShellScripting,
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import * as ServerSummaryTab from './ServerSummaryTab.svelte';
|
||||
import * as ImportExportTab from './ImportExportTab.svelte';
|
||||
import * as SqlObjectTab from './SqlObjectTab.svelte';
|
||||
import * as AppLogTab from './AppLogTab.svelte';
|
||||
import * as SettingsTab from './SettingsTab.svelte';
|
||||
|
||||
import protabs from './index-pro';
|
||||
|
||||
@@ -56,5 +57,6 @@ export default {
|
||||
ImportExportTab,
|
||||
SqlObjectTab,
|
||||
AppLogTab,
|
||||
SettingsTab,
|
||||
...protabs,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user