mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 11:56:00 +00:00
encrypting cloud content
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
import _ from 'lodash';
|
||||
import AppObjectCore from './AppObjectCore.svelte';
|
||||
import {
|
||||
cloudSigninToken,
|
||||
cloudSigninTokenHolder,
|
||||
currentDatabase,
|
||||
DEFAULT_CONNECTION_SEARCH_SETTINGS,
|
||||
expandedConnections,
|
||||
@@ -334,7 +334,7 @@
|
||||
onClick: handleDuplicate,
|
||||
},
|
||||
!$openedConnections.includes(data._id) &&
|
||||
$cloudSigninToken &&
|
||||
$cloudSigninTokenHolder &&
|
||||
passProps?.cloudContentList?.length > 0 && {
|
||||
text: _t('connection.moveToCloudFolder', { defaultMessage: 'Move to cloud folder' }),
|
||||
submenu: passProps?.cloudContentList?.map(fld => ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
cloudSigninToken,
|
||||
cloudSigninTokenHolder,
|
||||
currentDatabase,
|
||||
currentTheme,
|
||||
emptyConnectionGroupNames,
|
||||
@@ -668,7 +668,7 @@ registerCommand({
|
||||
category: 'Cloud',
|
||||
name: 'Logout',
|
||||
onClick: () => {
|
||||
cloudSigninToken.set(null);
|
||||
cloudSigninTokenHolder.set(null);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -182,14 +182,10 @@ export const focusedConnectionOrDatabase = writable<{ conid: string; database?:
|
||||
|
||||
export const focusedTreeDbKey = writable<{ key: string; root: string; type: string; text: string }>(null);
|
||||
|
||||
export const cloudSigninToken = writableSettingsValue(null, 'cloudSigninToken');
|
||||
export const cloudSigninTokenHolder = writableSettingsValue(null, 'cloudSigninTokenHolder');
|
||||
|
||||
export const cloudConnectionsStore = writable({});
|
||||
|
||||
// export const cloudSigninToken = getElectron()
|
||||
// ? writableSettingsValue(null, 'cloudSigninToken')
|
||||
// : writableWithStorage(null, 'cloudSigninToken');
|
||||
|
||||
export const DEFAULT_OBJECT_SEARCH_SETTINGS = {
|
||||
pureName: true,
|
||||
schemaName: false,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { batchDispatchCacheTriggers, dispatchCacheChange } from './cache';
|
||||
import { isAdminPage, isOneOfPage } from './pageDefs';
|
||||
import { openWebLink } from './simpleTools';
|
||||
import { serializeJsTypesReplacer } from 'dbgate-tools';
|
||||
import { cloudSigninToken } from '../stores';
|
||||
import { cloudSigninTokenHolder } from '../stores';
|
||||
|
||||
export const strmid = uuidv1();
|
||||
|
||||
@@ -281,8 +281,9 @@ export function installNewVolatileConnectionListener() {
|
||||
}
|
||||
|
||||
export function installNewCloudTokenListener() {
|
||||
apiOn('got-cloud-token', async ({ token }) => {
|
||||
cloudSigninToken.set(token);
|
||||
apiOn('got-cloud-token', async tokenHolder => {
|
||||
console.log('HOLDER', tokenHolder);
|
||||
cloudSigninTokenHolder.set(tokenHolder);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
import { apiCall } from '../utility/api';
|
||||
import {
|
||||
cloudConnectionsStore,
|
||||
cloudSigninToken,
|
||||
cloudSigninTokenHolder,
|
||||
currentDatabase,
|
||||
expandedConnections,
|
||||
openedConnections,
|
||||
@@ -82,7 +82,7 @@
|
||||
name="privateCloud"
|
||||
height="50%"
|
||||
storageName="privateCloudItems"
|
||||
skip={!$cloudSigninToken}
|
||||
skip={!$cloudSigninTokenHolder}
|
||||
>
|
||||
<WidgetsInnerContainer>
|
||||
<SearchBoxWrapper>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
visibleHamburgerMenuWidget,
|
||||
lockedDatabaseMode,
|
||||
getCurrentConfig,
|
||||
cloudSigninToken,
|
||||
cloudSigninTokenHolder,
|
||||
} from '../stores';
|
||||
import mainMenuDefinition from '../../../../app/src/mainMenuDefinition';
|
||||
import hasPermission from '../utility/hasPermission';
|
||||
@@ -149,7 +149,7 @@
|
||||
{#each widgets
|
||||
.filter(x => x && hasPermission(`widgets/${x.name}`))
|
||||
.filter(x => !x.isPremiumPromo || !isProApp())
|
||||
.filter(x => x.name != 'cloud-private' || $cloudSigninToken) as item}
|
||||
.filter(x => x.name != 'cloud-private' || $cloudSigninTokenHolder) as item}
|
||||
<div
|
||||
class="wrapper"
|
||||
class:selected={item.name == $visibleSelectedWidget}
|
||||
@@ -176,7 +176,7 @@
|
||||
<FontIcon icon={$lockedDatabaseMode ? 'icon locked-database-mode' : 'icon unlocked-database-mode'} />
|
||||
</div> -->
|
||||
|
||||
{#if $cloudSigninToken}
|
||||
{#if $cloudSigninTokenHolder}
|
||||
<div
|
||||
class="wrapper"
|
||||
on:click={handleCloudAccountMenu}
|
||||
|
||||
Reference in New Issue
Block a user