Преглед изворни кода

UI: refine LocalRecordingInfoDialog

master
Radium Zheng пре 7 година
родитељ
комит
dda7568a48

+ 1
- 0
css/main.scss Прегледај датотеку

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

+ 92
- 0
css/modals/local-recording/_local-recording.scss Прегледај датотеку

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

+ 69
- 43
react/features/local-recording/components/LocalRecordingInfoDialog.js Прегледај датотеку

152
                 cancelTitleKey = { 'dialog.close' }
152
                 cancelTitleKey = { 'dialog.close' }
153
                 submitDisabled = { true }
153
                 submitDisabled = { true }
154
                 titleKey = 'localRecording.dialogTitle'>
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
                 </div>
164
                 </div>
165
+                { this._renderModeratorControls() }
166
+                { this._renderDurationAndFormat() }
172
             </Dialog>
167
             </Dialog>
173
         );
168
         );
174
     }
169
     }
191
         return (
186
         return (
192
             <div>
187
             <div>
193
                 <div>
188
                 <div>
194
-                    <span className = 'info-label'>
189
+                    <span className = 'localrec-control-info-label'>
195
                         {`${t('localRecording.duration')}:`}
190
                         {`${t('localRecording.duration')}:`}
196
                     </span>
191
                     </span>
197
-                    <span className = 'spacer'>&nbsp;</span>
198
                     <span className = 'info-value'>
192
                     <span className = 'info-value'>
199
                         { durationString === ''
193
                         { durationString === ''
200
                             ? t('localRecording.durationNA')
194
                             ? t('localRecording.durationNA')
202
                     </span>
196
                     </span>
203
                 </div>
197
                 </div>
204
                 <div>
198
                 <div>
205
-                    <span className = 'info-label'>
199
+                    <span className = 'localrec-control-info-label'>
206
                         {`${t('localRecording.encoding')}:`}
200
                         {`${t('localRecording.encoding')}:`}
207
                     </span>
201
                     </span>
208
-                    <span className = 'spacer'>&nbsp;</span>
209
                     <span className = 'info-value'>
202
                     <span className = 'info-value'>
210
                         { encodingFormat }
203
                         { encodingFormat }
211
                     </span>
204
                     </span>
219
      * each participant.
212
      * each participant.
220
      *
213
      *
221
      * @private
214
      * @private
222
-     * @returns {ReactElement}
215
+     * @returns {ReactElement|null}
223
      */
216
      */
224
     _renderStats() {
217
     _renderStats() {
225
         const { stats } = this.props;
218
         const { stats } = this.props;
226
 
219
 
227
         if (stats === undefined) {
220
         if (stats === undefined) {
228
-            return <ul />;
221
+            return null;
229
         }
222
         }
230
         const ids = Object.keys(stats);
223
         const ids = Object.keys(stats);
231
 
224
 
232
         return (
225
         return (
233
-            <ul>
226
+            <div className = 'localrec-participant-stats' >
227
+                { this._renderStatsHeader() }
234
                 { ids.map((id, i) => this._renderStatsLine(i, id)) }
228
                 { ids.map((id, i) => this._renderStatsLine(i, id)) }
235
-            </ul>
229
+            </div>
236
         );
230
         );
237
     }
231
     }
238
 
232
 
245
      * @returns {ReactElement}
239
      * @returns {ReactElement}
246
      */
240
      */
247
     _renderStatsLine(lineKey, id) {
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
         return (
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
 
303
 
278
         return (
304
         return (
279
             <div>
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
                         { isEngaged ? <a
308
                         { isEngaged ? <a
289
                             onClick = { this._onStop }>
309
                             onClick = { this._onStop }>
290
                             { t('localRecording.stop') }
310
                             { t('localRecording.stop') }
296
                         }
316
                         }
297
                     </div>
317
                     </div>
298
                 </div>
318
                 </div>
319
+                <div>
320
+                    <span className = 'localrec-control-info-label'>
321
+                        {`${t('localRecording.participantStats')}:`}
322
+                    </span>
323
+                </div>
324
+                { this._renderStats() }
299
             </div>
325
             </div>
300
         );
326
         );
301
     }
327
     }

Loading…
Откажи
Сачувај