stats fixed

This commit is contained in:
SPRINX0\prochazka
2025-05-28 13:21:52 +02:00
parent 7b50a19b2c
commit 7a3b27227a
3 changed files with 8 additions and 2 deletions

View File

@@ -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,
}, },
} }
); );

View File

@@ -87,4 +87,5 @@ module.exports = {
getHardwareFingerprint, getHardwareFingerprint,
getHardwareFingerprintHash, getHardwareFingerprintHash,
getPublicHardwareFingerprint, getPublicHardwareFingerprint,
getPublicIpInfo,
}; };

View File

@@ -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',