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
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,8 +30,8 @@ export default function Status({ service }) {
}
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="text-[8px] font-bold text-emerald-500/80 uppercase">{data.health ?? data.status}</div>
<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>
);
}

View File

@ -6,6 +6,7 @@ import Head from "next/head";
import "styles/globals.css";
import "styles/theme.css";
import "styles/manrope.css";
import "styles/custom.css";
import nextI18nextConfig from "../../next-i18next.config";
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")),
xteve: dynamic(() => import("./xteve/component")),
immich: dynamic(() => import("./immich/component")),
uptimekuma: dynamic(() => import("./uptimekuma/component")),
};
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 xteve from "./xteve/widget";
import immich from "./immich/widget";
import uptimekuma from "./uptimekuma/widget";
const widgets = {
adguard,
@ -123,6 +124,7 @@ const widgets = {
watchtower,
xteve,
immich,
uptimekuma,
};
export default widgets;