mirror of
https://github.com/rajnandan1/kener.git
synced 2026-08-07 07:14:56 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca4f7040e8 | |||
| 1cfa861d7e | |||
| 007baefe80 | |||
| 7d77f4d996 | |||
| 3d5a62c085 | |||
| 24ffef997b | |||
| 7d5275152c | |||
| 93167c2358 | |||
| 734d3ad280 | |||
| 753668dfa5 | |||
| 351817338d | |||
| 7c12218489 | |||
| 7c71298227 | |||
| 167db6d7e6 | |||
| 74834f3559 | |||
| e13ca5c639 | |||
| a51806d62b | |||
| 57238dfb72 | |||
| a2be642af0 | |||
| aec2d23c2f | |||
| 11a11162da | |||
| 12a7be497e | |||
| 9b69da66a5 | |||
| 3b05ca73e5 | |||
| 236d7ea585 |
+1
-3
@@ -108,6 +108,7 @@ COPY --chown=node:node --from=builder /app/src/lib/ ./src/lib/
|
||||
COPY --chown=node:node --from=builder /app/build ./build
|
||||
COPY --chown=node:node --from=builder /app/uploads ./uploads
|
||||
COPY --chown=node:node --from=builder /app/database ./database
|
||||
COPY --chown=node:node --from=builder /app/src/lib/server/templates ./build/server/templates
|
||||
# TODO: Consider changing from copying `node_modules` to instead letting `npm ci --omit=dev` handle production dependencies. Right now, copying `node_modules` is leading to a smaller image, whereas letting `npm ci` handle the install in final image is slightly faster, but leads to larger image size. IMO, having a slightly longer build time (e.g. ~10 sec.) is better in the end to have a smaller image.
|
||||
COPY --chown=node:node --from=builder /app/node_modules ./node_modules
|
||||
COPY --chown=node:node --from=builder /app/migrations ./migrations
|
||||
@@ -120,9 +121,6 @@ COPY --chown=node:node --from=builder /app/openapi.json ./openapi.json
|
||||
COPY --chown=node:node --from=builder /app/openapi.yaml ./openapi.yaml
|
||||
COPY --chown=node:node --from=builder /app/package.json ./package.json
|
||||
|
||||
# Ensure necessary directories are writable
|
||||
VOLUME ["/uploads", "/database"]
|
||||
|
||||
# Set container timezone and make entrypoint script executable
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
|
||||
chmod +x ./entrypoint.sh
|
||||
|
||||
@@ -79,7 +79,7 @@ npm run dev
|
||||
|
||||
Official Docker images for **Kener** are available on [Docker Hub](https://hub.docker.com/r/rajnandan1/kener). Multiple versions are maintained to support different use cases.
|
||||
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.16"><img src="https://img.shields.io/badge/Latest_Stable_Release-3.2.16-blue" alt="Kener latest stable version: 3.2.16" /></a>
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.17"><img src="https://img.shields.io/badge/Latest_Stable_Release-3.2.17-blue" alt="Kener latest stable version: 3.2.17" /></a>
|
||||
|
||||
#### Available Tags
|
||||
|
||||
@@ -93,38 +93,38 @@ Official Docker images for **Kener** are available on [Docker Hub](https://hub.d
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest" target="_blank"><code>latest</code></td>
|
||||
<td>Latest stable release (aka 3.2.16)</td>
|
||||
<td>Latest stable release (aka 3.2.17)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.16" target="_blank"><code>3.2.16</code></a></td>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.17" target="_blank"><code>3.2.17</code></a></td>
|
||||
<td>Specific release version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2" target="_blank"><code>3.2</code></a></td>
|
||||
<td>Major-minor version tag pointing to the latest patch (3.2.16) release within that minor version (3.2.x)</td>
|
||||
<td>Major-minor version tag pointing to the latest patch (3.2.17) release within that minor version (3.2.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3" target="_blank"><code>3</code></a></td>
|
||||
<td>Major version tag pointing to the latest stable (3.2.16) release within that major version (3.x.x)</td>
|
||||
<td>Major version tag pointing to the latest stable (3.2.17) release within that major version (3.x.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" style="color:#0D597F;text-align:left;">Alpine Linux 3.21 w/ Node.js v23.7.0 <strong><em>(smallest image size)</em></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine" target="_blank"><code>alpine</code></td>
|
||||
<td>Latest stable release (aka 3.2.16)</td>
|
||||
<td>Latest stable release (aka 3.2.17)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.16-alpine" target="_blank"><code>3.2.16-alpine</code></a></td>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.17-alpine" target="_blank"><code>3.2.17-alpine</code></a></td>
|
||||
<td>Specific release version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2-alpine" target="_blank"><code>3.2-alpine</code></a></td>
|
||||
<td>Major-minor version tag pointing to the latest patch (3.2.16) release within that minor version (3.2.x)</td>
|
||||
<td>Major-minor version tag pointing to the latest patch (3.2.17) release within that minor version (3.2.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3-alpine" target="_blank"><code>3-alpine</code></a></td>
|
||||
<td>Major version tag pointing to the latest stable (3.2.16) release within that major version (3.x.x)</td>
|
||||
<td>Major version tag pointing to the latest stable (3.2.17) release within that major version (3.x.x)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ Copy and update the translation file in the `locales` folder. The translation fi
|
||||
"All Systems are Degraded": "All Systems are Degraded",
|
||||
"All Systems are Down": "All Systems are Down",
|
||||
"All Systems are Operational": "All Systems are Operational",
|
||||
"All Systems are in Maintenance": "All Systems are in Maintenance",
|
||||
"Back": "Back",
|
||||
"Badge Copied": "Badge Copied",
|
||||
"Badge": "Badge",
|
||||
@@ -91,6 +92,7 @@ Copy and update the translation file in the `locales` folder. The translation fi
|
||||
"Some Systems are not working as expected": "Some Systems are not working as expected",
|
||||
"Some Systems Degraded": "Some Systems Degraded",
|
||||
"Some Systems Down": "Some Systems Down",
|
||||
"Some Systems in Maintenance": "Some Systems in Maintenance",
|
||||
"Standard": "Standard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Started %startedAt, lasted for %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Started %startedAt, still ongoing",
|
||||
|
||||
@@ -73,7 +73,7 @@ To close an incident, you need to add a message and set the status to `RESOLVED`
|
||||
|
||||
## Add Monitors
|
||||
|
||||
To add monitors to the incident, you need to add the monitor tag to the incident. This will automatically add the monitor to the incident. You will also get the status of the monitor in the incident. This can be `DEGRADED` or `DOWN`.
|
||||
To add monitors to the incident, you need to add the monitor tag to the incident. This will automatically add the monitor to the incident. You will also get the status of the monitor in the incident. For any event type, this can be `DEGRADED` or `DOWN`. For maintenance event type, this can also be `MAINTENANCE`.
|
||||
|
||||
## Maintenance
|
||||
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ Shows the day's impact. Example: If it was down at 10:00 AM and it is 11:00 AM,
|
||||
|
||||
## Colors
|
||||
|
||||
You can change the colors of UP/DEGRADED/DOWN states of the monitor. You show have a shade of green, yellow, and red respectively.
|
||||
You can change the colors of UP/DEGRADED/DOWN/MAINTENANCE states of the monitor. By default, it shows a shade of green, yellow, red and blue respectively.
|
||||
|
||||
---
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kener",
|
||||
"version": "3.2.17",
|
||||
"version": "3.2.18",
|
||||
"private": false,
|
||||
"license": "MIT",
|
||||
"description": "Kener is a modern, open-source status page application built with Node.js. It provides real-time monitoring, uptime tracking, incident management, and beautiful dashboards. Perfect for DevOps teams, SaaS providers, and businesses needing reliable service status communication with minimal setup.",
|
||||
|
||||
@@ -10,6 +10,7 @@ section {
|
||||
--up-color: #4ead94;
|
||||
--down-color: #ca3038;
|
||||
--degraded-color: #e6ca61;
|
||||
--maintenance-color: #6679cc;
|
||||
}
|
||||
|
||||
/*Colors for something UP*/
|
||||
@@ -82,6 +83,33 @@ section {
|
||||
background: linear-gradient(0deg, var(--degraded-color) 90%, var(--up-color) 1%);
|
||||
}
|
||||
|
||||
/*Colors for something in maintenance*/
|
||||
.bg-api-maintenance {
|
||||
background-color: var(--maintenance-color);
|
||||
}
|
||||
.text-api-maintenance {
|
||||
color: var(--maintenance-color);
|
||||
}
|
||||
|
||||
.bg-api-maintenance-10 {
|
||||
background: linear-gradient(0deg, var(--maintenance-color) 10%, var(--up-color) 1%);
|
||||
}
|
||||
.bg-api-maintenance-20 {
|
||||
background: linear-gradient(0deg, var(--maintenance-color) 20%, var(--up-color) 1%);
|
||||
}
|
||||
.bg-api-maintenance-40 {
|
||||
background: linear-gradient(0deg, var(--maintenance-color) 40%, var(--up-color) 1%);
|
||||
}
|
||||
.bg-api-maintenance-60 {
|
||||
background: linear-gradient(0deg, var(--maintenance-color) 60%, var(--up-color) 1%);
|
||||
}
|
||||
.bg-api-maintenance-80 {
|
||||
background: linear-gradient(0deg, var(--maintenance-color) 80%, var(--up-color) 1%);
|
||||
}
|
||||
.bg-api-maintenance-90 {
|
||||
background: linear-gradient(0deg, var(--maintenance-color) 90%, var(--up-color) 1%);
|
||||
}
|
||||
|
||||
/*Needed to show markdown properly*/
|
||||
.prose :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *))::before {
|
||||
content: "";
|
||||
|
||||
@@ -7,6 +7,7 @@ async function StatusColor(status) {
|
||||
UP: site.colors?.UP || "#00dfa2",
|
||||
DEGRADED: site.colors?.DEGRADED || "#e6ca61",
|
||||
DOWN: site.colors?.DOWN || "#ca3038",
|
||||
MAINTENANCE: site.colors?.MAINTENANCE || "#6679cc",
|
||||
NO_DATA: "#f1f5f8"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
colorsJ: {
|
||||
UP: "#4ead94",
|
||||
DOWN: "#ca3038",
|
||||
DEGRADED: "#e6ca61"
|
||||
DEGRADED: "#e6ca61",
|
||||
MAINTENANCE: "#6679cc"
|
||||
},
|
||||
fontJ: {
|
||||
cssSrc:
|
||||
@@ -50,7 +51,10 @@
|
||||
themeData = siteDataExtractFromDb(data.siteData, themeData);
|
||||
|
||||
if (data.siteData.colors) {
|
||||
themeData.colorsJ = data.siteData.colors;
|
||||
if (data.siteData.colors.MAINTENANCE === undefined) {
|
||||
data.siteData.colors.MAINTENANCE = "#6679cc"; // default value for MAINTENANCE
|
||||
}
|
||||
themeData.colorsJ = JSON.parse(JSON.stringify(data.siteData.colors));
|
||||
}
|
||||
if (data.siteData.font) {
|
||||
themeData.fontJ = data.siteData.font;
|
||||
@@ -296,7 +300,7 @@
|
||||
<div>
|
||||
<p class="font-medium">Status Colors</p>
|
||||
<p class=" text-xs font-semibold text-muted-foreground">
|
||||
Choose the colors for the monitor. You can choose between UP, DEGRADED, and DOWN.
|
||||
Choose the colors for the monitor. You can choose between UP, DEGRADED, DOWN and MAINTENANCE.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -343,6 +347,20 @@
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<ColorPicker
|
||||
bind:hex={themeData.colorsJ.MAINTENANCE}
|
||||
position="responsive"
|
||||
isAlpha={false}
|
||||
isDark={$mode == "dark"}
|
||||
--input-size="16px"
|
||||
isTextInput={true}
|
||||
label="MAINTENANCE"
|
||||
on:input={(event) => {
|
||||
themeData.colorsJ.MAINTENANCE = event.detail.hex;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<p class="font-medium">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { format, formatDistance, formatDistanceToNow, formatDuration } from "date-fns";
|
||||
import { ru, enUS, hi, de, zhCN, vi, ja, nl, da, fr, ko, ptBR, tr, nb, pl } from "date-fns/locale";
|
||||
import { ru, enUS, hi, de, zhCN, vi, ja, nl, da, fr, ko, ptBR, tr, nb, pl, es } from "date-fns/locale";
|
||||
import { formatInTimeZone } from "date-fns-tz";
|
||||
|
||||
const locales = {
|
||||
@@ -20,6 +20,7 @@ const locales = {
|
||||
tr,
|
||||
"nb-NO": nb,
|
||||
pl,
|
||||
es,
|
||||
};
|
||||
|
||||
const f = function (date, formatStr, locale, tz) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Alle Systeme sind eingeschränkt",
|
||||
"All Systems are Down": "Alle Systeme sind ausgefallen",
|
||||
"All Systems are Operational": "Alle Systeme sind betriebsbereit",
|
||||
"All Systems are in Maintenance": "Alle Systeme sind in Wartung",
|
||||
"Back": "Zurück",
|
||||
"Badge Copied": "Abzeichen kopiert",
|
||||
"Badge": "Abzeichen",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Einige Systeme funktionieren nicht wie erwartet",
|
||||
"Some Systems Degraded": "Einige Systeme eingeschränkt",
|
||||
"Some Systems Down": "Einige Systeme ausgefallen",
|
||||
"Some Systems in Maintenance": "Einige Systeme sind in Wartung",
|
||||
"Standard": "Standard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Begann vor etwa %startedAt und dauerte etwa %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Begann vor etwa %startedAt und dauert noch an",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Alle Systemer er Forringet",
|
||||
"All Systems are Down": "Alle Systemer er Nede",
|
||||
"All Systems are Operational": "Alle Systemer er Operationelle",
|
||||
"All Systems are in Maintenance": "Alle systemer er i vedligeholdelse",
|
||||
"Back": "Tilbage",
|
||||
"Badge Copied": "Mærke Kopieret",
|
||||
"Badge": "Mærke",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Nogle Systemer fungerer ikke som forventet",
|
||||
"Some Systems Degraded": "Nogle Systemer er Forringet",
|
||||
"Some Systems Down": "Nogle Systemer er Nede",
|
||||
"Some Systems in Maintenance": "Nogle Systemer er i Vedligeholdelse",
|
||||
"Standard": "Standard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Startede for cirka %startedAt siden, varede i cirka %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Startede for cirka %startedAt siden, stadig igangværende",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "All Systems are Degraded",
|
||||
"All Systems are Down": "All Systems are Down",
|
||||
"All Systems are Operational": "All Systems are Operational",
|
||||
"All Systems are in Maintenance": "All Systems are in Maintenance",
|
||||
"Back": "Back",
|
||||
"Badge Copied": "Badge Copied",
|
||||
"Badge": "Badge",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Some Systems are not working as expected",
|
||||
"Some Systems Degraded": "Some Systems Degraded",
|
||||
"Some Systems Down": "Some Systems Down",
|
||||
"Some Systems in Maintenance": "Some Systems in Maintenance",
|
||||
"Standard": "Standard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Started %startedAt, lasted for %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Started %startedAt, still ongoing",
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"%status for %duration": "%status durante %duration",
|
||||
"120 Days": "120 Días",
|
||||
"14 Days": "14 Días",
|
||||
"150 Days": "150 Días",
|
||||
"180 Days": "180 Días",
|
||||
"30 Days": "30 Días",
|
||||
"60 Days": "60 Días",
|
||||
"7 Days": "7 Días",
|
||||
"90 Days": "90 Días",
|
||||
"Availability per Component": "Disponibilidad por componente",
|
||||
"All Systems are Degraded": "Todos los sistemas están degradados",
|
||||
"All Systems are Down": "Todos los sistemas están caídos",
|
||||
"All Systems are Operational": "Todos los sistemas están operativos",
|
||||
"Back": "Volver",
|
||||
"Badge Copied": "Distintivo copiado",
|
||||
"Badge": "Distintivo",
|
||||
"Browse Events": "Ver eventos",
|
||||
"Change Email": "Cambiar correo electrónico",
|
||||
"Code Copied": "Código copiado",
|
||||
"Confirm Login": "Confirmar inicio de sesión",
|
||||
"Copy Code": "Copiar código",
|
||||
"Copy Link": "Copiar enlace",
|
||||
"DEGRADED": "DEGRADADO",
|
||||
"DOWN": "CAÍDO",
|
||||
"Dark": "Oscuro",
|
||||
"Days": "Días",
|
||||
"Embed this monitor using <script> or <iframe> in your app.": "Incrusta este monitor usando <script> o <iframe> en tu aplicación.",
|
||||
"Embed": "Incrustar",
|
||||
"Enter the code": "Ingresa el código",
|
||||
"Enter your email": "Ingresa tu correo electrónico",
|
||||
"Enter your email to log in. If you are not subscribed, you will be prompted to subscribe.": "Ingresa tu correo electrónico para iniciar sesión. Si no estás suscrito, se te pedirá que te suscribas.",
|
||||
"Get SVG badge for this monitor": "Obtener distintivo SVG para este monitor",
|
||||
"Get a LIVE Status for this monitor": "Obtener estado EN VIVO para este monitor",
|
||||
"IDENTIFIED": "IDENTIFICADO",
|
||||
"INVESTIGATING": "INVESTIGANDO",
|
||||
"Incident Updates": "Actualizaciones de incidentes",
|
||||
"LIVE Status": "Estado EN VIVO",
|
||||
"Lasted for about %lastedFor": "Duró aproximadamente %lastedFor",
|
||||
"Light": "Claro",
|
||||
"Link Copied": "Enlace copiado",
|
||||
"Login": "Iniciar sesión",
|
||||
"MAINTENANCE": "MANTENIMIENTO",
|
||||
"MONITORING": "MONITOREANDO",
|
||||
"Maintenance Completed": "Mantenimiento completado",
|
||||
"Maintenance in Progress": "Mantenimiento en progreso",
|
||||
"Manage Subscription": "Gestionar suscripción",
|
||||
"Mode": "Modo",
|
||||
"No Data": "Sin datos",
|
||||
"No Incident in %date": "Sin incidentes en %date",
|
||||
"No Incidents": "Sin incidentes",
|
||||
"No Monitor Found": "No se encontró monitor",
|
||||
"No Updates Yet": "Aún no hay actualizaciones",
|
||||
"Ongoing Incidents": "Incidentes en curso",
|
||||
"Pinging": "Haciendo ping",
|
||||
"Please select specific monitors to receive updates from.": "Por favor selecciona monitores específicos para recibir actualizaciones.",
|
||||
"RESOLVED": "RESUELTO",
|
||||
"Recent Incidents": "Incidentes recientes",
|
||||
"Recent Maintenances": "Mantenimientos recientes",
|
||||
"Share this monitor using a link with others": "Comparte este monitor mediante un enlace con otros",
|
||||
"Share": "Compartir",
|
||||
"Some Systems are not working as expected": "Algunos sistemas no funcionan como se espera",
|
||||
"Some Systems Degraded": "Algunos sistemas degradados",
|
||||
"Some Systems Down": "Algunos sistemas caídos",
|
||||
"Standard": "Estándar",
|
||||
"Started %startedAt, lasted for %lastedFor": "Comenzó el %startedAt, duró %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Comenzó el %startedAt, aún en curso",
|
||||
"Started %startedAt, will last for %lastedFor more": "Comenzó el %startedAt, durará %lastedFor más",
|
||||
"Starts %startedAt, will last for %lastedFor": "Empieza el %startedAt, durará %lastedFor",
|
||||
"Starts %startedAt": "Empieza el %startedAt",
|
||||
"Status OK": "Estado OK",
|
||||
"Status": "Estado",
|
||||
"Subscribe": "Suscribirse",
|
||||
"Subscribe to Updates": "Suscribirse a actualizaciones",
|
||||
"Subscribe to all monitors": "Suscribirse a todos los monitores",
|
||||
"Switch to your timezone": "Cambiar a tu zona horaria",
|
||||
"Theme": "Tema",
|
||||
"There are no upcoming maintenances": "No hay mantenimientos próximos",
|
||||
"Timezone set to %tz": "Zona horaria configurada a %tz",
|
||||
"Today": "Hoy",
|
||||
"UP": "ACTIVO",
|
||||
"Update Subscription": "Actualizar suscripción",
|
||||
"Upcoming Maintenance": "Mantenimiento próximo",
|
||||
"Upcoming Maintenances": "Mantenimientos próximos",
|
||||
"Updates": "Actualizaciones",
|
||||
"Uptime": "Tiempo en línea",
|
||||
"View in detail": "Ver en detalle",
|
||||
"We have sent a code to your email. Please enter it below to confirm your login": "Hemos enviado un código a tu correo. Por favor, ingrésalo abajo para confirmar tu inicio de sesión",
|
||||
"You are logged in as %email": "Has iniciado sesión como %email"
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Tous les systèmes sont dégradés",
|
||||
"All Systems are Down": "Tous les systèmes sont hors ligne",
|
||||
"All Systems are Operational": "Tous les systèmes sont opérationnels",
|
||||
"All Systems are in Maintenance": "Tous les systèmes sont en maintenance",
|
||||
"Back": "Retour",
|
||||
"Badge Copied": "Badge copié",
|
||||
"Badge": "Badge",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Certains systèmes ne fonctionnent pas comme prévu",
|
||||
"Some Systems Degraded": "Certains systèmes sont dégradés",
|
||||
"Some Systems Down": "Certains systèmes sont hors ligne",
|
||||
"Some Systems in Maintenance": "Certains systèmes sont en maintenance",
|
||||
"Standard": "Standard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Commencé il y a environ %startedAt, a duré environ %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Commencé il y a environ %startedAt, toujours en cours",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "सभी सिस्टम क्षीण हैं",
|
||||
"All Systems are Down": "सभी सिस्टम डाउन हैं",
|
||||
"All Systems are Operational": "सभी सिस्टम कार्यरत हैं",
|
||||
"All Systems are in Maintenance": "सभी सिस्टम रखरखाव में हैं",
|
||||
"Back": "वापस",
|
||||
"Badge Copied": "बैज कॉपी किया गया",
|
||||
"Badge": "बैज",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "कुछ सिस्टम अपेक्षित रूप से काम नहीं कर रहे हैं",
|
||||
"Some Systems Degraded": "कुछ सिस्टम क्षीण हैं",
|
||||
"Some Systems Down": "कुछ सिस्टम डाउन हैं",
|
||||
"Some Systems in Maintenance": "कुछ सिस्टम रखरखाव में हैं",
|
||||
"Standard": "मानक",
|
||||
"Started %startedAt, lasted for %lastedFor": "%startedAt शुरू हुआ, %lastedFor तक चला",
|
||||
"Started %startedAt, still ongoing": "%startedAt शुरू हुआ, अभी भी जारी है",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "すべてのシステムが劣化しています",
|
||||
"All Systems are Down": "すべてのシステムがダウンしています",
|
||||
"All Systems are Operational": "すべてのシステムが正常に稼働しています",
|
||||
"All Systems are in Maintenance": "すべてのシステムがメンテナンス中です",
|
||||
"Back": "戻る",
|
||||
"Badge Copied": "バッジがコピーされました",
|
||||
"Badge": "バッジ",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "一部のシステムが期待通りに動作していません",
|
||||
"Some Systems Degraded": "一部のシステムが劣化しています",
|
||||
"Some Systems Down": "一部のシステムがダウンしています",
|
||||
"Some Systems in Maintenance": "いくつかのシステムがメンテナンス中です",
|
||||
"Standard": "標準",
|
||||
"Started %startedAt, lasted for %lastedFor": "%startedAt 前に開始し、約 %lastedFor 続きました",
|
||||
"Started %startedAt, still ongoing": "%startedAt 前に開始し、まだ進行中です",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "모든 시스템이 성능 저하 상태입니다",
|
||||
"All Systems are Down": "모든 시스템이 중단되었습니다",
|
||||
"All Systems are Operational": "모든 시스템이 정상 작동 중입니다",
|
||||
"All Systems are in Maintenance": "모든 시스템이 유지보수 중입니다",
|
||||
"Back": "뒤로",
|
||||
"Badge Copied": "배지 복사됨",
|
||||
"Badge": "배지",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "일부 시스템이 예상대로 작동하지 않습니다",
|
||||
"Some Systems Degraded": "일부 시스템이 성능 저하 상태입니다",
|
||||
"Some Systems Down": "일부 시스템이 중단되었습니다",
|
||||
"Some Systems in Maintenance": "일부 시스템이 유지보수 중입니다",
|
||||
"Standard": "기본",
|
||||
"Started %startedAt, lasted for %lastedFor": "%startedAt 전에 시작되었으며, %lastedFor 동안 지속되었습니다",
|
||||
"Started %startedAt, still ongoing": "%startedAt 전에 시작되었으며, 아직 진행중입니다",
|
||||
|
||||
@@ -58,5 +58,9 @@
|
||||
{
|
||||
"code": "pl",
|
||||
"name": "Polski"
|
||||
},
|
||||
{
|
||||
"code": "es",
|
||||
"name": "Español"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Alle systemer har nedsatt ytelse",
|
||||
"All Systems are Down": "Alle systemer er nede",
|
||||
"All Systems are Operational": "Alle systemer er operative",
|
||||
"All Systems are in Maintenance": "Alle systemer er til vedlikehold",
|
||||
"Back": "Tilbake",
|
||||
"Badge Copied": "Merke kopiert",
|
||||
"Badge": "Merke",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Noen systemer fungerer ikke som forventet",
|
||||
"Some Systems Degraded": "Noen systemer har nedsatt ytelse",
|
||||
"Some Systems Down": "Noen systemer er nede",
|
||||
"Some Systems in Maintenance": "Noen systemer er til vedlikehold",
|
||||
"Standard": "Standard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Startet %startedAt, varte i %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Startet %startedAt, fortsatt pågår",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Alle systemen werken met beperkte functionaliteit",
|
||||
"All Systems are Down": "Alle systemen zijn niet bereikbaar",
|
||||
"All Systems are Operational": "Alle systemen zijn operationeel",
|
||||
"All Systems are in Maintenance": "Alle systemen zijn in onderhoud",
|
||||
"Back": "Terug",
|
||||
"Badge Copied": "Badge gekopieerd",
|
||||
"Badge": "Badge",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Sommige systemen werken niet zoals verwacht",
|
||||
"Some Systems Degraded": "Sommige systemen werken met beperkte functionaliteit",
|
||||
"Some Systems Down": "Sommige systemen zijn niet bereikbaar",
|
||||
"Some Systems in Maintenance": "Sommige systemen zijn in onderhoud",
|
||||
"Standard": "Standaard",
|
||||
"Started %startedAt, lasted for %lastedFor": "Begonnen ongeveer %startedAt geleden, duurde ongeveer %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Begonnen ongeveer %startedAt geleden, nog steeds bezig",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Wszystkie systemy działają z ograniczeniami",
|
||||
"All Systems are Down": "Wszystkie systemy są niedostępne",
|
||||
"All Systems are Operational": "Wszystkie systemy działają poprawnie",
|
||||
"All Systems are in Maintenance": "Wszystkie systemy są w konserwacji",
|
||||
"Back": "Wstecz",
|
||||
"Badge Copied": "Odznaka skopiowana",
|
||||
"Badge": "Odznaka",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Niektóre systemy nie działają zgodnie z oczekiwaniami",
|
||||
"Some Systems Degraded": "Niektóre systemy działają z ograniczeniami",
|
||||
"Some Systems Down": "Niektóre systemy są niedostępne",
|
||||
"Some Systems in Maintenance": "Niektóre systemy są w konserwacji",
|
||||
"Standard": "Standardowy",
|
||||
"Started %startedAt, lasted for %lastedFor": "Rozpoczęto %startedAt, trwało %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Rozpoczęto %startedAt, nadal trwa",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Todos os Sistemas estão com Falhas",
|
||||
"All Systems are Down": "Todos os Sistemas estão Indisponíveis",
|
||||
"All Systems are Operational": "Todos os Sistemas estão Operacionais",
|
||||
"All Systems are in Maintenance": "Todos os Sistemas estão em Manutenção",
|
||||
"Back": "Voltar",
|
||||
"Badge Copied": "Emblema Copiado",
|
||||
"Badge": "Emblema",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Alguns Sistemas não estão funcionando como esperado",
|
||||
"Some Systems Degraded": "Alguns Sistemas estão com Falhas",
|
||||
"Some Systems Down": "Alguns Sistemas estão Indisponíveis",
|
||||
"Some Systems in Maintenance": "Alguns Sistemas estão em Manutenção",
|
||||
"Standard": "Padrão",
|
||||
"Started %startedAt, lasted for %lastedFor": "Ocorreu faz %startedAt e durou %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Iniciou faz %startedAt, ainda em andamento",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Все системы работают с ухудшенной производительностью",
|
||||
"All Systems are Down": "Все системы недоступны",
|
||||
"All Systems are Operational": "Все системы работают нормально",
|
||||
"All Systems are in Maintenance": "Все системы на обслуживании",
|
||||
"Back": "Назад",
|
||||
"Badge Copied": "Значок скопирован",
|
||||
"Badge": "Значок",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Некоторые системы работают не так, как ожидалось",
|
||||
"Some Systems Degraded": "Некоторые системы работают с ухудшенной производительностью",
|
||||
"Some Systems Down": "Некоторые системы недоступны",
|
||||
"Some Systems in Maintenance": "Некоторые системы на обслуживании",
|
||||
"Standard": "Стандартная",
|
||||
"Started %startedAt, lasted for %lastedFor": "Началось около %startedAt назад, длилось около %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Началось около %startedAt назад, все еще продолжается",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Tüm Sistemler Bozuk Durumda",
|
||||
"All Systems are Down": "Tüm Sistemler Çalışmıyor",
|
||||
"All Systems are Operational": "Tüm Sistemler Çalışıyor",
|
||||
"All Systems are in Maintenance": "Tüm Sistemler Bakımda",
|
||||
"Back": "Geri",
|
||||
"Badge Copied": "Rozet Kopyalandı",
|
||||
"Badge": "Rozet",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Bazı Sistemler Beklendiği Gibi Çalışmıyor",
|
||||
"Some Systems Degraded": "Bazı Sistemler Bozuk Durumda",
|
||||
"Some Systems Down": "Bazı Sistemler Çalışmıyor",
|
||||
"Some Systems in Maintenance": "Bazı Sistemler Bakımda",
|
||||
"Standard": "Standart",
|
||||
"Started %startedAt, lasted for %lastedFor": "%startedAt başladı, %lastedFor sürdü",
|
||||
"Started %startedAt, still ongoing": "%startedAt başladı, devam ediyor",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "Tất cả hệ thống đang suy giảm hiệu suất",
|
||||
"All Systems are Down": "Tất cả hệ thống đang ngừng hoạt động",
|
||||
"All Systems are Operational": "Tất cả hệ thống đang hoạt động bình thường",
|
||||
"All Systems are in Maintenance": "Tất cả hệ thống đang bảo trì",
|
||||
"Back": "Quay lại",
|
||||
"Badge Copied": "Huy hiệu đã được sao chép",
|
||||
"Badge": "Huy hiệu",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "Một số hệ thống không hoạt động như mong đợi",
|
||||
"Some Systems Degraded": "Một số hệ thống đang suy giảm hiệu suất",
|
||||
"Some Systems Down": "Một số hệ thống đang ngừng hoạt động",
|
||||
"Some Systems in Maintenance": "Một số hệ thống đang bảo trì",
|
||||
"Standard": "Tiêu chuẩn",
|
||||
"Started %startedAt, lasted for %lastedFor": "Bắt đầu khoảng %startedAt trước, kéo dài khoảng %lastedFor",
|
||||
"Started %startedAt, still ongoing": "Bắt đầu khoảng %startedAt trước, vẫn đang diễn ra",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"All Systems are Degraded": "所有系统性能下降",
|
||||
"All Systems are Down": "所有系统不可用",
|
||||
"All Systems are Operational": "所有系统运行正常",
|
||||
"All Systems are in Maintenance": "所有系统正在维护",
|
||||
"Back": "返回",
|
||||
"Badge Copied": "徽章已复制",
|
||||
"Badge": "徽章",
|
||||
@@ -62,6 +63,7 @@
|
||||
"Some Systems are not working as expected": "部分系统运行异常",
|
||||
"Some Systems Degraded": "部分系统性能下降",
|
||||
"Some Systems Down": "部分系统不可用",
|
||||
"Some Systems in Maintenance": "部分系统正在维护",
|
||||
"Standard": "标准",
|
||||
"Started %startedAt, lasted for %lastedFor": "大约 %startedAt 前开始,持续了约 %lastedFor",
|
||||
"Started %startedAt, still ongoing": "大约 %startedAt 前开始,目前仍在进行中",
|
||||
|
||||
@@ -8,6 +8,7 @@ const SITE = "./config/site.yaml";
|
||||
const UP = "UP";
|
||||
const DOWN = "DOWN";
|
||||
const DEGRADED = "DEGRADED";
|
||||
const MAINTENANCE = "MAINTENANCE";
|
||||
const NO_DATA = "NO_DATA";
|
||||
const API_TIMEOUT = 10 * 1000; // 10 seconds
|
||||
const AnalyticsProviders = {
|
||||
|
||||
@@ -206,6 +206,7 @@ export const SystemDataMessage = async () => {
|
||||
let upsCount = 0;
|
||||
let degradedCount = 0;
|
||||
let downCount = 0;
|
||||
let maintenanceCount = 0;
|
||||
for (let i = 0; i < monitors.length; i++) {
|
||||
let status = await db.getLatestMonitoringData(monitors[i].tag);
|
||||
if (status) {
|
||||
@@ -215,11 +216,13 @@ export const SystemDataMessage = async () => {
|
||||
degradedCount++;
|
||||
} else if (status.status === "DOWN") {
|
||||
downCount++;
|
||||
} else if (status.status === "MAINTENANCE") {
|
||||
maintenanceCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const total = upsCount + degradedCount + downCount;
|
||||
const total = upsCount + degradedCount + downCount + maintenanceCount;
|
||||
|
||||
if (total === 0) {
|
||||
return {
|
||||
@@ -227,48 +230,56 @@ export const SystemDataMessage = async () => {
|
||||
upsPercentage: 0,
|
||||
degradedPercentage: 0,
|
||||
downsPercentage: 0,
|
||||
maintenancePercentage: 0,
|
||||
};
|
||||
}
|
||||
|
||||
let upsPercentage = Math.round((upsCount / total) * 100);
|
||||
let degradedPercentage = Math.round((degradedCount / total) * 100);
|
||||
let downsPercentage = Math.round((downCount / total) * 100);
|
||||
let maintenancePercentage = Math.round((maintenanceCount / total) * 100);
|
||||
|
||||
let message = "";
|
||||
|
||||
// Determine message based on the combination of system states
|
||||
if (upsCount > 0 && degradedCount === 0 && downCount === 0) {
|
||||
// UP=1|DOWN=0|DEGRADED=0
|
||||
if (upsCount > 0 && degradedCount === 0 && downCount === 0 && maintenanceCount == 0) {
|
||||
// UP=1|DOWN=0|DEGRADED=0|MAINTENANCE=0
|
||||
message = "All Systems are Operational";
|
||||
} else if (upsCount === 0 && degradedCount > 0 && downCount === 0) {
|
||||
// UP=0|DOWN=0|DEGRADED=1
|
||||
} else if (upsCount === 0 && degradedCount > 0 && downCount === 0 && maintenanceCount == 0) {
|
||||
// UP=0|DOWN=0|DEGRADED=1|MAINTENANCE=0
|
||||
message = "All Systems are Degraded";
|
||||
} else if (upsCount === 0 && degradedCount === 0 && downCount > 0) {
|
||||
// UP=0|DOWN=1|DEGRADED=0
|
||||
} else if (upsCount === 0 && degradedCount === 0 && downCount > 0 && maintenanceCount == 0) {
|
||||
// UP=0|DOWN=1|DEGRADED=0|MAINTENANCE=0
|
||||
message = "All Systems are Down";
|
||||
} else if (upsCount === 0 && degradedCount === 0 && downCount === 0 && maintenanceCount > 0) {
|
||||
message = "All Systems are in Maintenance";
|
||||
} else if (
|
||||
(upsCount > 0 && degradedCount > 0 && downCount > 0) ||
|
||||
(upsCount === 0 && degradedCount > 0 && downCount > 0)
|
||||
(upsCount > 0 && degradedCount > 0 && downCount > 0 && maintenanceCount > 0) ||
|
||||
(upsCount === 0 && degradedCount > 0 && downCount > 0 && maintenanceCount > 0)
|
||||
) {
|
||||
// UP=1|DOWN=1|DEGRADED=1 or UP=0|DOWN=1|DEGRADED=1
|
||||
// UP=1|DOWN=1|DEGRADED=1|MAINTENANCE=1 or UP=0|DOWN=1|DEGRADED=1|MAINTENANCE=1
|
||||
message = "Some Systems are not working as expected";
|
||||
} else if (upsCount > 0 && degradedCount === 0 && downCount > 0) {
|
||||
// UP=1|DOWN=1|DEGRADED=0
|
||||
} else if (upsCount > 0 && degradedCount === 0 && downCount > 0 && maintenanceCount == 0) {
|
||||
// UP=1|DOWN=1|DEGRADED=0|MAINTENANCE=0
|
||||
message = "Some Systems Down";
|
||||
} else if (upsCount > 0 && degradedCount > 0 && downCount === 0) {
|
||||
// UP=1|DOWN=0|DEGRADED=1
|
||||
} else if (upsCount > 0 && degradedCount > 0 && downCount === 0 && maintenanceCount == 0) {
|
||||
// UP=1|DOWN=0|DEGRADED=1|MAINTENANCE=0
|
||||
message = "Some Systems Degraded";
|
||||
} else if (upsCount > 0 && degradedCount === 0 && downCount === 0 && maintenanceCount > 0) {
|
||||
// UP=1|DOWN=0|DEGRADED=0|MAINTENANCE=1
|
||||
message = "Some Systems in Maintenance";
|
||||
}
|
||||
|
||||
//if percentage is not 100 sum, then add remaining to up
|
||||
if (upsPercentage + degradedPercentage + downsPercentage < 100) {
|
||||
upsPercentage = 100 - (degradedPercentage + downsPercentage);
|
||||
if (upsPercentage + degradedPercentage + downsPercentage + maintenancePercentage < 100) {
|
||||
upsPercentage = 100 - (degradedPercentage + downsPercentage + maintenancePercentage);
|
||||
}
|
||||
return {
|
||||
text: message,
|
||||
upsPercentage,
|
||||
degradedPercentage,
|
||||
downsPercentage,
|
||||
maintenancePercentage
|
||||
};
|
||||
};
|
||||
|
||||
@@ -722,6 +733,7 @@ export const GetDataGroupByDayAlternative = async (monitor_tag, start, end, time
|
||||
UP: 0,
|
||||
DOWN: 0,
|
||||
DEGRADED: 0,
|
||||
MAINTENANCE: 0,
|
||||
NO_DATA: 0,
|
||||
};
|
||||
}
|
||||
@@ -740,6 +752,7 @@ export const GetDataGroupByDayAlternative = async (monitor_tag, start, end, time
|
||||
UP: group.UP,
|
||||
DOWN: group.DOWN,
|
||||
DEGRADED: group.DEGRADED,
|
||||
MAINTENANCE: group.MAINTENANCE,
|
||||
NO_DATA: group.NO_DATA,
|
||||
}));
|
||||
};
|
||||
@@ -863,9 +876,9 @@ export const RemoveIncidentMonitor = async (incident_id, monitor_tag) => {
|
||||
};
|
||||
|
||||
export const AddIncidentMonitor = async (incident_id, monitor_tag, monitor_impact) => {
|
||||
//monitor_impact must be DOWN or DEGRADED or NONE
|
||||
if (!["DOWN", "DEGRADED"].includes(monitor_impact)) {
|
||||
throw new Error("Monitor impact must be either DOWN, DEGRADED ");
|
||||
//monitor_impact must be DOWN or DEGRADED or MAINTENANCE or NONE
|
||||
if (!["DOWN", "DEGRADED", "MAINTENANCE"].includes(monitor_impact)) {
|
||||
throw new Error("Monitor impact must be either DOWN, DEGRADED, MAINTENANCE");
|
||||
}
|
||||
|
||||
//check if monitor exists
|
||||
@@ -1616,7 +1629,7 @@ export const CreateSubscriptionTrigger = async (data) => {
|
||||
} else {
|
||||
await db.updateSubscriptionTrigger({
|
||||
id: subscriptionTrigger.id,
|
||||
subscription_trigger_status: "ACTIVE",
|
||||
subscription_trigger_status: data.subscription_trigger_status || "ACTIVE",
|
||||
subscription_trigger_type: subscriptionTrigger.subscription_trigger_type,
|
||||
config: data.config,
|
||||
});
|
||||
@@ -1629,6 +1642,11 @@ export const CreateSubscriptionTrigger = async (data) => {
|
||||
};
|
||||
};
|
||||
|
||||
//updateSubscriptionTriggerStatus
|
||||
export const UpdateSubscriptionTriggerStatus = async (id, status) => {
|
||||
return await db.updateSubscriptionTriggerStatus(id, status);
|
||||
};
|
||||
|
||||
// Get subscribers paginated
|
||||
export const GetSubscribersPaginated = async (data) => {
|
||||
const page = parseInt(data.page) || 1;
|
||||
|
||||
@@ -109,7 +109,7 @@ export function IsValidColors(colors) {
|
||||
return false;
|
||||
}
|
||||
if (typeof colors !== "object") return false;
|
||||
const validColorKeys = ["UP", "DOWN", "DEGRADED"];
|
||||
const validColorKeys = ["UP", "DOWN", "DEGRADED", "MAINTENANCE"];
|
||||
for (const key of validColorKeys) {
|
||||
if (typeof colors[key] !== "string" || !/^#[0-9A-Fa-f]{6}$/.test(colors[key])) return false;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@ async function manualIncident(monitor) {
|
||||
for (let i = 0; i < impactArr.length; i++) {
|
||||
const element = impactArr[i];
|
||||
|
||||
if (element.monitor_impact === "MAINTENANCE") {
|
||||
impact = "MAINTENANCE";
|
||||
break;
|
||||
}
|
||||
if (element.monitor_impact === "DOWN") {
|
||||
impact = "DOWN";
|
||||
break;
|
||||
|
||||
@@ -92,6 +92,7 @@ const seedSiteData = {
|
||||
UP: "#67ab95",
|
||||
DOWN: "#ca3038",
|
||||
DEGRADED: "#e6ca61",
|
||||
MAINTENANCE: "#6679cc",
|
||||
},
|
||||
font: {
|
||||
cssSrc: "",
|
||||
|
||||
@@ -125,6 +125,11 @@ const FetchData = async function (site, monitor, localTz, selectedLang, lang, is
|
||||
summaryDuration = getSummaryDuration(dayData.DOWN, selectedLang);
|
||||
summaryStatus = "DOWN";
|
||||
}
|
||||
if (dayData.MAINTENANCE > 0) {
|
||||
cssClass = returnStatusClass(dayData.MAINTENANCE, dayData.total, StatusObj.MAINTENANCE, site.barStyle);
|
||||
summaryDuration = getSummaryDuration(dayData.MAINTENANCE, selectedLang);
|
||||
summaryStatus = "MAINTENANCE";
|
||||
}
|
||||
if (dayData.NO_DATA === dayData.total) {
|
||||
cssClass = StatusObj.NO_DATA;
|
||||
summaryStatus = NO_DATA;
|
||||
@@ -178,6 +183,11 @@ const FetchData = async function (site, monitor, localTz, selectedLang, lang, is
|
||||
summaryStatus = "DOWN";
|
||||
summaryColorClass = "api-down";
|
||||
}
|
||||
if (!!lastRow && lastRow.status == "MAINTENANCE") {
|
||||
summaryDuration = getSummaryDuration(getCountOfSimilarStatuesEnd(todayDataDb, "MAINTENANCE"), selectedLang);
|
||||
summaryStatus = "MAINTENANCE";
|
||||
summaryColorClass = "api-maintenance";
|
||||
}
|
||||
if (lastRow.status === "NO_DATA") {
|
||||
summaryStatus = NO_DATA;
|
||||
summaryColorClass = "api-nodata";
|
||||
|
||||
@@ -149,6 +149,7 @@ const StatusObj = {
|
||||
UP: "api-up",
|
||||
DEGRADED: "api-degraded",
|
||||
DOWN: "api-down",
|
||||
MAINTENANCE: "api-maintenance",
|
||||
NO_DATA: "api-nodata",
|
||||
};
|
||||
// @ts-ignore
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
IsLoggedInSession,
|
||||
GetLocaleFromCookie,
|
||||
IsEmailSetup,
|
||||
GetSubscriptionTriggerByEmail,
|
||||
} from "$lib/server/controllers/controller.js";
|
||||
|
||||
export async function load({ params, route, url, cookies, request }) {
|
||||
@@ -47,6 +48,8 @@ export async function load({ params, route, url, cookies, request }) {
|
||||
|
||||
const query = url.searchParams;
|
||||
const bgc = query.get("bgc") ? "#" + query.get("bgc") : "";
|
||||
const emailSubscriptionTrigger = await GetSubscriptionTriggerByEmail();
|
||||
|
||||
return {
|
||||
site: site,
|
||||
localTz: localTz,
|
||||
@@ -55,6 +58,7 @@ export async function load({ params, route, url, cookies, request }) {
|
||||
selectedLang: selectedLang,
|
||||
isLoggedIn: !!isLoggedIn.user,
|
||||
canSendEmail: IsEmailSetup(),
|
||||
canUsersSubscribe: !!emailSubscriptionTrigger && emailSubscriptionTrigger.subscription_trigger_status == "ACTIVE",
|
||||
isMobile: isMobile,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,7 +109,8 @@
|
||||
--bg-custom: {data.bgc};
|
||||
--up-color: {data.site.colors.UP};
|
||||
--down-color: {data.site.colors.DOWN};
|
||||
--degraded-color: {data.site.colors.DEGRADED}
|
||||
--degraded-color: {data.site.colors.DEGRADED};
|
||||
--maintenance-color: {data.site.colors.MAINTENANCE};
|
||||
"
|
||||
class="kener-theme-{kenerTheme}"
|
||||
>
|
||||
|
||||
@@ -117,12 +117,15 @@
|
||||
<div class="bg-api-up h-4" style="width: {data.systemDataMessage.upsPercentage}%;"></div>
|
||||
<div class="bg-api-degraded h-4" style="width: {data.systemDataMessage.degradedPercentage}%;"></div>
|
||||
<div class="bg-api-down h-4" style="width: {data.systemDataMessage.downsPercentage}%;"></div>
|
||||
<div class="bg-api-maintenance h-4" style="width: {data.systemDataMessage.maintenancePercentage}%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="section-actions mx-auto mb-8 flex w-full max-w-[655px] flex-1 flex-col items-center justify-center">
|
||||
<div class="flex w-full flex-wrap rounded-md border shadow-sm">
|
||||
{#if data.canSendEmail}
|
||||
<div
|
||||
class="section-actions relative mx-auto mb-8 flex w-full max-w-[655px] flex-1 flex-col items-center justify-center"
|
||||
>
|
||||
<div class="flex w-full flex-wrap rounded-md border bg-background shadow-sm">
|
||||
{#if data.canSendEmail && data.canUsersSubscribe}
|
||||
<Button
|
||||
variant="ghost"
|
||||
class="dash-after relative h-10 rounded-md text-sm font-medium"
|
||||
@@ -216,13 +219,13 @@
|
||||
class="section-legend mx-auto mb-2 flex w-full flex-1 flex-col items-start justify-center bg-transparent md:w-[655px]"
|
||||
id=""
|
||||
>
|
||||
<div class="grid w-full grid-cols-2 gap-4">
|
||||
<div class="col-span-2 text-center md:col-span-1 md:text-left">
|
||||
<div class="flex w-full flex-col justify-between gap-4 md:flex-row">
|
||||
<div class="md:content-left flex justify-center">
|
||||
<Badge class="border-0 md:pl-0" variant="outline">
|
||||
{l(data.lang, "Availability per Component")}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="col-span-2 text-center md:col-span-1 md:text-right">
|
||||
<div class="flex justify-center md:justify-end">
|
||||
<Badge variant="outline" class="border-0 md:pr-0">
|
||||
<span class="bg-api-up mr-1 inline-flex h-[8px] w-[8px] rounded-full opacity-75"></span>
|
||||
<span class="mr-3">
|
||||
@@ -235,9 +238,14 @@
|
||||
</span>
|
||||
|
||||
<span class="bg-api-down mr-1 inline-flex h-[8px] w-[8px] rounded-full opacity-75"></span>
|
||||
<span class="">
|
||||
<span class="mr-3">
|
||||
{l(data.lang, "DOWN")}
|
||||
</span>
|
||||
|
||||
<span class="bg-api-maintenance mr-1 inline-flex h-[8px] w-[8px] rounded-full opacity-75"></span>
|
||||
<span class="">
|
||||
{l(data.lang, "MAINTENANCE")}
|
||||
</span>
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
InsertKeyValue,
|
||||
GetMonitors,
|
||||
CreateUpdateTrigger,
|
||||
UpdateSubscriptionTriggerStatus,
|
||||
GetAllTriggers,
|
||||
UpdateTriggerData,
|
||||
GetSubscriptionTriggerByEmail,
|
||||
@@ -254,6 +255,8 @@ export async function POST({ request, cookies }) {
|
||||
resp = await GetSubscribersPaginated(data);
|
||||
} else if (action == "updateSubscriptionStatus") {
|
||||
resp = await UpdateSubscriptionStatus(data.id, data.status);
|
||||
} else if (action == "updateSubscriptionTriggerStatus") {
|
||||
resp = await UpdateSubscriptionTriggerStatus(data.id, data.status);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@@ -1092,6 +1092,11 @@
|
||||
<Select.Content>
|
||||
<Select.Group>
|
||||
<Select.Label>Impact</Select.Label>
|
||||
{#if currentIncident.incident_type == "MAINTENANCE"}
|
||||
<Select.Item value="MAINTENANCE" label="MAINTENANCE" class="text-api-maintenance text-sm font-medium">
|
||||
MAINTENANCE
|
||||
</Select.Item>
|
||||
{/if}
|
||||
<Select.Item value="DOWN" label="DOWN" class="text-api-down text-sm font-medium">
|
||||
DOWN
|
||||
</Select.Item>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
let total = 0; // Initialize total to 0
|
||||
let totalPages = 0; // Initialize totalPages
|
||||
let subscriptionTrigger = {
|
||||
subscription_trigger_id: null,
|
||||
id: null,
|
||||
subscription_trigger_status: "INACTIVE",
|
||||
subscription_trigger_type: "email",
|
||||
config: {
|
||||
@@ -122,6 +122,21 @@
|
||||
});
|
||||
}
|
||||
|
||||
function updateSubscriptionTriggerStatus(id, status) {
|
||||
// Call the API to update the subscription status
|
||||
fetch(base + "/manage/app/api/", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
action: "updateSubscriptionTriggerStatus",
|
||||
data: {
|
||||
id: id,
|
||||
status: status
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// Reactive statement to calculate totalPages
|
||||
</script>
|
||||
|
||||
@@ -132,6 +147,30 @@
|
||||
Events Subscription
|
||||
{#if pageLoading}
|
||||
<Loader size="16" class="absolute right-0 top-0 animate-spin text-gray-500" />
|
||||
{:else if canSendEmail && !!subscriptionTrigger.id}
|
||||
<label class="absolute right-0 top-0 flex cursor-pointer items-center justify-between gap-2 text-sm">
|
||||
<Label class="text-xs font-medium ">
|
||||
{subscriptionTrigger.subscription_trigger_status == "ACTIVE" ? "Active" : "Inactive"}
|
||||
</Label>
|
||||
<input
|
||||
type="checkbox"
|
||||
value=""
|
||||
disabled={!canSendEmail}
|
||||
class="peer sr-only"
|
||||
checked={subscriptionTrigger.subscription_trigger_status == "ACTIVE"}
|
||||
on:change={(e) => {
|
||||
subscriptionTrigger.subscription_trigger_status = e.target.checked ? "ACTIVE" : "INACTIVE";
|
||||
// Call the API to update the subscription status
|
||||
updateSubscriptionTriggerStatus(
|
||||
subscriptionTrigger.id,
|
||||
subscriptionTrigger.subscription_trigger_status
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
class="peer relative h-6 w-11 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:peer-focus:ring-blue-800 rtl:peer-checked:after:-translate-x-full"
|
||||
></div>
|
||||
</label>
|
||||
{/if}
|
||||
</Card.Title>
|
||||
<Card.Description>Configure and view who have subscribed to updates for your status page.</Card.Description>
|
||||
@@ -163,7 +202,7 @@
|
||||
class="mr-1"
|
||||
type="checkbox"
|
||||
checked={subscriptionTrigger.config.createIncident}
|
||||
disabled={!canSendEmail}
|
||||
disabled={!canSendEmail || subscriptionTrigger.subscription_trigger_status != "ACTIVE"}
|
||||
/>
|
||||
Event Triggered
|
||||
</label>
|
||||
@@ -181,7 +220,7 @@
|
||||
class="mr-1"
|
||||
type="checkbox"
|
||||
checked={subscriptionTrigger.config.updateIncident}
|
||||
disabled={!canSendEmail}
|
||||
disabled={!canSendEmail || subscriptionTrigger.subscription_trigger_status != "ACTIVE"}
|
||||
/>
|
||||
Event Updated
|
||||
</label>
|
||||
@@ -197,7 +236,7 @@
|
||||
class="mr-1"
|
||||
type="checkbox"
|
||||
checked={subscriptionTrigger.config.insertIncidentMonitor}
|
||||
disabled={!canSendEmail}
|
||||
disabled={!canSendEmail || subscriptionTrigger.subscription_trigger_status != "ACTIVE"}
|
||||
/>
|
||||
Update Monitor in Event
|
||||
</label>
|
||||
@@ -215,7 +254,7 @@
|
||||
class="mr-1"
|
||||
type="checkbox"
|
||||
checked={subscriptionTrigger.config.updateIncidentComment}
|
||||
disabled={!canSendEmail}
|
||||
disabled={!canSendEmail || subscriptionTrigger.subscription_trigger_status != "ACTIVE"}
|
||||
/>
|
||||
Update Incident Comment
|
||||
</label>
|
||||
@@ -233,7 +272,7 @@
|
||||
class="mr-1"
|
||||
type="checkbox"
|
||||
checked={subscriptionTrigger.config.insertIncidentComment}
|
||||
disabled={!canSendEmail}
|
||||
disabled={!canSendEmail || subscriptionTrigger.subscription_trigger_status != "ACTIVE"}
|
||||
/>
|
||||
Insert Incident Comment
|
||||
</label>
|
||||
@@ -363,7 +402,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
value=""
|
||||
disabled={!canSendEmail}
|
||||
disabled={!canSendEmail || subscriptionTrigger.subscription_trigger_status != "ACTIVE"}
|
||||
class="peer sr-only"
|
||||
checked={user.subscriptions_status == "ACTIVE"}
|
||||
on:change={(e) => {
|
||||
|
||||
Reference in New Issue
Block a user