2021-06-25 13:55:49 +00:00
|
|
|
<template>
|
2021-08-10 07:02:46 +00:00
|
|
|
<div :class="classes">
|
2021-08-08 05:47:29 +00:00
|
|
|
<div v-if="! $root.socket.connected && ! $root.socket.firstConnect" class="lost-connection">
|
|
|
|
<div class="container-fluid">
|
|
|
|
{{ $root.connectionErrorMsg }}
|
|
|
|
</div>
|
2021-06-25 13:55:49 +00:00
|
|
|
</div>
|
|
|
|
|
2021-08-08 05:47:29 +00:00
|
|
|
<!-- Desktop header -->
|
|
|
|
<header v-if="! $root.isMobile" class="d-flex flex-wrap justify-content-center py-3 mb-3 border-bottom">
|
|
|
|
<router-link to="/dashboard" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
|
|
|
|
<object class="bi me-2 ms-4" width="40" height="40" data="/icon.svg" alt="Logo" />
|
|
|
|
<span class="fs-4 title">Uptime Kuma</span>
|
|
|
|
</router-link>
|
|
|
|
|
2021-08-21 11:50:22 +00:00
|
|
|
<a v-if="hasNewVersion" target="_blank" href="https://github.com/louislam/uptime-kuma/releases" class="btn btn-info me-3">
|
2021-08-24 08:44:58 +00:00
|
|
|
<font-awesome-icon icon="arrow-alt-circle-up" /> {{ $t("New Update") }}
|
2021-08-21 11:50:22 +00:00
|
|
|
</a>
|
|
|
|
|
2021-08-08 05:47:29 +00:00
|
|
|
<ul class="nav nav-pills">
|
|
|
|
<li class="nav-item">
|
|
|
|
<router-link to="/dashboard" class="nav-link">
|
2021-08-24 08:44:58 +00:00
|
|
|
<font-awesome-icon icon="tachometer-alt" /> {{ $t("Dashboard") }}
|
2021-08-08 05:47:29 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<router-link to="/settings" class="nav-link">
|
2021-08-24 08:44:58 +00:00
|
|
|
<font-awesome-icon icon="cog" /> {{ $t("Settings") }}
|
2021-08-08 05:47:29 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<!-- Mobile header -->
|
|
|
|
<header v-else class="d-flex flex-wrap justify-content-center pt-2 pb-2 mb-3">
|
|
|
|
<router-link to="/dashboard" class="d-flex align-items-center text-dark text-decoration-none">
|
|
|
|
<object class="bi" width="40" height="40" data="/icon.svg" />
|
|
|
|
<span class="fs-4 title ms-2">Uptime Kuma</span>
|
|
|
|
</router-link>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<main>
|
|
|
|
<!-- Add :key to disable vue router re-use the same component -->
|
|
|
|
<router-view v-if="$root.loggedIn" :key="$route.fullPath" />
|
|
|
|
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
<div class="container-fluid">
|
|
|
|
Uptime Kuma -
|
|
|
|
Version: {{ $root.info.version }} -
|
|
|
|
<a href="https://github.com/louislam/uptime-kuma/releases" target="_blank" rel="noopener">Check Update On GitHub</a>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
|
|
|
|
<!-- Mobile Only -->
|
|
|
|
<div v-if="$root.isMobile" style="width: 100%;height: 60px;" />
|
|
|
|
<nav v-if="$root.isMobile" class="bottom-nav">
|
2021-08-19 10:12:52 +00:00
|
|
|
<router-link to="/dashboard" class="nav-link">
|
2021-08-08 05:47:29 +00:00
|
|
|
<div><font-awesome-icon icon="tachometer-alt" /></div>
|
2021-08-24 08:44:58 +00:00
|
|
|
{{ $t("Dashboard") }}
|
2021-08-08 05:47:29 +00:00
|
|
|
</router-link>
|
|
|
|
|
2021-08-19 10:12:52 +00:00
|
|
|
<router-link to="/list" class="nav-link">
|
2021-08-08 05:47:29 +00:00
|
|
|
<div><font-awesome-icon icon="list" /></div>
|
|
|
|
List
|
2021-08-19 10:12:52 +00:00
|
|
|
</router-link>
|
2021-08-08 05:47:29 +00:00
|
|
|
|
2021-08-19 10:12:52 +00:00
|
|
|
<router-link to="/add" class="nav-link">
|
2021-08-08 05:47:29 +00:00
|
|
|
<div><font-awesome-icon icon="plus" /></div>
|
|
|
|
Add
|
|
|
|
</router-link>
|
|
|
|
|
2021-08-19 10:12:52 +00:00
|
|
|
<router-link to="/settings" class="nav-link">
|
2021-08-08 05:47:29 +00:00
|
|
|
<div><font-awesome-icon icon="cog" /></div>
|
2021-08-24 08:44:58 +00:00
|
|
|
{{ $t("Settings") }}
|
2021-08-08 05:47:29 +00:00
|
|
|
</router-link>
|
|
|
|
</nav>
|
|
|
|
</div>
|
2021-06-25 13:55:49 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Login from "../components/Login.vue";
|
2021-08-21 11:50:22 +00:00
|
|
|
import compareVersions from "compare-versions";
|
2021-06-25 13:55:49 +00:00
|
|
|
|
|
|
|
export default {
|
2021-08-10 07:02:46 +00:00
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
components: {
|
2021-07-27 17:47:13 +00:00
|
|
|
Login,
|
2021-07-11 07:23:28 +00:00
|
|
|
},
|
2021-08-10 07:02:46 +00:00
|
|
|
|
2021-07-11 07:23:28 +00:00
|
|
|
data() {
|
2021-07-27 17:47:13 +00:00
|
|
|
return {}
|
2021-06-25 13:55:49 +00:00
|
|
|
},
|
2021-08-10 07:02:46 +00:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
// Theme or Mobile
|
|
|
|
classes() {
|
|
|
|
const classes = {};
|
|
|
|
classes[this.$root.theme] = true;
|
|
|
|
classes["mobile"] = this.$root.isMobile;
|
|
|
|
return classes;
|
2021-08-21 11:50:22 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
hasNewVersion() {
|
|
|
|
if (this.$root.info.latestVersion && this.$root.info.version) {
|
|
|
|
return compareVersions(this.$root.info.latestVersion, this.$root.info.version) >= 1;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
},
|
2021-08-10 07:02:46 +00:00
|
|
|
|
|
|
|
},
|
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
watch: {
|
2021-08-19 10:12:52 +00:00
|
|
|
$route(to, from) {
|
2021-06-25 13:55:49 +00:00
|
|
|
this.init();
|
2021-07-27 17:47:13 +00:00
|
|
|
},
|
|
|
|
},
|
2021-08-10 07:02:46 +00:00
|
|
|
|
2021-07-27 17:47:13 +00:00
|
|
|
mounted() {
|
|
|
|
this.init();
|
2021-06-25 13:55:49 +00:00
|
|
|
},
|
2021-08-10 07:02:46 +00:00
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
methods: {
|
|
|
|
init() {
|
|
|
|
if (this.$route.name === "root") {
|
|
|
|
this.$router.push("/dashboard")
|
|
|
|
}
|
2021-07-11 07:23:28 +00:00
|
|
|
},
|
2021-07-27 17:47:13 +00:00
|
|
|
},
|
2021-08-10 07:02:46 +00:00
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-08-08 05:47:29 +00:00
|
|
|
<style lang="scss" scoped>
|
2021-07-11 07:23:28 +00:00
|
|
|
@import "../assets/vars.scss";
|
2021-06-25 13:55:49 +00:00
|
|
|
|
2021-07-11 07:23:28 +00:00
|
|
|
.bottom-nav {
|
|
|
|
z-index: 1000;
|
|
|
|
position: fixed;
|
|
|
|
bottom: 0;
|
|
|
|
height: 60px;
|
|
|
|
width: 100%;
|
|
|
|
left: 0;
|
2021-07-13 04:16:11 +00:00
|
|
|
background-color: #fff;
|
2021-07-11 07:23:28 +00:00
|
|
|
box-shadow: 0 15px 47px 0 rgba(0, 0, 0, 0.05), 0 5px 14px 0 rgba(0, 0, 0, 0.05);
|
|
|
|
text-align: center;
|
|
|
|
white-space: nowrap;
|
2021-07-27 08:52:44 +00:00
|
|
|
padding: 0 10px;
|
2021-06-25 13:55:49 +00:00
|
|
|
|
2021-07-11 07:23:28 +00:00
|
|
|
a {
|
|
|
|
text-align: center;
|
|
|
|
width: 25%;
|
|
|
|
display: inline-block;
|
|
|
|
height: 100%;
|
|
|
|
padding: 8px 10px 0;
|
|
|
|
font-size: 13px;
|
|
|
|
color: #c1c1c1;
|
|
|
|
overflow: hidden;
|
|
|
|
text-decoration: none;
|
2021-06-30 13:04:58 +00:00
|
|
|
|
2021-07-11 07:23:28 +00:00
|
|
|
&.router-link-exact-active {
|
|
|
|
color: $primary;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
div {
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
2021-06-30 13:04:58 +00:00
|
|
|
}
|
2021-07-11 07:23:28 +00:00
|
|
|
}
|
|
|
|
|
2021-08-08 17:58:56 +00:00
|
|
|
main {
|
|
|
|
min-height: calc(100vh - 160px)
|
|
|
|
}
|
|
|
|
|
2021-07-11 07:23:28 +00:00
|
|
|
.title {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav {
|
|
|
|
margin-right: 25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.lost-connection {
|
|
|
|
padding: 5px;
|
|
|
|
background-color: crimson;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
|
2021-07-13 10:08:12 +00:00
|
|
|
footer {
|
|
|
|
color: #AAA;
|
|
|
|
font-size: 13px;
|
2021-07-27 08:52:44 +00:00
|
|
|
margin-top: 10px;
|
2021-08-08 05:47:29 +00:00
|
|
|
padding-bottom: 30px;
|
2021-07-13 10:08:12 +00:00
|
|
|
margin-left: 10px;
|
2021-07-17 08:12:05 +00:00
|
|
|
text-align: center;
|
2021-07-11 07:23:28 +00:00
|
|
|
}
|
2021-07-13 10:08:12 +00:00
|
|
|
|
2021-08-08 05:47:29 +00:00
|
|
|
.dark {
|
|
|
|
header {
|
|
|
|
background-color: #161B22;
|
|
|
|
border-bottom-color: #161B22 !important;
|
|
|
|
|
|
|
|
span {
|
|
|
|
color: #F0F6FC;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.bottom-nav {
|
|
|
|
background-color: $dark-bg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
</style>
|