Merge remote-tracking branch 'upstream/main' into main

This commit is contained in:
KillahBee 2023-02-02 12:02:25 -05:00
commit e751eb4290
14 changed files with 159 additions and 77 deletions

View File

@ -88,7 +88,7 @@ jobs:
# https://github.com/docker/build-push-action # https://github.com/docker/build-push-action
- name: Build and push Docker image - name: Build and push Docker image
id: build-and-push id: build-and-push
uses: docker/build-push-action@v3 uses: docker/build-push-action@v4
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}

View File

@ -448,9 +448,11 @@
"videos": "Videos", "videos": "Videos",
"storage": "Storage" "storage": "Storage"
}, },
"komga": { "uptimekuma": {
"libraries": "Libraries", "up": "Sites Up",
"series": "Series", "down": "Sites Down",
"books": "Books" "uptime": "Uptime",
"incident": "Incident",
"m": "m"
} }
} }

View File

@ -280,8 +280,8 @@
"quicklaunch": { "quicklaunch": {
"bookmark": "Marcadores", "bookmark": "Marcadores",
"service": "Servicio", "service": "Servicio",
"search": "Search", "search": "Buscar",
"custom": "Custom" "custom": "Personalizado"
}, },
"homebridge": { "homebridge": {
"available_update": "Sistema", "available_update": "Sistema",
@ -434,9 +434,9 @@
"memory_usage": "Memoria" "memory_usage": "Memoria"
}, },
"immich": { "immich": {
"users": "Users", "users": "Usuarios",
"photos": "Photos", "photos": "Fotos",
"videos": "Videos", "videos": "Vídeos",
"storage": "Storage" "storage": "Almacenamiento"
} }
} }

View File

