From 27c62874ef11ca97e6a4042aa9999c1ce4194c43 Mon Sep 17 00:00:00 2001 From: Vithorio Polten Date: Thu, 2 May 2024 06:36:10 -0300 Subject: [PATCH 01/11] refactor(ui): break down config.html into smaller pieces Breaks that big chungus of a vue file into smaller readable vue files, Also includes some QoL improvements, `$tp` for i18n `$t` but knows platforms, `PlatformLayout` for slotted platform layout, making it clearer what should load per platform and easier to add new as needed. --- .gitignore | 1 + package.json | 1 + .../common/assets/web/PlatformLayout.vue | 27 + src_assets/common/assets/web/apps.html | 8 +- src_assets/common/assets/web/config.html | 1109 ++--------------- .../assets/web/configs/tabs/Advanced.vue | 104 ++ .../assets/web/configs/tabs/AudioVideo.vue | 101 ++ .../web/configs/tabs/ContainerEncoders.vue | 58 + .../common/assets/web/configs/tabs/Files.vue | 63 + .../assets/web/configs/tabs/General.vue | 135 ++ .../common/assets/web/configs/tabs/Inputs.vue | 184 +++ .../assets/web/configs/tabs/Network.vue | 161 +++ .../tabs/audiovideo/AdapterNameSelector.vue | 39 + .../tabs/audiovideo/DisplayDeviceOptions.vue | 45 + .../tabs/audiovideo/DisplayModesSettings.vue | 67 + .../LegacyDisplayOutputSelector.vue | 46 + .../audiovideo/NewDisplayOutputSelector.vue | 39 + .../configs/tabs/encoders/AmdAmfEncoder.vue | 128 ++ .../tabs/encoders/IntelQuickSyncEncoder.vue | 54 + .../tabs/encoders/NvidiaNvencEncoder.vue | 127 ++ .../configs/tabs/encoders/SoftwareEncoder.vue | 48 + .../tabs/encoders/VideotoolboxEncoder.vue | 45 + src_assets/common/assets/web/index.html | 7 +- src_assets/common/assets/web/init.js | 10 + src_assets/common/assets/web/password.html | 8 +- src_assets/common/assets/web/pin.html | 1 + src_assets/common/assets/web/platform-i18n.js | 69 + .../assets/web/public/assets/locale/en.json | 4 +- .../common/assets/web/troubleshooting.html | 8 +- src_assets/common/assets/web/welcome.html | 8 +- 30 files changed, 1635 insertions(+), 1070 deletions(-) create mode 100644 src_assets/common/assets/web/PlatformLayout.vue create mode 100644 src_assets/common/assets/web/configs/tabs/Advanced.vue create mode 100644 src_assets/common/assets/web/configs/tabs/AudioVideo.vue create mode 100644 src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue create mode 100644 src_assets/common/assets/web/configs/tabs/Files.vue create mode 100644 src_assets/common/assets/web/configs/tabs/General.vue create mode 100644 src_assets/common/assets/web/configs/tabs/Inputs.vue create mode 100644 src_assets/common/assets/web/configs/tabs/Network.vue create mode 100644 src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue create mode 100644 src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue create mode 100644 src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue create mode 100644 src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue create mode 100644 src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue create mode 100644 src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue create mode 100644 src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue create mode 100644 src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue create mode 100644 src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue create mode 100644 src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue create mode 100644 src_assets/common/assets/web/init.js create mode 100644 src_assets/common/assets/web/platform-i18n.js diff --git a/.gitignore b/.gitignore index 502fc372577..9f6ef26a4f5 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ package-lock.json # Translations *.mo *.pot +.DS_Store diff --git a/package.json b/package.json index 08b860c6285..0c0f7455808 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "scripts": { "build": "vite build --debug", + "build-clean": "vite build --debug --emptyOutDir", "dev": "vite build --watch" }, "dependencies": { diff --git a/src_assets/common/assets/web/PlatformLayout.vue b/src_assets/common/assets/web/PlatformLayout.vue new file mode 100644 index 00000000000..2ed8b16d5ed --- /dev/null +++ b/src_assets/common/assets/web/PlatformLayout.vue @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index 3abde6c5d57..0fd0651aa13 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -356,7 +356,7 @@

