2021-06-25 09:55:49 -04:00
|
|
|
<template>
|
2021-08-10 03:02:46 -04:00
|
|
|
<div :class="classes">
|
2021-08-08 01:47:29 -04:00
|
|
|
<div v-if="! $root.socket.connected && ! $root.socket.firstConnect" class="lost-connection">
|
|
|
|
<div class="container-fluid">
|
|
|
|
{{ $root.connectionErrorMsg }}
|
2022-03-22 11:46:13 -04:00
|
|
|
<div v-if="$root.showReverseProxyGuide">
|
|
|
|
Using a Reverse Proxy? <a href="https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy" target="_blank">Check how to config it for WebSocket</a>
|
|
|
|
</div>
|
2021-08-08 01:47:29 -04:00
|
|
|
</div>
|
2021-06-25 09:55:49 -04:00
|
|
|
</div>
|
|
|
|
|
2021-08-08 01:47:29 -04: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">
|
2021-08-24 11:38:25 -04:00
|
|
|
<object class="bi me-2 ms-4" width="40" height="40" data="/icon.svg" />
|
2021-09-26 11:19:39 -04:00
|
|
|
<span class="fs-4 title">{{ $t("Uptime Kuma") }}</span>
|
2021-08-08 01:47:29 -04:00
|
|
|
</router-link>
|
|
|
|
|
2021-08-21 07:50:22 -04:00
|
|
|
<a v-if="hasNewVersion" target="_blank" href="https://github.com/louislam/uptime-kuma/releases" class="btn btn-info me-3">
|
2021-08-24 04:44:58 -04:00
|
|
|
<font-awesome-icon icon="arrow-alt-circle-up" /> {{ $t("New Update") }}
|
2021-08-21 07:50:22 -04:00
|
|
|
</a>
|
|
|
|
|
2021-08-08 01:47:29 -04:00
|
|
|
<ul class="nav nav-pills">
|
2022-03-18 02:14:22 -04:00
|
|
|
<li v-if="$root.loggedIn" class="nav-item me-2">
|
2022-03-10 08:34:30 -05:00
|
|
|
<router-link to="/manage-status-page" class="nav-link">
|
|
|
|
<font-awesome-icon icon="stream" /> {{ $t("Status Pages") }}
|
|
|
|
</router-link>
|
2021-09-11 07:40:03 -04:00
|
|
|
</li>
|
2021-10-01 09:12:37 -04:00
|
|
|
<li v-if="$root.loggedIn" class="nav-item me-2">
|
2021-08-08 01:47:29 -04:00
|
|
|
<router-link to="/dashboard" class="nav-link">
|
2021-08-24 04:44:58 -04:00
|
|
|
<font-awesome-icon icon="tachometer-alt" /> {{ $t("Dashboard") }}
|
2021-08-08 01:47:29 -04:00
|
|
|
</router-link>
|
|
|
|
</li>
|
2022-04-18 12:39:49 -04:00
|
|
|
<li v-if="$root.loggedIn" class="nav-item">
|
|
|
|
<div class="dropdown dropdown-profile-pic">
|
|
|
|
<div type="button" class="nav-link" data-bs-toggle="dropdown">
|
2022-04-19 07:40:28 -04:00
|
|
|
<div class="profile-pic">{{ $root.usernameFirstChar }}</div>
|
2022-04-18 12:39:49 -04:00
|
|
|
<font-awesome-icon icon="angle-down" />
|
|
|
|
</div>
|
|
|
|
<ul class="dropdown-menu">
|
2022-04-19 07:40:28 -04:00
|
|
|
<li><span class="dropdown-item-text">Signed in as <strong>{{ $root.username }}</strong></span></li>
|
2022-04-18 12:39:49 -04:00
|
|
|
<li><hr class="dropdown-divider"></li>
|
|
|
|
<li>
|
|
|
|
<router-link to="/settings" class="dropdown-item" :class="{ active: $route.path.includes('settings') }">
|
|
|
|
<font-awesome-icon icon="cog" /> {{ $t("Settings") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
<li v-if="$root.loggedIn && $root.storage().token !== 'autoLogin'">
|
|
|
|
<button class="dropdown-item" @click="$root.logout">
|
|
|
|
<font-awesome-icon icon="sign-out-alt" />
|
|
|
|
{{ $t("Logout") }}
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2022-01-27 14:45:31 -05:00
|
|
|
</li>
|
2021-08-08 01:47:29 -04:00
|
|
|
</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>
|
2022-03-25 14:09:12 -04:00
|
|
|
<router-view v-if="$root.loggedIn || forceShowContent" />
|
2021-08-08 01:47:29 -04:00
|
|
|
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<!-- Mobile Only -->
|
2021-08-24 11:38:25 -04:00
|
|
|
<div v-if="$root.isMobile" style="width: 100%; height: 60px;" />
|
2021-08-08 01:47:29 -04:00
|
|
|
<nav v-if="$root.isMobile" class="bottom-nav">
|
2021-08-19 06:12:52 -04:00
|
|
|
<router-link to="/dashboard" class="nav-link">
|
2021-08-08 01:47:29 -04:00
|
|
|
<div><font-awesome-icon icon="tachometer-alt" /></div>
|
2021-08-24 04:44:58 -04:00
|
|
|
{{ $t("Dashboard") }}
|
2021-08-08 01:47:29 -04:00
|
|
|
</router-link>
|
|
|
|
|
2021-08-19 06:12:52 -04:00
|
|
|
<router-link to="/list" class="nav-link">
|
2021-08-08 01:47:29 -04:00
|
|
|
<div><font-awesome-icon icon="list" /></div>
|
2021-08-24 06:26:44 -04:00
|
|
|
{{ $t("List") }}
|
2021-08-19 06:12:52 -04:00
|
|
|
</router-link>
|
2021-08-08 01:47:29 -04:00
|
|
|
|
2021-08-19 06:12:52 -04:00
|
|
|
<router-link to="/add" class="nav-link">
|
2021-08-08 01:47:29 -04:00
|
|
|
<div><font-awesome-icon icon="plus" /></div>
|
2021-08-24 06:26:44 -04:00
|
|
|
{{ $t("Add") }}
|
2021-08-08 01:47:29 -04:00
|
|
|
</router-link>
|
|
|
|
|
2021-08-19 06:12:52 -04:00
|
|
|
<router-link to="/settings" class="nav-link">
|
2021-08-08 01:47:29 -04:00
|
|
|
<div><font-awesome-icon icon="cog" /></div>
|
2021-08-24 04:44:58 -04:00
|
|
|
{{ $t("Settings") }}
|
2021-08-08 01:47:29 -04:00
|
|
|
</router-link>
|
|
|
|
</nav>
|
|
|
|
</div>
|
2021-06-25 09:55:49 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Login from "../components/Login.vue";
|
2021-08-21 07:50:22 -04:00
|
|
|
import compareVersions from "compare-versions";
|
2021-06-25 09:55:49 -04:00
|
|
|
|
|
|
|
export default {
|
2021-08-10 03:02:46 -04:00
|
|
|
|
2021-06-25 09:55:49 -04:00
|
|
|
components: {
|
2021-07-27 13:47:13 -04:00
|
|
|
Login,
|
2021-07-11 03:23:28 -04:00
|
|
|
},
|
2021-08-10 03:02:46 -04:00
|
|
|
|
2021-07-11 03:23:28 -04:00
|
|
|
data() {
|
2021-09-22 06:05:40 -04:00
|
|
|
return {};
|
2021-06-25 09:55:49 -04:00
|
|
|
},
|
2021-08-10 03:02:46 -04:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
// Theme or Mobile
|
|
|
|
classes() {
|
|
|
|
const classes = {};
|
|
|
|
classes[this.$root.theme] = true;
|
|
|
|
classes["mobile"] = this.$root.isMobile;
|
|
|
|
return classes;
|
2021-08-21 07:50:22 -04: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 03:02:46 -04:00
|
|
|
|
|
|
|
},
|
|
|
|
|
2021-06-25 09:55:49 -04:00
|
|
|
watch: {
|
2021-09-23 01:57:24 -04:00
|
|
|
|
2021-07-27 13:47:13 -04:00
|
|
|
},
|
2021-08-10 03:02:46 -04:00
|
|
|
|
2021-07-27 13:47:13 -04:00
|
|
|
mounted() {
|
2021-09-23 01:57:24 -04:00
|
|
|
|
2021-06-25 09:55:49 -04:00
|
|
|
},
|
2021-08-10 03:02:46 -04:00
|
|
|
|
2021-06-25 09:55:49 -04:00
|
|
|
methods: {
|
2021-09-15 08:40:26 -04:00
|
|
|
|
2021-07-27 13:47:13 -04:00
|
|
|
},
|
2021-08-10 03:02:46 -04:00
|
|
|
|
2021-09-22 06:05:40 -04:00
|
|
|
};
|
2021-06-25 09:55:49 -04:00
|
|
|
</script>
|
|
|
|
|
2021-08-08 01:47:29 -04:00
|
|
|
<style lang="scss" scoped>
|
2021-07-11 03:23:28 -04:00
|
|
|
@import "../assets/vars.scss";
|
2021-06-25 09:55:49 -04:00
|
|
|
|
2021-09-11 07:40:03 -04:00
|
|
|
.nav-link {
|
|
|
|
&.status-page {
|
|
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-11 03:23:28 -04:00
|
|
|
.bottom-nav {
|
|
|
|
z-index: 1000;
|
|
|
|
position: fixed;
|
|
|
|
bottom: 0;
|
|
|
|
height: 60px;
|
|
|
|
width: 100%;
|
|
|
|
left: 0;
|
2021-07-13 00:16:11 -04:00
|
|
|
background-color: #fff;
|
2021-07-11 03:23:28 -04: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 04:52:44 -04:00
|
|
|
padding: 0 10px;
|
2021-06-25 09:55:49 -04:00
|
|
|
|
2022-04-18 12:39:49 -04:00
|
|
|
a {
|
2021-07-11 03:23:28 -04:00
|
|
|
text-align: center;
|
2022-04-18 12:39:49 -04:00
|
|
|
width: 25%;
|
2021-07-11 03:23:28 -04:00
|
|
|
display: inline-block;
|
|
|
|
height: 100%;
|
|
|
|
padding: 8px 10px 0;
|
|
|
|
font-size: 13px;
|
|
|
|
color: #c1c1c1;
|
|
|
|
overflow: hidden;
|
|
|
|
text-decoration: none;
|
2021-06-30 09:04:58 -04:00
|
|
|
|
2022-03-04 10:20:42 -05:00
|
|
|
&.router-link-exact-active, &.active {
|
2021-07-11 03:23:28 -04:00
|
|
|
color: $primary;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
div {
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
2021-06-30 09:04:58 -04:00
|
|
|
}
|
2021-07-11 03:23:28 -04:00
|
|
|
}
|
|
|
|
|
2021-08-08 13:58:56 -04:00
|
|
|
main {
|
2021-08-24 11:38:25 -04:00
|
|
|
min-height: calc(100vh - 160px);
|
2021-08-08 13:58:56 -04:00
|
|
|
}
|
|
|
|
|
2021-07-11 03:23:28 -04:00
|
|
|
.title {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav {
|
|
|
|
margin-right: 25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.lost-connection {
|
|
|
|
padding: 5px;
|
|
|
|
background-color: crimson;
|
|
|
|
color: white;
|
2022-03-22 11:46:13 -04:00
|
|
|
position: fixed;
|
|
|
|
width: 100%;
|
2022-03-31 04:15:34 -04:00
|
|
|
z-index: 99999;
|
2021-07-11 03:23:28 -04:00
|
|
|
}
|
|
|
|
|
2022-04-18 12:39:49 -04:00
|
|
|
// Profile Pic Button with Dropdown
|
|
|
|
.dropdown-profile-pic {
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
.nav-link {
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
gap: 6px;
|
|
|
|
align-items: center;
|
|
|
|
background-color: rgba(200, 200, 200, 0.2);
|
|
|
|
padding: 0.5rem 0.8rem;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: rgba(255, 255, 255, 0.2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-menu {
|
|
|
|
transition: all 0.2s;
|
|
|
|
padding-left: 0;
|
2022-04-19 07:46:21 -04:00
|
|
|
margin-top: 8px !important;
|
|
|
|
border-radius: 20px;
|
2022-04-18 12:39:49 -04:00
|
|
|
|
|
|
|
.dropdown-divider {
|
|
|
|
margin: 0;
|
|
|
|
border-top: 1px solid rgba(0, 0, 0, 0.4);
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-item-text {
|
|
|
|
font-size: 14px;
|
|
|
|
padding-bottom: 0.7rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-item {
|
|
|
|
padding: 0.7rem 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dark & {
|
|
|
|
background-color: $dark-bg;
|
|
|
|
color: $dark-font-color;
|
|
|
|
border-color: $dark-border-color;
|
|
|
|
|
|
|
|
.dropdown-item {
|
|
|
|
color: $dark-font-color;
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: $dark-font-color2;
|
|
|
|
background-color: $highlight !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: $dark-bg2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.profile-pic {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
color: white;
|
|
|
|
background-color: $primary;
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
|
|
|
margin-right: 5px;
|
|
|
|
border-radius: 50rem;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-08 01:47:29 -04:00
|
|
|
.dark {
|
|
|
|
header {
|
2021-10-20 06:54:20 -04:00
|
|
|
background-color: $dark-header-bg;
|
|
|
|
border-bottom-color: $dark-header-bg !important;
|
2021-08-08 01:47:29 -04:00
|
|
|
|
|
|
|
span {
|
2021-08-24 11:38:25 -04:00
|
|
|
color: #f0f6fc;
|
2021-08-08 01:47:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.bottom-nav {
|
|
|
|
background-color: $dark-bg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-25 09:55:49 -04:00
|
|
|
</style>
|