UI: refine LocalRecordingInfoDialog

This commit is contained in:
Radium Zheng 2018-08-01 09:51:37 +10:00
parent 4550848eac
commit dda7568a48
4 changed files with 166 additions and 45 deletions

View File

@ -45,6 +45,7 @@
@import 'modals/settings/settings'; @import 'modals/settings/settings';
@import 'modals/speaker_stats/speaker_stats'; @import 'modals/speaker_stats/speaker_stats';
@import 'modals/video-quality/video-quality'; @import 'modals/video-quality/video-quality';
@import 'modals/local-recording/local-recording';
@import 'videolayout_default'; @import 'videolayout_default';
@import 'notice'; @import 'notice';
@import 'popup_menu'; @import 'popup_menu';

View File

@ -0,0 +1,92 @@
.localrec-participant-stats {
list-style: none;
padding: 0;
width: 100%;
font-weight: 500;
.localrec-participant-stats-item__status-dot {
position: relative;
display: block;
width: 9px;
height: 9px;
border-radius: 50%;
margin: 0 auto;
&.status-on {
background: green;
}
&.status-off {
background: gray;
}
&.status-unknown {
background: darkgoldenrod;
}
&.status-error {
background: darkred;
}
}
.localrec-participant-stats-item__status,
.localrec-participant-stats-item__name,
.localrec-participant-stats-item__sessionid {
display: inline-block;
margin: 5px 0;
vertical-align: middle;
}
.localrec-participant-stats-item__status {
width: 5%;
}
.localrec-participant-stats-item__name {
width: 40%;
}
.localrec-participant-stats-item__sessionid {
width: 55%;
}
.localrec-participant-stats-item__name,
.localrec-participant-stats-item__sessionid {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.localrec-control-info-label {
font-weight: bold;
}
.localrec-control-info-label:after {
content: ' ';
}
.localrec-control-action-link {
display: inline-block;
line-height: 1.5em;
a {
cursor: pointer;
vertical-align: middle;
}
}
.localrec-control-action-link:before {
color: $linkFontColor;
content: '\2022';
font-size: 1.5em;
padding: 0 10px;
vertical-align: middle;
}
.localrec-control-action-link:first-child:before {
content: '';
padding: 0;
}
.localrec-control-action-links {
font-weight: bold;
margin-top: 10px;
white-space: nowrap;
}

View File

@ -672,14 +672,16 @@
"localRecording": { "localRecording": {
"localRecording": "Local Recording", "localRecording": "Local Recording",
"dialogTitle": "Local Recording Controls", "dialogTitle": "Local Recording Controls",
"start": "Start", "start": "Start Recording",
"stop": "Stop", "stop": "Stop Recording",
"moderator": "Moderator", "moderator": "Moderator",
"me": "Me", "me": "Me",
"duration": "Duration", "duration": "Duration",
"durationNA": "N/A", "durationNA": "N/A",
"encoding": "Encoding", "encoding": "Encoding",
"participantStats": "Participant Stats", "participantStats": "Participant Stats",
"participant": "Participant",
"sessionToken": "Session Token",
"clientState": { "clientState": {
"on": "On", "on": "On",
"off": "Off", "off": "Off",

View File

@ -152,23 +152,18 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
cancelTitleKey = { 'dialog.close' } cancelTitleKey = { 'dialog.close' }
submitDisabled = { true } submitDisabled = { true }
titleKey = 'localRecording.dialogTitle'> titleKey = 'localRecording.dialogTitle'>
<div className = 'info-dialog'> <div className = 'localrec-control'>
<div className = 'info-dialog-column'> <span className = 'localrec-control-info-label'>
<div> {`${t('localRecording.moderator')}:`}
<span className = 'info-label'> </span>
{`${t('localRecording.moderator')}:`} <span className = 'info-value'>
</span> { isModerator
<span className = 'spacer'>&nbsp;</span> ? t('localRecording.yes')
<span className = 'info-value'> : t('localRecording.no') }
{ isModerator </span>
? t('localRecording.yes')
: t('localRecording.no') }
</span>
</div>
{ this._renderDurationAndFormat() }
{ this._renderModeratorControls() }
</div>
</div> </div>
{ this._renderModeratorControls() }
{ this._renderDurationAndFormat() }
</Dialog> </Dialog>
); );
} }
@ -191,10 +186,9 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
return ( return (
<div> <div>
<div> <div>
<span className = 'info-label'> <span className = 'localrec-control-info-label'>
{`${t('localRecording.duration')}:`} {`${t('localRecording.duration')}:`}
</span> </span>
<span className = 'spacer'>&nbsp;</span>
<span className = 'info-value'> <span className = 'info-value'>
{ durationString === '' { durationString === ''
? t('localRecording.durationNA') ? t('localRecording.durationNA')
@ -202,10 +196,9 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
</span> </span>
</div> </div>
<div> <div>
<span className = 'info-label'> <span className = 'localrec-control-info-label'>
{`${t('localRecording.encoding')}:`} {`${t('localRecording.encoding')}:`}
</span> </span>
<span className = 'spacer'>&nbsp;</span>
<span className = 'info-value'> <span className = 'info-value'>
{ encodingFormat } { encodingFormat }
</span> </span>
@ -219,20 +212,21 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
* each participant. * each participant.
* *
* @private * @private
* @returns {ReactElement} * @returns {ReactElement|null}
*/ */
_renderStats() { _renderStats() {
const { stats } = this.props; const { stats } = this.props;
if (stats === undefined) { if (stats === undefined) {
return <ul />; return null;
} }
const ids = Object.keys(stats); const ids = Object.keys(stats);
return ( return (
<ul> <div className = 'localrec-participant-stats' >
{ this._renderStatsHeader() }
{ ids.map((id, i) => this._renderStatsLine(i, id)) } { ids.map((id, i) => this._renderStatsLine(i, id)) }
</ul> </div>
); );
} }
@ -245,19 +239,51 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
* @returns {ReactElement} * @returns {ReactElement}
*/ */
_renderStatsLine(lineKey, id) { _renderStatsLine(lineKey, id) {
const { stats, t } = this.props; const { stats } = this.props;
let statusClass = 'localrec-participant-stats-item__status-dot ';
statusClass += stats[id].recordingStats
? stats[id].recordingStats.isRecording
? 'status-on'
: 'status-off'
: 'status-unknown';
return ( return (
<li key = { lineKey }> <div
<span>{stats[id].displayName || id}: </span> className = 'localrec-participant-stats-item'
<span>{stats[id].recordingStats key = { lineKey } >
? `${stats[id].recordingStats.isRecording <div className = 'localrec-participant-stats-item__status'>
? t('localRecording.clientState.on') <span className = { statusClass } />
: t('localRecording.clientState.off')} ` </div>
+ `(${stats[id] <div className = 'localrec-participant-stats-item__name'>
.recordingStats.currentSessionToken})` { stats[id].displayName || id }
: t('localRecording.clientState.unknown')}</span> </div>
</li> <div className = 'localrec-participant-stats-item__sessionid'>
{ stats[id].recordingStats.currentSessionToken }
</div>
</div>
);
}
/**
* Renders the participant stats header line.
*
* @private
* @returns {ReactElement}
*/
_renderStatsHeader() {
const { t } = this.props;
return (
<div className = 'localrec-participant-stats-item'>
<div className = 'localrec-participant-stats-item__status' />
<div className = 'localrec-participant-stats-item__name'>
{ t('localRecording.participant') }
</div>
<div className = 'localrec-participant-stats-item__sessionid'>
{ t('localRecording.sessionToken') }
</div>
</div>
); );
} }
@ -277,14 +303,8 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
return ( return (
<div> <div>
<div> <div className = 'localrec-control-action-links'>
<span className = 'info-label'> <div className = 'localrec-control-action-link'>
{`${t('localRecording.participantStats')}:`}
</span>
</div>
{ this._renderStats() }
<div className = 'info-dialog-action-links'>
<div className = 'info-dialog-action-link'>
{ isEngaged ? <a { isEngaged ? <a
onClick = { this._onStop }> onClick = { this._onStop }>
{ t('localRecording.stop') } { t('localRecording.stop') }
@ -296,6 +316,12 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
} }
</div> </div>
</div> </div>
<div>
<span className = 'localrec-control-info-label'>
{`${t('localRecording.participantStats')}:`}
</span>
</div>
{ this._renderStats() }
</div> </div>
); );
} }