{{ $t('apps.env_vars_about') }}

diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index babb1ad4c46..146c18b5303 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -36,1022 +36,56 @@

{{ $t('config.configuration') }}

-
- -
- - -
{{ $t('config.locale_desc') }}
-
- - -
- - -
{{ $t('config.sunshine_name_desc') }}
-
- - -
- - -
{{ $t('config.log_level_desc') }}
-
- - -
- - -
- {{ $t('config.channels_desc_1') }}
- {{ $t('_common.note') }} {{ $t('config.channels_desc_2') }} -
-
- - -
- -
{{ $t('config.global_prep_cmd_desc') }}
- - - - - - - - - - - - - - - - - -
{{ $t('config.do_cmd') }} {{ $t('config.undo_cmd') }} - {{ $t('config.run_as') }} -
- - - - -
- - -
-
- - -
- -
-
+ + -
- -
- - -
{{ $t('config.controller_desc') }}
-
- - -
- - -
{{ $t('config.gamepad_desc') }}
-
-
-
-

- -

-
-
-
- - -
{{ $t('config.ds4_back_as_touchpad_click_desc') }}
-
-
-
-
-
-
-
-

- -

-
-
-
- - -
{{ $t('config.motion_as_ds4_desc') }}
-
-
- - -
{{ $t('config.touchpad_as_ds4_desc') }}
-
-
-
-
-
- - -
- - -
{{ $t('config.back_button_timeout_desc') }}
-
- - -
-
- - -
{{ $t('config.keyboard_desc') }}
-
- - -
- - -
{{ $t('config.key_repeat_delay_desc') }}
-
- - -
- - -
{{ $t('config.key_repeat_frequency_desc') }}
-
- - -
- - -
{{ $t('config.always_send_scancodes_desc') }}
-
- - -
- - -
{{ $t('config.key_rightalt_to_key_win_desc') }}
-
- - -
-
- - -
{{ $t('config.mouse_desc') }}
-
- - -
- - -
{{ $t('config.high_resolution_scrolling_desc') }}
-
- - -
- - -
{{ $t('config.native_pen_touch_desc') }}
-
- -
+ + -
- -
- - -
- {{ $t('config.audio_sink_desc_win') }}
-
tools\audio-info.exe
-
-
-
- - -
- {{ $t('config.audio_sink_desc_linux') }}
-
pacmd list-sinks | grep "name:"
-
pactl info | grep Source
-
-
-
- - -
- {{ $t('config.audio_sink_desc_macos') }}
-
- Soundflower
- BlackHole. -
-
- - -
- - -
{{ $t('config.virtual_sink_desc') }}
-
- - -
- - -
{{ $t('config.install_steam_audio_drivers_desc') }}
-
- - -
- - -
- {{ $t('config.adapter_name_desc_win') }}
-
tools\dxgi-info.exe
-
-
-
- - -
- {{ $t('config.adapter_name_desc_linux_1') }}
-
ls /dev/dri/renderD*  # {{ $t('config.adapter_name_desc_linux_2') }}
-
-              vainfo --display drm --device /dev/dri/renderD129 | \
-                grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version"
-            
- {{ $t('config.adapter_name_desc_linux_3') }}
- VAProfileH264High : VAEntrypointEncSlice -
-
- - -
- - -
- {{ $t('config.output_name_desc_win') }}
-
tools\dxgi-info.exe
-
-
-
- - -
- {{ $t('config.output_name_desc_unix') }}
-
-
-              Info: Detecting displays
-              Info: Detected display: DVI-D-0 (id: 0) connected: false
-              Info: Detected display: HDMI-0 (id: 1) connected: true
-              Info: Detected display: DP-0 (id: 2) connected: true
-              Info: Detected display: DP-1 (id: 3) connected: false
-              Info: Detected display: DVI-D-1 (id: 4) connected: false
-            
-
-              Info: Detecting displays
-              Info: Detected display: Monitor-0 (id: 3) connected: true
-              Info: Detected display: Monitor-1 (id: 2) connected: true
-            
-
-
- - -
- -
- -
-
- {{r}} - × -
-
-
- - -
-
- - -
- -
-
- {{f}} - × -
-
-
- - -
-
- -
{{ $t('config.res_fps_desc') }}
-
- -
+ + -
- -
- - -
{{ $t('config.upnp_desc') }}
-
- - -
- - -
{{ $t('config.address_family_desc') }}
-
- - -
- - -
{{ $t('config.port_desc') }}
- -
- {{ $t('config.port_alert_1') }} -
- -
- {{ $t('config.port_alert_2') }} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ $t('config.port_protocol') }}{{ $t('config.port_port') }}{{ $t('config.port_note') }}
{{ $t('config.port_tcp') }}{{+effectivePort - 5}}
{{ $t('config.port_tcp') }}{{+effectivePort}} - -
{{ $t('config.port_tcp') }}{{+effectivePort + 1}}{{ $t('config.port_web_ui') }}
{{ $t('config.port_tcp') }}{{+effectivePort + 21}}
{{ $t('config.port_udp') }}{{+effectivePort + 9}} - {{+effectivePort + 11}}
- -
- {{ $t('config.port_warning') }} -
-
- - -
- - -
{{ $t('config.origin_web_ui_allowed_desc') }}
-
- - -
- - -
{{ $t('config.external_ip_desc') }}
-
- - -
- - -
{{ $t('config.lan_encryption_mode_desc') }}
-
- - -
- - -
{{ $t('config.wan_encryption_mode_desc') }}
-
- - -
- - -
{{ $t('config.ping_timeout_desc') }}
-
- -
+ + -
- -
- - -
{{ $t('config.file_apps_desc') }}
-
- - -
- - -
{{ $t('config.credentials_file_desc') }}
-
- - -
- - -
{{ $t('config.log_path_desc') }}
-
- - -
- - -
{{ $t('config.pkey_desc') }}
-
- - -
- - -
{{ $t('config.cert_desc') }}
-
- - -
- - -
{{ $t('config.file_state_desc') }}
-
- -
+ + -
- -
- - -
{{ $t('config.fec_percentage_desc') }}
-
- - -
- - -
{{ $t('config.qp_desc') }}
-
- - -
- - -
{{ $t('config.min_threads_desc') }}
-
- - -
- - -
{{ $t('config.hevc_mode_desc') }}
-
- - -
- - -
{{ $t('config.av1_mode_desc') }}
-
- - -
- - -
{{ $t('config.capture_desc') }}
-
- - -
- - -
{{ $t('config.encoder_desc') }}
-
- -
- - -
- -
- - -
{{ $t('config.nvenc_preset_desc') }}
-
- - -
- - -
{{ $t('config.nvenc_twopass_desc') }}
-
- - -
- - -
{{ $t('config.nvenc_spatial_aq_desc') }}
-
- - -
- - -
- {{ $t('config.nvenc_vbv_increase_desc') }}
-
- VBV/HRD -
-
- - -
-
-

