mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 15:03:57 +00:00
stats fixed
This commit is contained in:
@@ -11,6 +11,8 @@ const { isProApp } = require('./checkLicense');
|
|||||||
const socket = require('./socket');
|
const socket = require('./socket');
|
||||||
const config = require('../controllers/config');
|
const config = require('../controllers/config');
|
||||||
const simpleEncryptor = require('simple-encryptor');
|
const simpleEncryptor = require('simple-encryptor');
|
||||||
|
const currentVersion = require('../currentVersion');
|
||||||
|
const { getPublicIpInfo } = require('./hardwareFingerprint');
|
||||||
|
|
||||||
const logger = getLogger('cloudIntf');
|
const logger = getLogger('cloudIntf');
|
||||||
|
|
||||||
@@ -151,6 +153,8 @@ async function updateCloudFiles(isRefresh) {
|
|||||||
lastCloudFilesTags = '';
|
lastCloudFilesTags = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ipInfo = await getPublicIpInfo();
|
||||||
|
|
||||||
const tags = (await collectCloudFilesSearchTags()).join(',');
|
const tags = (await collectCloudFilesSearchTags()).join(',');
|
||||||
let lastCheckedTm = 0;
|
let lastCheckedTm = 0;
|
||||||
if (tags == lastCloudFilesTags && cloudFiles.length > 0) {
|
if (tags == lastCloudFilesTags && cloudFiles.length > 0) {
|
||||||
@@ -162,11 +166,12 @@ async function updateCloudFiles(isRefresh) {
|
|||||||
const resp = await axios.default.get(
|
const resp = await axios.default.get(
|
||||||
`${DBGATE_CLOUD_URL}/public-cloud-updates?lastCheckedTm=${lastCheckedTm}&tags=${tags}&isRefresh=${
|
`${DBGATE_CLOUD_URL}/public-cloud-updates?lastCheckedTm=${lastCheckedTm}&tags=${tags}&isRefresh=${
|
||||||
isRefresh ? 1 : 0
|
isRefresh ? 1 : 0
|
||||||
}`,
|
}&country=${ipInfo?.country || ''}`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
...getLicenseHttpHeaders(),
|
...getLicenseHttpHeaders(),
|
||||||
...(await getCloudSigninHeaders()),
|
...(await getCloudSigninHeaders()),
|
||||||
|
'x-app-version': currentVersion.version,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -87,4 +87,5 @@ module.exports = {
|
|||||||
getHardwareFingerprint,
|
getHardwareFingerprint,
|
||||||
getHardwareFingerprintHash,
|
getHardwareFingerprintHash,
|
||||||
getPublicHardwareFingerprint,
|
getPublicHardwareFingerprint,
|
||||||
|
getPublicIpInfo,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ registerCommand({
|
|||||||
category: 'New',
|
category: 'New',
|
||||||
toolbarOrder: 1,
|
toolbarOrder: 1,
|
||||||
name: 'Connection on Cloud',
|
name: 'Connection on Cloud',
|
||||||
testEnabled: () => !getCurrentConfig()?.runAsPortal && !getCurrentConfig()?.storageDatabase,
|
testEnabled: () => !getCurrentConfig()?.runAsPortal && !getCurrentConfig()?.storageDatabase && isProApp(),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: 'New Connection on Cloud',
|
title: 'New Connection on Cloud',
|
||||||
|
|||||||
Reference in New Issue
Block a user