@ -280,8 +280,8 @@
"quicklaunch": { "quicklaunch": {
"bookmark": "Signet", "bookmark": "Signet",
"service": "Service", "service": "Service",
"search": "Search", "search": "Recherche",
"custom": "Custom" "custom": "Personnalisé"
}, },
"homebridge": { "homebridge": {
"available_update": "Système", "available_update": "Système",

View File

@ -31,10 +31,10 @@
"missing_type": "Tipo de Widget ausente: {{type}}", "missing_type": "Tipo de Widget ausente: {{type}}",
"api_error": "Erro da API", "api_error": "Erro da API",
"status": "Status", "status": "Status",
"information": "Information", "information": "Informação",
"url": "URL", "url": "URL",
"raw_error": "Raw Error", "raw_error": "Raw Error",
"response_data": "Response Data" "response_data": "Dados de Resposta"
}, },
"weather": { "weather": {
"current": "Localização atual", "current": "Localização atual",
@ -53,13 +53,13 @@
"cpu": "CPU" "cpu": "CPU"
}, },
"docker": { "docker": {
"rx": "Rx", "rx": "Recebido",
"tx": "Tx", "tx": "Transmitido",
"mem": "Mem", "mem": "Memória",
"cpu": "CPU", "cpu": "CPU",
"offline": "Desligado", "offline": "Desligado",
"error": "Error", "error": "Erro",
"unknown": "Unknown" "unknown": "Desconhecido"
}, },
"emby": { "emby": {
"playing": "Reproduzindo", "playing": "Reproduzindo",
@ -99,7 +99,7 @@
"wanted": "Desejado", "wanted": "Desejado",
"queued": "Na fila", "queued": "Na fila",
"movies": "Filmes", "movies": "Filmes",
"missing": "Missing" "missing": "Faltando"
}, },
"lidarr": { "lidarr": {
"wanted": "Desejado", "wanted": "Desejado",
@ -129,7 +129,7 @@
"pending": "Pendente", "pending": "Pendente",
"approved": "Aprovado", "approved": "Aprovado",
"available": "Disponível", "available": "Disponível",
"processing": "Processing" "processing": "Processando"
}, },
"pihole": { "pihole": {
"queries": "Consultas", "queries": "Consultas",
@ -148,9 +148,9 @@
"ping": "Ping" "ping": "Ping"
}, },
"traefik": { "traefik": {
"routers": "Rotas", "routers": "Roteadores",
"services": "Serviços", "services": "Serviços",
"middleware": "Middleware" "middleware": "Software intermediario"
}, },
"npm": { "npm": {
"enabled": "Habilitado", "enabled": "Habilitado",
@ -164,10 +164,10 @@
}, },
"prowlarr": { "prowlarr": {
"enableIndexers": "Indexadores", "enableIndexers": "Indexadores",
"numberOfGrabs": "Grabs", "numberOfGrabs": "Pegos",
"numberOfQueries": "Queries", "numberOfQueries": "Consultas",
"numberOfFailGrabs": "Fail Grabs", "numberOfFailGrabs": "Fail Grabs",
"numberOfFailQueries": "Fail Queries" "numberOfFailQueries": "Consultas Falhas"
}, },
"jackett": { "jackett": {
"configured": "Configurado", "configured": "Configurado",
@ -179,36 +179,36 @@
"domain_count": "Domínios" "domain_count": "Domínios"
}, },
"authentik": { "authentik": {
"users": "Users", "users": "Usuários",
"loginsLast24H": "Logins (24h)", "loginsLast24H": "Logins (24h)",
"failedLoginsLast24H": "Failed Logins (24h)" "failedLoginsLast24H": "Failed Logins (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "Memória",
"cpu": "CPU", "cpu": "Processador",
"lxc": "LXC", "lxc": "LXC",
"vms": "VMs" "vms": "VMs"
}, },
"unifi": { "unifi": {
"users": "Users", "users": "Usuários",
"uptime": "System Uptime", "uptime": "Tempo de Funcionamento",
"days": "Days", "days": "Dias",
"wan": "WAN", "wan": "WAN",
"lan_users": "LAN Users", "lan_users": "Usuarios locais",
"wlan_users": "WLAN Users", "wlan_users": "Usuarios WLAN",
"up": "UP", "up": "LIGADO",
"down": "DOWN", "down": "CÁIDO",
"wait": "Please wait", "wait": "Por favor guarde",
"lan": "LAN", "lan": "LAN",
"wlan": "WLAN", "wlan": "WLAN",
"devices": "Devices", "devices": "Dispositivos",
"lan_devices": "LAN Devices", "lan_devices": "Dispositivos LAN",
"wlan_devices": "WLAN Devices" "wlan_devices": "Dispositivos WLAN"
}, },
"plex": { "plex": {
"streams": "Active Streams", "streams": "Transmissões ativas",
"movies": "Movies", "movies": "Filmes",
"tv": "TV Shows" "tv": "Séries de TV"
}, },
"glances": { "glances": {
"cpu": "CPU", "cpu": "CPU",
@ -222,10 +222,10 @@
"wmo": { "wmo": {
"1-night": "Mainly Clear", "1-night": "Mainly Clear",
"2-day": "Partly Cloudy", "2-day": "Partly Cloudy",
"2-night": "Partly Cloudy", "2-night": "Parcialmente nublado",
"3-day": "Cloudy", "3-day": "Nublado",
"3-night": "Cloudy", "3-night": "Nublado",
"45-day": "Foggy", "45-day": "Névoa",
"45-night": "Foggy", "45-night": "Foggy",
"48-day": "Foggy", "48-day": "Foggy",
"48-night": "Foggy", "48-night": "Foggy",
@ -233,9 +233,9 @@
"57-day": "Freezing Drizzle", "57-day": "Freezing Drizzle",
"99-day": "Thunderstorm With Hail", "99-day": "Thunderstorm With Hail",
"99-night": "Thunderstorm With Hail", "99-night": "Thunderstorm With Hail",
"0-day": "Sunny", "0-day": "Ensolarado",
"53-day": "Drizzle", "53-day": "Drizzle",
"0-night": "Clear", "0-night": "Limpo",
"1-day": "Mainly Sunny", "1-day": "Mainly Sunny",
"51-day": "Light Drizzle", "51-day": "Light Drizzle",
"51-night": "Light Drizzle", "51-night": "Light Drizzle",
@ -315,8 +315,8 @@
"time": "{{value, number(style: unit; unitDisplay: long;)}}" "time": "{{value, number(style: unit; unitDisplay: long;)}}"
}, },
"navidrome": { "navidrome": {
"nothing_streaming": "No Active Streams", "nothing_streaming": "Sem transmissões ativas",
"please_wait": "Please Wait" "please_wait": "Por favor aguarde"
}, },
"pyload": { "pyload": {
"speed": "Speed", "speed": "Speed",
@ -334,7 +334,7 @@
"hd": "HD" "hd": "HD"
}, },
"ping": { "ping": {
"error": "Error", "error": "Erro",
"ping": "Ping" "ping": "Ping"
}, },
"scrutiny": { "scrutiny": {
@ -359,14 +359,14 @@
"seed": "Seed" "seed": "Seed"
}, },
"tdarr": { "tdarr": {
"queue": "Queue", "queue": "Fila",
"processed": "Processed", "processed": "Processado",
"errored": "Errored", "errored": "Erro",
"saved": "Saved" "saved": "Salvo"
}, },
"miniflux": { "miniflux": {
"read": "Read", "read": "Lidos",
"unread": "Unread" "unread": "Não Lidos"
}, },
"nextdns": { "nextdns": {
"wait": "Please Wait", "wait": "Please Wait",
@ -377,11 +377,11 @@
"bibitrate": "{{value, rate(bits: true; binary: true)}}" "bibitrate": "{{value, rate(bits: true; binary: true)}}"
}, },
"omada": { "omada": {
"connectedAp": "Connected APs", "connectedAp": "Pontos de acesso conectados",
"activeUser": "Active devices", "activeUser": "Dispositivos ativos",
"alerts": "Alerts", "alerts": "Alertas",
"connectedGateway": "Connected gateways", "connectedGateway": "Gateways conectados",
"connectedSwitches": "Connected switches" "connectedSwitches": "Interruptores conectados"
}, },
"downloadstation": { "downloadstation": {
"download": "Download", "download": "Download",

View File

@ -342,8 +342,8 @@
"quicklaunch": { "quicklaunch": {
"bookmark": "Закладка", "bookmark": "Закладка",
"service": "Сервіс", "service": "Сервіс",
"search": "Search", "search": "Пошук",
"custom": "Custom" "custom": "Користувацький"
}, },
"homebridge": { "homebridge": {
"available_update": "Система", "available_update": "Система",
@ -428,15 +428,15 @@
"status": "Стан" "status": "Стан"
}, },
"proxmoxbackupserver": { "proxmoxbackupserver": {
"datastore_usage": "Datastore", "datastore_usage": "Сховище даних",
"failed_tasks_24h": "Failed Tasks 24h", "failed_tasks_24h": "Невиконані завдання 24 години",
"cpu_usage": "CPU", "cpu_usage": "CPU",
"memory_usage": "Memory" "memory_usage": "Пам'ять"
}, },
"immich": { "immich": {
"users": "Users", "users": "Користувачі",
"photos": "Photos", "photos": "Фотографії",
"videos": "Videos", "videos": "Відео",
"storage": "Storage" "storage": "Сховище"
} }
} }

View File

@ -12,7 +12,7 @@
"placeholder": "搜索…" "placeholder": "搜索…"
}, },
"resources": { "resources": {
"total": "", "total": "总计",
"free": "空闲", "free": "空闲",
"used": "已用", "used": "已用",
"load": "负载", "load": "负载",

View File

@ -30,8 +30,8 @@ export default function Status({ service }) {
} }
return ( return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.health ?? data.status}> <div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.health || data.status}>
<div className="text-[8px] font-bold text-emerald-500/80 uppercase">{data.health ?? data.status}</div> <div className="text-[8px] font-bold text-emerald-500/80 uppercase">{data.health || data.status}</div>
</div> </div>
); );
} }