- -

-
-
- -
- - -
- {{ $t('config.nvenc_realtime_hags_desc') }}
-
- HAGS -
-
- - -
- - -
{{ $t('config.nvenc_latency_over_power_desc') }}
-
- - -
- - -
{{ $t('config.nvenc_opengl_vulkan_on_dxgi_desc') }}
-
- - -
- - -
{{ $t('config.nvenc_h264_cavlc_desc') }}
-
-
-
-
-
-
- - -
- -
- - -
- - -
- - -
- - -
- - -
{{ $t('config.qsv_slow_hevc_desc') }}
-
- -
- - -
- -
- - -
{{ $t('config.amd_usage_desc') }}
-
- - -
-
-

- -

-
-
- -
- - -
{{ $t('config.amd_rc_desc') }}
-
- - -
- - -
{{ $t('config.amd_enforce_hrd_desc') }}
-
-
-
-
-
- - -
-
-

- -

-
-
- -
- - -
{{ $t('config.amd_quality_desc') }}
-
- - -
- - -
{{ $t('config.amd_preanalysis_desc') }}
-
- - -
- - -
{{ $t('config.amd_vbaq_desc') }}
-
- - -
- - -
{{ $t('config.amd_coder_desc') }}
-
-
-
-
-
-
- - -
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
{{ $t('config.sw_preset_desc') }}
-
- -
- - -
{{ $t('config.sw_tune_desc') }}
-
-
- + + + + + @@ -1065,17 +99,34 @@

