mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 01:16:01 +00:00
show cloud content
This commit is contained in:
30
packages/web/src/appobj/CloudContentAppObject.svelte
Normal file
30
packages/web/src/appobj/CloudContentAppObject.svelte
Normal file
@@ -0,0 +1,30 @@
|
||||
<script lang="ts" context="module">
|
||||
import AppObjectCore from './AppObjectCore.svelte';
|
||||
|
||||
export const extractKey = data => data.cntid;
|
||||
export const createMatcher =
|
||||
filter =>
|
||||
({ name }) =>
|
||||
filterName(filter, name);
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { filterName } from 'dbgate-tools';
|
||||
|
||||
export let data;
|
||||
|
||||
function createMenu() {
|
||||
return [];
|
||||
}
|
||||
</script>
|
||||
|
||||
<AppObjectCore {...$$restProps} {data} icon={'img connection'} title={data.name} menu={createMenu}></AppObjectCore>
|
||||
|
||||
<style>
|
||||
.info {
|
||||
margin-left: 30px;
|
||||
margin-right: 5px;
|
||||
color: var(--theme-font-3);
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -108,6 +108,7 @@
|
||||
import _ from 'lodash';
|
||||
import AppObjectCore from './AppObjectCore.svelte';
|
||||
import {
|
||||
cloudSigninToken,
|
||||
currentDatabase,
|
||||
DEFAULT_CONNECTION_SEARCH_SETTINGS,
|
||||
expandedConnections,
|
||||
@@ -332,6 +333,17 @@
|
||||
text: _t('connection.duplicate', { defaultMessage: 'Duplicate' }),
|
||||
onClick: handleDuplicate,
|
||||
},
|
||||
!$openedConnections.includes(data._id) &&
|
||||
$cloudSigninToken &&
|
||||
passProps?.cloudContentList?.length > 0 && {
|
||||
text: _t('connection.moveToCloudFolder', { defaultMessage: 'Move to cloud folder' }),
|
||||
submenu: passProps?.cloudContentList?.map(fld => ({
|
||||
text: fld.name,
|
||||
onClick: () => {
|
||||
apiCall('cloud/move-connection-cloud', { conid: data._id, folid: fld.folid });
|
||||
},
|
||||
})),
|
||||
},
|
||||
],
|
||||
{ divider: true },
|
||||
!data.singleDatabase && [
|
||||
|
||||
Reference in New Issue
Block a user