mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 23:35:59 +00:00
ability to reset view when grid load error occurs
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,
|
||||||
@@ -445,6 +445,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);
|
||||||
|
|||||||
@@ -1485,7 +1485,11 @@
|
|||||||
{#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()} />
|
||||||
|
</div>
|
||||||
{:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
{:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
||||||
<div>
|
<div>
|
||||||
<ErrorInfo
|
<ErrorInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user