diff --git a/.changeset/wild-teachers-design.md b/.changeset/wild-teachers-design.md new file mode 100644 index 00000000000..f49f4549e76 --- /dev/null +++ b/.changeset/wild-teachers-design.md @@ -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 diff --git a/apps/meteor/app/api/server/lib/getServerInfo.ts b/apps/meteor/app/api/server/lib/getServerInfo.ts index 9a0e7e4e11c..020988b0aca 100644 --- a/apps/meteor/app/api/server/lib/getServerInfo.ts +++ b/apps/meteor/app/api/server/lib/getServerInfo.ts @@ -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 { const hasPermissionToViewStatistics = userId && (await hasPermissionAsync(userId, 'view-statistics')); const supportedVersionsToken = await wrapPromise(getCachedSupportedVersionsToken()); + const cloudWorkspaceId = settings.get('Cloud_Workspace_Id'); return { version: removePatchInfo(Info.version), - ...(hasPermissionToViewStatistics && { info: { ...Info, @@ -28,5 +29,7 @@ export async function getServerInfo(userId?: string): Promise { supportedVersionsToken.result && { supportedVersions: { signed: supportedVersionsToken.result }, }), + + cloudWorkspaceId, }; } diff --git a/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx index 0b48d0c8cc8..a300a792f45 100644 --- a/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx +++ b/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx @@ -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 + {cloudWorkspaceId && } + {appsEngineVersion && }