- + + diff --git a/src_assets/common/assets/web/configs/tabs/Advanced.vue b/src_assets/common/assets/web/configs/tabs/Advanced.vue new file mode 100644 index 00000000000..fe5d7f2af60 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/Advanced.vue @@ -0,0 +1,104 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue new file mode 100644 index 00000000000..a3641b9d248 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue @@ -0,0 +1,101 @@ + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue b/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue new file mode 100644 index 00000000000..cd74b9a6da8 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/Files.vue b/src_assets/common/assets/web/configs/tabs/Files.vue new file mode 100644 index 00000000000..d27f9c0801d --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/Files.vue @@ -0,0 +1,63 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/General.vue b/src_assets/common/assets/web/configs/tabs/General.vue new file mode 100644 index 00000000000..0ee03f3d964 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/General.vue @@ -0,0 +1,135 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/Inputs.vue b/src_assets/common/assets/web/configs/tabs/Inputs.vue new file mode 100644 index 00000000000..b79387f2259 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/Inputs.vue @@ -0,0 +1,184 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/Network.vue b/src_assets/common/assets/web/configs/tabs/Network.vue new file mode 100644 index 00000000000..3f27912aac4 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/Network.vue @@ -0,0 +1,161 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue new file mode 100644 index 00000000000..3784baf1634 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue new file mode 100644 index 00000000000..31469a20fba --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue new file mode 100644 index 00000000000..b82e24d82fe --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue @@ -0,0 +1,67 @@ + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue new file mode 100644 index 00000000000..d16c168d383 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue @@ -0,0 +1,46 @@ + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue new file mode 100644 index 00000000000..ef7c99a9657 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue new file mode 100644 index 00000000000..467edd7b5a7 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue @@ -0,0 +1,128 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue new file mode 100644 index 00000000000..68b46338981 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue @@ -0,0 +1,54 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue new file mode 100644 index 00000000000..1f7b2288259 --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue @@ -0,0 +1,127 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue new file mode 100644 index 00000000000..53cb6aea3aa --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue new file mode 100644 index 00000000000..e1124022ddf --- /dev/null +++ b/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/src_assets/common/assets/web/index.html b/src_assets/common/assets/web/index.html index 16dff05b921..a3fed032b28 100644 --- a/src_assets/common/assets/web/index.html +++ b/src_assets/common/assets/web/index.html @@ -73,7 +73,7 @@

{{githubVersion.name}}

