瀏覽代碼

UI: refine LocalRecordingInfoDialog

factor2
Radium Zheng 7 年之前
父節點
當前提交
dda7568a48

+ 1
- 0
css/main.scss 查看文件

@@ -45,6 +45,7 @@
45 45
 @import 'modals/settings/settings';
46 46
 @import 'modals/speaker_stats/speaker_stats';
47 47
 @import 'modals/video-quality/video-quality';
48
+@import 'modals/local-recording/local-recording';
48 49
 @import 'videolayout_default';
49 50
 @import 'notice';
50 51
 @import 'popup_menu';

+ 92
- 0
css/modals/local-recording/_local-recording.scss 查看文件

@@ -0,0 +1,92 @@
1
+.localrec-participant-stats {
2
+    list-style: none;
3
+    padding: 0;
4
+    width: 100%;
5
+    font-weight: 500;
6
+
7
+    .localrec-participant-stats-item__status-dot {
8
+        position: relative;
9
+        display: block;
10
+        width: 9px;
11
+        height: 9px;
12
+        border-radius: 50%;
13
+        margin: 0 auto;
14
+
15
+        &.status-on {
16
+            background: green;
17
+        }
18
+
19
+        &.status-off {
20
+            background: gray;
21
+        }
22
+
23
+        &.status-unknown {
24
+            background: darkgoldenrod;
25
+        }
26
+
27
+        &.status-error {
28
+            background: darkred;
29
+        }
30
+    }
31
+
32
+    .localrec-participant-stats-item__status,
33
+    .localrec-participant-stats-item__name,
34
+    .localrec-participant-stats-item__sessionid {
35
+        display: inline-block;
36
+        margin: 5px 0;
37
+        vertical-align: middle;
38
+    }
39
+    .localrec-participant-stats-item__status {
40
+        width: 5%;
41
+    }
42
+    .localrec-participant-stats-item__name {
43
+        width: 40%;
44
+    }
45
+    .localrec-participant-stats-item__sessionid {
46
+        width: 55%;
47
+    }
48
+
49
+    .localrec-participant-stats-item__name,
50
+    .localrec-participant-stats-item__sessionid {
51
+        overflow: hidden;
52
+        text-overflow: ellipsis;
53
+        white-space: nowrap;
54
+    }
55
+}
56
+
57
+.localrec-control-info-label {
58
+    font-weight: bold;
59
+}
60
+
61
+.localrec-control-info-label:after {
62
+    content: ' ';
63
+}
64
+
65
+.localrec-control-action-link {
66
+    display: inline-block;
67
+    line-height: 1.5em;
68
+
69
+    a {
70
+        cursor: pointer;
71
+        vertical-align: middle;
72
+    }
73
+}
74
+
75
+.localrec-control-action-link:before {
76
+    color: $linkFontColor;
77
+    content: '\2022';
78
+    font-size: 1.5em;
79
+    padding: 0 10px;
80
+    vertical-align: middle;
81
+}
82
+
83
+.localrec-control-action-link:first-child:before {
84
+    content: '';
85
+    padding: 0;
86
+}
87
+
88
+.localrec-control-action-links {
89
+    font-weight: bold;
90
+    margin-top: 10px;
91
+    white-space: nowrap;
92
+}

+ 4
- 2
lang/main.json 查看文件

@@ -672,14 +672,16 @@
672 672
     "localRecording": {
673 673
         "localRecording": "Local Recording",
674 674
         "dialogTitle": "Local Recording Controls",
675
-        "start": "Start",
676
-        "stop": "Stop",
675
+        "start": "Start Recording",
676
+        "stop": "Stop Recording",
677 677
         "moderator": "Moderator",
678 678
         "me": "Me",
679 679
         "duration": "Duration",
680 680
         "durationNA": "N/A",
681 681
         "encoding": "Encoding",
682 682
         "participantStats": "Participant Stats",
683
+        "participant": "Participant",
684
+        "sessionToken": "Session Token",
683 685
         "clientState": {
684 686
             "on": "On",
685 687
             "off": "Off",

+ 69
- 43
react/features/local-recording/components/LocalRecordingInfoDialog.js 查看文件

@@ -152,23 +152,18 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
152 152
                 cancelTitleKey = { 'dialog.close' }
153 153
                 submitDisabled = { true }
154 154
                 titleKey = 'localRecording.dialogTitle'>
155
-                <div className = 'info-dialog'>
156
-                    <div className = 'info-dialog-column'>
157
-                        <div>
158
-                            <span className = 'info-label'>
159
-                                {`${t('localRecording.moderator')}:`}
160
-                            </span>
161
-                            <span className = 'spacer'>&nbsp;</span>
162
-                            <span className = 'info-value'>
163
-                                { isModerator
164
-                                    ? t('localRecording.yes')
165
-                                    : t('localRecording.no') }
166
-                            </span>
167
-                        </div>
168
-                        { this._renderDurationAndFormat() }
169
-                        { this._renderModeratorControls() }
170
-                    </div>
155
+                <div className = 'localrec-control'>
156
+                    <span className = 'localrec-control-info-label'>
157
+                        {`${t('localRecording.moderator')}:`}
158
+                    </span>
159
+                    <span className = 'info-value'>
160
+                        { isModerator
161
+                            ? t('localRecording.yes')
162
+                            : t('localRecording.no') }
163
+                    </span>
171 164
                 </div>
165
+                { this._renderModeratorControls() }
166
+                { this._renderDurationAndFormat() }
172 167
             </Dialog>
173 168
         );
174 169
     }
