2019-08-05 14:29:35 +00:00
|
|
|
<template>
|
2022-06-19 00:25:21 +00:00
|
|
|
<div id="version-checker" :class="[store.state.versionStatus]">
|
|
|
|
<p v-if="store.state.versionStatus === 'loading'">Checking for updates…</p>
|
|
|
|
<p v-if="store.state.versionStatus === 'new-version'">
|
2023-10-09 10:28:14 +00:00
|
|
|
Hard Lounge <b>{{ store.state.versionData?.latest.version }}</b>
|
2022-06-19 00:25:21 +00:00
|
|
|
<template v-if="store.state.versionData?.latest.prerelease"> (pre-release) </template>
|
2019-08-05 14:29:35 +00:00
|
|
|
is now available.
|
|
|
|
<br />
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<a :href="store.state.versionData?.latest.url" target="_blank" rel="noopener">
|
2019-08-05 14:29:35 +00:00
|
|
|
Read more on GitHub
|
|
|
|
</a>
|
|
|
|
</p>
|
2022-06-19 00:25:21 +00:00
|
|
|
<p v-if="store.state.versionStatus === 'new-packages'">
|
2023-10-09 10:28:14 +00:00
|
|
|
Hard Lounge is up to date, but there are out of date packages Run
|
2019-08-05 14:29:35 +00:00
|
|
|
<code>thelounge upgrade</code> on the server to upgrade packages.
|
|
|
|
</p>
|
2022-06-19 00:25:21 +00:00
|
|
|
<template v-if="store.state.versionStatus === 'up-to-date'">
|
2023-10-09 10:28:14 +00:00
|
|
|
<p>Hard Lounge is up to date!</p>
|
2019-08-05 14:29:35 +00:00
|
|
|
|
|
|
|
<button
|
2022-06-19 00:25:21 +00:00
|
|
|
v-if="store.state.versionDataExpired"
|
2019-08-05 14:29:35 +00:00
|
|
|
id="check-now"
|
|
|
|
class="btn btn-small"
|
|
|
|
@click="checkNow"
|
|
|
|
>
|
|
|
|
Check now
|
|
|
|
</button>
|
|
|
|
</template>
|
2022-06-19 00:25:21 +00:00
|
|
|
<template v-if="store.state.versionStatus === 'error'">
|
2020-08-25 09:49:53 +00:00
|
|
|
<p>Information about latest release could not be retrieved.</p>
|
2019-08-05 14:29:35 +00:00
|
|
|
|
|
|
|
<button id="check-now" class="btn btn-small" @click="checkNow">Try again</button>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import {defineComponent, onMounted} from "vue";
|
2019-11-16 17:24:03 +00:00
|
|
|
import socket from "../js/socket";
|
2022-06-19 00:25:21 +00:00
|
|
|
import {useStore} from "../js/store";
|
2019-08-05 14:29:35 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
export default defineComponent({
|
2019-08-05 14:29:35 +00:00
|
|
|
name: "VersionChecker",
|
2022-06-19 00:25:21 +00:00
|
|
|
setup() {
|
|
|
|
const store = useStore();
|
|
|
|
|
|
|
|
const checkNow = () => {
|
|
|
|
store.commit("versionData", null);
|
|
|
|
store.commit("versionStatus", "loading");
|
2019-08-05 14:29:35 +00:00
|
|
|
socket.emit("changelog");
|
2022-06-19 00:25:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (!store.state.versionData) {
|
|
|
|
checkNow();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
store,
|
|
|
|
checkNow,
|
|
|
|
};
|
2019-08-05 14:29:35 +00:00
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
});
|
2019-08-05 14:29:35 +00:00
|
|
|
</script>
|