mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 11:06:02 +00:00
data archive refresh works
This commit is contained in:
@@ -13,11 +13,13 @@ export class JslGridDisplay extends GridDisplay {
|
|||||||
cache: GridCache,
|
cache: GridCache,
|
||||||
setCache: ChangeCacheFunc,
|
setCache: ChangeCacheFunc,
|
||||||
rows: any,
|
rows: any,
|
||||||
isDynamicStructure: boolean
|
isDynamicStructure: boolean,
|
||||||
|
supportsReload: boolean
|
||||||
) {
|
) {
|
||||||
super(config, setConfig, cache, setCache, null);
|
super(config, setConfig, cache, setCache, null);
|
||||||
|
|
||||||
this.filterable = true;
|
this.filterable = true;
|
||||||
|
this.supportsReload = supportsReload;
|
||||||
this.isDynamicStructure = isDynamicStructure;
|
this.isDynamicStructure = isDynamicStructure;
|
||||||
if (isDynamicStructure) this.filterTypeOverride = 'string';
|
if (isDynamicStructure) this.filterTypeOverride = 'string';
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
import JslDataGridCore from './JslDataGridCore.svelte';
|
import JslDataGridCore from './JslDataGridCore.svelte';
|
||||||
|
|
||||||
export let jslid;
|
export let jslid;
|
||||||
|
export let supportsReload;
|
||||||
|
|
||||||
let loadedRows;
|
let loadedRows;
|
||||||
|
|
||||||
@@ -16,7 +17,17 @@
|
|||||||
const config = writable(createGridConfig());
|
const config = writable(createGridConfig());
|
||||||
const cache = writable(createGridCache());
|
const cache = writable(createGridCache());
|
||||||
|
|
||||||
$: display = new JslGridDisplay(jslid, $info, $config, config.update, $cache, cache.update, loadedRows, $info?.__isDynamicStructure);
|
$: display = new JslGridDisplay(
|
||||||
|
jslid,
|
||||||
|
$info,
|
||||||
|
$config,
|
||||||
|
config.update,
|
||||||
|
$cache,
|
||||||
|
cache.update,
|
||||||
|
loadedRows,
|
||||||
|
$info?.__isDynamicStructure,
|
||||||
|
supportsReload
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#key jslid}
|
{#key jslid}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
id: 'jslTableGrid.export',
|
id: 'jslTableGrid.export',
|
||||||
category: 'Data grid',
|
category: 'Data grid',
|
||||||
name: 'Export',
|
name: 'Export',
|
||||||
|
icon: 'icon export',
|
||||||
keyText: 'Ctrl+E',
|
keyText: 'Ctrl+E',
|
||||||
testEnabled: () => getCurrentEditor() != null,
|
testEnabled: () => getCurrentEditor() != null,
|
||||||
onClick: () => getCurrentEditor().exportGrid(),
|
onClick: () => getCurrentEditor().exportGrid(),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
registerCommand({
|
registerCommand({
|
||||||
id: 'freeTableGrid.export',
|
id: 'freeTableGrid.export',
|
||||||
category: 'Data grid',
|
category: 'Data grid',
|
||||||
|
icon: 'icon export',
|
||||||
name: 'Export',
|
name: 'Export',
|
||||||
keyText: 'Ctrl+E',
|
keyText: 'Ctrl+E',
|
||||||
testEnabled: () => getCurrentEditor() != null,
|
testEnabled: () => getCurrentEditor() != null,
|
||||||
|
|||||||
@@ -3,11 +3,24 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
||||||
|
|
||||||
|
import ToolStripContainer from '../buttons/ToolStripContainer.svelte';
|
||||||
|
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
||||||
|
|
||||||
import JslDataGrid from '../datagrid/JslDataGrid.svelte';
|
import JslDataGrid from '../datagrid/JslDataGrid.svelte';
|
||||||
|
|
||||||
export let archiveFolder = undefined;
|
export let archiveFolder = undefined;
|
||||||
export let archiveFile = undefined;
|
export let archiveFile = undefined;
|
||||||
export let jslid = undefined;
|
export let jslid = undefined;
|
||||||
|
|
||||||
|
const quickExportHandlerRef = createQuickExportHandlerRef();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<JslDataGrid jslid={jslid || `archive://${archiveFolder}/${archiveFile}`} />
|
<ToolStripContainer>
|
||||||
|
<JslDataGrid jslid={jslid || `archive://${archiveFolder}/${archiveFile}`} supportsReload />
|
||||||
|
<svelte:fragment slot="toolstrip">
|
||||||
|
<ToolStripCommandButton command="dataGrid.refresh" />
|
||||||
|
<ToolStripExportButton command="jslTableGrid.export" {quickExportHandlerRef} />
|
||||||
|
</svelte:fragment>
|
||||||
|
</ToolStripContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user