mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 21:03:59 +00:00
data grid - handle edge cases (error, structure not loaded)
This commit is contained in:
@@ -243,6 +243,7 @@
|
||||
import { clearLastFocusedFormView } from '../formview/FormView.svelte';
|
||||
import openReferenceForm, { openPrimaryKeyForm } from '../formview/openReferenceForm';
|
||||
import openNewTab from '../utility/openNewTab';
|
||||
import ErrorInfo from '../elements/ErrorInfo.svelte';
|
||||
|
||||
export let onLoadNextData = undefined;
|
||||
export let grider = undefined;
|
||||
@@ -261,6 +262,7 @@
|
||||
export let onOpenQuery = null;
|
||||
export let onOpenActiveChart = null;
|
||||
export let formViewAvailable = false;
|
||||
export let errorMessage = undefined;
|
||||
|
||||
export let isLoadedAll;
|
||||
export let loadedTime;
|
||||
@@ -1002,12 +1004,23 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
{#if !columns || columns.length == 0}
|
||||
<LoadingInfo wrapper message="Waiting for structure" />
|
||||
{:else if errorMessage}
|
||||
<ErrorInfo message={errorMessage} />
|
||||
{:else if grider.errors && grider.errors.length > 0}
|
||||
<div>
|
||||
{#each grider.errors as err}
|
||||
<ErrorInfo message={err} key={index} isSmall />
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<div
|
||||
class="container"
|
||||
bind:clientWidth={containerWidth}
|
||||
bind:clientHeight={containerHeight}
|
||||
use:contextMenu={createMenu}
|
||||
>
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="focus-field"
|
||||
@@ -1137,7 +1150,8 @@
|
||||
{#if isLoading}
|
||||
<LoadingInfo wrapper message="Loading data" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.container {
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
bind:this={domGrid}
|
||||
{...$$props}
|
||||
onLoadNextData={handleLoadNextData}
|
||||
{errorMessage}
|
||||
{grider}
|
||||
{isLoading}
|
||||
{allRowCount}
|
||||
|
||||
Reference in New Issue
Block a user