2021-05-09 16:55:34 +00:00
|
|
|
<div id="content" class="container">
|
2022-02-05 23:18:00 +00:00
|
|
|
<h1 class="my-4">Hello, Sunshine!</h1>
|
2022-12-28 21:30:32 +00:00
|
|
|
<p>Sunshine is a self-hosted game stream host for Moonlight.</p>
|
2023-03-09 23:13:57 +00:00
|
|
|
<!--Version-->
|
|
|
|
<div class="card p-2 my-4">
|
|
|
|
<div class="card-body" v-if="version">
|
|
|
|
<h2>Version {{version}}</h2>
|
|
|
|
<br />
|
|
|
|
<div v-if="loading">
|
|
|
|
Loading Latest Release...
|
|
|
|
</div>
|
2023-03-27 19:55:21 +00:00
|
|
|
<div class="alert alert-success" v-if="runningDirtyBuild">
|
|
|
|
Thank you for helping to make Sunshine a better software! 🌇
|
|
|
|
</div>
|
|
|
|
<div v-else-if="!nightlyBuildAvailable && !stableBuildAvailable && !runningDirtyBuild">
|
2023-03-09 23:13:57 +00:00
|
|
|
<div class="alert alert-success">
|
|
|
|
You're running the latest version of Sunshine
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-26 23:28:57 +00:00
|
|
|
<div v-if="nightlyBuildAvailable">
|
2023-03-09 23:13:57 +00:00
|
|
|
<div class="alert alert-warning">
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
<div class="my-2">A new <b>Nightly</b> Version is Available!</div>
|
2023-05-08 01:03:20 +00:00
|
|
|
<a class="btn btn-success m-1" href="https://github.com/LizardByte/Sunshine/releases/nightly-dev" target="_blank">Download</a>
|
2023-03-09 23:13:57 +00:00
|
|
|
</div>
|
|
|
|
<pre><b>{{nightlyData.head_sha}}</b></pre>
|
|
|
|
<pre>{{nightlyData.display_title}}</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-26 23:28:57 +00:00
|
|
|
<div v-if="stableBuildAvailable">
|
2023-03-09 23:13:57 +00:00
|
|
|
<div class="alert alert-warning">
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
<div class="my-2">A new <b>Stable</b> Version is Available!</div>
|
|
|
|
<a class="btn btn-success m-1" :href="githubVersion.html_url" target="_blank">Download</a>
|
|
|
|
</div>
|
|
|
|
<h3>{{githubVersion.name}}</h3>
|
|
|
|
<pre>{{githubVersion.body}}</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-05 23:18:00 +00:00
|
|
|
<!--Resources-->
|
|
|
|
<div class="card p-2 my-4">
|
|
|
|
<div class="card-body">
|
|
|
|
<h2>Resources</h2>
|
|
|
|
<br />
|
|
|
|
<p>
|
|
|
|
Resources for Sunshine!
|
|
|
|
</p>
|
2022-08-07 20:34:39 +00:00
|
|
|
<div class="card-group p-4 align-items-center">
|
|
|
|
<a class="btn btn-success m-1" href="https://app.lizardbyte.dev" target="_blank">LizardByte Website</a>
|
|
|
|
<a class="btn btn-primary m-1" href="https://app.lizardbyte.dev/discord" target="_blank">
|
|
|
|
<i class="fab fa-fw fa-discord"></i> Discord</a>
|
|
|
|
<a class="btn btn-secondary m-1" href="https://github.com/LizardByte/Sunshine/discussions" target="_blank">
|
|
|
|
<i class="fab fa-fw fa-github"></i> Github Discussions</a>
|
|
|
|
</div>
|
2022-02-05 23:18:00 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!--Legal-->
|
|
|
|
<div class="card p-2 my-4">
|
|
|
|
<div class="card-body">
|
|
|
|
<h2>Legal</h2>
|
|
|
|
<br />
|
|
|
|
<p>
|
|
|
|
By continuing to use this software you agree to the terms and conditions in the following documents.
|
|
|
|
</p>
|
2022-08-07 20:34:39 +00:00
|
|
|
<div class="card-group p-4 align-items-center">
|
|
|
|
<a class="btn btn-danger m-1" href="https://github.com/LizardByte/Sunshine/blob/master/LICENSE" target="_blank">
|
|
|
|
<i class="fas fa-fw fa-file-alt"></i> License</a>
|
|
|
|
<a class="btn btn-danger m-1" href="https://github.com/LizardByte/Sunshine/blob/master/NOTICE" target="_blank">
|
|
|
|
<i class="fas fa-fw fa-exclamation"></i> Third Party Notice</a>
|
|
|
|
</div>
|
2021-05-30 13:56:13 +00:00
|
|
|
</div>
|
2021-08-17 17:12:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-09 23:13:57 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
new Vue({
|
|
|
|
el: "#content",
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
version: null,
|
|
|
|
githubVersion: null,
|
|
|
|
nightlyData: null,
|
|
|
|
loading: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async created() {
|
|
|
|
try {
|
|
|
|
this.version = (await fetch("/api/config").then((r) => r.json())).version;
|
|
|
|
this.githubVersion = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/releases/latest").then((r) => r.json()));
|
2023-03-26 23:28:57 +00:00
|
|
|
if (this.buildVersionIsNightly()) {
|
2023-03-09 23:13:57 +00:00
|
|
|
this.nightlyData = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/actions/workflows/CI.yml/runs?branch=nightly&status=success&per_page=1").then((r) => r.json())).workflow_runs[0];
|
|
|
|
}
|
|
|
|
} catch(e){
|
|
|
|
}
|
|
|
|
this.loading = false;
|
|
|
|
},
|
|
|
|
computed: {
|
2023-03-27 19:55:21 +00:00
|
|
|
runningDirtyBuild() {
|
|
|
|
return this.buildVersionIsDirty()
|
|
|
|
},
|
2023-03-26 23:28:57 +00:00
|
|
|
stableBuildAvailable() {
|
2023-03-09 23:13:57 +00:00
|
|
|
// If we can't get versions, return false
|
|
|
|
if (!this.githubVersion || !this.version) return false;
|
|
|
|
// Get the GitHub version tag
|
|
|
|
let v = this.githubVersion.name;
|
|
|
|
// If the version starts with a v, remove it
|
|
|
|
if (v.indexOf("v") === 0) v = v.substring(1);
|
2023-03-26 23:28:57 +00:00
|
|
|
|
2023-03-27 19:55:21 +00:00
|
|
|
// if nightly or dirty, we do an additional check to make sure it's an actual upgrade.
|
|
|
|
if (this.buildVersionIsNightly() || this.buildVersionIsDirty()) {
|
2023-03-26 23:28:57 +00:00
|
|
|
const stableVersion = this.version.split('.').slice(0, 3).join('.');
|
|
|
|
return this.githubVersion.tag_name.substring(1) > stableVersion;
|
|
|
|
}
|
|
|
|
|
2023-03-09 23:13:57 +00:00
|
|
|
// return true if the version is different, otherwise false
|
|
|
|
return v !== this.version.split(".")[0];
|
|
|
|
},
|
2023-03-26 23:28:57 +00:00
|
|
|
nightlyBuildAvailable() {
|
|
|
|
// Verify nightly data is available and the build version is not stable
|
|
|
|
// This is important to ensure the UI does not try to load undefined values.
|
|
|
|
if (!this.nightlyData || this.buildVersionIsStable()) return false;
|
2023-03-09 23:13:57 +00:00
|
|
|
// If built with dirty git tree, return false
|
2023-03-27 19:55:21 +00:00
|
|
|
if (this.buildVersionIsDirty()) return false;
|
2023-03-09 23:13:57 +00:00
|
|
|
// Get the commit hash
|
2023-03-26 23:28:57 +00:00
|
|
|
let commit = this.version?.split(".").pop();
|
2023-03-09 23:13:57 +00:00
|
|
|
// return true if the commit hash is different, otherwise false
|
|
|
|
return this.nightlyData.head_sha.indexOf(commit) !== 0;
|
|
|
|
}
|
2023-03-26 23:28:57 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2023-03-27 19:55:21 +00:00
|
|
|
buildVersionIsDirty() {
|
|
|
|
return this.version?.split(".").length === 5 &&
|
|
|
|
this.version.indexOf("dirty") !== -1
|
2023-03-26 23:28:57 +00:00
|
|
|
},
|
|
|
|
buildVersionIsNightly() {
|
|
|
|
return this.version?.split(".").length === 4
|
2023-03-27 19:55:21 +00:00
|
|
|
},
|
|
|
|
buildVersionIsStable() {
|
|
|
|
return this.version?.split(".").length === 3
|
2023-03-26 23:28:57 +00:00
|
|
|
}
|
2023-03-09 23:13:57 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|