diff --git a/src_assets/common/assets/web/init.js b/src_assets/common/assets/web/init.js new file mode 100644 index 00000000000..e96dbef8dfb --- /dev/null +++ b/src_assets/common/assets/web/init.js @@ -0,0 +1,10 @@ +import i18n from './locale' + +export function initApp(app) { + //Wait for locale initialization, then render + i18n().then(i18n => { + app.use(i18n); + app.provide('i18n', i18n.global) + app.mount('#app'); + }); +} \ No newline at end of file diff --git a/src_assets/common/assets/web/password.html b/src_assets/common/assets/web/password.html index 9044b272df9..9a47cc565c8 100644 --- a/src_assets/common/assets/web/password.html +++ b/src_assets/common/assets/web/password.html @@ -67,7 +67,7 @@

{{ $t('password.new_creds') }}

diff --git a/src_assets/common/assets/web/pin.html b/src_assets/common/assets/web/pin.html index 056bd6e20db..e703dac3751 100644 --- a/src_assets/common/assets/web/pin.html +++ b/src_assets/common/assets/web/pin.html @@ -36,6 +36,7 @@

{{ $t('pin.pin_pairing') }}

//Wait for locale initialization, then render i18n().then(i18n => { app.use(i18n); + app.provide('i18n', i18n.global) app.mount('#app'); // this must be after mounting the app diff --git a/src_assets/common/assets/web/platform-i18n.js b/src_assets/common/assets/web/platform-i18n.js new file mode 100644 index 00000000000..02ef2059d9d --- /dev/null +++ b/src_assets/common/assets/web/platform-i18n.js @@ -0,0 +1,69 @@ +import {inject} from 'vue' + +class PlatformMessageI18n { + /** + * @param {string} platform + */ + constructor(platform) { + this.platform = platform + } + + /** + * @param {string} key + * @return {string} key with platform identifier + */ + getPlatformKey(key) { + switch (this.platform) { + case 'windows': + return key + '_win' + default: + return key + '_' + this.platform + } + } + + /** + * @param {string} key + * @param {string?} defaultMsg + * @return {string} translated message or defaultMsg if provided + */ + getMessageUsingPlatform(key, defaultMsg) { + const realKey = this.getPlatformKey(key) + const i18n = inject('i18n') + const message = i18n.t(realKey) + if (message === realKey && defaultMsg) { + // there's no message for key, return defaultMsg + return defaultMsg + } + return message + } +} + +/** + * @param {string?} platform + * @return {PlatformMessageI18n} instance + */ +export function usePlatformI18n(platform) { + if (!platform) { + platform = inject('platform').value + } + + if (!platform) { + throw 'platform argument missing' + } + + return inject( + 'platformMessage', + () => new PlatformMessageI18n(platform), + true + ) +} + +/** + * @param {string} key + * @param {string?} defaultMsg + * @return {string} translated message or defaultMsg if provided + */ +export function $tp(key, defaultMsg) { + const pm = usePlatformI18n() + return pm.getMessageUsingPlatform(key, defaultMsg) +} \ No newline at end of file diff --git a/src_assets/common/assets/web/public/assets/locale/en.json b/src_assets/common/assets/web/public/assets/locale/en.json index 4f41fb42a5d..338c5d49823 100644 --- a/src_assets/common/assets/web/public/assets/locale/en.json +++ b/src_assets/common/assets/web/public/assets/locale/en.json @@ -243,9 +243,9 @@ "origin_web_ui_allowed_lan": "Only those in LAN may access Web UI", "origin_web_ui_allowed_pc": "Only localhost may access Web UI", "origin_web_ui_allowed_wan": "Anyone may access Web UI", - "output_name_desc_unix": "During Sunshine startup, you should see the list of detected displays. Note: You need to use the id value inside the parenthesis.", + "output_name_desc_linux": "During Sunshine startup, you should see the list of detected displays. Note: You need to use the id value inside the parenthesis.", "output_name_desc_win": "Manually specify a display to use for capture. If unset, the primary display is captured. Note: If you specified a GPU above, this display must be connected to that GPU. The appropriate values can be found using the following command:", - "output_name_unix": "Display number", + "output_name_linux": "Display number", "output_name_win": "Output Name", "ping_timeout": "Ping Timeout", "ping_timeout_desc": "How long to wait in milliseconds for data from moonlight before shutting down the stream", diff --git a/src_assets/common/assets/web/troubleshooting.html b/src_assets/common/assets/web/troubleshooting.html index 8fce7e4ba92..00497741368 100644 --- a/src_assets/common/assets/web/troubleshooting.html +++ b/src_assets/common/assets/web/troubleshooting.html @@ -114,7 +114,7 @@

{{ $t('troubleshooting.logs') }}

diff --git a/src_assets/common/assets/web/welcome.html b/src_assets/common/assets/web/welcome.html index c2946c745d2..cf1e74ba8e6 100644 --- a/src_assets/common/assets/web/welcome.html +++ b/src_assets/common/assets/web/welcome.html @@ -53,8 +53,8 @@

From ec342cb0aaef924293e269e79352b6c3839e6648 Mon Sep 17 00:00:00 2001 From: Vithorio Polten Date: Thu, 2 May 2024 09:35:53 -0300 Subject: [PATCH 02/11] chore: improved init for pin too --- src_assets/common/assets/web/init.js | 5 ++++- src_assets/common/assets/web/pin.html | 10 +++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src_assets/common/assets/web/init.js b/src_assets/common/assets/web/init.js index e96dbef8dfb..3694402741a 100644 --- a/src_assets/common/assets/web/init.js +++ b/src_assets/common/assets/web/init.js @@ -1,10 +1,13 @@ import i18n from './locale' -export function initApp(app) { +export function initApp(app, config) { //Wait for locale initialization, then render i18n().then(i18n => { app.use(i18n); app.provide('i18n', i18n.global) app.mount('#app'); + if (config) { + config(app) + } }); } \ No newline at end of file diff --git a/src_assets/common/assets/web/pin.html b/src_assets/common/assets/web/pin.html index e703dac3751..359c5e527ba 100644 --- a/src_assets/common/assets/web/pin.html +++ b/src_assets/common/assets/web/pin.html @@ -26,6 +26,7 @@

{{ $t('pin.pin_pairing') }}

import { createApp } from 'vue' import i18n from './locale.js' import Navbar from './Navbar.vue' + import {initApp} from "./init"; let app = createApp({ components: { @@ -33,12 +34,7 @@

{{ $t('pin.pin_pairing') }}

} }); - //Wait for locale initialization, then render - i18n().then(i18n => { - app.use(i18n); - app.provide('i18n', i18n.global) - app.mount('#app'); - + initApp(app, (app => { // this must be after mounting the app document.querySelector("#form").addEventListener("submit", (e) => { e.preventDefault(); @@ -60,5 +56,5 @@

{{ $t('pin.pin_pairing') }}

} }); }); - }); + })); From ffe2298ea0f8cfa811ffa528825c24a99b0fd5a8 Mon Sep 17 00:00:00 2001 From: Vithorio Polten Date: Thu, 2 May 2024 15:57:27 -0300 Subject: [PATCH 03/11] First batch of suggestions from code review Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .../common/assets/web/PlatformLayout.vue | 32 +++++++++---------- src_assets/common/assets/web/index.html | 1 - 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src_assets/common/assets/web/PlatformLayout.vue b/src_assets/common/assets/web/PlatformLayout.vue index 2ed8b16d5ed..6d60f517a76 100644 --- a/src_assets/common/assets/web/PlatformLayout.vue +++ b/src_assets/common/assets/web/PlatformLayout.vue @@ -1,27 +1,27 @@ \ No newline at end of file + diff --git a/src_assets/common/assets/web/index.html b/src_assets/common/assets/web/index.html index a3fed032b28..1f191e54af3 100644 --- a/src_assets/common/assets/web/index.html +++ b/src_assets/common/assets/web/index.html @@ -167,6 +167,5 @@

