+
+
+ Recent Failure
+
+ Last failure was {{ago(last_failure.created_at)}} ago. {{last_failure.issue}}
-
-
- {{incident.title}} - {{incident.description}}
-
- {{update.type}} - {{update.message}}
-
+
+
+ Upcoming Announcement
+ {{message.description}}
+ @ {{niceDate(message.start_on)}}
+
+
+
+ Recent Incident
+ {{incident.title}} - {{incident.description}}
+ @ {{niceDate(incident.created_at)}}
+
+
+
+ No New Events
+
+ Last failure was {{ago(service.last_error)}} ago.
+
+
+
@@ -34,7 +39,6 @@ export default {
name: "ServiceEvents",
components: {
Loading
-
},
props: {
service: {
@@ -45,7 +49,6 @@ name: "ServiceEvents",
data() {
return {
incidents: null,
- failure: null,
loaded: false,
}
},
@@ -53,16 +56,28 @@ name: "ServiceEvents",
this.load()
},
computed: {
+ last_failure() {
+ if (!this.service.failures) {
+ return null
+ }
+ return this.service.failures[0]
+ },
+ failureBefore() {
+ return this.isAfter(this.parseISO(this.service.last_error), this.nowSubtract(43200).toISOString())
+ },
messages() {
return this.$store.getters.serviceMessages(this.service.id)
+ },
+ success_event() {
+ if (this.service.online && this.service.messages.length === 0 && this.service.incidents.length === 0) {
+ return true
+ }
+ return false
}
},
methods: {
async load() {
this.loaded = false
- if (!this.service.online) {
- await this.getFailure()
- }
await this.getMessages()
await this.getIncidents()
this.loaded = true
@@ -70,10 +85,6 @@ name: "ServiceEvents",
async getMessages() {
// this.messages = this.$store.getters.serviceMessages(this.service.id)
},
- async getFailure() {
- const f = await Api.service_failures(this.service.id, null, null, 1)
- this.failure = f[0]
- },
async getIncidents() {
this.incidents = await Api.incidents_service(this.service.id)
},
diff --git a/frontend/src/components/Dashboard/ServiceInfo.vue b/frontend/src/components/Dashboard/ServiceInfo.vue
index acd62c6a..57da18c2 100644
--- a/frontend/src/components/Dashboard/ServiceInfo.vue
+++ b/frontend/src/components/Dashboard/ServiceInfo.vue
@@ -1,64 +1,56 @@
-