@@ -191,10 +186,9 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
191 186
         return (
192 187
             <div>
193 188
                 <div>
194
-                    <span className = 'info-label'>
189
+                    <span className = 'localrec-control-info-label'>
195 190
                         {`${t('localRecording.duration')}:`}
196 191
                     </span>
197
-                    <span className = 'spacer'>&nbsp;</span>
198 192
                     <span className = 'info-value'>
199 193
                         { durationString === ''
200 194
                             ? t('localRecording.durationNA')
@@ -202,10 +196,9 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
202 196
                     </span>
203 197
                 </div>
204 198
                 <div>
205
-                    <span className = 'info-label'>
199
+                    <span className = 'localrec-control-info-label'>
206 200
                         {`${t('localRecording.encoding')}:`}
207 201
                     </span>
208
-                    <span className = 'spacer'>&nbsp;</span>
209 202
                     <span className = 'info-value'>
210 203
                         { encodingFormat }
211 204
                     </span>
@@ -219,20 +212,21 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
219 212
      * each participant.
220 213
      *
221 214
      * @private
222
-     * @returns {ReactElement}
215
+     * @returns {ReactElement|null}
223 216
      */
224 217
     _renderStats() {
225 218
         const { stats } = this.props;
226 219
 
227 220
         if (stats === undefined) {
228
-            return <ul />;
221
+            return null;
229 222
         }
230 223
         const ids = Object.keys(stats);
231 224
 
232 225
         return (
233
-            <ul>
226
+            <div className = 'localrec-participant-stats' >
227
+                { this._renderStatsHeader() }
234 228
                 { ids.map((id, i) => this._renderStatsLine(i, id)) }
235
-            </ul>
229
+            </div>
236 230
         );
237 231
     }
238 232
 
@@ -245,19 +239,51 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
245 239
      * @returns {ReactElement}
246 240
      */
247 241
     _renderStatsLine(lineKey, id) {
248
-        const { stats, t } = this.props;
242
+        const { stats } = this.props;
243
+        let statusClass = 'localrec-participant-stats-item__status-dot ';
244
+
245
+        statusClass += stats[id].recordingStats
246
+            ? stats[id].recordingStats.isRecording
247
+                ? 'status-on'
248
+                : 'status-off'
249
+            : 'status-unknown';
249 250
 
250 251
         return (
251
-            <li key = { lineKey }>
252
-                <span>{stats[id].displayName || id}: </span>
253
-                <span>{stats[id].recordingStats
254
-                    ? `${stats[id].recordingStats.isRecording
255
-                        ? t('localRecording.clientState.on')
256
-                        : t('localRecording.clientState.off')} `
257
-                    + `(${stats[id]
258
-                        .recordingStats.currentSessionToken})`
259
-                    : t('localRecording.clientState.unknown')}</span>
260
-            </li>
252
+            <div
253
+                className = 'localrec-participant-stats-item'
254
+                key = { lineKey } >
255
+                <div className = 'localrec-participant-stats-item__status'>
256
+                    <span className = { statusClass } />
257
+                </div>
258
+                <div className = 'localrec-participant-stats-item__name'>
259
+                    { stats[id].displayName || id }
260
+                </div>
261
+                <div className = 'localrec-participant-stats-item__sessionid'>
262
+                    { stats[id].recordingStats.currentSessionToken }
263
+                </div>
264
+            </div>
265
+        );
266
+    }
267
+
268
+    /**
269
+     * Renders the participant stats header line.
270
+     *
271
+     * @private
272
+     * @returns {ReactElement}
273
+     */
274
+    _renderStatsHeader() {
275
+        const { t } = this.props;
276
+
277
+        return (
278
+            <div className = 'localrec-participant-stats-item'>
279
+                <div className = 'localrec-participant-stats-item__status' />
280
+                <div className = 'localrec-participant-stats-item__name'>
281
+                    { t('localRecording.participant') }
282
+                </div>
283
+                <div className = 'localrec-participant-stats-item__sessionid'>
284
+                    { t('localRecording.sessionToken') }
285
+                </div>
286
+            </div>
261 287
         );
262 288
     }
263 289
 
@@ -277,14 +303,8 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
277 303
 
278 304
         return (
279 305
             <div>
280
-                <div>
281
-                    <span className = 'info-label'>
282
-                        {`${t('localRecording.participantStats')}:`}
283
-                    </span>
284
-                </div>
285
-                { this._renderStats() }
286
-                <div className = 'info-dialog-action-links'>
287
-                    <div className = 'info-dialog-action-link'>
306
+                <div className = 'localrec-control-action-links'>
307
+                    <div className = 'localrec-control-action-link'>
288 308
                         { isEngaged ? <a
289 309
                             onClick = { this._onStop }>
290 310
                             { t('localRecording.stop') }
@@ -296,6 +316,12 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
296 316
                         }
297 317
                     </div>
298 318
                 </div>
319
+                <div>
320
+                    <span className = 'localrec-control-info-label'>
321
+                        {`${t('localRecording.participantStats')}:`}
322
+                    </span>
323
+                </div>
324
+                { this._renderStats() }
299 325
             </div>
300 326
         );
301 327
     }

Loading…
取消
儲存