Browse Source

add webclient v2 preview

ljw 1 year ago
parent
commit
399c32da7d
91 changed files with 178224 additions and 1 deletions
  1. 2 1
      .gitattributes
  2. 1 0
      .gitignore
  3. 1 0
      http/router/router.go
  4. 1 0
      resources/web2/assets/AssetManifest.bin
  5. 1 0
      resources/web2/assets/AssetManifest.json
  6. 42 0
      resources/web2/assets/FontManifest.json
  7. 1 0
      resources/web2/assets/assets/actions.svg
  8. 1 0
      resources/web2/assets/assets/actions_mobile.svg
  9. BIN
      resources/web2/assets/assets/address_book.ttf
  10. 1 0
      resources/web2/assets/assets/android.svg
  11. 1 0
      resources/web2/assets/assets/arrow.svg
  12. 1 0
      resources/web2/assets/assets/auth-apple.svg
  13. 1 0
      resources/web2/assets/assets/auth-auth0.svg
  14. 1 0
      resources/web2/assets/assets/auth-azure.svg
  15. 1 0
      resources/web2/assets/assets/auth-default.svg
  16. 1 0
      resources/web2/assets/assets/auth-facebook.svg
  17. 1 0
      resources/web2/assets/assets/auth-github.svg
  18. 1 0
      resources/web2/assets/assets/auth-gitlab.svg
  19. 1 0
      resources/web2/assets/assets/auth-google.svg
  20. 1 0
      resources/web2/assets/assets/auth-okta.svg
  21. 1 0
      resources/web2/assets/assets/call_end.svg
  22. 1 0
      resources/web2/assets/assets/call_wait.svg
  23. 1 0
      resources/web2/assets/assets/chat.svg
  24. 1 0
      resources/web2/assets/assets/chat2.svg
  25. 1 0
      resources/web2/assets/assets/checkbox-outline.svg
  26. 1 0
      resources/web2/assets/assets/chevron_up_chevron_down.svg
  27. 1 0
      resources/web2/assets/assets/close.svg
  28. 1 0
      resources/web2/assets/assets/display.svg
  29. 1 0
      resources/web2/assets/assets/dots.svg
  30. 1 0
      resources/web2/assets/assets/file.svg
  31. 1 0
      resources/web2/assets/assets/file_transfer.svg
  32. 1 0
      resources/web2/assets/assets/folder.svg
  33. 1 0
      resources/web2/assets/assets/folder_new.svg
  34. 1 0
      resources/web2/assets/assets/fullscreen.svg
  35. 1 0
      resources/web2/assets/assets/fullscreen_exit.svg
  36. BIN
      resources/web2/assets/assets/gestures.ttf
  37. 1 0
      resources/web2/assets/assets/home.svg
  38. 1 0
      resources/web2/assets/assets/icon.svg
  39. 1 0
      resources/web2/assets/assets/insecure.svg
  40. 1 0
      resources/web2/assets/assets/insecure_relay.svg
  41. 1 0
      resources/web2/assets/assets/kb_layout_iso.svg
  42. 1 0
      resources/web2/assets/assets/kb_layout_not_iso.svg
  43. 1 0
      resources/web2/assets/assets/keyboard.svg
  44. 1 0
      resources/web2/assets/assets/linux.svg
  45. 1 0
      resources/web2/assets/assets/mac.svg
  46. 1 0
      resources/web2/assets/assets/message_24dp_5F6368.svg
  47. BIN
      resources/web2/assets/assets/peer_searchbar.ttf
  48. 1 0
      resources/web2/assets/assets/pinned.svg
  49. 1 0
      resources/web2/assets/assets/rec.svg
  50. 1 0
      resources/web2/assets/assets/record_screen.svg
  51. 1 0
      resources/web2/assets/assets/refresh.svg
  52. BIN
      resources/web2/assets/assets/scam.png
  53. 1 0
      resources/web2/assets/assets/screen.svg
  54. 1 0
      resources/web2/assets/assets/search.svg
  55. 1 0
      resources/web2/assets/assets/secure.svg
  56. 1 0
      resources/web2/assets/assets/secure_relay.svg
  57. BIN
      resources/web2/assets/assets/tabbar.ttf
  58. 1 0
      resources/web2/assets/assets/transfer.svg
  59. 1 0
      resources/web2/assets/assets/trash.svg
  60. 1 0
      resources/web2/assets/assets/unpinned.svg
  61. 1 0
      resources/web2/assets/assets/voice_call.svg
  62. 1 0
      resources/web2/assets/assets/voice_call_waiting.svg
  63. 1 0
      resources/web2/assets/assets/win.svg
  64. BIN
      resources/web2/assets/fonts/MaterialIcons-Regular.otf
  65. BIN
      resources/web2/assets/packages/dash_chat_2/assets/placeholder.png
  66. BIN
      resources/web2/assets/packages/dash_chat_2/assets/profile_placeholder.png
  67. BIN
      resources/web2/assets/packages/flex_color_picker/assets/opacity.png
  68. 230 0
      resources/web2/assets/packages/wakelock_plus/assets/no_sleep.js
  69. BIN
      resources/web2/assets/packages/window_manager/images/ic_chrome_close.png
  70. BIN
      resources/web2/assets/packages/window_manager/images/ic_chrome_maximize.png
  71. BIN
      resources/web2/assets/packages/window_manager/images/ic_chrome_minimize.png
  72. BIN
      resources/web2/assets/packages/window_manager/images/ic_chrome_unmaximize.png
  73. BIN
      resources/web2/assets/shaders/ink_sparkle.frag
  74. 1 0
      resources/web2/favicon.svg
  75. 16 0
      resources/web2/ffmpeg-core.js
  76. BIN
      resources/web2/ffmpeg-core.wasm
  77. 111 0
      resources/web2/ffmpeg.js
  78. 7201 0
      resources/web2/flutter_service_worker.js
  79. BIN
      resources/web2/icons/Icon-192.png
  80. BIN
      resources/web2/icons/libopus.wasm
  81. 340 0
      resources/web2/index.html
  82. 360 0
      resources/web2/js/dist/index.js
  83. 102 0
      resources/web2/js/dist/vendor.js
  84. 5555 0
      resources/web2/libopus.js
  85. BIN
      resources/web2/libopus.wasm
  86. 2 0
      resources/web2/libs/firebase-analytics.js
  87. 2 0
      resources/web2/libs/firebase-app.js
  88. 8 0
      resources/web2/libs/stream/StreamSaver.min.js
  89. 8 0
      resources/web2/libs/stream/ponyfill.min.js
  90. 164153 0
      resources/web2/main.dart.js
  91. 35 0
      resources/web2/manifest.json

