mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 01:55: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 { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc } from './GridConfig';
|
||||
import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc, createGridConfig } from './GridConfig';
|
||||
import {
|
||||
ForeignKeyInfo,
|
||||
TableInfo,
|
||||
@@ -445,6 +445,11 @@ export abstract class GridDisplay {
|
||||
this.reload();
|
||||
}
|
||||
|
||||
resetConfig() {
|
||||
this.setConfig(cfg => createGridConfig());
|
||||
this.reload();
|
||||
}
|
||||
|
||||
getChangeSetCondition(row) {
|
||||
if (!this.changeSetKeyFields) return null;
|
||||
return _.pick(row, this.changeSetKeyFields);
|
||||
|
||||
@@ -1485,7 +1485,11 @@
|
||||
{#if !display || (!isDynamicStructure && (!columns || columns.length == 0))}
|
||||
<LoadingInfo wrapper message="Waiting for structure" />
|
||||
{: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}
|
||||
<div>
|
||||
<ErrorInfo
|
||||
|
||||
Reference in New Issue
Block a user