{{githubVersion.name}}

} }); - //Wait for locale initialization, then render initApp(app); From 8c4544ba906d0a98c500495cbd5e5016388cfcbc Mon Sep 17 00:00:00 2001 From: Vithorio Polten Date: Thu, 2 May 2024 15:58:46 -0300 Subject: [PATCH 04/11] chore: add endlines --- src_assets/common/assets/web/configs/tabs/Advanced.vue | 2 +- src_assets/common/assets/web/configs/tabs/AudioVideo.vue | 2 +- src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue | 2 +- src_assets/common/assets/web/configs/tabs/Files.vue | 2 +- src_assets/common/assets/web/configs/tabs/General.vue | 2 +- src_assets/common/assets/web/configs/tabs/Inputs.vue | 2 +- src_assets/common/assets/web/configs/tabs/Network.vue | 2 +- .../assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue | 2 +- .../assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue | 2 +- .../assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue | 2 +- .../web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue | 2 +- .../web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue | 2 +- .../common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue | 2 +- .../assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue | 2 +- .../assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue | 2 +- .../common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue | 2 +- .../assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue | 2 +- src_assets/common/assets/web/init.js | 2 +- src_assets/common/assets/web/platform-i18n.js | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src_assets/common/assets/web/configs/tabs/Advanced.vue b/src_assets/common/assets/web/configs/tabs/Advanced.vue index fe5d7f2af60..fc85ccce369 100644 --- a/src_assets/common/assets/web/configs/tabs/Advanced.vue +++ b/src_assets/common/assets/web/configs/tabs/Advanced.vue @@ -101,4 +101,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue index a3641b9d248..41030d42735 100644 --- a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue +++ b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue @@ -98,4 +98,4 @@ const config = ref(props.config) /> - \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue b/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue index cd74b9a6da8..084c3001f57 100644 --- a/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue +++ b/src_assets/common/assets/web/configs/tabs/ContainerEncoders.vue @@ -55,4 +55,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/Files.vue b/src_assets/common/assets/web/configs/tabs/Files.vue index d27f9c0801d..858f666eeed 100644 --- a/src_assets/common/assets/web/configs/tabs/Files.vue +++ b/src_assets/common/assets/web/configs/tabs/Files.vue @@ -60,4 +60,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/General.vue b/src_assets/common/assets/web/configs/tabs/General.vue index 0ee03f3d964..cc473c803e2 100644 --- a/src_assets/common/assets/web/configs/tabs/General.vue +++ b/src_assets/common/assets/web/configs/tabs/General.vue @@ -132,4 +132,4 @@ function removeCmd(index) { \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/Inputs.vue b/src_assets/common/assets/web/configs/tabs/Inputs.vue index b79387f2259..e9855b771e3 100644 --- a/src_assets/common/assets/web/configs/tabs/Inputs.vue +++ b/src_assets/common/assets/web/configs/tabs/Inputs.vue @@ -181,4 +181,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/Network.vue b/src_assets/common/assets/web/configs/tabs/Network.vue index 3f27912aac4..b32074a599c 100644 --- a/src_assets/common/assets/web/configs/tabs/Network.vue +++ b/src_assets/common/assets/web/configs/tabs/Network.vue @@ -158,4 +158,4 @@ const effectivePort = computed(() => +config.value?.port ?? defaultMoonlightPort \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue index 3784baf1634..8fa94ce8b05 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue @@ -36,4 +36,4 @@ const config = ref(props.config) - \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue index 31469a20fba..4c0cd419d2d 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue @@ -42,4 +42,4 @@ function addRemapping(type) {
- \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue index b82e24d82fe..74bd5d9f87b 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue @@ -64,4 +64,4 @@ const fpsIn = ref("")
{{ $t('config.res_fps_desc') }}
- \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue index d16c168d383..56c55ee6e3d 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue @@ -43,4 +43,4 @@ const outputNamePlaceholder = (props.platform === 'windows') ? '\\.\DISPLAY1' : - \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue index ef7c99a9657..1c87a69514e 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/NewDisplayOutputSelector.vue @@ -36,4 +36,4 @@ const outputNamePlaceholder = (props.platform === 'windows') ? '{de9bb7e2-186e-5 - \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue index 467edd7b5a7..32616e2aee6 100644 --- a/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue +++ b/src_assets/common/assets/web/configs/tabs/encoders/AmdAmfEncoder.vue @@ -125,4 +125,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue index 68b46338981..bbdbcda2de2 100644 --- a/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue +++ b/src_assets/common/assets/web/configs/tabs/encoders/IntelQuickSyncEncoder.vue @@ -51,4 +51,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue index 1f7b2288259..39e509d1046 100644 --- a/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue +++ b/src_assets/common/assets/web/configs/tabs/encoders/NvidiaNvencEncoder.vue @@ -124,4 +124,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue index 53cb6aea3aa..a2524ca7d8a 100644 --- a/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue +++ b/src_assets/common/assets/web/configs/tabs/encoders/SoftwareEncoder.vue @@ -45,4 +45,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue b/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue index e1124022ddf..94f3fbb3271 100644 --- a/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue +++ b/src_assets/common/assets/web/configs/tabs/encoders/VideotoolboxEncoder.vue @@ -42,4 +42,4 @@ const config = ref(props.config) \ No newline at end of file + diff --git a/src_assets/common/assets/web/init.js b/src_assets/common/assets/web/init.js index 3694402741a..3f30a0f034e 100644 --- a/src_assets/common/assets/web/init.js +++ b/src_assets/common/assets/web/init.js @@ -10,4 +10,4 @@ export function initApp(app, config) { config(app) } }); -} \ No newline at end of file +} diff --git a/src_assets/common/assets/web/platform-i18n.js b/src_assets/common/assets/web/platform-i18n.js index 02ef2059d9d..8e658beabb2 100644 --- a/src_assets/common/assets/web/platform-i18n.js +++ b/src_assets/common/assets/web/platform-i18n.js @@ -66,4 +66,4 @@ export function usePlatformI18n(platform) { export function $tp(key, defaultMsg) { const pm = usePlatformI18n() return pm.getMessageUsingPlatform(key, defaultMsg) -} \ No newline at end of file +} From 1b2542a916a85f93cf719caa60dbc6c6980b53af Mon Sep 17 00:00:00 2001 From: Vithorio Polten Date: Thu, 2 May 2024 15:59:36 -0300 Subject: [PATCH 05/11] chore: correctly add .DS_Store to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9f6ef26a4f5..ccc8b0c7487 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,6 @@ package-lock.json # Translations *.mo *.pot + +# Dummy macOS files .DS_Store From 71efb5c4499c74f9b752407680a3de5581646475 Mon Sep 17 00:00:00 2001 From: Vithorio Polten Date: Sun, 5 May 2024 22:21:55 -0300 Subject: [PATCH 06/11] chore(ui): rename win keys, add fallback to unix --- .../LegacyDisplayOutputSelector.vue | 4 +-- src_assets/common/assets/web/platform-i18n.js | 28 +++++++++++-------- .../assets/web/public/assets/locale/de.json | 14 +++++----- .../assets/web/public/assets/locale/en.json | 18 ++++++------ .../web/public/assets/locale/en_GB.json | 14 +++++----- .../web/public/assets/locale/en_US.json | 14 +++++----- .../assets/web/public/assets/locale/es.json | 14 +++++----- .../assets/web/public/assets/locale/fr.json | 14 +++++----- .../assets/web/public/assets/locale/it.json | 14 +++++----- .../assets/web/public/assets/locale/ja.json | 14 +++++----- .../assets/web/public/assets/locale/pt.json | 14 +++++----- .../assets/web/public/assets/locale/ru.json | 14 +++++----- .../assets/web/public/assets/locale/sv.json | 14 +++++----- .../assets/web/public/assets/locale/zh.json | 14 +++++----- 14 files changed, 105 insertions(+), 99 deletions(-) diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue index 56c55ee6e3d..c0042717af5 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/LegacyDisplayOutputSelector.vue @@ -14,11 +14,11 @@ const outputNamePlaceholder = (props.platform === 'windows') ? '\\.\DISPLAY1' :