From 68f671809cbb707a6caaee69d19cfc48827d2d9f Mon Sep 17 00:00:00 2001 From: David Lane <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 24 May 2026 12:17:24 -0400 Subject: [PATCH] fix(web-ui): add documentation link and version-aware URLs (#5176) --- AGENTS.md | 2 ++ docs/app_examples.md | 12 ++++----- src_assets/common/assets/web/ResourceCard.vue | 18 +++++++++++++ src_assets/common/assets/web/apps.html | 25 +++++++++++++++++-- src_assets/common/assets/web/index.html | 2 +- .../assets/web/public/assets/locale/en.json | 1 + 6 files changed, 51 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7b056d2a7..f532e021c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,3 +9,5 @@ the build directory. The project uses gtest as a test framework. Always follow the style guidelines defined in .clang-format for c/c++ code. + +When adding localization do not update any language other than `en`. This also means to exclude en-US or other variants. diff --git a/docs/app_examples.md b/docs/app_examples.md index e6e251b68..4bf45cb9b 100644 --- a/docs/app_examples.md +++ b/docs/app_examples.md @@ -138,21 +138,21 @@ and applications to Sunshine. \|-------------------\|--------------------------------------------------------------\| \| Application Name \| @code{}Surviving Mars@endcode \| \| Command \| @code{}MarsSteam@endcode \| - \| Working Directory \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars@endcode \| + \| Working Directory \| @code{}$(HOME)/.steam/steam/SteamApps/common/Survivng Mars@endcode \| } @tab{Linux | \| Field \| Value \| \|-------------------\|--------------------------------------------------------------\| \| Application Name \| @code{}Surviving Mars@endcode \| \| Command \| @code{}MarsSteam@endcode \| - \| Working Directory \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars@endcode \| + \| Working Directory \| @code{}$(HOME)/.steam/steam/SteamApps/common/Survivng Mars@endcode \| } @tab{macOS | \| Field \| Value \| \|-------------------\|--------------------------------------------------------------\| \| Application Name \| @code{}Surviving Mars@endcode \| \| Command \| @code{}MarsSteam@endcode \| - \| Working Directory \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars@endcode \| + \| Working Directory \| @code{}$(HOME)/.steam/steam/SteamApps/common/Survivng Mars@endcode \| } @tab{Windows | \| Field \| Value \| @@ -169,19 +169,19 @@ and applications to Sunshine. \| Field \| Value \| \|-------------------\|------------------------------------------------------------------------\| \| Application Name \| @code{}Surviving Mars@endcode \| - \| Command \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| + \| Command \| @code{}$(HOME)/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| } @tab{Linux | \| Field \| Value \| \|-------------------\|------------------------------------------------------------------------\| \| Application Name \| @code{}Surviving Mars@endcode \| - \| Command \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| + \| Command \| @code{}$(HOME)/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| } @tab{macOS | \| Field \| Value \| \|-------------------\|------------------------------------------------------------------------\| \| Application Name \| @code{}Surviving Mars@endcode \| - \| Command \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| + \| Command \| @code{}$(HOME)/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| } @tab{Windows | \| Field \| Value \| diff --git a/src_assets/common/assets/web/ResourceCard.vue b/src_assets/common/assets/web/ResourceCard.vue index 72818e073..6a54ef163 100644 --- a/src_assets/common/assets/web/ResourceCard.vue +++ b/src_assets/common/assets/web/ResourceCard.vue @@ -8,6 +8,10 @@ {{ $t('resource_card.lizardbyte_website') }} + + + {{ $t('resource_card.documentation') }} + Discord @@ -43,17 +47,31 @@ diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index 13a53fd5a..16a5e3e3c 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -416,7 +416,7 @@
sh -c "displayplacer "id:<screenId> res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:${SUNSHINE_CLIENT_FPS} scaling:on origin:(0,0) degree:0""
{{ $t('_common.see_more') }}
@@ -514,6 +514,7 @@ import Navbar from './Navbar.vue' import Checkbox from './Checkbox.vue' import { apiFetch } from './fetch_utils' + import SunshineVersion from './sunshine_version' import { Modal } from 'bootstrap/dist/js/bootstrap' import { ArrowDown, @@ -588,9 +589,21 @@ fileBrowserTypedPath: "", searchQuery: "", sortMode: "default", + version: null, + githubVersion: null, }; }, computed: { + installedVersionNotStable() { + if (!this.githubVersion || !this.version) { + return false; + } + return this.version.isGreater(this.githubVersion); + }, + documentationBaseUrl() { + const docsVersion = this.installedVersionNotStable ? 'master' : 'latest' + return `https://docs.lizardbyte.dev/projects/sunshine/${docsVersion}` + }, displayedApps() { let list = this.apps.map((app, index) => ({ app, index })); @@ -644,7 +657,15 @@ fetch("./api/config") .then(r => r.json()) - .then(r => this.platform = r.platform); + .then(r => { + this.platform = r.platform; + this.version = new SunshineVersion(null, r.version); + }); + + fetch("https://api.github.com/repos/LizardByte/Sunshine/releases/latest") + .then((r) => r.json()) + .then((r) => this.githubVersion = new SunshineVersion(r, null)) + .catch((e) => console.error(e)); }, methods: { newApp() { diff --git a/src_assets/common/assets/web/index.html b/src_assets/common/assets/web/index.html index 7a02b34fc..6b332e30d 100644 --- a/src_assets/common/assets/web/index.html +++ b/src_assets/common/assets/web/index.html @@ -121,7 +121,7 @@
- +
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 31e30f7ed..f4eee2cdc 100644 --- a/src_assets/common/assets/web/public/assets/locale/en.json +++ b/src_assets/common/assets/web/public/assets/locale/en.json @@ -478,6 +478,7 @@ "warning_msg": "Make sure you have access to the client you are pairing with. This software can give total control to your computer, so be careful!" }, "resource_card": { + "documentation": "Documentation", "github_discussions": "GitHub Discussions", "legal": "Legal", "legal_desc": "By continuing to use this software you agree to the terms and conditions in the following documents.",