mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
SYNC: folder administration modal
This commit is contained in:
committed by
Diflow
parent
edf1632cab
commit
2d400ae7eb
@@ -40,6 +40,7 @@
|
||||
import runCommand from '../commands/runCommand';
|
||||
import SaveFileModal from '../modals/SaveFileModal.svelte';
|
||||
import newQuery from '../query/newQuery';
|
||||
import ConfigureSharedFolderModal from '../modals/ConfigureSharedFolderModal.svelte';
|
||||
|
||||
let filter = '';
|
||||
let domSqlObjectList = null;
|
||||
@@ -201,41 +202,40 @@
|
||||
});
|
||||
};
|
||||
|
||||
const handleCopyInviteLink = async role => {
|
||||
const { inviteToken } = await apiCall(`cloud/get-invite-token`, {
|
||||
folid: folder,
|
||||
role,
|
||||
});
|
||||
if (inviteToken) {
|
||||
const inviteLink = `dbgate://folder/v1/${inviteToken}?mode=${role}`;
|
||||
navigator.clipboard.writeText(inviteLink);
|
||||
showSnackbarInfo(`Invite link (${role}) copied to clipboard`);
|
||||
}
|
||||
};
|
||||
|
||||
return [
|
||||
contentGroupMap[folder]?.role == 'admin' && [
|
||||
{ text: 'Rename', onClick: handleRename },
|
||||
{ text: 'Delete', onClick: handleDelete },
|
||||
],
|
||||
contentGroupMap[folder]?.role == 'admin' &&
|
||||
isProApp() &&
|
||||
contentGroupMap[folder]?.role == 'admin' &&
|
||||
!contentGroupMap[folder]?.isPrivate && {
|
||||
text: 'Copy invite link',
|
||||
submenu: [
|
||||
{
|
||||
text: 'Admin',
|
||||
onClick: () => handleCopyInviteLink('admin'),
|
||||
},
|
||||
{
|
||||
text: 'Write',
|
||||
onClick: () => handleCopyInviteLink('write'),
|
||||
},
|
||||
{
|
||||
text: 'Read',
|
||||
onClick: () => handleCopyInviteLink('read'),
|
||||
},
|
||||
],
|
||||
text: 'Administrate access',
|
||||
onClick: () => {
|
||||
showModal(ConfigureSharedFolderModal, {
|
||||
folid: folder,
|
||||
name: contentGroupMap[folder]?.name,
|
||||
});
|
||||
},
|
||||
},
|
||||
// contentGroupMap[folder]?.role == 'admin' &&
|
||||
// !contentGroupMap[folder]?.isPrivate && {
|
||||
// text: 'Copy invite link',
|
||||
// submenu: [
|
||||
// {
|
||||
// text: 'Admin',
|
||||
// onClick: () => handleCopyInviteLink('admin'),
|
||||
// },
|
||||
// {
|
||||
// text: 'Write',
|
||||
// onClick: () => handleCopyInviteLink('write'),
|
||||
// },
|
||||
// {
|
||||
// text: 'Read',
|
||||
// onClick: () => handleCopyInviteLink('read'),
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user