2020-04-10 01:01:46 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
2020-05-14 21:35:25 +08:00
|
|
|
import { FormattedTime, defineMessages, injectIntl } from 'react-intl';
|
2020-04-10 01:01:46 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2020-05-14 21:35:25 +08:00
|
|
|
import UserAvatar from '/imports/ui/components/user-avatar/component';
|
2024-08-21 21:05:37 +08:00
|
|
|
import CommonIcon from '/imports/ui/components/common/icon/component';
|
|
|
|
import TooltipContainer from '/imports/ui/components/common/tooltip/container';
|
2021-04-23 09:07:48 +08:00
|
|
|
import Icon from '/imports/ui/components/connection-status/icon/component';
|
2021-03-26 05:22:50 +08:00
|
|
|
import Service from '../service';
|
2021-11-09 19:54:48 +08:00
|
|
|
import Styled from './styles';
|
2023-12-06 20:12:25 +08:00
|
|
|
import ConnectionStatusHelper from '../status-helper/component';
|
2023-12-05 22:18:45 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2024-08-21 21:05:37 +08:00
|
|
|
import connectionStatus from '../../../core/graphql/singletons/connectionStatus';
|
2020-04-10 01:01:46 +08:00
|
|
|
|
2021-10-07 08:05:15 +08:00
|
|
|
const MIN_TIMEOUT = 3000;
|
2021-08-13 03:39:04 +08:00
|
|
|
|
2020-04-10 01:01:46 +08:00
|
|
|
const intlMessages = defineMessages({
|
|
|
|
ariaTitle: {
|
|
|
|
id: 'app.connection-status.ariaTitle',
|
|
|
|
description: 'Connection status aria title',
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
id: 'app.connection-status.title',
|
|
|
|
description: 'Connection status title',
|
|
|
|
},
|
|
|
|
description: {
|
|
|
|
id: 'app.connection-status.description',
|
|
|
|
description: 'Connection status description',
|
|
|
|
},
|
2020-05-14 21:35:25 +08:00
|
|
|
empty: {
|
|
|
|
id: 'app.connection-status.empty',
|
|
|
|
description: 'Connection status empty',
|
|
|
|
},
|
2020-04-14 02:45:14 +08:00
|
|
|
more: {
|
|
|
|
id: 'app.connection-status.more',
|
2024-03-18 21:58:53 +08:00
|
|
|
description: 'More about connectivity issues',
|
2020-04-14 02:45:14 +08:00
|
|
|
},
|
2021-08-13 03:39:04 +08:00
|
|
|
audioLabel: {
|
|
|
|
id: 'app.settings.audioTab.label',
|
|
|
|
description: 'Audio label',
|
|
|
|
},
|
|
|
|
videoLabel: {
|
|
|
|
id: 'app.settings.videoTab.label',
|
|
|
|
description: 'Video label',
|
|
|
|
},
|
2021-08-11 07:45:59 +08:00
|
|
|
copy: {
|
|
|
|
id: 'app.connection-status.copy',
|
|
|
|
description: 'Copy network data',
|
|
|
|
},
|
|
|
|
copied: {
|
|
|
|
id: 'app.connection-status.copied',
|
|
|
|
description: 'Copied network data',
|
|
|
|
},
|
2021-04-02 02:10:15 +08:00
|
|
|
offline: {
|
|
|
|
id: 'app.connection-status.offline',
|
|
|
|
description: 'Offline user',
|
|
|
|
},
|
2021-03-26 05:22:50 +08:00
|
|
|
dataSaving: {
|
|
|
|
id: 'app.settings.dataSavingTab.description',
|
|
|
|
description: 'Description of data saving',
|
|
|
|
},
|
|
|
|
webcam: {
|
|
|
|
id: 'app.settings.dataSavingTab.webcam',
|
|
|
|
description: 'Webcam data saving switch',
|
|
|
|
},
|
|
|
|
screenshare: {
|
|
|
|
id: 'app.settings.dataSavingTab.screenShare',
|
|
|
|
description: 'Screenshare data saving switch',
|
2020-05-12 21:26:08 +08:00
|
|
|
},
|
2021-05-11 04:41:52 +08:00
|
|
|
on: {
|
|
|
|
id: 'app.switch.onLabel',
|
|
|
|
description: 'label for toggle switch on state',
|
|
|
|
},
|
|
|
|
off: {
|
|
|
|
id: 'app.switch.offLabel',
|
|
|
|
description: 'label for toggle switch off state',
|
|
|
|
},
|
2021-08-25 03:35:41 +08:00
|
|
|
no: {
|
|
|
|
id: 'app.connection-status.no',
|
|
|
|
description: 'No to is using turn',
|
|
|
|
},
|
|
|
|
yes: {
|
|
|
|
id: 'app.connection-status.yes',
|
|
|
|
description: 'Yes to is using turn',
|
|
|
|
},
|
|
|
|
usingTurn: {
|
|
|
|
id: 'app.connection-status.usingTurn',
|
|
|
|
description: 'User is using turn server',
|
|
|
|
},
|
|
|
|
jitter: {
|
|
|
|
id: 'app.connection-status.jitter',
|
|
|
|
description: 'Jitter buffer in ms',
|
|
|
|
},
|
|
|
|
lostPackets: {
|
|
|
|
id: 'app.connection-status.lostPackets',
|
|
|
|
description: 'Number of lost packets',
|
|
|
|
},
|
2021-10-19 04:52:59 +08:00
|
|
|
audioUploadRate: {
|
|
|
|
id: 'app.connection-status.audioUploadRate',
|
|
|
|
description: 'Label for audio current upload rate',
|
|
|
|
},
|
|
|
|
audioDownloadRate: {
|
|
|
|
id: 'app.connection-status.audioDownloadRate',
|
|
|
|
description: 'Label for audio current download rate',
|
|
|
|
},
|
|
|
|
videoUploadRate: {
|
|
|
|
id: 'app.connection-status.videoUploadRate',
|
|
|
|
description: 'Label for video current upload rate',
|
|
|
|
},
|
|
|
|
videoDownloadRate: {
|
|
|
|
id: 'app.connection-status.videoDownloadRate',
|
|
|
|
description: 'Label for video current download rate',
|
|
|
|
},
|
|
|
|
connectionStats: {
|
|
|
|
id: 'app.connection-status.connectionStats',
|
2021-11-23 20:05:02 +08:00
|
|
|
description: 'Label for Connection Stats tab',
|
2021-10-19 04:52:59 +08:00
|
|
|
},
|
|
|
|
myLogs: {
|
|
|
|
id: 'app.connection-status.myLogs',
|
2021-11-23 20:05:02 +08:00
|
|
|
description: 'Label for My Logs tab',
|
2021-10-19 04:52:59 +08:00
|
|
|
},
|
|
|
|
sessionLogs: {
|
|
|
|
id: 'app.connection-status.sessionLogs',
|
2021-11-23 20:05:02 +08:00
|
|
|
description: 'Label for Session Logs tab',
|
|
|
|
},
|
|
|
|
next: {
|
|
|
|
id: 'app.connection-status.next',
|
|
|
|
description: 'Label for the next page of the connection stats tab',
|
|
|
|
},
|
|
|
|
prev: {
|
|
|
|
id: 'app.connection-status.prev',
|
|
|
|
description: 'Label for the previous page of the connection stats tab',
|
|
|
|
},
|
2022-09-15 09:16:27 +08:00
|
|
|
clientNotResponding: {
|
|
|
|
id: 'app.connection-status.clientNotRespondingWarning',
|
|
|
|
description: 'Text for Client not responding warning',
|
|
|
|
},
|
2024-08-21 21:05:37 +08:00
|
|
|
noEvent: {
|
|
|
|
id: 'app.connection-status.connectionStatusNoEvent',
|
|
|
|
description: 'Text for inform on status without event ot time of occurrence',
|
|
|
|
},
|
2020-04-10 01:01:46 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
const propTypes = {
|
2023-03-21 01:57:36 +08:00
|
|
|
setModalIsOpen: PropTypes.func.isRequired,
|
2020-04-10 01:01:46 +08:00
|
|
|
intl: PropTypes.shape({
|
|
|
|
formatMessage: PropTypes.func.isRequired,
|
|
|
|
}).isRequired,
|
|
|
|
};
|
|
|
|
|
2021-03-26 05:22:50 +08:00
|
|
|
const isConnectionStatusEmpty = (connectionStatus) => {
|
|
|
|
// Check if it's defined
|
|
|
|
if (!connectionStatus) return true;
|
|
|
|
|
|
|
|
// Check if it's an array
|
|
|
|
if (!Array.isArray(connectionStatus)) return true;
|
|
|
|
|
|
|
|
// Check if is empty
|
|
|
|
if (connectionStatus.length === 0) return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
2020-04-10 01:01:46 +08:00
|
|
|
class ConnectionStatusComponent extends PureComponent {
|
2021-03-26 05:22:50 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
2021-08-13 03:39:04 +08:00
|
|
|
const { intl } = this.props;
|
|
|
|
|
2021-03-26 05:22:50 +08:00
|
|
|
this.help = Service.getHelp();
|
2021-08-13 03:39:04 +08:00
|
|
|
this.state = {
|
2022-10-28 22:10:07 +08:00
|
|
|
selectedTab: 0,
|
2024-07-05 04:26:09 +08:00
|
|
|
hasNetworkData: true,
|
2022-05-24 01:09:50 +08:00
|
|
|
copyButtonText: intl.formatMessage(intlMessages.copy),
|
2021-08-13 03:39:04 +08:00
|
|
|
networkData: {
|
|
|
|
user: {
|
|
|
|
|
|
|
|
},
|
|
|
|
audio: {
|
|
|
|
audioCurrentUploadRate: 0,
|
|
|
|
audioCurrentDownloadRate: 0,
|
2021-08-18 03:51:50 +08:00
|
|
|
jitter: 0,
|
|
|
|
packetsLost: 0,
|
2021-08-25 03:35:41 +08:00
|
|
|
transportStats: {},
|
2021-08-13 03:39:04 +08:00
|
|
|
},
|
|
|
|
video: {
|
|
|
|
videoCurrentUploadRate: 0,
|
|
|
|
videoCurrentDownloadRate: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-05-24 01:09:50 +08:00
|
|
|
this.setButtonMessage = this.setButtonMessage.bind(this);
|
2021-08-13 03:39:04 +08:00
|
|
|
this.rateInterval = null;
|
2021-10-19 04:52:59 +08:00
|
|
|
this.audioUploadLabel = intl.formatMessage(intlMessages.audioUploadRate);
|
|
|
|
this.audioDownloadLabel = intl.formatMessage(intlMessages.audioDownloadRate);
|
|
|
|
this.videoUploadLabel = intl.formatMessage(intlMessages.videoUploadRate);
|
|
|
|
this.videoDownloadLabel = intl.formatMessage(intlMessages.videoDownloadRate);
|
2022-10-28 22:10:07 +08:00
|
|
|
this.handleSelectTab = this.handleSelectTab.bind(this);
|
2021-08-13 03:39:04 +08:00
|
|
|
}
|
|
|
|
|
2024-07-05 04:26:09 +08:00
|
|
|
// async componentDidMount() {
|
|
|
|
// this.startMonitoringNetwork();
|
|
|
|
// }
|
2021-08-13 03:39:04 +08:00
|
|
|
|
|
|
|
componentWillUnmount() {
|
2024-07-03 01:58:58 +08:00
|
|
|
clearInterval(this.rateInterval);
|
2021-03-26 05:22:50 +08:00
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
handleSelectTab(tab) {
|
|
|
|
this.setState({
|
|
|
|
selectedTab: tab,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
setButtonMessage(msg) {
|
|
|
|
this.setState({
|
|
|
|
copyButtonText: msg,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-13 03:39:04 +08:00
|
|
|
/**
|
|
|
|
* Copy network data to clipboard
|
|
|
|
* @return {Promise} A Promise that is resolved after data is copied.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2022-10-28 22:10:07 +08:00
|
|
|
async copyNetworkData() {
|
2024-07-05 04:26:09 +08:00
|
|
|
const { intl, networkData } = this.props;
|
2021-08-13 03:39:04 +08:00
|
|
|
const {
|
|
|
|
hasNetworkData,
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
if (!hasNetworkData) return;
|
|
|
|
|
2022-05-24 01:09:50 +08:00
|
|
|
this.setButtonMessage(intl.formatMessage(intlMessages.copied));
|
2021-08-11 22:10:49 +08:00
|
|
|
|
2021-08-13 03:39:04 +08:00
|
|
|
const data = JSON.stringify(networkData, null, 2);
|
|
|
|
|
2021-08-11 22:10:49 +08:00
|
|
|
await navigator.clipboard.writeText(data);
|
|
|
|
|
|
|
|
this.copyNetworkDataTimeout = setTimeout(() => {
|
2022-05-24 01:09:50 +08:00
|
|
|
this.setButtonMessage(intl.formatMessage(intlMessages.copy));
|
2021-10-07 08:05:15 +08:00
|
|
|
}, MIN_TIMEOUT);
|
2021-08-11 07:45:59 +08:00
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
renderEmpty() {
|
|
|
|
const { intl } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Styled.Item last data-test="connectionStatusItemEmpty">
|
|
|
|
<Styled.Left>
|
|
|
|
<Styled.FullName>
|
|
|
|
<Styled.Text>
|
|
|
|
{intl.formatMessage(intlMessages.empty)}
|
|
|
|
</Styled.Text>
|
|
|
|
</Styled.FullName>
|
|
|
|
</Styled.Left>
|
|
|
|
</Styled.Item>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-05-14 21:35:25 +08:00
|
|
|
renderConnections() {
|
2020-05-12 21:26:08 +08:00
|
|
|
const {
|
2023-12-05 22:18:45 +08:00
|
|
|
connectionData,
|
2020-05-12 21:26:08 +08:00
|
|
|
intl,
|
|
|
|
} = this.props;
|
2020-05-14 21:35:25 +08:00
|
|
|
|
2021-10-19 04:52:59 +08:00
|
|
|
const { selectedTab } = this.state;
|
|
|
|
|
2024-08-21 21:05:37 +08:00
|
|
|
if (isConnectionStatusEmpty(connectionData) && selectedTab !== 1) return this.renderEmpty();
|
2020-05-14 21:35:25 +08:00
|
|
|
|
2023-12-05 22:18:45 +08:00
|
|
|
let connections = connectionData;
|
2023-01-11 20:27:31 +08:00
|
|
|
if (selectedTab === 1) {
|
2023-12-05 22:18:45 +08:00
|
|
|
connections = connections.filter((curr) => curr.user.userId === Auth.userID);
|
2024-08-21 21:05:37 +08:00
|
|
|
if (isConnectionStatusEmpty(connections)) {
|
|
|
|
connections = connectionStatus.getUserNetworkHistory();
|
|
|
|
}
|
2021-10-19 04:52:59 +08:00
|
|
|
if (isConnectionStatusEmpty(connections)) return this.renderEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
return connections.map((conn, index) => {
|
2023-12-05 22:18:45 +08:00
|
|
|
const dateTime = new Date(conn.lastUnstableStatusAt);
|
2020-05-14 21:35:25 +08:00
|
|
|
return (
|
2021-11-09 19:54:48 +08:00
|
|
|
<Styled.Item
|
2023-12-05 22:18:45 +08:00
|
|
|
key={`${conn.user.name}-${conn.user.userId}`}
|
2021-10-19 04:52:59 +08:00
|
|
|
last={(index + 1) === connections.length}
|
2021-04-01 21:55:27 +08:00
|
|
|
data-test="connectionStatusItemUser"
|
2020-05-14 21:35:25 +08:00
|
|
|
>
|
2021-11-09 19:54:48 +08:00
|
|
|
<Styled.Left>
|
|
|
|
<Styled.Avatar>
|
2020-05-14 21:35:25 +08:00
|
|
|
<UserAvatar
|
2023-12-05 22:18:45 +08:00
|
|
|
you={conn.user.userId === Auth.userID}
|
|
|
|
avatar={conn.user.avatar}
|
|
|
|
moderator={conn.user.isModerator}
|
|
|
|
color={conn.user.color}
|
2020-05-14 21:35:25 +08:00
|
|
|
>
|
2023-12-05 22:18:45 +08:00
|
|
|
{conn.user.name.toLowerCase().slice(0, 2)}
|
2020-05-14 21:35:25 +08:00
|
|
|
</UserAvatar>
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Avatar>
|
2020-05-12 21:26:08 +08:00
|
|
|
|
2021-11-09 19:54:48 +08:00
|
|
|
<Styled.Name>
|
|
|
|
<Styled.Text
|
2023-12-05 22:18:45 +08:00
|
|
|
offline={!conn.user.isOnline}
|
|
|
|
data-test={!conn.user.isOnline ? "offlineUser" : null}
|
2021-04-07 08:39:18 +08:00
|
|
|
>
|
2023-12-05 22:18:45 +08:00
|
|
|
{conn.user.name}
|
|
|
|
{!conn.user.isOnline ? ` (${intl.formatMessage(intlMessages.offline)})` : null}
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Text>
|
|
|
|
</Styled.Name>
|
2024-08-21 21:05:37 +08:00
|
|
|
{
|
|
|
|
!conn.clientNotResponding ? (
|
|
|
|
<Styled.Status
|
|
|
|
aria-label={`${intl.formatMessage(intlMessages.title)} ${conn.lastUnstableStatus}`}
|
|
|
|
>
|
|
|
|
<Styled.Icon>
|
|
|
|
<Icon level={conn.lastUnstableStatus} />
|
|
|
|
</Styled.Icon>
|
|
|
|
</Styled.Status>
|
|
|
|
) : null
|
|
|
|
}
|
2023-12-05 22:18:45 +08:00
|
|
|
{conn.clientNotResponding && conn.user.isOnline
|
2022-09-15 09:16:27 +08:00
|
|
|
? (
|
|
|
|
<Styled.ClientNotRespondingText>
|
|
|
|
{intl.formatMessage(intlMessages.clientNotResponding)}
|
|
|
|
</Styled.ClientNotRespondingText>
|
2023-12-05 22:18:45 +08:00
|
|
|
) : null}
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Left>
|
2023-12-05 22:18:45 +08:00
|
|
|
<Styled.Right>
|
|
|
|
<Styled.Time>
|
2024-08-21 21:05:37 +08:00
|
|
|
{
|
|
|
|
conn.lastUnstableStatusAt
|
|
|
|
? (
|
|
|
|
<time dateTime={dateTime}>
|
|
|
|
<FormattedTime value={dateTime} />
|
|
|
|
</time>
|
|
|
|
)
|
|
|
|
: (
|
|
|
|
<TooltipContainer
|
|
|
|
placement="top"
|
|
|
|
title={intl.formatMessage(intlMessages.noEvent)}
|
|
|
|
>
|
|
|
|
<CommonIcon iconName="close" rotate={false} />
|
|
|
|
</TooltipContainer>
|
|
|
|
)
|
|
|
|
}
|
2023-12-05 22:18:45 +08:00
|
|
|
</Styled.Time>
|
|
|
|
</Styled.Right>
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Item>
|
2020-05-14 21:35:25 +08:00
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-13 03:39:04 +08:00
|
|
|
/**
|
2024-03-18 21:58:53 +08:00
|
|
|
* Render network data , containing information about current upload and
|
2021-08-13 03:39:04 +08:00
|
|
|
* download rates
|
|
|
|
* @return {Object} The component to be renderized.
|
|
|
|
*/
|
|
|
|
renderNetworkData() {
|
2024-03-07 01:28:18 +08:00
|
|
|
const { enableNetworkStats } = window.meetingClientSettings.public.app;
|
2021-08-26 03:38:36 +08:00
|
|
|
|
|
|
|
if (!enableNetworkStats) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-08-13 03:39:04 +08:00
|
|
|
const {
|
2021-10-19 04:52:59 +08:00
|
|
|
audioUploadLabel,
|
|
|
|
audioDownloadLabel,
|
|
|
|
videoUploadLabel,
|
|
|
|
videoDownloadLabel,
|
2021-08-13 03:39:04 +08:00
|
|
|
} = this;
|
|
|
|
|
2023-12-06 20:12:25 +08:00
|
|
|
const { intl, setModalIsOpen, connectionData } = this.props;
|
2021-08-25 03:35:41 +08:00
|
|
|
|
2024-07-05 04:26:09 +08:00
|
|
|
const { networkData } = this.props;
|
2021-08-13 03:39:04 +08:00
|
|
|
|
|
|
|
const {
|
|
|
|
audioCurrentUploadRate,
|
|
|
|
audioCurrentDownloadRate,
|
2021-08-25 03:35:41 +08:00
|
|
|
jitter,
|
|
|
|
packetsLost,
|
|
|
|
transportStats,
|
2021-08-13 03:39:04 +08:00
|
|
|
} = networkData.audio;
|
|
|
|
|
|
|
|
const {
|
|
|
|
videoCurrentUploadRate,
|
|
|
|
videoCurrentDownloadRate,
|
|
|
|
} = networkData.video;
|
|
|
|
|
2021-08-25 03:35:41 +08:00
|
|
|
let isUsingTurn = '--';
|
|
|
|
|
|
|
|
if (transportStats) {
|
|
|
|
switch (transportStats.isUsingTurn) {
|
|
|
|
case true:
|
|
|
|
isUsingTurn = intl.formatMessage(intlMessages.yes);
|
|
|
|
break;
|
|
|
|
case false:
|
|
|
|
isUsingTurn = intl.formatMessage(intlMessages.no);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-13 03:39:04 +08:00
|
|
|
return (
|
2022-06-10 22:50:35 +08:00
|
|
|
<Styled.NetworkDataContainer
|
|
|
|
data-test="networkDataContainer"
|
|
|
|
tabIndex={0}
|
|
|
|
>
|
|
|
|
<Styled.HelperWrapper>
|
|
|
|
<Styled.Helper>
|
2023-12-06 20:12:25 +08:00
|
|
|
<ConnectionStatusHelper
|
|
|
|
connectionData={connectionData}
|
|
|
|
closeModal={() => setModalIsOpen(false)}
|
|
|
|
/>
|
2022-06-10 22:50:35 +08:00
|
|
|
</Styled.Helper>
|
|
|
|
</Styled.HelperWrapper>
|
|
|
|
<Styled.NetworkDataContent>
|
2021-10-19 04:52:59 +08:00
|
|
|
<Styled.DataColumn>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${audioUploadLabel}`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>{`${audioCurrentUploadRate}k ↑`}</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${videoUploadLabel}`}</div>
|
2022-09-13 01:10:57 +08:00
|
|
|
<div data-test="videoUploadRateData">{`${videoCurrentUploadRate}k ↑`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
</Styled.NetworkData>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${intl.formatMessage(intlMessages.jitter)}`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>{`${jitter} ms`}</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${intl.formatMessage(intlMessages.usingTurn)}`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>{`${isUsingTurn}`}</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
</Styled.DataColumn>
|
|
|
|
|
|
|
|
<Styled.DataColumn>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${audioDownloadLabel}`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>{`${audioCurrentDownloadRate}k ↓`}</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${videoDownloadLabel}`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>{`${videoCurrentDownloadRate}k ↓`}</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
<Styled.NetworkData>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>{`${intl.formatMessage(intlMessages.lostPackets)}`}</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>{`${packetsLost}`}</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
<Styled.NetworkData invisible>
|
2021-11-23 20:05:02 +08:00
|
|
|
<div>Content Hidden</div>
|
2021-10-19 04:52:59 +08:00
|
|
|
<div>0</div>
|
|
|
|
</Styled.NetworkData>
|
|
|
|
</Styled.DataColumn>
|
|
|
|
</Styled.NetworkDataContent>
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.NetworkDataContainer>
|
2021-08-13 03:39:04 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the clipboard's copy button, for network stats.
|
|
|
|
* @return {Object} - The component to be renderized
|
|
|
|
*/
|
|
|
|
renderCopyDataButton() {
|
2024-03-07 01:28:18 +08:00
|
|
|
const { enableCopyNetworkStatsButton } = window.meetingClientSettings.public.app;
|
2021-08-26 03:38:36 +08:00
|
|
|
|
|
|
|
if (!enableCopyNetworkStatsButton) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
const { hasNetworkData, copyButtonText } = this.state;
|
2021-08-13 03:39:04 +08:00
|
|
|
return (
|
2021-11-09 19:54:48 +08:00
|
|
|
<Styled.CopyContainer aria-live="polite">
|
|
|
|
<Styled.Copy
|
|
|
|
disabled={!hasNetworkData}
|
2021-08-13 03:39:04 +08:00
|
|
|
role="button"
|
2023-12-05 22:18:45 +08:00
|
|
|
data-test="copyStats"
|
2021-08-13 03:39:04 +08:00
|
|
|
onClick={this.copyNetworkData.bind(this)}
|
|
|
|
onKeyPress={this.copyNetworkData.bind(this)}
|
|
|
|
tabIndex={0}
|
|
|
|
>
|
2022-10-28 22:10:07 +08:00
|
|
|
{copyButtonText}
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Copy>
|
|
|
|
</Styled.CopyContainer>
|
2021-08-13 03:39:04 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-04-10 01:01:46 +08:00
|
|
|
render() {
|
|
|
|
const {
|
2023-03-21 01:57:36 +08:00
|
|
|
setModalIsOpen,
|
2020-04-10 01:01:46 +08:00
|
|
|
intl,
|
2023-03-21 01:57:36 +08:00
|
|
|
isModalOpen,
|
2024-04-04 21:41:01 +08:00
|
|
|
amIModerator,
|
2020-04-10 01:01:46 +08:00
|
|
|
} = this.props;
|
|
|
|
|
2023-02-17 20:58:24 +08:00
|
|
|
const { selectedTab } = this.state;
|
2021-02-25 21:14:09 +08:00
|
|
|
|
2020-04-10 01:01:46 +08:00
|
|
|
return (
|
2021-11-09 19:54:48 +08:00
|
|
|
<Styled.ConnectionStatusModal
|
2023-03-21 01:57:36 +08:00
|
|
|
priority="low"
|
|
|
|
onRequestClose={() => setModalIsOpen(false)}
|
|
|
|
setIsOpen={setModalIsOpen}
|
2020-04-10 01:01:46 +08:00
|
|
|
hideBorder
|
2023-03-21 01:57:36 +08:00
|
|
|
isOpen={isModalOpen}
|
2020-04-10 01:01:46 +08:00
|
|
|
contentLabel={intl.formatMessage(intlMessages.ariaTitle)}
|
2022-01-20 21:03:18 +08:00
|
|
|
data-test="connectionStatusModal"
|
2020-04-10 01:01:46 +08:00
|
|
|
>
|
2021-11-09 19:54:48 +08:00
|
|
|
<Styled.Container>
|
|
|
|
<Styled.Header>
|
|
|
|
<Styled.Title>
|
2020-04-10 01:01:46 +08:00
|
|
|
{intl.formatMessage(intlMessages.title)}
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Title>
|
|
|
|
</Styled.Header>
|
2022-10-28 22:10:07 +08:00
|
|
|
|
|
|
|
<Styled.ConnectionTabs
|
|
|
|
onSelect={this.handleSelectTab}
|
|
|
|
selectedIndex={selectedTab}
|
|
|
|
>
|
|
|
|
<Styled.ConnectionTabList>
|
|
|
|
<Styled.ConnectionTabSelector selectedClassName="is-selected">
|
2022-10-28 23:58:32 +08:00
|
|
|
<span id="connection-status-tab">{intl.formatMessage(intlMessages.title)}</span>
|
2022-10-28 22:10:07 +08:00
|
|
|
</Styled.ConnectionTabSelector>
|
|
|
|
<Styled.ConnectionTabSelector selectedClassName="is-selected">
|
2022-10-28 23:58:32 +08:00
|
|
|
<span id="my-logs-tab">{intl.formatMessage(intlMessages.myLogs)}</span>
|
2022-10-28 22:10:07 +08:00
|
|
|
</Styled.ConnectionTabSelector>
|
2024-04-04 21:41:01 +08:00
|
|
|
{amIModerator
|
2022-10-29 00:07:06 +08:00
|
|
|
&& (
|
|
|
|
<Styled.ConnectionTabSelector selectedClassName="is-selected">
|
|
|
|
<span id="session-logs-tab">{intl.formatMessage(intlMessages.sessionLogs)}</span>
|
|
|
|
</Styled.ConnectionTabSelector>
|
|
|
|
)
|
2021-10-19 04:52:59 +08:00
|
|
|
}
|
2022-10-28 22:10:07 +08:00
|
|
|
</Styled.ConnectionTabList>
|
|
|
|
<Styled.ConnectionTabPanel selectedClassName="is-selected">
|
|
|
|
<div>
|
|
|
|
{this.renderNetworkData()}
|
|
|
|
{this.renderCopyDataButton()}
|
|
|
|
</div>
|
|
|
|
</Styled.ConnectionTabPanel>
|
|
|
|
<Styled.ConnectionTabPanel selectedClassName="is-selected">
|
2023-07-31 22:24:25 +08:00
|
|
|
<ul>{this.renderConnections()}</ul>
|
2022-10-28 22:10:07 +08:00
|
|
|
</Styled.ConnectionTabPanel>
|
2024-04-04 21:41:01 +08:00
|
|
|
{amIModerator
|
2022-10-29 00:07:06 +08:00
|
|
|
&& (
|
|
|
|
<Styled.ConnectionTabPanel selectedClassName="is-selected">
|
2023-07-31 22:24:25 +08:00
|
|
|
<ul>{this.renderConnections()}</ul>
|
2022-10-29 00:07:06 +08:00
|
|
|
</Styled.ConnectionTabPanel>
|
|
|
|
)
|
2021-02-25 21:14:09 +08:00
|
|
|
}
|
2022-10-28 22:10:07 +08:00
|
|
|
</Styled.ConnectionTabs>
|
2021-11-09 19:54:48 +08:00
|
|
|
</Styled.Container>
|
|
|
|
</Styled.ConnectionStatusModal>
|
2020-04-10 01:01:46 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ConnectionStatusComponent.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default injectIntl(ConnectionStatusComponent);
|