+ 2 - 1
.gitattributes

@@ -1 +1,2 @@
1
-resources/web/**/* linguist-vendored
1
+resources/web/**/* linguist-vendored
2
+resources/web2/**/* linguist-vendored

+ 1 - 0
.gitignore

@@ -5,6 +5,7 @@ go.sum
5 5
 resources/*
6 6
 !resources/public/upload/.gitignore
7 7
 !resources/web
8
+!resources/web2
8 9
 !resources/i18n
9 10
 release
10 11
 data

+ 1 - 0
http/router/router.go

@@ -17,6 +17,7 @@ func WebInit(g *gin.Engine) {
17 17
 
18 18
 	if global.Config.App.WebClient == 1 {
19 19
 		g.StaticFS("/webclient", http.Dir(global.Config.Gin.ResourcesPath+"/web"))
20
+		g.StaticFS("/webclient2", http.Dir(global.Config.Gin.ResourcesPath+"/web2"))
20 21
 	}
21 22
 	g.StaticFS("/_admin", http.Dir(global.Config.Gin.ResourcesPath+"/admin"))
22 23
 }

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/AssetManifest.bin


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/AssetManifest.json


+ 42 - 0
resources/web2/assets/FontManifest.json

@@ -0,0 +1,42 @@
1
+[
2
+  {
3
+    "family": "MaterialIcons",
4
+    "fonts": [
5
+      {
6
+        "asset": "fonts/MaterialIcons-Regular.otf"
7
+      }
8
+    ]
9
+  },
10
+  {
11
+    "family": "GestureIcons",
12
+    "fonts": [
13
+      {
14
+        "asset": "assets/gestures.ttf"
15
+      }
16
+    ]
17
+  },
18
+  {
19
+    "family": "Tabbar",
20
+    "fonts": [
21
+      {
22
+        "asset": "assets/tabbar.ttf"
23
+      }
24
+    ]
25
+  },
26
+  {
27
+    "family": "PeerSearchbar",
28
+    "fonts": [
29
+      {
30
+        "asset": "assets/peer_searchbar.ttf"
31
+      }
32
+    ]
33
+  },
34
+  {
35
+    "family": "AddressBook",
36
+    "fonts": [
37
+      {
38
+        "asset": "assets/address_book.ttf"
39
+      }
40
+    ]
41
+  }
42
+]

+ 1 - 0
resources/web2/assets/assets/actions.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="496.063 521.772 32 32"><path fill="none" d="M496.063 521.772h32v32h-32v-32Z"/><path d="m513.817 535.858.87-8.052c.136-1.26-.279-1.399-.927-.31l-6.856 11.532c-.216.363-.049.658.374.658h3.031l-.87 8.052c-.136 1.26.279 1.399.927.309l6.856-11.531c.216-.363.048-.658-.374-.658h-3.031Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/actions_mobile.svg


BIN
resources/web2/assets/assets/address_book.ttf


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/android.svg


+ 1 - 0
resources/web2/assets/assets/arrow.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="305.118 110.478 32 32"><path fill="none" d="M305.118 110.478h32v32h-32v-32Z"/><path d="m322.26 126.052-5.963-5.962a1.48 1.48 0 1 1 2.093-2.093l7.63 7.63c.47.47.47 1.233 0 1.703l-7.63 7.629a1.48 1.48 0 0 1-2.093 0 1.482 1.482 0 0 1 0-2.093l5.963-5.962a.603.603 0 0 0 0-.852Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-apple.svg


+ 1 - 0
resources/web2/assets/assets/auth-auth0.svg

@@ -0,0 +1 @@
1
+<svg width="32" height="32"><path d="M29.307 9.932 26.161 0H5.796L2.692 9.932c-1.802 5.75.042 12.271 5.089 16.021L16.01 32l8.208-6.068c5.005-3.75 6.911-10.25 5.089-16.021l-8.214 6.104 3.12 9.938-8.208-6.13-8.208 6.104 3.141-9.911-8.25-6.063 10.177-.063 3.146-9.891 3.141 9.87z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-azure.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-default.svg


+ 1 - 0
resources/web2/assets/assets/auth-facebook.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><rect width="512" height="512" fill="#1877f2" rx="76.8"/><path fill="#fff" d="m355.6 330 11.4-74h-71v-48c0-20.2 9.9-40 41.7-40H370v-63s-29.3-5-57.3-5c-58.5 0-96.7 35.4-96.7 99.6V256h-65v74h65v182h80V330z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-github.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-gitlab.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-google.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/auth-okta.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/call_end.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/call_wait.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/chat.svg


+ 1 - 0
resources/web2/assets/assets/chat2.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#fff"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 0 1-4.644-1.142l-4.29 1.117a.85.85 0 0 1-1.037-1.036l1.116-4.289A9.959 9.959 0 0 1 2 12C2 6.477 6.477 2 12 2Zm1.252 11H8.75l-.102.007a.75.75 0 0 0 0 1.486l.102.007h4.502l.101-.007a.75.75 0 0 0 0-1.486L13.252 13Zm1.998-3.5h-6.5l-.102.007a.75.75 0 0 0 0 1.486L8.75 11h6.5l.102-.007a.75.75 0 0 0 0-1.486L15.25 9.5Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/checkbox-outline.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/chevron_up_chevron_down.svg


+ 1 - 0
resources/web2/assets/assets/close.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="679.559 521.772 32 32"><path fill="none" d="M679.559 521.772h32v32h-32v-32Z"/><path d="m695.559 536.034-5.305-5.305a1.229 1.229 0 1 0-1.738 1.738l5.305 5.305-5.305 5.305a1.229 1.229 0 0 0 0 1.738 1.23 1.23 0 0 0 1.738 0l5.305-5.305 5.305 5.305a1.229 1.229 0 1 0 1.738-1.738l-5.305-5.305 5.305-5.305a1.229 1.229 0 1 0-1.738-1.738l-5.305 5.305Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/display.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/dots.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/file.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/file_transfer.svg


+ 1 - 0
resources/web2/assets/assets/folder.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="129.858 75.669 32 32"><path fill="none" d="M129.858 75.669h32v32h-32v-32Z"/><path d="M138.617 99.535H153.1a2.76 2.76 0 0 0 2.758-2.758V89.32a2.76 2.76 0 0 0-2.758-2.759h-5.397a.552.552 0 0 1-.552-.552v-.827a1.38 1.38 0 0 0-1.379-1.38h-5.776c-.761 0-1.816.437-2.355.976l-.808.808c-.538.538-.975 1.593-.975 2.354v8.837a2.76 2.76 0 0 0 2.759 2.758Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/folder_new.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/fullscreen.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/fullscreen_exit.svg


BIN
resources/web2/assets/assets/gestures.ttf


+ 1 - 0
resources/web2/assets/assets/home.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="13.554 106.603 32 32"><path fill="none" d="M13.554 106.603h32v32h-32v-32Z"/><path d="M32.944 132.507h3.661a1 1 0 0 0 1-1v-7.837h2.335c.552 0 .683-.316.293-.707l-9.972-9.971a.999.999 0 0 0-1.414 0l-9.971 9.971c-.391.391-.259.707.293.707h2.334v7.837a1 1 0 0 0 1 1h3.661a1 1 0 0 0 1-1v-2.966a.5.5 0 0 1 .5-.5h3.78a.5.5 0 0 1 .5.5v2.966c0 .552.449 1 1 1Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/icon.svg


+ 1 - 0
resources/web2/assets/assets/insecure.svg

@@ -0,0 +1 @@
1
+<svg viewBox="0 0 347.97 347.97"><path fill="none" stroke="red" stroke-width="14.827" d="M317.469 61.615c-59.442 0-104.976-16.082-143.489-51.539-38.504 35.457-84.04 51.539-143.479 51.539 0 92.337-20.177 224.612 143.479 278.324 163.661-53.717 143.489-185.992 143.489-278.324z"/><g fill="red"><path d="m238.802 115.023-111.573 114.68-8.6-8.367L230.2 106.656z"/><path d="m125.559 108.093 114.68 111.572-8.368 8.601-114.68-111.572z"/></g></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/insecure_relay.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/kb_layout_iso.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/kb_layout_not_iso.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/keyboard.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/linux.svg


+ 1 - 0
resources/web2/assets/assets/mac.svg

@@ -0,0 +1 @@
1
+<svg viewBox="0 0 384 512"><path fill="#fff" d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"/></svg>

+ 1 - 0
resources/web2/assets/assets/message_24dp_5F6368.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="-4 -4 32 32" width="24px" fill="#5f6368"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/></svg>

BIN
resources/web2/assets/assets/peer_searchbar.ttf


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/pinned.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/rec.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/record_screen.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/refresh.svg


BIN
resources/web2/assets/assets/scam.png


+ 1 - 0
resources/web2/assets/assets/screen.svg

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="321.118 40.669 32 32"><path fill="none" d="M321.118 40.669h32v32h-32v-32Z"/><path d="M344.588 47.817h-14.94a3.764 3.764 0 0 0-3.761 3.764v10.176a3.764 3.764 0 0 0 3.761 3.764h14.94a3.765 3.765 0 0 0 3.762-3.764V51.581a3.765 3.765 0 0 0-3.762-3.764Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/search.svg


+ 1 - 0
resources/web2/assets/assets/secure.svg

@@ -0,0 +1 @@
1
+<svg viewBox="0 0 347.97 347.97"><path fill="#3F7D46" d="M317.31 54.367c-59.376 0-104.86-16.964-143.33-54.367-38.461 37.403-83.947 54.367-143.32 54.367 0 97.405-20.155 236.94 143.32 293.6 163.48-56.666 143.33-196.2 143.33-293.6zm-155.2 171.41-47.749-47.756 21.379-21.378 26.37 26.376 50.121-50.122 21.378 21.378-71.499 71.502z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/secure_relay.svg


BIN
resources/web2/assets/assets/tabbar.ttf


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/transfer.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/trash.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/unpinned.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/voice_call.svg


File diff suppressed because it is too large
+ 1 - 0
resources/web2/assets/assets/voice_call_waiting.svg


+ 1 - 0
resources/web2/assets/assets/win.svg

@@ -0,0 +1 @@
1
+<svg viewBox="0 0 448 512"><path fill="#fff" d="m0 93.7 183.6-25.3v177.4H0V93.7zm0 324.6 183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"/></svg>

BIN
resources/web2/assets/fonts/MaterialIcons-Regular.otf


BIN
resources/web2/assets/packages/dash_chat_2/assets/placeholder.png


BIN
resources/web2/assets/packages/dash_chat_2/assets/profile_placeholder.png


BIN
resources/web2/assets/packages/flex_color_picker/assets/opacity.png


File diff suppressed because it is too large
+ 230 - 0
resources/web2/assets/packages/wakelock_plus/assets/no_sleep.js


BIN
resources/web2/assets/packages/window_manager/images/ic_chrome_close.png


BIN
resources/web2/assets/packages/window_manager/images/ic_chrome_maximize.png


BIN
resources/web2/assets/packages/window_manager/images/ic_chrome_minimize.png


BIN
resources/web2/assets/packages/window_manager/images/ic_chrome_unmaximize.png


BIN
resources/web2/assets/shaders/ink_sparkle.frag


File diff suppressed because it is too large
+ 1 - 0
resources/web2/favicon.svg


File diff suppressed because it is too large
+ 16 - 0
resources/web2/ffmpeg-core.js


BIN
resources/web2/ffmpeg-core.wasm


+ 111 - 0
resources/web2/ffmpeg.js

@@ -0,0 +1,111 @@
1
+
2
+const ERROR_IMPORT_FAILURE = 'Failed to import FFmpeg core';
3
+
4
+let ffmpeg;
5
+let arrayBufferPool = [];
6
+const load = async ({ coreURL, wasmURL }) => {
7
+  const first = !ffmpeg;
8
+  try {
9
+    // when web worker type is `classic`.
10
+    importScripts([coreURL]);
11
+  } catch {
12
+    // when web worker type is `module`.
13
+    const module = await import(/* @vite-ignore */ coreURL);
14
+    self.createFFmpegCore = module.default;
15
+
16
+    if (!self.createFFmpegCore) {
17
+      throw ERROR_IMPORT_FAILURE;
18
+    }
19
+  }
20
+
21
+  try {
22
+    ffmpeg = await self.createFFmpegCore({
23
+      // Fix `Overload resolution failed.` when using multi-threaded ffmpeg-core.
24
+      // Encoded wasmURL and workerURL in the URL as a hack to fix locateFile issue.
25
+      mainScriptUrlOrBlob: `${coreURL}#${btoa(JSON.stringify({ wasmURL }))}`,
26
+    });
27
+  } catch(e) {
28
+    console.error(e);
29
+    throw ERROR_IMPORT_FAILURE;
30
+  }
31
+
32
+  return first;
33
+};
34
+
35
+const decode = async ({ codec, data }) => {
36
+  return ffmpeg.processFrame(codec, data, (_) =>{});
37
+};
38
+
39
+const recycle = (array) => {
40
+  ffmpeg.recycleFrame(array);
41
+}
42
+
43
+const close = () => {
44
+  ffmpeg.close();
45
+  ffmpeg = null;
46
+  arrayBufferPool = [];
47
+}
48
+
49
+// message handler is synchronous
50
+self.onmessage = async ({ data: { id, type, data } }) => {
51
+  try {
52
+    if (type !== "LOAD" && !ffmpeg) {
53
+      self.postMessage({
54
+        id,
55
+        type: "ERROR",
56
+        data: "FFmpeg not loaded",
57
+      });
58
+    } else if (type === "LOAD") {
59
+      const ret = await load(data);
60
+      self.postMessage({ id, type, data: ret });
61
+    } else if (type === "DECODE") {
62
+      // accept moved buffer first
63
+      if (data.arrayBuffer) {
64
+        arrayBufferPool.push(data.arrayBuffer);
65
+        if (arrayBufferPool.length > 8) {
66
+          arrayBufferPool.shift();
67
+        }
68
+      }
69
+      const ret = await decode(data);
70
+      if (ret === 0) {
71
+        var buffer = null;
72
+        while(arrayBufferPool.length > 0) {
73
+          var pop = arrayBufferPool.pop();
74
+          if (pop.byteLength  === ffmpeg.frameBuffer.data.length) {
75
+            buffer = pop;
76
+            break;
77
+          }
78
+        }
79
+        if (!buffer) {
80
+          buffer = new ArrayBuffer(ffmpeg.frameBuffer.data.length);
81
+          console.log("worker create arrayBuffer");
82
+        }
83
+        let array = new Uint8Array(buffer);
84
+        array.set(ffmpeg.frameBuffer.data);
85
+        self.postMessage({ id, type, data: {data: {data: buffer, yuvFormat: ffmpeg.frameBuffer.yuvFormat}}}, [buffer]);
86
+        recycle(ffmpeg.frameBuffer.data);
87
+      } else {
88
+        self.postMessage({
89
+          id,
90
+          type: "ERROR",
91
+          data: {},
92
+        });
93
+      }
94
+    } else if (type === "CLOSE") {
95
+      close();
96
+      self.postMessage({ id, type, data: {} });
97
+    } else {
98
+      self.postMessage({
99
+        id,
100
+        type: "ERROR",
101
+        data: `Unknown command: ${type}`,
102
+      });
103
+    }
104
+  } catch (e) {
105
+    self.postMessage({
106
+      id,
107
+      type: "ERROR",
108
+      data: e.toString(),
109
+    });
110
+  }
111
+};

