mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 14:46:01 +00:00
Merge branch 'master' of https://github.com/dbgate/dbgate
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc } from './GridConfig';
|
import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc, createGridConfig } from './GridConfig';
|
||||||
import {
|
import {
|
||||||
ForeignKeyInfo,
|
ForeignKeyInfo,
|
||||||
TableInfo,
|
TableInfo,
|
||||||
@@ -194,12 +194,14 @@ export abstract class GridDisplay {
|
|||||||
if (condition) {
|
if (condition) {
|
||||||
conditions.push(
|
conditions.push(
|
||||||
_.cloneDeepWith(condition, (expr: Expression) => {
|
_.cloneDeepWith(condition, (expr: Expression) => {
|
||||||
if (expr.exprType == 'placeholder')
|
if (expr.exprType == 'placeholder') {
|
||||||
return {
|
return this.createColumnExpression(column, { alias: column.sourceAlias });
|
||||||
exprType: 'column',
|
}
|
||||||
columnName: column.columnName,
|
// return {
|
||||||
source: { alias: column.sourceAlias },
|
// exprType: 'column',
|
||||||
};
|
// columnName: column.columnName,
|
||||||
|
// source: { alias: column.sourceAlias },
|
||||||
|
// };
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -445,6 +447,11 @@ export abstract class GridDisplay {
|
|||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetConfig() {
|
||||||
|
this.setConfig(cfg => createGridConfig());
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
getChangeSetCondition(row) {
|
getChangeSetCondition(row) {
|
||||||
if (!this.changeSetKeyFields) return null;
|
if (!this.changeSetKeyFields) return null;
|
||||||
return _.pick(row, this.changeSetKeyFields);
|
return _.pick(row, this.changeSetKeyFields);
|
||||||
|
|||||||
33
packages/web/src/buttons/CommandButton.svelte
Normal file
33
packages/web/src/buttons/CommandButton.svelte
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<script context="module">
|
||||||
|
function getCommandTitle(command) {
|
||||||
|
let res = command.text;
|
||||||
|
if (command.keyText || command.keyTextFromGroup) {
|
||||||
|
res += ` (${formatKeyText(command.keyText || command.keyTextFromGroup)})`;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { commandsCustomized } from '../stores';
|
||||||
|
import { formatKeyText } from '../utility/common';
|
||||||
|
import FormStyledButton from './FormStyledButton.svelte';
|
||||||
|
|
||||||
|
export let command;
|
||||||
|
export let component = FormStyledButton;
|
||||||
|
export let hideDisabled = false;
|
||||||
|
|
||||||
|
$: cmd = Object.values($commandsCustomized).find((x: any) => x.id == command) as any;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if cmd && (!hideDisabled || cmd.enabled)}
|
||||||
|
<svelte:component
|
||||||
|
this={component}
|
||||||
|
title={getCommandTitle(cmd)}
|
||||||
|
icon={cmd.icon}
|
||||||
|
on:click={cmd.onClick}
|
||||||
|
disabled={!cmd.enabled}
|
||||||
|
value={cmd.toolbarName || cmd.name}
|
||||||
|
{...$$restProps}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
@@ -344,7 +344,8 @@
|
|||||||
export let collapsedLeftColumnStore;
|
export let collapsedLeftColumnStore;
|
||||||
export let multipleGridsOnTab = false;
|
export let multipleGridsOnTab = false;
|
||||||
export let tabControlHiddenTab = false;
|
export let tabControlHiddenTab = false;
|
||||||
export let onCustomGridRefresh;
|
export let onCustomGridRefresh = null;
|
||||||
|
export let onOpenQuery = null;
|
||||||
export let useEvalFilters = false;
|
export let useEvalFilters = false;
|
||||||
export let jslid;
|
export let jslid;
|
||||||
// export let generalAllowSave = false;
|
// export let generalAllowSave = false;
|
||||||
@@ -1485,7 +1486,14 @@
|
|||||||
{#if !display || (!isDynamicStructure && (!columns || columns.length == 0))}
|
{#if !display || (!isDynamicStructure && (!columns || columns.length == 0))}
|
||||||
<LoadingInfo wrapper message="Waiting for structure" />
|
<LoadingInfo wrapper message="Waiting for structure" />
|
||||||
{:else if errorMessage}
|
{:else if errorMessage}
|
||||||
<ErrorInfo message={errorMessage} alignTop />
|
<div>
|
||||||
|
<ErrorInfo message={errorMessage} alignTop />
|
||||||
|
<FormStyledButton value="Reset filter" on:click={() => display.clearFilters()} />
|
||||||
|
<FormStyledButton value="Reset view" on:click={() => display.resetConfig()} />
|
||||||
|
{#if onOpenQuery}
|
||||||
|
<FormStyledButton value="Open Query" on:click={onOpenQuery} />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
{:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
{:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
||||||
<div>
|
<div>
|
||||||
<ErrorInfo
|
<ErrorInfo
|
||||||
|
|||||||
@@ -224,4 +224,5 @@
|
|||||||
frameSelection={!!macroPreview}
|
frameSelection={!!macroPreview}
|
||||||
{grider}
|
{grider}
|
||||||
{display}
|
{display}
|
||||||
|
onOpenQuery={openQuery}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user