check update

This commit is contained in:
LouisLam
2021-08-21 19:50:22 +08:00
parent 362eabab8d
commit 4571a9b8c1
7 changed files with 89 additions and 10 deletions

View File

@@ -13,6 +13,10 @@
<span class="fs-4 title">Uptime Kuma</span>
</router-link>
<a v-if="hasNewVersion" target="_blank" href="https://github.com/louislam/uptime-kuma/releases" class="btn btn-info me-3">
<font-awesome-icon icon="arrow-alt-circle-up" /> New Update
</a>
<ul class="nav nav-pills">
<li class="nav-item">
<router-link to="/dashboard" class="nav-link">
@@ -77,6 +81,7 @@
<script>
import Login from "../components/Login.vue";
import compareVersions from "compare-versions";
export default {
@@ -96,7 +101,15 @@ export default {
classes[this.$root.theme] = true;
classes["mobile"] = this.$root.isMobile;
return classes;
}
},
hasNewVersion() {
if (this.$root.info.latestVersion && this.$root.info.version) {
return compareVersions(this.$root.info.latestVersion, this.$root.info.version) >= 1;
} else {
return false;
}
},
},