This commit is contained in:
Romein van Buren 2022-08-29 12:22:17 +02:00
parent e11645932d
commit 9b4b71d25f
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
6 changed files with 22 additions and 17 deletions

View File

@ -21,7 +21,7 @@ const defaultEndpoint = {
{ type: 'httpstatus',
truth: 'true',
operator: 'equal',
string: '200'
string: '200',
},
],
};
@ -29,7 +29,7 @@ const defaultReq = {
type: 'httpstatus',
truth: 'true',
operator: 'equal',
string: ''
string: '',
};
const defaultHeader = {
name: '',
@ -110,6 +110,7 @@ function removeEndpoint(i) {
/>
<button on:click={() => {
endpoint.headers.splice(iHeader, 1);
// eslint-disable-next-line no-self-assign
endpoint = endpoint;
}}>
&times;
@ -161,7 +162,7 @@ function removeEndpoint(i) {
inline
labels={{
on: translate('is', language),
off: translate('isn\'t', language)
off: translate('isn\'t', language),
}}
bind:value={req.truth}
on:change={changeValue}
@ -196,6 +197,7 @@ function removeEndpoint(i) {
/>
<button on:click={() => {
endpoint.requirements.splice(iReq, 1);
// eslint-disable-next-line no-self-assign
endpoint = endpoint;
}}>
&times;

View File

@ -28,7 +28,7 @@ const severity = {
name: 'no impact',
class: 'l4',
},
}
};
const dispatch = createEventDispatcher();
const service = value; // for clarity
let outages = [];

View File

@ -17,7 +17,7 @@
let hasData = false;
function tileProps(service) {
let props = {
const props = {
title: service.name.en,
subtitle: service.cluster,
date: service.lastBeat?.date ? new Date(service.lastBeat.date) : undefined,
@ -87,7 +87,9 @@
settings.subscribe(s => {
size = (s.cols || 4) * (s.rows || 3);
if (hasData) organiseGrid();
if (hasData) {
organiseGrid();
}
});
return () => clearInterval(clockInterval);

View File

@ -14,13 +14,13 @@
}) : '';
onMount(() => {
if (since) {
function updateDuration() {
formattedDuration = formatDuration(
new Date().getTime() - since.getTime()
);
}
if (since) {
updateDuration();
const interval = setInterval(updateDuration, 100);
return () => clearInterval(interval);

View File

@ -5,7 +5,9 @@
onMount(() => {
let url = window.location.href;
if (!url.endsWith('/')) url += '/';
if (!url.endsWith('/')) {
url += '/';
}
url += 'status/dashboard';
window.open(url, '_blank').focus();

View File

@ -3,7 +3,6 @@
const { makeId } = require('core/makeid');
const decoder = new TextDecoder('utf-8');
let uws;
let downIdsBefore = [];
let downIdsAfter = [];
@ -16,7 +15,7 @@ const mapService = (s, beat) => ({
});
async function createDashboardSocket(server) {
uws = server.ws({
server.ws({
route: '/status/dashboard/socket',
onOpen: async ws => {
async function sendStatuses() {