File diff suppressed because it is too large
+ 7201 - 0
resources/web2/flutter_service_worker.js


BIN
resources/web2/icons/Icon-192.png


BIN
resources/web2/icons/libopus.wasm


+ 340 - 0
resources/web2/index.html

@@ -0,0 +1,340 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <!--
5
+    If you are serving your web app in a path other than the root, change the
6
+    href value below to reflect the base path you are serving from.
7
+
8
+    The path provided below has to start and end with a slash "/" in order for
9
+    it to work correctly.
10
+
11
+    For more details:
12
+    * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
13
+
14
+    This is a placeholder for base href that will be replaced by the value of
15
+    the `--base-href` argument provided to `flutter build`.
16
+  -->
17
+    <base href="/webclient2/" />
18
+
19
+    <meta charset="UTF-8" />
20
+    <meta content="IE=Edge" http-equiv="X-UA-Compatible" />
21
+    <meta name="description" content="Remote Desktop." />
22
+
23
+    <!-- iOS meta tags & icons -->
24
+    <meta name="apple-mobile-web-app-capable" content="yes" />
25
+    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
26
+    <meta name="apple-mobile-web-app-title" content="RustDesk" />
27
+    <link rel="apple-touch-icon" href="icons/Icon-192.png?v=1a7ad736" />
28
+
29
+    <!-- Favicon -->
30
+    <link rel="icon" type="image/svg+xml" href="favicon.svg?v=8fcccd9a" />
31
+
32
+    <title>RustDesk</title>
33
+    <link rel="manifest" href="manifest.json" />
34
+    <script type="module" crossorigin src="js/dist/index.js?v=22564f40"></script>
35
+    <link rel="modulepreload" href="js/dist/vendor.js?v=0b990c6e" />
36
+    <style>
37
+      html,
38
+      body,
39
+      #root {
40
+        height: 100%;
41
+        margin: 0;
42
+        padding: 0;
43
+      }
44
+      #root {
45
+        background-repeat: no-repeat;
46
+        background-size: 100% auto;
47
+      }
48
+
49
+      .loading-title {
50
+        font-size: 1.1rem;
51
+      }
52
+
53
+      .loading-sub-title {
54
+        margin-top: 20px;
55
+        font-size: 1rem;
56
+        color: #888;
57
+      }
58
+
59
+      .page-loading-warp {
60
+        display: flex;
61
+        align-items: center;
62
+        justify-content: center;
63
+        padding: 26px;
64
+      }
65
+      .ant-spin {
66
+        position: absolute;
67
+        display: none;
68
+        -webkit-box-sizing: border-box;
69
+        box-sizing: border-box;
70
+        margin: 0;
71
+        padding: 0;
72
+        color: rgba(0, 0, 0, 0.65);
73
+        color: #1890ff;
74
+        font-size: 14px;
75
+        font-variant: tabular-nums;
76
+        line-height: 1.5;
77
+        text-align: center;
78
+        list-style: none;
79
+        opacity: 0;
80
+        -webkit-transition: -webkit-transform 0.3s
81
+          cubic-bezier(0.78, 0.14, 0.15, 0.86);
82
+        transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
83
+        transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
84
+        transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
85
+          -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
86
+        -webkit-font-feature-settings: "tnum";
87
+        font-feature-settings: "tnum";
88
+      }
89
+
90
+      .ant-spin-spinning {
91
+        position: static;
92
+        display: inline-block;
93
+        opacity: 1;
94
+      }
95
+
96
+      .ant-spin-dot {
97
+        position: relative;
98
+        display: inline-block;
99
+        width: 20px;
100
+        height: 20px;
101
+        font-size: 20px;
102
+      }
103
+
104
+      .ant-spin-dot-item {
105
+        position: absolute;
106
+        display: block;
107
+        width: 9px;
108
+        height: 9px;
109
+        background-color: #1890ff;
110
+        border-radius: 100%;
111
+        -webkit-transform: scale(0.75);
112
+        -ms-transform: scale(0.75);
113
+        transform: scale(0.75);
114
+        -webkit-transform-origin: 50% 50%;
115
+        -ms-transform-origin: 50% 50%;
116
+        transform-origin: 50% 50%;
117
+        opacity: 0.3;
118
+        -webkit-animation: antspinmove 1s infinite linear alternate;
119
+        animation: antSpinMove 1s infinite linear alternate;
120
+      }
121
+
122
+      .ant-spin-dot-item:nth-child(1) {
123
+        top: 0;
124
+        left: 0;
125
+      }
126
+
127
+      .ant-spin-dot-item:nth-child(2) {
128
+        top: 0;
129
+        right: 0;
130
+        -webkit-animation-delay: 0.4s;
131
+        animation-delay: 0.4s;
132
+      }
133
+
134
+      .ant-spin-dot-item:nth-child(3) {
135
+        right: 0;
136
+        bottom: 0;
137
+        -webkit-animation-delay: 0.8s;
138
+        animation-delay: 0.8s;
139
+      }
140
+
141
+      .ant-spin-dot-item:nth-child(4) {
142
+        bottom: 0;
143
+        left: 0;
144
+        -webkit-animation-delay: 1.2s;
145
+        animation-delay: 1.2s;
146
+      }
147
+
148
+      .ant-spin-dot-spin {
149
+        -webkit-transform: rotate(45deg);
150
+        -ms-transform: rotate(45deg);
151
+        transform: rotate(45deg);
152
+        -webkit-animation: antrotate 1.2s infinite linear;
153
+        animation: antRotate 1.2s infinite linear;
154
+      }
155
+
156
+      .ant-spin-lg .ant-spin-dot {
157
+        width: 32px;
158
+        height: 32px;
159
+        font-size: 32px;
160
+      }
161
+
162
+      .ant-spin-lg .ant-spin-dot i {
163
+        width: 14px;
164
+        height: 14px;
165
+      }
166
+
167
+      @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
168
+        .ant-spin-blur {
169
+          background: #fff;
170
+          opacity: 0.5;
171
+        }
172
+      }
173
+
174
+      @-webkit-keyframes antSpinMove {
175
+        to {
176
+          opacity: 1;
177
+        }
178
+      }
179
+
180
+      @keyframes antSpinMove {
181
+        to {
182
+          opacity: 1;
183
+        }
184
+      }
185
+
186
+      @-webkit-keyframes antRotate {
187
+        to {
188
+          -webkit-transform: rotate(405deg);
189
+          transform: rotate(405deg);
190
+        }
191
+      }
192
+
193
+      @keyframes antRotate {
194
+        to {
195
+          -webkit-transform: rotate(405deg);
196
+          transform: rotate(405deg);
197
+        }
198
+      }
199
+    </style>
200
+  </head>
201
+
202
+  <body>
203
+    <div id="root">
204
+      <div
205
+        id="div-background"
206
+        style="
207
+          display: flex;
208
+          flex-direction: column;
209
+          align-items: center;
210
+          justify-content: center;
211
+          height: 100%;
212
+          min-height: 420px;
213
+        "
214
+      >
215
+        <img src="./favicon.svg?v=8fcccd9a" alt="logo" width="256" />
216
+        <div class="page-loading-warp">
217
+          <div class="ant-spin ant-spin-lg ant-spin-spinning">
218
+            <span class="ant-spin-dot ant-spin-dot-spin">
219
+              <i class="ant-spin-dot-item"></i>
220
+              <i class="ant-spin-dot-item"></i>
221
+              <i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i>
222
+            </span>
223
+          </div>
224
+        </div>
225
+        <div
226
+          style="display: flex; align-items: center; justify-content: center"
227
+        >
228
+          <img src="./favicon.svg?v=8fcccd9a" width="32" style="margin-right: 8px" />
229
+          <span id="span-text">RustDesk Web Client V2 Preview</span>
230
+        </div>
231
+      </div>
232
+    </div>
233
+    <!-- This script installs service_worker.js to provide PWA functionality to
234
+       application. For more information, see:
235
+       https://developers.google.com/web/fundamentals/primers/service-workers -->
236
+    <script>
237
+      const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
238
+        .matches
239
+        ? "dark"
240
+        : "light";
241
+      const myTheme = localStorage.getItem("wc-option:local:theme");
242
+      const them = myTheme || systemTheme;
243
+
244
+      const divBackground = document.querySelector("#div-background");
245
+      if (divBackground) {
246
+        divBackground.style.backgroundColor = them === "dark" ? "#000" : "#fff";
247
+      }
248
+      const spanConsole = document.querySelector("#span-text");
249
+      if (spanConsole) {
250
+        spanConsole.style.color = them === "dark" ? "#fff" : "#000";
251
+      }
252
+
253
+      const serviceWorkerVersion = "3267265270";
254
+      var scriptLoaded = false;
255
+      function loadMainDartJs() {
256
+        if (scriptLoaded) {
257
+          return;
258
+        }
259
+        scriptLoaded = true;
260
+        var scriptTag = document.createElement("script");
261
+        scriptTag.src = "main.dart.js?v=6d46937e";
262
+        scriptTag.type = "application/javascript";
263
+        document.body.append(scriptTag);
264
+      }
265
+
266
+      if ("serviceWorker" in navigator) {
267
+        // Service workers are supported. Use them.
268
+        window.addEventListener("load", function () {
269
+          // Wait for registration to finish before dropping the <script> tag.
270
+          // Otherwise, the browser will load the script multiple times,
271
+          // potentially different versions.
272
+          var serviceWorkerUrl =
273
+            "flutter_service_worker.js?v=" + serviceWorkerVersion;
274
+          navigator.serviceWorker.register(serviceWorkerUrl).then((reg) => {
275
+            function waitForActivation(serviceWorker) {
276
+              serviceWorker.addEventListener("statechange", () => {
277
+                if (serviceWorker.state == "activated") {
278
+                  console.log("Installed new service worker.");
279
+                  loadMainDartJs();
280
+                }
281
+              });
282
+            }
283
+            if (!reg.active && (reg.installing || reg.waiting)) {
284
+              // No active web worker and we have installed or are installing
285
+              // one for the first time. Simply wait for it to activate.
286
+              waitForActivation(reg.installing || reg.waiting);
287
+            } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
288
+              // When the app updates the serviceWorkerVersion changes, so we
289
+              // need to ask the service worker to update.
290
+              console.log("New service worker available.");
291
+              reg.update();
292
+              waitForActivation(reg.installing);
293
+            } else {
294
+              // Existing service worker is still good.
295
+              console.log("Loading app from service worker.");
296
+              loadMainDartJs();
297
+            }
298
+          });
299
+
300
+          // If service worker doesn't succeed in a reasonable amount of time,
301
+          // fallback to plaint <script> tag.
302
+          setTimeout(() => {
303
+            if (!scriptLoaded) {
304
+              console.warn(
305
+                "Failed to load app from service worker. Falling back to plain <script> tag."
306
+              );
307
+              loadMainDartJs();
308
+            }
309
+          }, 4000);
310
+        });
311
+      } else {
312
+        // Service workers not supported. Just drop the <script> tag.
313
+        loadMainDartJs();
314
+      }
315
+    </script>
316
+    <script src="libs/stream/ponyfill.min.js"></script>
317
+    <script src="libs/stream/StreamSaver.min.js"></script>
318
+    <script src="libs/firebase-app.js?8.10.1"></script>
319
+    <script src="libs/firebase-analytics.js?8.10.1"></script>
320
+
321
+    <script>
322
+      // Your web app's Firebase configuration
323
+      // For Firebase JS SDK v7.20.0 and later, measurementId is optional
324
+      const firebaseConfig = {
325
+        apiKey: "AIzaSyCgehIZk1aFP0E7wZtYRRqrfvNiNAF39-A",
326
+        authDomain: "rustdesk.firebaseapp.com",
327
+        databaseURL: "https://rustdesk.firebaseio.com",
328
+        projectId: "rustdesk",
329
+        storageBucket: "rustdesk.appspot.com",
330
+        messagingSenderId: "768133699366",
331
+        appId: "1:768133699366:web:d50faf0792cb208d7993e7",
332
+        measurementId: "G-9PEH85N6ZQ",
333
+      };
334
+
335
+      // Initialize Firebase
336
+      firebase.initializeApp(firebaseConfig);
337
+      firebase.analytics();
338
+    </script>
339
+  </body>
340
+</html>

