SYNC: dbgate cloud menu refactor

This commit is contained in:
SPRINX0\prochazka
2025-06-23 09:40:14 +02:00
committed by Diflow
parent ccb18ca302
commit e1e53d323f
2 changed files with 16 additions and 8 deletions

View File

@@ -128,7 +128,7 @@ registerCommand({
id: 'new.connectionOnCloud',
toolbar: true,
icon: 'img cloud-connection',
toolbarName: 'Add connection on cloud',
toolbarName: 'Add connection',
category: 'New',
toolbarOrder: 1,
name: 'Connection on Cloud',

View File

@@ -105,10 +105,18 @@
// }
// });
function createAddMenu() {
function createAddItemMenu() {
return [
{
command: 'new.connectionOnCloud',
},
];
}
function createAddFolderMenu() {
return [
isProApp() && {
text: 'New shared folder',
text: 'Create shared folder',
onClick: () => {
showModal(InputTextModal, {
label: 'New folder name',
@@ -122,7 +130,7 @@
},
},
isProApp() && {
text: 'Add existing shared folder',
text: 'Add existing folder (from link)',
onClick: () => {
showModal(InputTextModal, {
label: 'Your invite link (in form dbgate://folder/xxx)',
@@ -135,9 +143,6 @@
});
},
},
{
command: 'new.connectionOnCloud',
},
];
}
@@ -218,7 +223,10 @@
<SearchBoxWrapper>
<SearchInput placeholder="Search cloud connections and files" bind:value={filter} />
<CloseSearchButton bind:filter />
<DropDownButton icon="icon plus-thick" menu={createAddMenu} />
<DropDownButton icon="icon plus-thick" menu={createAddItemMenu} title="Add new connection or file" />
{#if isProApp()}
<DropDownButton icon="icon add-folder" menu={createAddFolderMenu} title="Add new folder" />
{/if}
<InlineButton
on:click={handleRefreshContent}
title="Refresh files"