feat: added cloud workspace id to workspace statistics (#32298)

pull/32341/head^2
Aleksander Nicacio da Silva 2 years ago committed by GitHub
parent 972b5b8516
commit 70ab2a7b7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      .changeset/wild-teachers-design.md
  2. 5
      apps/meteor/app/api/server/lib/getServerInfo.ts
  3. 4
      apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx
  4. 1
      packages/core-typings/src/IWorkspaceInfo.ts
  5. 1
      packages/i18n/src/locales/en.i18n.json
  6. 2
      packages/i18n/src/locales/pt-BR.i18n.json

@ -0,0 +1,7 @@
---
"@rocket.chat/meteor": minor
"@rocket.chat/core-typings": minor
"@rocket.chat/i18n": minor
---
Added "Rocket.Chat Cloud Workspace ID" to workspace statistics page

@ -5,6 +5,7 @@ import {
getCachedSupportedVersionsToken,
wrapPromise,
} from '../../../cloud/server/functions/supportedVersionsToken/supportedVersionsToken';
import { settings } from '../../../settings/server';
import { Info, minimumClientVersions } from '../../../utils/rocketchat.info';
const removePatchInfo = (version: string): string => version.replace(/(\d+\.\d+).*/, '$1');
@ -12,10 +13,10 @@ const removePatchInfo = (version: string): string => version.replace(/(\d+\.\d+)
export async function getServerInfo(userId?: string): Promise<IWorkspaceInfo> {
const hasPermissionToViewStatistics = userId && (await hasPermissionAsync(userId, 'view-statistics'));
const supportedVersionsToken = await wrapPromise(getCachedSupportedVersionsToken());
const cloudWorkspaceId = settings.get<string | undefined>('Cloud_Workspace_Id');
return {
version: removePatchInfo(Info.version),
...(hasPermissionToViewStatistics && {
info: {
...Info,
@ -28,5 +29,7 @@ export async function getServerInfo(userId?: string): Promise<IWorkspaceInfo> {
supportedVersionsToken.result && {
supportedVersions: { signed: supportedVersionsToken.result },
}),
cloudWorkspaceId,
};
}

@ -16,7 +16,7 @@ type DeploymentCardProps = {
statistics: IStats;
};
const DeploymentCard = ({ serverInfo: { info }, statistics, instances }: DeploymentCardProps): ReactElement => {
const DeploymentCard = ({ serverInfo: { info, cloudWorkspaceId }, statistics, instances }: DeploymentCardProps): ReactElement => {
const t = useTranslation();
const formatDateAndTime = useFormatDateAndTime();
const setModal = useSetModal();
@ -33,6 +33,8 @@ const DeploymentCard = ({ serverInfo: { info }, statistics, instances }: Deploym
<WorkspaceCardSection title={t('Version')} body={statistics.version} />
<WorkspaceCardSection title={t('Deployment_ID')} body={statistics.uniqueId} />
{cloudWorkspaceId && <WorkspaceCardSection title={t('Cloud_Workspace_Id')} body={cloudWorkspaceId} />}
{appsEngineVersion && <WorkspaceCardSection title={t('Apps_Engine_Version')} body={appsEngineVersion} />}
<WorkspaceCardSection title={t('Node_version')} body={statistics.process.nodeVersion} />
<WorkspaceCardSection

@ -5,4 +5,5 @@ export type IWorkspaceInfo = {
supportedVersions?: { signed: string };
minimumClientVersions: { desktop: string; mobile: string };
version: string;
cloudWorkspaceId?: string;
};

@ -1100,6 +1100,7 @@
"Cloud_workspace_connected_without_account": "Your workspace is now connected to the Rocket.Chat Cloud. If you would like, you can login to the Rocket.Chat Cloud and associate your workspace with your Cloud account.",
"Cloud_workspace_disconnect": "If you no longer wish to utilize cloud services you can disconnect your workspace from Rocket.Chat Cloud.",
"Cloud_workspace_support": "If you have trouble with a cloud service, please try to sync first. Should the issue persist, please open a support ticket in the Cloud Console.",
"Cloud_Workspace_Id": "Cloud Workspace ID",
"Collaborative": "Collaborative",
"Collapse": "Collapse",
"Collapse_Embedded_Media_By_Default": "Collapse Embedded Media by Default",

@ -5016,4 +5016,4 @@
"Enterprise": "Enterprise",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics",
"UpgradeToGetMore_auditing_Title": "Auditoria de mensagem"
}
}

Loading…
Cancel
Save