View File

@ -6,6 +6,7 @@ import Head from "next/head";
import "styles/globals.css"; import "styles/globals.css";
import "styles/theme.css"; import "styles/theme.css";
import "styles/manrope.css"; import "styles/manrope.css";
import "styles/custom.css";
import nextI18nextConfig from "../../next-i18next.config"; import nextI18nextConfig from "../../next-i18next.config";
import { ColorProvider } from "utils/contexts/color"; import { ColorProvider } from "utils/contexts/color";

3
src/styles/custom.css Normal file
View File

@ -0,0 +1,3 @@
/*
Mount this file and define your custom styles
*/

View File

@ -64,6 +64,7 @@ const components = {
watchtower: dynamic(() => import("./watchtower/component")), watchtower: dynamic(() => import("./watchtower/component")),
xteve: dynamic(() => import("./xteve/component")), xteve: dynamic(() => import("./xteve/component")),
immich: dynamic(() => import("./immich/component")), immich: dynamic(() => import("./immich/component")),
uptimekuma: dynamic(() => import("./uptimekuma/component")),
}; };
export default components; export default components;

View File

@ -0,0 +1,55 @@
import { useTranslation } from "next-i18next";
import Container from "components/services/widget/container";
import useWidgetAPI from "utils/proxy/use-widget-api";
import Block from "components/services/widget/block";
export default function Component({ service }) {
const { t } = useTranslation();
const { widget } = service;
const { data: statusData, error: statusError } = useWidgetAPI(widget, "status_page");
const { data: heartbeatData, error: heartbeatError } = useWidgetAPI(widget, "heartbeat");
if (statusError || heartbeatError) {
return <Container error={statusError ?? heartbeatError} />;
}
if (!statusData || !heartbeatData) {
return (
<Container service={service}>
<Block label="uptimekuma.up"/>
<Block label="uptimekuma.down"/>
<Block label="uptimekuma.uptime"/>
<Block label="uptimekuma.incidents"/>
</Container>
);
}
let sitesUp = 0;
let sitesDown = 0;
Object.values(heartbeatData.heartbeatList).forEach((siteList) => {
const lastHeartbeat = siteList[siteList.length - 1];
if (lastHeartbeat?.status === 1) {
sitesUp += 1;
} else {
sitesDown += 1;
}
});
// Adapted from https://github.com/bastienwirtz/homer/blob/b7cd8f9482e6836a96b354b11595b03b9c3d67cd/src/components/services/UptimeKuma.vue#L105
const uptimeList = Object.values(heartbeatData.uptimeList);
const percent = uptimeList.reduce((a, b) => a + b, 0) / uptimeList.length || 0;
const uptime = (percent * 100).toFixed(1);
const incidentTime = statusData.incident ? (Math.abs(new Date(statusData.incident?.createdDate) - new Date()) / 1000) / (60 * 60) : null;
return (
<Container service={service}>
<Block label="uptimekuma.up" value={t("common.number", { value: sitesUp })} />
<Block label="uptimekuma.down" value={t("common.number", { value: sitesDown })} />
<Block label="uptimekuma.uptime" value={t("common.percent", { value: uptime })} />
{incidentTime && <Block label="uptimekuma.incident" value={t("common.number", { value: Math.round(incidentTime) }) + t("uptimekuma.m")} />}
</Container>
);
}

View File

@ -0,0 +1,18 @@
// import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
import genericProxyHandler from "utils/proxy/handlers/generic";
const widget = {
api: "{url}/api/{endpoint}/{slug}",
proxyHandler: genericProxyHandler,
mappings: {
status_page: {
endpoint: "status-page",
},
heartbeat: {
endpoint: "status-page/heartbeat",
},
}
};
export default widget;

View File

@ -58,6 +58,7 @@ import unifi from "./unifi/widget";
import watchtower from "./watchtower/widget"; import watchtower from "./watchtower/widget";
import xteve from "./xteve/widget"; import xteve from "./xteve/widget";
import immich from "./immich/widget"; import immich from "./immich/widget";
import uptimekuma from "./uptimekuma/widget";
const widgets = { const widgets = {
adguard, adguard,
@ -123,6 +124,7 @@ const widgets = {
watchtower, watchtower,
xteve, xteve,
immich, immich,
uptimekuma,
}; };
export default widgets; export default widgets;