File diff suppressed because it is too large
+ 360 - 0
resources/web2/js/dist/index.js


File diff suppressed because it is too large
+ 102 - 0
resources/web2/js/dist/vendor.js


File diff suppressed because it is too large
+ 5555 - 0
resources/web2/libopus.js


BIN
resources/web2/libopus.wasm


File diff suppressed because it is too large
+ 2 - 0
resources/web2/libs/firebase-analytics.js


File diff suppressed because it is too large
+ 2 - 0
resources/web2/libs/firebase-app.js


File diff suppressed because it is too large
+ 8 - 0
resources/web2/libs/stream/StreamSaver.min.js


File diff suppressed because it is too large
+ 8 - 0
resources/web2/libs/stream/ponyfill.min.js


File diff suppressed because it is too large
+ 164153 - 0
resources/web2/main.dart.js


+ 35 - 0
resources/web2/manifest.json

@@ -0,0 +1,35 @@
1
+{
2
+    "name": "rustdesk",
3
+    "short_name": "rustdesk",
4
+    "start_url": ".",
5
+    "display": "standalone",
6
+    "background_color": "#0175C2",
7
+    "theme_color": "#0175C2",
8
+    "description": "Remote Desktop.",
9
+    "orientation": "portrait-primary",
10
+    "prefer_related_applications": false,
11
+    "icons": [
12
+        {
13
+            "src": "icons/Icon-192.png",
14
+            "sizes": "192x192",
15
+            "type": "image/png"
16
+        },
17
+        {
18
+            "src": "icons/Icon-512.png",
19
+            "sizes": "512x512",
20
+            "type": "image/png"
21
+        },
22
+        {
23
+            "src": "icons/Icon-maskable-192.png",
24
+            "sizes": "192x192",
25
+            "type": "image/png",
26
+            "purpose": "maskable"
27
+        },
28
+        {
29
+            "src": "icons/Icon-maskable-512.png",
30
+            "sizes": "512x512",
31
+            "type": "image/png",
32
+            "purpose": "maskable"
33
+        }
34
+    ]
35
+}