feat!: release v2 (#6545)

Co-authored-by: Artur <145776561+arturict@users.noreply.github.com>
Co-authored-by: arturict <arturict@users.noreply.github.com>
Co-authored-by: Thomas <thomas@ajnart.fr>
Co-authored-by: Afonso Jorge Ramos <afonsojorgeramos@gmail.com>
Co-authored-by: Danura30082 <danura30082+github@gmail.com>
Co-authored-by: Kushie <122986913+kushiemoon-dev@users.noreply.github.com>
Co-authored-by: ajnart <thomas@ajnart.fr>
Co-authored-by: ajnart <thomas@ajnart.dev>
Co-authored-by: chenjun <chenjun@foxmail.com>
Co-authored-by: Wikibear <wikibear@users.noreply.github.com>
Co-authored-by: Bergasha <bergasha@gmail.com>
Co-authored-by: leafyelin <43306196+leafyelin@users.noreply.github.com>
Co-authored-by: Lucas Araujo <lucas.lra@gmail.com>
Co-authored-by: GreenMonito <86085570+GreenMonito@users.noreply.github.com>
Co-authored-by: Nerdy-Technician <roffo@nerdy-technician.social>
Co-authored-by: Jun <34545896+jcstrong@users.noreply.github.com>
Co-authored-by: Edmond Abraham <54119952+gitedmond@users.noreply.github.com>
Co-authored-by: thrawnx <tight.bulb9384@fastmail.com>
Co-authored-by: Chris <58918656+nordada@users.noreply.github.com>
Co-authored-by: yi111 <153097222+Yi-111-a@users.noreply.github.com>
Co-authored-by: Yanis <naamaneyanis@gmail.com>
Co-authored-by: Wikibear <me@sej.de>
Co-authored-by: alessiottavo <93441886+alessiottavo@users.noreply.github.com>
This commit is contained in:
3286 files changed
+284386 -139176

No files matched your search

+17 -9
View File
@@ -1,5 +1,5 @@
import { createLogger } from "@homarr/core/infrastructure/logs";
import { createIntegrationAsync } from "@homarr/integrations";
import { createIntegrationAsync } from "@homarr/integrations/factory";
import type {
BeszelAlert,
BeszelAlertHistory,
@@ -13,6 +13,7 @@ import type {
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
const logger = createLogger({ module: "beszelRequestHandler" });
const MEBIBYTE = 1024 ** 2;
export type { BeszelSystemRow } from "@homarr/integrations/types";
@@ -22,7 +23,7 @@ export type { BeszelSystemRow } from "@homarr/integrations/types";
*
* BeszelSystemInfo uses short field names (see beszel-types.ts for full docs):
* cpu=CPU%, mp=memory%, dp=disk%, g=GPU%, la=loadAvg, u=uptime(s), v=version,
* bb=bandwidth(bytes/s), b=bandwidth(Mbps legacy), dt=disk temp, bat=battery,
* bb=bandwidth(bytes/s), b=bandwidth(MiB/s legacy), dt=disk temp, bat=battery,
* sv=[running,total] services, h=hostname, m=CPU model, c=cores, ct=threads
*/
function mapToSystemRow(system: BeszelSystem, details: BeszelSystemDetails | null): BeszelSystemRow {
@@ -37,8 +38,8 @@ function mapToSystemRow(system: BeszelSystem, details: BeszelSystemDetails | nul
extraFilesystems: info.efs ?? {},
gpu: info.g ?? 0,
loadAvg: info.la ?? null,
// bb = bytes/s (newer), b = Mbps (legacy, multiply to get bytes/s)
netBytes: info.bb ?? (info.b ?? 0) * 1_000_000,
// bb = bytes/s (newer), b = MiB/s (legacy, normalize to bytes/s)
netBytes: info.bb ?? (info.b ?? 0) * MEBIBYTE,
temp: info.dt ?? null,
battery: info.bat ?? null,
services: info.sv?.[0] ?? 0,
@@ -57,6 +58,7 @@ export const beszelSystemsRequestHandler = createIntegrationRequestHandler<
"beszel" | "mock",
Record<string, never>
>({
cacheNamespace: "beszel:systems",
async requestAsync(integration) {
const start = performance.now();
const instance = await createIntegrationAsync(integration);
@@ -89,6 +91,7 @@ export const beszelAlertsRequestHandler = createIntegrationRequestHandler<
"beszel" | "mock",
{ includeHistory: boolean; maxHistoryItems: number }
>({
cacheNamespace: "beszel:alerts",
async requestAsync(integration, input) {
const start = performance.now();
const instance = await createIntegrationAsync(integration);
@@ -123,6 +126,7 @@ export const beszelStatsRequestHandler = createIntegrationRequestHandler<
"beszel" | "mock",
{ systemId: string; timePeriod: string; includeDocker: boolean }
>({
cacheNamespace: "beszel:stats",
// No cache — the widget polls every 5s for live updates;
// a TTL here would serve stale records between polls.
cacheTtlMs: 0,
@@ -130,13 +134,17 @@ export const beszelStatsRequestHandler = createIntegrationRequestHandler<
const start = performance.now();
const config = timePeriodConfig[input.timePeriod] ?? { type: "1m", perPage: 60 };
const instance = await createIntegrationAsync(integration);
const systemStats = await instance.getSystemStatsAsync(input.systemId, config.type, config.perPage);
const containerStats = input.includeDocker
? await instance.getContainerStatsAsync(input.systemId, config.type, config.perPage).catch((error) => {
const systemStatsPromise = instance.getSystemStatsAsync(input.systemId, config.type, config.perPage);
let containerStatsPromise: Promise<BeszelContainerStatsRecord[]> = Promise.resolve([]);
if (input.includeDocker) {
containerStatsPromise = instance
.getContainerStatsAsync(input.systemId, config.type, config.perPage)
.catch((error) => {
logger.warn("Failed to fetch Beszel container stats", { systemId: input.systemId, error: String(error) });
return [];
})
: [];
});
}
const [systemStats, containerStats] = await Promise.all([systemStatsPromise, containerStatsPromise]);
logger.debug("beszelStats fetch completed", {
integrationId: integration.id,
systemId: input.systemId,