瀏覽代碼

feat(stats - show more): local p2p transport indication

Will show (direct) next to the UPD or TCP transport type if we're
running on P2P connection.
j8
paweldomas 8 年之前
父節點
當前提交
2973364c02
共有 2 個檔案被更改,包括 12 行新增3 行删除
  1. 2
    1
      lang/main.json
  2. 10
    2
      modules/UI/videolayout/ConnectionIndicator.js

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

@@ -192,7 +192,8 @@
192 192
         "transport": "Transport:",
193 193
         "transport_plural": "Transports:",
194 194
         "bandwidth": "Estimated bandwidth:",
195
-        "na": "Come back here for connection information once the conference starts"
195
+        "na": "Come back here for connection information once the conference starts",
196
+        "direct": " (direct)"
196 197
     },
197 198
     "notify": {
198 199
         "disconnected": "disconnected",

+ 10
- 2
modules/UI/videolayout/ConnectionIndicator.js 查看文件

@@ -198,6 +198,9 @@ ConnectionIndicator.prototype.generateText = function () {
198 198
                 }
199 199
             }
200 200
 
201
+            // All of the transports should be either P2P or JVB
202
+            const isP2P = this.transport.length ? this.transport[0].p2p : false;
203
+
201 204
             var local_address_key = "connectionindicator.localaddress";
202 205
             var remote_address_key = "connectionindicator.remoteaddress";
203 206
             var localTransport =
@@ -243,8 +246,13 @@ ConnectionIndicator.prototype.generateText = function () {
243 246
                     JSON.stringify({count: data.transportType.length})
244 247
                 + "'></span></td>" +
245 248
                 "<td>"
246
-                    + ConnectionIndicator.getStringFromArray(data.transportType)
247
-                + "</td></tr>";
249
+                    + ConnectionIndicator.getStringFromArray(data.transportType);
250
+            // Append (direct) to indicate the P2P type of transport
251
+            if (isP2P) {
252
+                transport += "<span data-i18n='connectionindicator.direct'>";
253
+            }
254
+            // Close "type" column and end table row
255
+            transport += "</td></tr>";
248 256
 
249 257
         }
250 258
 

Loading…
取消
儲存