mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 01:55:59 +00:00
archive file - save as
This commit is contained in:
@@ -14,6 +14,16 @@
|
|||||||
testEnabled: () => getCurrentEditor()?.canSave(),
|
testEnabled: () => getCurrentEditor()?.canSave(),
|
||||||
onClick: () => getCurrentEditor().save(),
|
onClick: () => getCurrentEditor().save(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registerCommand({
|
||||||
|
id: 'archiveFile.saveAs',
|
||||||
|
category: 'Archive file',
|
||||||
|
name: 'Save as',
|
||||||
|
icon: 'icon save',
|
||||||
|
isRelatedToTab: true,
|
||||||
|
testEnabled: () => getCurrentEditor() != null,
|
||||||
|
onClick: () => getCurrentEditor().saveAs(),
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -22,6 +32,7 @@
|
|||||||
import { onMount, tick } from 'svelte';
|
import { onMount, tick } from 'svelte';
|
||||||
|
|
||||||
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
||||||
|
import ToolStripCommandSplitButton from '../buttons/ToolStripCommandSplitButton.svelte';
|
||||||
|
|
||||||
import ToolStripContainer from '../buttons/ToolStripContainer.svelte';
|
import ToolStripContainer from '../buttons/ToolStripContainer.svelte';
|
||||||
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
||||||
@@ -72,8 +83,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveAs() {
|
export function saveAs() {
|
||||||
showModal(SaveArchiveModal, {
|
showModal(SaveArchiveModal, {
|
||||||
|
folder: archiveFolder,
|
||||||
|
file: archiveFile,
|
||||||
onSave: doSaveAs,
|
onSave: doSaveAs,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -82,7 +95,7 @@
|
|||||||
await apiCall('archive/save-jsl-data', {
|
await apiCall('archive/save-jsl-data', {
|
||||||
folder,
|
folder,
|
||||||
file,
|
file,
|
||||||
jslid,
|
jslid: jslid || `archive://${archiveFolder}/${archiveFile}`,
|
||||||
changeSet: changeSetContainsChanges($changeSetStore?.value) ? $changeSetStore.value : null,
|
changeSet: changeSetContainsChanges($changeSetStore?.value) ? $changeSetStore.value : null,
|
||||||
});
|
});
|
||||||
changeTab(tabid, tab => ({
|
changeTab(tabid, tab => ({
|
||||||
@@ -160,5 +173,6 @@
|
|||||||
<ToolStripCommandButton command="dataGrid.refresh" />
|
<ToolStripCommandButton command="dataGrid.refresh" />
|
||||||
<ToolStripExportButton command="jslTableGrid.export" {quickExportHandlerRef} />
|
<ToolStripExportButton command="jslTableGrid.export" {quickExportHandlerRef} />
|
||||||
<ToolStripCommandButton command="archiveFile.save" />
|
<ToolStripCommandButton command="archiveFile.save" />
|
||||||
|
<ToolStripCommandButton command="archiveFile.saveAs" />
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ToolStripContainer>
|
</ToolStripContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user