mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 05:16:00 +00:00
add new archive folder command
This commit is contained in:
@@ -106,7 +106,7 @@
|
||||
const handleOpenWrite = () => {
|
||||
openNewTab({
|
||||
title: data.fileName,
|
||||
icon: 'img archive',
|
||||
icon: 'img free-table',
|
||||
tabComponent: 'FreeTableTab',
|
||||
props: {
|
||||
initialArgs: {
|
||||
|
||||
@@ -112,6 +112,23 @@ registerCommand({
|
||||
},
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'new.archiveFolder',
|
||||
category: 'New',
|
||||
icon: 'img archive',
|
||||
name: 'Archive folder',
|
||||
onClick: () => {
|
||||
showModal(InputTextModal, {
|
||||
value: '',
|
||||
label: 'New archive folder name',
|
||||
header: 'Create archive folder',
|
||||
onConfirm: async folder => {
|
||||
axiosInstance.post('archive/create-folder', { folder });
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'new.table',
|
||||
category: 'New',
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
|
||||
import AppObjectList from '../appobj/AppObjectList.svelte';
|
||||
import * as archiveFolderAppObject from '../appobj/ArchiveFolderAppObject.svelte';
|
||||
import runCommand from '../commands/runCommand';
|
||||
|
||||
import InlineButton from '../elements/InlineButton.svelte';
|
||||
|
||||
import SearchBoxWrapper from '../elements/SearchBoxWrapper.svelte';
|
||||
import SearchInput from '../elements/SearchInput.svelte';
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import axiosInstance from '../utility/axiosInstance';
|
||||
import { useArchiveFolders } from '../utility/metadataLoaders';
|
||||
import WidgetsInnerContainer from './WidgetsInnerContainer.svelte';
|
||||
@@ -23,7 +25,12 @@
|
||||
|
||||
<SearchBoxWrapper>
|
||||
<SearchInput placeholder="Search archive folders" bind:value={filter} />
|
||||
<InlineButton on:click={handleRefreshFolders}>Refresh</InlineButton>
|
||||
<InlineButton on:click={() => runCommand('new.archiveFolder')} title="Add new archive folder">
|
||||
<FontIcon icon="icon plus-thick" />
|
||||
</InlineButton>
|
||||
<InlineButton on:click={handleRefreshFolders} title="Refresh archive folder list">
|
||||
<FontIcon icon="icon refresh" />
|
||||
</InlineButton>
|
||||
</SearchBoxWrapper>
|
||||
<WidgetsInnerContainer>
|
||||
<AppObjectList list={_.sortBy($folders, 'name')} module={archiveFolderAppObject} {filter} />
|
||||
|
||||
Reference in New Issue
Block a user