fix(web-ui): add documentation link and version-aware URLs (#5176)

This commit is contained in:
David Lane
2026-05-24 12:17:24 -04:00
committed by GitHub
parent 7822c1f3f6
commit 68f671809c
6 changed files with 51 additions and 9 deletions

View File

@@ -9,3 +9,5 @@ the build directory.
The project uses gtest as a test framework. The project uses gtest as a test framework.
Always follow the style guidelines defined in .clang-format for c/c++ code. 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.

View File

@@ -138,21 +138,21 @@ and applications to Sunshine.
\|-------------------\|--------------------------------------------------------------\| \|-------------------\|--------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \| \| Application Name \| @code{}Surviving Mars@endcode \|
\| Command \| @code{}MarsSteam@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 | <!-- --> @tab{Linux | <!-- -->
\| Field \| Value \| \| Field \| Value \|
\|-------------------\|--------------------------------------------------------------\| \|-------------------\|--------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \| \| Application Name \| @code{}Surviving Mars@endcode \|
\| Command \| @code{}MarsSteam@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 | <!-- --> @tab{macOS | <!-- -->
\| Field \| Value \| \| Field \| Value \|
\|-------------------\|--------------------------------------------------------------\| \|-------------------\|--------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \| \| Application Name \| @code{}Surviving Mars@endcode \|
\| Command \| @code{}MarsSteam@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 | <!-- --> @tab{Windows | <!-- -->
\| Field \| Value \| \| Field \| Value \|
@@ -169,19 +169,19 @@ and applications to Sunshine.
\| Field \| Value \| \| Field \| Value \|
\|-------------------\|------------------------------------------------------------------------\| \|-------------------\|------------------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \| \| 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 | <!-- --> @tab{Linux | <!-- -->
\| Field \| Value \| \| Field \| Value \|
\|-------------------\|------------------------------------------------------------------------\| \|-------------------\|------------------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \| \| 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 | <!-- --> @tab{macOS | <!-- -->
\| Field \| Value \| \| Field \| Value \|
\|-------------------\|------------------------------------------------------------------------\| \|-------------------\|------------------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \| \| 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 | <!-- --> @tab{Windows | <!-- -->
\| Field \| Value \| \| Field \| Value \|

View File

@@ -8,6 +8,10 @@
<Globe :size="18" class="icon"></Globe> <Globe :size="18" class="icon"></Globe>
{{ $t('resource_card.lizardbyte_website') }} {{ $t('resource_card.lizardbyte_website') }}
</a> </a>
<a class="btn btn-info" :href="documentationUrl" target="_blank">
<BookOpen :size="18" class="icon"></BookOpen>
{{ $t('resource_card.documentation') }}
</a>
<a class="btn btn-primary" href="https://app.lizardbyte.dev/discord" target="_blank"> <a class="btn btn-primary" href="https://app.lizardbyte.dev/discord" target="_blank">
<SimpleIcon icon="Discord" :size="18" class="icon"></SimpleIcon> <SimpleIcon icon="Discord" :size="18" class="icon"></SimpleIcon>
Discord Discord
@@ -43,17 +47,31 @@
<script> <script>
import { import {
AlertCircle, AlertCircle,
BookOpen,
FileText, FileText,
Globe, Globe,
} from 'lucide-vue-next' } from 'lucide-vue-next'
import SimpleIcon from './SimpleIcon.vue' import SimpleIcon from './SimpleIcon.vue'
export default { export default {
props: {
installedVersionNotStable: {
type: Boolean,
default: false
}
},
components: { components: {
SimpleIcon, SimpleIcon,
AlertCircle, AlertCircle,
BookOpen,
FileText, FileText,
Globe, Globe,
},
computed: {
documentationUrl() {
const docsVersion = this.installedVersionNotStable ? 'master' : 'latest'
return `https://docs.lizardbyte.dev/projects/sunshine/${docsVersion}/`
}
} }
} }
</script> </script>

View File

@@ -416,7 +416,7 @@
<pre>sh -c "displayplacer "id:&lt;screenId&gt; res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:${SUNSHINE_CLIENT_FPS} scaling:on origin:(0,0) degree:0""</pre> <pre>sh -c "displayplacer "id:&lt;screenId&gt; res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:${SUNSHINE_CLIENT_FPS} scaling:on origin:(0,0) degree:0""</pre>
</div> </div>
<div class="form-text"><a <div class="form-text"><a
href="https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2app__examples.html" :href="`${documentationBaseUrl}/md_docs_2app__examples.html`"
target="_blank">{{ $t('_common.see_more') }}</a></div> target="_blank">{{ $t('_common.see_more') }}</a></div>
</div> </div>
<!-- Save buttons --> <!-- Save buttons -->
@@ -514,6 +514,7 @@
import Navbar from './Navbar.vue' import Navbar from './Navbar.vue'
import Checkbox from './Checkbox.vue' import Checkbox from './Checkbox.vue'
import { apiFetch } from './fetch_utils' import { apiFetch } from './fetch_utils'
import SunshineVersion from './sunshine_version'
import { Modal } from 'bootstrap/dist/js/bootstrap' import { Modal } from 'bootstrap/dist/js/bootstrap'
import { import {
ArrowDown, ArrowDown,
@@ -588,9 +589,21 @@
fileBrowserTypedPath: "", fileBrowserTypedPath: "",
searchQuery: "", searchQuery: "",
sortMode: "default", sortMode: "default",
version: null,
githubVersion: null,
}; };
}, },
computed: { 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() { displayedApps() {
let list = this.apps.map((app, index) => ({ app, index })); let list = this.apps.map((app, index) => ({ app, index }));
@@ -644,7 +657,15 @@
fetch("./api/config") fetch("./api/config")
.then(r => r.json()) .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: { methods: {
newApp() { newApp() {

View File

@@ -121,7 +121,7 @@
<!-- Resources --> <!-- Resources -->
<div class="my-4"> <div class="my-4">
<Resource-Card></Resource-Card> <Resource-Card :installed-version-not-stable="installedVersionNotStable"></Resource-Card>
</div> </div>
</div> </div>
</body> </body>

View File

@@ -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!" "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": { "resource_card": {
"documentation": "Documentation",
"github_discussions": "GitHub Discussions", "github_discussions": "GitHub Discussions",
"legal": "Legal", "legal": "Legal",
"legal_desc": "By continuing to use this software you agree to the terms and conditions in the following documents.", "legal_desc": "By continuing to use this software you agree to the terms and conditions in the following documents.",