-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BREAK][ENTERPRISE] Limit presence statuses to 200 concurrent users w…
…hen running monolith to keep performance (#27854) Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com> Co-authored-by: Júlia Jaeger Foresti <60678893+juliajforesti@users.noreply.github.com> Co-authored-by: Rodrigo Nascimento <rodrigoknascimento@gmail.com>
- Loading branch information
1 parent
58898f0
commit 0d9b086
Showing
58 changed files
with
938 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Presence } from '@rocket.chat/core-services'; | ||
|
||
import { API } from '../api'; | ||
|
||
API.v1.addRoute( | ||
'presence.getConnections', | ||
{ authRequired: true, permissionsRequired: ['manage-user-status'] }, | ||
{ | ||
async get() { | ||
const result = await Presence.getConnectionCount(); | ||
|
||
return API.v1.success(result); | ||
}, | ||
}, | ||
); | ||
|
||
API.v1.addRoute( | ||
'presence.enableBroadcast', | ||
{ authRequired: true, permissionsRequired: ['manage-user-status'], twoFactorRequired: true }, | ||
{ | ||
async post() { | ||
await Presence.toggleBroadcast(true); | ||
|
||
return API.v1.success(); | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
apps/meteor/client/sidebar/sections/StatusDisabledSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { SidebarBanner } from '@rocket.chat/fuselage'; | ||
import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; | ||
import { useRoute, useSetModal, useTranslation } from '@rocket.chat/ui-contexts'; | ||
import React from 'react'; | ||
|
||
import GenericModal from '../../components/GenericModal'; | ||
|
||
const StatusDisabledSection = ({ onDismiss }: { onDismiss: () => void }) => { | ||
const t = useTranslation(); | ||
const userStatusRoute = useRoute('user-status'); | ||
const setModal = useSetModal(); | ||
const closeModal = useMutableCallback(() => setModal()); | ||
const handleGoToSettings = useMutableCallback(() => { | ||
userStatusRoute.push({}); | ||
closeModal(); | ||
}); | ||
|
||
return ( | ||
<SidebarBanner | ||
text={t('User_status_temporarily_disabled')} | ||
description={t('Learn_more')} | ||
onClose={onDismiss} | ||
onClick={() => | ||
setModal( | ||
<GenericModal | ||
title={t('User_status_disabled_learn_more')} | ||
cancelText={t('Close')} | ||
confirmText={t('Go_to_workspace_settings')} | ||
children={t('User_status_disabled_learn_more_description')} | ||
onConfirm={handleGoToSettings} | ||
onClose={closeModal} | ||
onCancel={closeModal} | ||
icon={null} | ||
variant='warning' | ||
/>, | ||
) | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default StatusDisabledSection; |
Oops, something went wrong.
0d9b086
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A great way to make sure RocketChat users will go away and use another chat software. Limiting free instances to 200 users that way, blocking a major feature of the software, is not really a great choice. 😠