2022-03-10 13:34:30 +00:00
|
|
|
<template>
|
|
|
|
<transition name="slide-fade" appear>
|
|
|
|
<div>
|
|
|
|
<h1 class="mb-3">
|
|
|
|
{{ $t("Status Pages") }}
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<div>
|
2022-03-17 11:07:05 +00:00
|
|
|
<router-link to="/add-status-page" class="btn btn-primary mb-3"><font-awesome-icon icon="plus" /> {{ $t("New Status Page") }}</router-link>
|
2022-03-10 13:34:30 +00:00
|
|
|
</div>
|
|
|
|
|
2022-03-17 11:07:05 +00:00
|
|
|
<div class="shadow-box">
|
|
|
|
<template v-if="$root.statusPageListLoaded">
|
2022-03-18 13:47:14 +00:00
|
|
|
<span v-if="Object.keys($root.statusPageList).length === 0" class="d-flex align-items-center justify-content-center my-3">
|
2022-04-04 03:33:02 +00:00
|
|
|
{{ $t("No status pages") }}
|
2022-03-17 14:44:47 +00:00
|
|
|
</span>
|
2022-03-17 11:07:05 +00:00
|
|
|
|
2022-03-17 16:00:56 +00:00
|
|
|
<!-- use <a> instead of <router-link>, because the heartbeat won't load. -->
|
|
|
|
<a v-for="statusPage in $root.statusPageList" :key="statusPage.slug" :href="'/status/' + statusPage.slug" class="item">
|
2022-03-17 11:07:05 +00:00
|
|
|
<img :src="icon(statusPage.icon)" alt class="logo me-2" />
|
|
|
|
<div class="info">
|
|
|
|
<div class="title">{{ statusPage.title }}</div>
|
|
|
|
<div class="slug">/status/{{ statusPage.slug }}</div>
|
|
|
|
</div>
|
2022-03-17 16:00:56 +00:00
|
|
|
</a>
|
2022-03-17 11:07:05 +00:00
|
|
|
</template>
|
|
|
|
<div v-else class="d-flex align-items-center justify-content-center my-3 spinner">
|
|
|
|
<font-awesome-icon icon="spinner" size="2x" spin />
|
|
|
|
</div>
|
2022-03-10 13:34:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2022-03-17 08:42:26 +00:00
|
|
|
import { getResBaseURL } from "../util-frontend";
|
|
|
|
|
2022-03-10 13:34:30 +00:00
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
2022-06-02 12:46:44 +00:00
|
|
|
/**
|
|
|
|
* Get the correct URL for the icon
|
|
|
|
* @param {string} icon Path for icon
|
|
|
|
* @returns {string} Correctly formatted path including port numbers
|
|
|
|
*/
|
2022-03-17 08:42:26 +00:00
|
|
|
icon(icon) {
|
|
|
|
if (icon === "/icon.svg") {
|
|
|
|
return icon;
|
|
|
|
} else {
|
|
|
|
return getResBaseURL() + icon;
|
|
|
|
}
|
|
|
|
}
|
2022-03-10 13:34:30 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import "../assets/vars.scss";
|
|
|
|
|
|
|
|
.item {
|
2022-03-17 08:42:26 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 10px;
|
2022-03-10 13:34:30 +00:00
|
|
|
text-decoration: none;
|
|
|
|
border-radius: 10px;
|
|
|
|
transition: all ease-in-out 0.15s;
|
2022-03-17 08:42:26 +00:00
|
|
|
padding: 10px;
|
2022-03-10 13:34:30 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: $highlight-white;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
background-color: #cdf8f4;
|
|
|
|
}
|
|
|
|
|
2022-03-17 08:42:26 +00:00
|
|
|
$logo-width: 70px;
|
2022-03-10 13:34:30 +00:00
|
|
|
|
2022-03-17 08:42:26 +00:00
|
|
|
.logo {
|
|
|
|
width: $logo-width;
|
2022-03-17 11:07:05 +00:00
|
|
|
|
|
|
|
// Better when the image is loading
|
|
|
|
min-height: 1px;
|
2022-03-10 13:34:30 +00:00
|
|
|
}
|
|
|
|
|
2022-03-17 08:42:26 +00:00
|
|
|
.info {
|
|
|
|
.title {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.slug {
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
2022-03-10 13:34:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dark {
|
|
|
|
.item {
|
|
|
|
&:hover {
|
|
|
|
background-color: $dark-bg2;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
background-color: $dark-bg2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|