sermoni

"Service monitor" / cronjob status service
Log | Files | Refs

commit 7b0ee38ccaaf723c21d878d292e33c5a4659fb3b
parent e64bbf8f510f854a8076a304a517529685c67daf
Author: Vetle Haflan <vetle@haflan.dev>
Date:   Sun,  2 Aug 2020 09:37:58 +0200

Minor bug and style fixes

Diffstat:
Minternal/http/events.go | 2+-
Mui/src/Events.vue | 5++++-
Mui/src/Services.vue | 15++++++++-------
Mui/src/TimePicker.vue | 2+-
4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/internal/http/events.go b/internal/http/events.go @@ -119,7 +119,7 @@ func generateLateEvent(s *services.Service) *events.Event { Timestamp: now(), Status: "late", Title: "Expectation not met", - Details: s.Name + " has failed to report within the expected internal." + + Details: s.Name + " has failed to report within the expected interval. " + "Something is probably wrong.", ServiceName: s.Name, } diff --git a/ui/src/Events.vue b/ui/src/Events.vue @@ -9,7 +9,7 @@ <!--<mq-layout mq="md+">--> <div class="event-field">{{ simplifyDate(e.timestamp) }}</div> <!--</mq-layout>--> - <button v-show="e.id" @click="deleteEvent(e.id)">&times;</button> + <button v-show="e.id > 0" @click="deleteEvent(e.id)">&times;</button> </div> <div v-show="false"> more info here </div> </div> @@ -80,9 +80,12 @@ }, computed: { events() { + // Vue needs unique indices, so late events get negative IDs + let lateId = 0; return this.loadedEvents.map(e => { return { ...e, + id: e.id ? e.id : lateId--, style: this.statusStyle(e.status) }; }); diff --git a/ui/src/Services.vue b/ui/src/Services.vue @@ -1,21 +1,22 @@ <template> <div class="services-wrapper"> <div class="service" v-for="service in services" :key="service.id"> - {{ service.id }} : <br/> + <span>Service ID:</span> + <input type="text" :value="service.id"> <br/> - <span>Token</span> + <span>Token:</span> <input :type="showPasswords ? 'text' : 'password'" :value="service.token"/> <br/> - <span>Name</span> + <span>Name:</span> <input type="text" :value="service.name"/> <br/> - <span>Description</span> + <span>Description:</span> <input type="text" :value="service.description"/> <br/> - <span>Max number of events</span> + <span>Max number of events:</span> <input type="number" :value="service.maxevents"/> <br/> - <span>Expectation period</span> + <span>Expectation period:</span> <time-picker :value="service.period"/> <br/> <button @click="deletionID = service.id">Delete</button> @@ -52,7 +53,7 @@ period: {"number": 0, "scalar": 0}, maxevents: 0 }, - showPasswords: true, + showPasswords: false, deletionID: 0, } }, diff --git a/ui/src/TimePicker.vue b/ui/src/TimePicker.vue @@ -1,5 +1,5 @@ <template> - <div> + <div style="display: flex;"> <input type="number" @input="update('number', $event)" :value="number"/> <select @input="update('scalar', $event)" :value="scalar"> <option v-for="u in units"