Merge branch 'dev' into feat/docker-logs
This commit is contained in:
57 files changed
+1512
-1019
No files matched your search
@@ -41,7 +41,7 @@
|
||||
"@homarr/translation": "workspace:^0.1.0",
|
||||
"@homarr/validation": "workspace:^0.1.0",
|
||||
"@kubernetes/client-node": "^1.4.0",
|
||||
"@tanstack/react-query": "^5.90.12",
|
||||
"@tanstack/react-query": "^5.90.16",
|
||||
"@trpc/client": "^11.8.1",
|
||||
"@trpc/react-query": "^11.8.1",
|
||||
"@trpc/server": "^11.8.1",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { generateOpenApiDocument } from "trpc-to-openapi";
|
||||
|
||||
import { API_KEY_HEADER_NAME } from "@homarr/auth/api-key";
|
||||
|
||||
import { appRouter } from "./root";
|
||||
|
||||
export const openApiDocument = (base: string) =>
|
||||
@@ -11,7 +13,7 @@ export const openApiDocument = (base: string) =>
|
||||
securitySchemes: {
|
||||
apikey: {
|
||||
type: "apiKey",
|
||||
name: "ApiKey",
|
||||
name: API_KEY_HEADER_NAME,
|
||||
description: "API key which can be obtained in the Homarr administration dashboard",
|
||||
in: "header",
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ import { createTRPCRouter, publicProcedure } from "../../trpc";
|
||||
|
||||
export const healthMonitoringRouter = createTRPCRouter({
|
||||
getSystemHealthStatus: publicProcedure
|
||||
.concat(createManyIntegrationMiddleware("query", "openmediavault", "dashDot", "truenas", "mock"))
|
||||
.concat(createManyIntegrationMiddleware("query", "openmediavault", "dashDot", "truenas", "unraid", "mock"))
|
||||
.query(async ({ ctx }) => {
|
||||
return await Promise.all(
|
||||
ctx.integrations.map(async (integration) => {
|
||||
@@ -26,7 +26,7 @@ export const healthMonitoringRouter = createTRPCRouter({
|
||||
);
|
||||
}),
|
||||
subscribeSystemHealthStatus: publicProcedure
|
||||
.concat(createManyIntegrationMiddleware("query", "openmediavault", "dashDot", "truenas", "mock"))
|
||||
.concat(createManyIntegrationMiddleware("query", "openmediavault", "dashDot", "truenas", "unraid", "mock"))
|
||||
.subscription(({ ctx }) => {
|
||||
return observable<{ integrationId: string; healthInfo: SystemHealthMonitoring; timestamp: Date }>((emit) => {
|
||||
const unsubscribes: (() => void)[] = [];
|
||||
|
||||
@@ -24,7 +24,7 @@ export const notebookRouter = createTRPCRouter({
|
||||
where: eq(items.id, input.itemId),
|
||||
});
|
||||
|
||||
if (!item || item.boardId !== input.boardId) {
|
||||
if (item?.boardId !== input.boardId) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
message: "Specified item was not found",
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export const API_KEY_HEADER_NAME = "ApiKey";
|
||||
@@ -0,0 +1,76 @@
|
||||
import type { Session } from "next-auth";
|
||||
|
||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||
import type { Database } from "@homarr/db";
|
||||
import { eq } from "@homarr/db";
|
||||
import { apiKeys } from "@homarr/db/schema";
|
||||
|
||||
import { hashPasswordAsync } from "../security";
|
||||
import { createSessionAsync } from "../server";
|
||||
|
||||
const logger = createLogger({ module: "apiKeyAuth" });
|
||||
|
||||
/**
|
||||
* Validate an API key from the request header and return a session if valid.
|
||||
*
|
||||
* @param db - The database instance
|
||||
* @param apiKeyHeaderValue - The value of the ApiKey header (format: "id.token")
|
||||
* @param ipAddress - The IP address of the request (for logging)
|
||||
* @param userAgent - The user agent of the request (for logging)
|
||||
* @returns A session if the API key is valid, null otherwise
|
||||
*/
|
||||
export const getSessionFromApiKeyAsync = async (
|
||||
db: Database,
|
||||
apiKeyHeaderValue: string | null,
|
||||
ipAddress: string | null,
|
||||
userAgent: string,
|
||||
): Promise<Session | null> => {
|
||||
if (apiKeyHeaderValue === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const [apiKeyId, apiKey] = apiKeyHeaderValue.split(".");
|
||||
|
||||
if (!apiKeyId || !apiKey) {
|
||||
logger.warn("Failed to authenticate with api-key", { ipAddress, userAgent, reason: "API_KEY_INVALID_FORMAT" });
|
||||
return null;
|
||||
}
|
||||
|
||||
const apiKeyFromDb = await db.query.apiKeys.findFirst({
|
||||
where: eq(apiKeys.id, apiKeyId),
|
||||
columns: {
|
||||
id: true,
|
||||
apiKey: true,
|
||||
salt: true,
|
||||
},
|
||||
with: {
|
||||
user: {
|
||||
columns: {
|
||||
id: true,
|
||||
name: true,
|
||||
email: true,
|
||||
emailVerified: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!apiKeyFromDb) {
|
||||
logger.warn("Failed to authenticate with api-key", { ipAddress, userAgent, reason: "API_KEY_NOT_FOUND" });
|
||||
return null;
|
||||
}
|
||||
|
||||
const hashedApiKey = await hashPasswordAsync(apiKey, apiKeyFromDb.salt);
|
||||
|
||||
if (apiKeyFromDb.apiKey !== hashedApiKey) {
|
||||
logger.warn("Failed to authenticate with api-key", { ipAddress, userAgent, reason: "API_KEY_MISMATCH" });
|
||||
return null;
|
||||
}
|
||||
|
||||
logger.info("Successfully authenticated with api-key", {
|
||||
name: apiKeyFromDb.user.name,
|
||||
id: apiKeyFromDb.user.id,
|
||||
});
|
||||
|
||||
return await createSessionAsync(db, apiKeyFromDb.user);
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
export { getSessionFromApiKeyAsync } from "./get-api-key-session";
|
||||
export { API_KEY_HEADER_NAME } from "./constants";
|
||||
@@ -0,0 +1,133 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
import { createId } from "@homarr/common";
|
||||
import { apiKeys, users } from "@homarr/db/schema";
|
||||
import { createDb } from "@homarr/db/test";
|
||||
|
||||
import { createSaltAsync, hashPasswordAsync } from "../../security";
|
||||
import { getSessionFromApiKeyAsync } from "../get-api-key-session";
|
||||
|
||||
// Mock the logger to avoid console output during tests
|
||||
vi.mock("@homarr/core/infrastructure/logs", () => ({
|
||||
createLogger: () => ({
|
||||
warn: vi.fn(),
|
||||
info: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
const defaultUserId = createId();
|
||||
const defaultUsername = "testuser";
|
||||
const defaultApiKeyId = createId();
|
||||
const defaultIpAddress = "127.0.0.1";
|
||||
const defaultUserAgent = "test-agent";
|
||||
const defaultLogParams = [defaultIpAddress, defaultUserAgent] as const;
|
||||
|
||||
describe("getSessionFromApiKeyAsync", () => {
|
||||
test("should return null when api key header is null", async () => {
|
||||
// Arrange
|
||||
const { db } = await setupAsync();
|
||||
const apiKey = null;
|
||||
|
||||
// Act
|
||||
const result = await getSessionFromApiKeyAsync(db, apiKey, ...defaultLogParams);
|
||||
|
||||
// Assert
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test.each([
|
||||
["invalidformat", "no dot"],
|
||||
["keyid.", "missing token"],
|
||||
[".token", "missing id"],
|
||||
])("should return null when api key format is invalid key=%s reason=%s", async (apiKey) => {
|
||||
// Arrange
|
||||
const { db } = await setupAsync();
|
||||
|
||||
// Act
|
||||
const result = await getSessionFromApiKeyAsync(db, apiKey, ...defaultLogParams);
|
||||
|
||||
// Assert
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test("should return null when api key is not found in database", async () => {
|
||||
// Arrange
|
||||
const { db } = await setupAsync();
|
||||
|
||||
// Act
|
||||
const result = await getSessionFromApiKeyAsync(db, "nonexistent.token", ...defaultLogParams);
|
||||
|
||||
// Assert
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test("should return null when api key token does not match", async () => {
|
||||
// Arrange
|
||||
const { db } = await setupAsync({ token: "correcttoken" });
|
||||
|
||||
// Act
|
||||
const result = await getSessionFromApiKeyAsync(db, `${defaultApiKeyId}.wrongtoken`, ...defaultLogParams);
|
||||
|
||||
// Assert
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test("should return session when api key is valid", async () => {
|
||||
// Arrange
|
||||
const token = "validtesttoken123";
|
||||
const { db } = await setupAsync({ token });
|
||||
|
||||
// Act
|
||||
const result = await getSessionFromApiKeyAsync(db, `${defaultApiKeyId}.${token}`, ...defaultLogParams);
|
||||
|
||||
// Assert
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.user.id).toEqual(defaultUserId);
|
||||
expect(result!.user.name).toEqual(defaultUsername);
|
||||
});
|
||||
|
||||
test("should work with null ip address", async () => {
|
||||
// Arrange
|
||||
const token = "validtesttoken456";
|
||||
const { db } = await setupAsync({ token });
|
||||
|
||||
// Act
|
||||
const result = await getSessionFromApiKeyAsync(db, `${defaultApiKeyId}.${token}`, null, defaultUserAgent);
|
||||
|
||||
// Assert
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.user.id).toEqual(defaultUserId);
|
||||
});
|
||||
});
|
||||
|
||||
interface SetupOptions {
|
||||
/**
|
||||
* If provided, inserts an API key into the database for testing.
|
||||
*/
|
||||
token?: string;
|
||||
}
|
||||
|
||||
const setupAsync = async (options?: SetupOptions) => {
|
||||
const db = createDb();
|
||||
|
||||
await db.insert(users).values({
|
||||
id: defaultUserId,
|
||||
name: defaultUsername,
|
||||
email: "test@example.com",
|
||||
});
|
||||
|
||||
if (options?.token) {
|
||||
const salt = await createSaltAsync();
|
||||
await db.insert(apiKeys).values({
|
||||
id: defaultApiKeyId,
|
||||
apiKey: await hashPasswordAsync(options.token, salt),
|
||||
salt,
|
||||
userId: defaultUserId,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
db,
|
||||
};
|
||||
};
|
||||
@@ -8,6 +8,7 @@
|
||||
".": "./index.ts",
|
||||
"./next": "./next.ts",
|
||||
"./security": "./security.ts",
|
||||
"./api-key": "./api-key/index.ts",
|
||||
"./client": "./client.ts",
|
||||
"./server": "./server.ts",
|
||||
"./shared": "./shared.ts",
|
||||
@@ -32,7 +33,7 @@
|
||||
"@homarr/validation": "workspace:^0.1.0",
|
||||
"bcrypt": "^6.0.0",
|
||||
"cookies": "^0.9.1",
|
||||
"ldapts": "8.0.34",
|
||||
"ldapts": "8.1.0",
|
||||
"next": "16.1.1",
|
||||
"next-auth": "5.0.0-beta.30",
|
||||
"react": "19.2.3",
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"esbuild": "^0.27.1",
|
||||
"esbuild": "^0.27.2",
|
||||
"eslint": "^9.39.2",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
|
||||
@@ -9,3 +9,7 @@ export const userAgent = (headers: Headers) => {
|
||||
};
|
||||
|
||||
export type DeviceType = "console" | "mobile" | "tablet" | "smarttv" | "wearable" | "embedded" | undefined;
|
||||
|
||||
export const ipAddressFromHeaders = (headers: Headers): string | null => {
|
||||
return headers.get("x-forwarded-for");
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
export * from "./security";
|
||||
export * from "./encryption";
|
||||
export * from "./user-agent";
|
||||
export * from "./request";
|
||||
export * from "./errors";
|
||||
@@ -26,7 +26,9 @@ const createMysqlDbConnection = () => {
|
||||
|
||||
return mysql.createPool({
|
||||
...defaultOptions,
|
||||
host: dbEnv.HOST,
|
||||
port: dbEnv.PORT,
|
||||
database: dbEnv.NAME,
|
||||
user: dbEnv.USER,
|
||||
password: dbEnv.PASSWORD,
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"@homarr/common": "workspace:^0.1.0",
|
||||
"@homarr/core": "workspace:^0.1.0",
|
||||
"@homarr/cron-jobs": "workspace:^0.1.0",
|
||||
"@tanstack/react-query": "^5.90.12",
|
||||
"@tanstack/react-query": "^5.90.16",
|
||||
"@trpc/client": "^11.8.1",
|
||||
"@trpc/server": "^11.8.1",
|
||||
"@trpc/tanstack-react-query": "^11.8.1",
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
"@homarr/server-settings": "workspace:^0.1.0",
|
||||
"@mantine/core": "^8.3.10",
|
||||
"@paralleldrive/cuid2": "^3.1.0",
|
||||
"@testcontainers/mysql": "^11.10.0",
|
||||
"@testcontainers/postgresql": "^11.10.0",
|
||||
"@testcontainers/mysql": "^11.11.0",
|
||||
"@testcontainers/postgresql": "^11.11.0",
|
||||
"better-sqlite3": "^12.5.0",
|
||||
"dotenv": "^17.2.3",
|
||||
"drizzle-kit": "^0.31.8",
|
||||
@@ -67,7 +67,7 @@
|
||||
"@types/better-sqlite3": "7.6.13",
|
||||
"@types/pg": "^8.16.0",
|
||||
"dotenv-cli": "^11.0.0",
|
||||
"esbuild": "^0.27.1",
|
||||
"esbuild": "^0.27.2",
|
||||
"eslint": "^9.39.2",
|
||||
"prettier": "^3.7.4",
|
||||
"tsx": "4.20.4",
|
||||
|
||||
@@ -188,6 +188,7 @@ export type HomarrDocumentationPath =
|
||||
| "/docs/integrations/transmission"
|
||||
| "/docs/integrations/truenas"
|
||||
| "/docs/integrations/unifi-controller"
|
||||
| "/docs/integrations/unraid"
|
||||
| "/docs/management/api"
|
||||
| "/docs/management/apps"
|
||||
| "/docs/management/boards"
|
||||
|
||||
@@ -298,6 +298,13 @@ export const integrationDefs = {
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/truenas"),
|
||||
},
|
||||
unraid: {
|
||||
name: "Unraid",
|
||||
secretKinds: [["apiKey"]],
|
||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/unraid.svg",
|
||||
category: ["healthMonitoring"],
|
||||
documentationUrl: createDocumentationLink("/docs/integrations/unraid"),
|
||||
},
|
||||
// This integration only returns mock data, it is used during development (but can also be used in production by directly going to the create page)
|
||||
mock: {
|
||||
name: "Mock",
|
||||
|
||||
@@ -38,6 +38,7 @@ import { ProxmoxIntegration } from "../proxmox/proxmox-integration";
|
||||
import { QuayIntegration } from "../quay/quay-integration";
|
||||
import { TrueNasIntegration } from "../truenas/truenas-integration";
|
||||
import { UnifiControllerIntegration } from "../unifi-controller/unifi-controller-integration";
|
||||
import { UnraidIntegration } from "../unraid/unraid-integration";
|
||||
import type { Integration, IntegrationInput } from "./integration";
|
||||
|
||||
export const createIntegrationAsync = async <TKind extends keyof typeof integrationCreators>(
|
||||
@@ -101,6 +102,7 @@ export const integrationCreators = {
|
||||
ntfy: NTFYIntegration,
|
||||
mock: MockIntegration,
|
||||
truenas: TrueNasIntegration,
|
||||
unraid: UnraidIntegration,
|
||||
} satisfies Record<IntegrationKind, IntegrationInstance | [(input: IntegrationInput) => Promise<Integration>]>;
|
||||
|
||||
type IntegrationInstanceOfKind<TKind extends keyof typeof integrationCreators> = {
|
||||
|
||||
@@ -22,6 +22,7 @@ export { PiHoleIntegrationV6 } from "./pi-hole/v6/pi-hole-integration-v6";
|
||||
export { PlexIntegration } from "./plex/plex-integration";
|
||||
export { ProwlarrIntegration } from "./prowlarr/prowlarr-integration";
|
||||
export { TrueNasIntegration } from "./truenas/truenas-integration";
|
||||
export { UnraidIntegration } from "./unraid/unraid-integration";
|
||||
export { OPNsenseIntegration } from "./opnsense/opnsense-integration";
|
||||
export { ICalIntegration } from "./ical/ical-integration";
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ export class TrueNasIntegration extends Integration implements ISystemHealthMoni
|
||||
*/
|
||||
private async requestAsync(method: string, params: unknown[] = [], webSocketOverride?: WebSocket) {
|
||||
let webSocket = webSocketOverride ?? this.webSocket;
|
||||
if (!webSocket || webSocket.readyState !== WebSocket.OPEN) {
|
||||
if (webSocket?.readyState !== WebSocket.OPEN) {
|
||||
logger.debug("Connecting to websocket", {
|
||||
url: this.wsUrl(),
|
||||
});
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
import dayjs from "dayjs";
|
||||
import type { fetch as undiciFetch } from "undici/types/fetch";
|
||||
|
||||
import { humanFileSize } from "@homarr/common";
|
||||
import { ResponseError } from "@homarr/common/server";
|
||||
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||
|
||||
import { HandleIntegrationErrors } from "../base/errors/decorator";
|
||||
import type { IntegrationTestingInput } from "../base/integration";
|
||||
import { Integration } from "../base/integration";
|
||||
import type { TestingResult } from "../base/test-connection/test-connection-service";
|
||||
import type { ISystemHealthMonitoringIntegration } from "../interfaces/health-monitoring/health-monitoring-integration";
|
||||
import type { SystemHealthMonitoring } from "../interfaces/health-monitoring/health-monitoring-types";
|
||||
import type { UnraidSystemInfo } from "./unraid-types";
|
||||
import { unraidSystemInfoSchema } from "./unraid-types";
|
||||
|
||||
const logger = createLogger({ module: "UnraidIntegration" });
|
||||
|
||||
@HandleIntegrationErrors([])
|
||||
export class UnraidIntegration extends Integration implements ISystemHealthMonitoringIntegration {
|
||||
protected async testingAsync(input: IntegrationTestingInput): Promise<TestingResult> {
|
||||
await this.queryGraphQLAsync<{ info: UnraidSystemInfo }>(
|
||||
`
|
||||
query {
|
||||
info {
|
||||
os { platform }
|
||||
}
|
||||
}
|
||||
`,
|
||||
input.fetchAsync,
|
||||
);
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
public async getSystemInfoAsync(): Promise<SystemHealthMonitoring> {
|
||||
const systemInfo = await this.getSystemInformationAsync();
|
||||
|
||||
const cpuUtilization = systemInfo.metrics.cpu.cpus.reduce((acc, val) => acc + val.percentTotal, 0);
|
||||
const cpuCount = systemInfo.info.cpu.cores;
|
||||
|
||||
// We use "info" object instead of the stats since this is the exact amount the kernel sees, which is what Unraid displays.
|
||||
const totalMemory = systemInfo.info.memory.layout.reduce((acc, layout) => layout.size + acc, 0);
|
||||
const usedMemory = totalMemory * (systemInfo.metrics.memory.percentTotal / 100);
|
||||
const uptime = dayjs(systemInfo.info.os.uptime);
|
||||
|
||||
return {
|
||||
version: systemInfo.info.os.release,
|
||||
cpuModelName: systemInfo.info.cpu.brand,
|
||||
cpuUtilization: cpuUtilization / cpuCount,
|
||||
memUsedInBytes: usedMemory,
|
||||
memAvailableInBytes: totalMemory - usedMemory,
|
||||
uptime: dayjs().diff(uptime, "seconds"),
|
||||
network: null, // Not implemented, see https://github.com/unraid/api/issues/1602
|
||||
loadAverage: null,
|
||||
rebootRequired: false,
|
||||
availablePkgUpdates: 0,
|
||||
cpuTemp: undefined, // Not implemented, see https://github.com/unraid/api/issues/1597
|
||||
fileSystem: systemInfo.array.disks.map((disk) => ({
|
||||
deviceName: disk.name,
|
||||
used: humanFileSize(disk.fsUsed * 1024), // API is in KiB (kibibytes), covert to bytes
|
||||
available: `${disk.size * 1024}`, // API is in KiB (kibibytes), covert to bytes
|
||||
percentage: (disk.fsUsed / disk.size) * 100, // The units are the same, therefore the actual unit is irrelevant
|
||||
})),
|
||||
smart: systemInfo.array.disks.map((disk) => ({
|
||||
deviceName: disk.name,
|
||||
temperature: disk.temp ?? null,
|
||||
overallStatus: disk.status,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
private async getSystemInformationAsync(): Promise<UnraidSystemInfo> {
|
||||
logger.debug("Retrieving system information", {
|
||||
url: this.url("/graphql"),
|
||||
});
|
||||
|
||||
const query = `
|
||||
query {
|
||||
metrics {
|
||||
cpu {
|
||||
percentTotal
|
||||
cpus {
|
||||
percentTotal
|
||||
}
|
||||
},
|
||||
memory {
|
||||
available
|
||||
used
|
||||
free
|
||||
total
|
||||
swapFree
|
||||
swapTotal
|
||||
swapUsed
|
||||
percentTotal
|
||||
}
|
||||
}
|
||||
array {
|
||||
state
|
||||
capacity {
|
||||
disks {
|
||||
free
|
||||
total
|
||||
used
|
||||
}
|
||||
}
|
||||
disks {
|
||||
name
|
||||
size
|
||||
fsFree
|
||||
fsUsed
|
||||
status
|
||||
temp
|
||||
}
|
||||
}
|
||||
info {
|
||||
devices {
|
||||
network {
|
||||
speed
|
||||
dhcp
|
||||
model
|
||||
model
|
||||
}
|
||||
}
|
||||
os {
|
||||
platform,
|
||||
distro,
|
||||
release,
|
||||
uptime
|
||||
},
|
||||
cpu {
|
||||
manufacturer,
|
||||
brand,
|
||||
cores,
|
||||
threads
|
||||
},
|
||||
memory {
|
||||
layout {
|
||||
size
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const response = await this.queryGraphQLAsync<UnraidSystemInfo>(query);
|
||||
const result = await unraidSystemInfoSchema.parseAsync(response);
|
||||
|
||||
logger.debug("Retrieved system information", {
|
||||
url: this.url("/graphql"),
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private async queryGraphQLAsync<T>(
|
||||
query: string,
|
||||
fetchAsync: typeof undiciFetch = fetchWithTrustedCertificatesAsync,
|
||||
): Promise<T> {
|
||||
const url = this.url("/graphql");
|
||||
const apiKey = this.getSecretValue("apiKey");
|
||||
|
||||
logger.debug("Sending GraphQL query", {
|
||||
url: url.toString(),
|
||||
});
|
||||
|
||||
const response = await fetchAsync(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"x-api-key": apiKey,
|
||||
},
|
||||
body: JSON.stringify({ query }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new ResponseError(response);
|
||||
}
|
||||
|
||||
const json = (await response.json()) as { data: T; errors?: { message: string }[] };
|
||||
|
||||
if (json.errors) {
|
||||
throw new Error(`GraphQL errors: ${json.errors.map((error) => error.message).join(", ")}`);
|
||||
}
|
||||
|
||||
return json.data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import z from "zod";
|
||||
|
||||
export const unraidSystemInfoSchema = z.object({
|
||||
metrics: z.object({
|
||||
cpu: z.object({
|
||||
percentTotal: z.number(),
|
||||
cpus: z.array(
|
||||
z.object({
|
||||
percentTotal: z.number(),
|
||||
}),
|
||||
),
|
||||
}),
|
||||
memory: z.object({
|
||||
available: z.number(),
|
||||
used: z.number(),
|
||||
free: z.number(),
|
||||
total: z.number().min(0),
|
||||
percentTotal: z.number().min(0).max(100),
|
||||
}),
|
||||
}),
|
||||
array: z.object({
|
||||
state: z.string(),
|
||||
capacity: z.object({
|
||||
disks: z.object({
|
||||
free: z.coerce.number(),
|
||||
total: z.coerce.number(),
|
||||
used: z.coerce.number(),
|
||||
}),
|
||||
}),
|
||||
disks: z.array(
|
||||
z.object({
|
||||
name: z.string(),
|
||||
size: z.number(),
|
||||
fsFree: z.number(),
|
||||
fsUsed: z.number(),
|
||||
status: z.string(),
|
||||
temp: z.number().nullish(),
|
||||
}),
|
||||
),
|
||||
}),
|
||||
info: z.object({
|
||||
devices: z.object({
|
||||
network: z.array(
|
||||
z.object({
|
||||
speed: z.number(),
|
||||
dhcp: z.boolean(),
|
||||
model: z.string(),
|
||||
}),
|
||||
),
|
||||
}),
|
||||
os: z.object({
|
||||
platform: z.string(),
|
||||
distro: z.string(),
|
||||
release: z.string(),
|
||||
uptime: z.coerce.date(),
|
||||
}),
|
||||
cpu: z.object({
|
||||
manufacturer: z.string(),
|
||||
brand: z.string(),
|
||||
cores: z.number(),
|
||||
threads: z.number(),
|
||||
}),
|
||||
memory: z.object({
|
||||
layout: z.array(
|
||||
z.object({
|
||||
size: z.number(),
|
||||
}),
|
||||
),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
export type UnraidSystemInfo = z.infer<typeof unraidSystemInfoSchema>;
|
||||
@@ -34,7 +34,7 @@
|
||||
"@homarr/ui": "workspace:^0.1.0",
|
||||
"@homarr/validation": "workspace:^0.1.0",
|
||||
"@mantine/core": "^8.3.10",
|
||||
"@tabler/icons-react": "^3.35.0",
|
||||
"@tabler/icons-react": "^3.36.0",
|
||||
"dayjs": "^1.11.19",
|
||||
"next": "16.1.1",
|
||||
"react": "19.2.3",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"dependencies": {
|
||||
"@homarr/ui": "workspace:^0.1.0",
|
||||
"@mantine/notifications": "^8.3.10",
|
||||
"@tabler/icons-react": "^3.35.0"
|
||||
"@tabler/icons-react": "^3.36.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"@mantine/core": "^8.3.10",
|
||||
"@mantine/hooks": "^8.3.10",
|
||||
"@mantine/spotlight": "^8.3.10",
|
||||
"@tabler/icons-react": "^3.35.0",
|
||||
"@tabler/icons-react": "^3.36.0",
|
||||
"jotai": "^2.16.1",
|
||||
"next": "16.1.1",
|
||||
"react": "19.2.3",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Group, Text, useMantineColorScheme } from "@mantine/core";
|
||||
import type { TablerIcon } from "@tabler/icons-react";
|
||||
import {
|
||||
IconBox,
|
||||
IconCategoryPlus,
|
||||
@@ -17,6 +16,7 @@ import { useSession } from "@homarr/auth/client";
|
||||
import { useModalAction } from "@homarr/modals";
|
||||
import { AddBoardModal, AddGroupModal, ImportBoardModal, InviteCreateModal } from "@homarr/modals-collection";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
import type { TablerIcon } from "@homarr/ui";
|
||||
|
||||
import { createGroup } from "../../lib/group";
|
||||
import type { inferSearchInteractionDefinition, SearchInteraction } from "../../lib/interaction";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Box, Group, Stack, Text } from "@mantine/core";
|
||||
import type { TablerIcon } from "@tabler/icons-react";
|
||||
import { IconCaretUpDown, IconSearch, IconSearchOff } from "@tabler/icons-react";
|
||||
|
||||
import type { RouterOutputs } from "@homarr/api";
|
||||
@@ -9,6 +8,7 @@ import { useSession } from "@homarr/auth/client";
|
||||
import { useSettings } from "@homarr/settings";
|
||||
import type { TranslationFunction } from "@homarr/translation";
|
||||
import { useI18n } from "@homarr/translation/client";
|
||||
import type { TablerIcon } from "@homarr/ui";
|
||||
|
||||
import { createGroup } from "../../lib/group";
|
||||
import type { inferSearchInteractionDefinition, SearchInteraction } from "../../lib/interaction";
|
||||
|
||||
@@ -1941,19 +1941,19 @@
|
||||
"description": "您的容器状态 (这个小部件只能用管理员权限添加)",
|
||||
"option": {
|
||||
"enableRowSorting": {
|
||||
"label": ""
|
||||
"label": "启用项目排序"
|
||||
},
|
||||
"defaultSort": {
|
||||
"label": "",
|
||||
"label": "默认排序列",
|
||||
"option": {
|
||||
"name": "",
|
||||
"state": "",
|
||||
"cpuUsage": "",
|
||||
"memoryUsage": ""
|
||||
"name": "名称",
|
||||
"state": "状态",
|
||||
"cpuUsage": "CPU 利用率",
|
||||
"memoryUsage": "内存占用率"
|
||||
}
|
||||
},
|
||||
"descendingDefaultSort": {
|
||||
"label": ""
|
||||
"label": "倒序"
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
@@ -2248,7 +2248,7 @@
|
||||
"unknown": "未知",
|
||||
"pending": "等待处理",
|
||||
"processing": "处理中",
|
||||
"requested": "",
|
||||
"requested": "已请求",
|
||||
"partiallyAvailable": "部分",
|
||||
"available": "可用",
|
||||
"blacklisted": "已列入黑名单",
|
||||
|
||||
@@ -1941,19 +1941,19 @@
|
||||
"description": "Estadísticas de tus contenedores (Este widget sólo puede ser añadido con privilegios de administrador)",
|
||||
"option": {
|
||||
"enableRowSorting": {
|
||||
"label": ""
|
||||
"label": "Habilitar ordenar elementos"
|
||||
},
|
||||
"defaultSort": {
|
||||
"label": "",
|
||||
"label": "Columna usada para ordenar por defecto",
|
||||
"option": {
|
||||
"name": "",
|
||||
"state": "",
|
||||
"cpuUsage": "",
|
||||
"memoryUsage": ""
|
||||
"name": "Nombre",
|
||||
"state": "Estado",
|
||||
"cpuUsage": "Uso de CPU",
|
||||
"memoryUsage": "Uso de memoria"
|
||||
}
|
||||
},
|
||||
"descendingDefaultSort": {
|
||||
"label": ""
|
||||
"label": "Invertir orden"
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"description": "Pour commencer, veuillez selectionner comment vous souhaitez configurer votre instance Homarr.",
|
||||
"action": {
|
||||
"scratch": "Partir de zéro",
|
||||
"importOldmarr": "Importer à partir d'Homarr avant la 1.0"
|
||||
"importOldmarr": "Importer depuis Homarr avant la 1.0"
|
||||
}
|
||||
},
|
||||
"import": {
|
||||
@@ -27,7 +27,7 @@
|
||||
"description": "Configurer le comportement d'importation"
|
||||
},
|
||||
"boardSelection": {
|
||||
"title": "{count} tableaux trouvés",
|
||||
"title": "Tableaux {count} trouvés",
|
||||
"description": "Choisissez tous les tableaux avec la taille que vous souhaitez importer",
|
||||
"action": {
|
||||
"selectAll": "Tout sélectionner",
|
||||
@@ -113,7 +113,7 @@
|
||||
"subtitle": "Bon retour parmi nous ! Veuillez entrer vos identifiants"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Rejoindre Homarr",
|
||||
"title": "Rejoignez Homarr",
|
||||
"subtitle": "Bienvenue sur Homarr! Veuillez créer votre compte",
|
||||
"description": "Vous avez été invité par {username}"
|
||||
},
|
||||
@@ -649,14 +649,14 @@
|
||||
"app": {
|
||||
"option": {
|
||||
"existing": {
|
||||
"title": "",
|
||||
"label": ""
|
||||
"title": "Existant",
|
||||
"label": "Sélectionner une application existante"
|
||||
},
|
||||
"new": {
|
||||
"title": "",
|
||||
"title": "Nouveau",
|
||||
"url": {
|
||||
"label": "",
|
||||
"description": ""
|
||||
"label": "Lien de l'application",
|
||||
"description": "Lien d'ouverture de l'application depuis le tableau de bord"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -676,9 +676,9 @@
|
||||
},
|
||||
"app": {
|
||||
"action": {
|
||||
"add": "",
|
||||
"remove": "",
|
||||
"select": ""
|
||||
"add": "Lier une application",
|
||||
"remove": "Délier",
|
||||
"select": "Sélectionnez une application à lier"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -709,7 +709,7 @@
|
||||
"description": "L'intégration \"{kind}\" peut être utilisée avec les moteurs de recherche. Cochez ceci pour configurer automatiquement le moteur de recherche."
|
||||
},
|
||||
"app": {
|
||||
"sectionTitle": ""
|
||||
"sectionTitle": "Application liée"
|
||||
},
|
||||
"createApp": {
|
||||
"label": "Créer une application",
|
||||
@@ -991,8 +991,8 @@
|
||||
"newLabel": "Nouvel ID d'installation"
|
||||
},
|
||||
"privateKey": {
|
||||
"label": "",
|
||||
"newLabel": ""
|
||||
"label": "Clé privée",
|
||||
"newLabel": "Nouvelle clé privée"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1044,14 +1044,14 @@
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"success": "",
|
||||
"success": "Succès",
|
||||
"beta": "Bêta",
|
||||
"error": "Erreur",
|
||||
"action": {
|
||||
"add": "Ajouter",
|
||||
"apply": "Appliquer",
|
||||
"backToOverview": "Retourner à l'aperçu",
|
||||
"change": "",
|
||||
"change": "Modifier",
|
||||
"create": "Créer",
|
||||
"createAnother": "Créer et recommencer",
|
||||
"edit": "Modifier",
|
||||
@@ -1174,8 +1174,8 @@
|
||||
},
|
||||
"unit": {
|
||||
"speed": {
|
||||
"kilometersPerHour": "",
|
||||
"milesPerHour": ""
|
||||
"kilometersPerHour": "km/h",
|
||||
"milesPerHour": "mph"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1190,7 +1190,7 @@
|
||||
"label": "Titre"
|
||||
},
|
||||
"customCssClasses": {
|
||||
"label": ""
|
||||
"label": "Classes Css personnalisées"
|
||||
},
|
||||
"borderColor": {
|
||||
"label": "Couleur de la bordure"
|
||||
@@ -1321,21 +1321,21 @@
|
||||
"label": "Activer la vérification du statut"
|
||||
},
|
||||
"layout": {
|
||||
"label": "",
|
||||
"label": "Mise en page",
|
||||
"option": {
|
||||
"row": "",
|
||||
"row-reverse": "",
|
||||
"column": "",
|
||||
"column-reverse": ""
|
||||
"row": "Horizontale",
|
||||
"row-reverse": "Horizontal (inversé)",
|
||||
"column": "Vertical",
|
||||
"column-reverse": "Vertical (inversé)"
|
||||
}
|
||||
},
|
||||
"descriptionDisplayMode": {
|
||||
"label": "",
|
||||
"description": "",
|
||||
"label": "Mode d'affichage de la description",
|
||||
"description": "Choisissez comment afficher la description de l'application",
|
||||
"option": {
|
||||
"normal": "",
|
||||
"tooltip": "",
|
||||
"hidden": ""
|
||||
"normal": "Au sein du widget",
|
||||
"tooltip": "Comme infobulle",
|
||||
"hidden": "Masquer"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1584,11 +1584,11 @@
|
||||
},
|
||||
"placeholder": "Commencer à écrire vos notes",
|
||||
"dismiss": {
|
||||
"title": "",
|
||||
"message": "",
|
||||
"title": "Abandonner les modifications ?",
|
||||
"message": "Vous avez des modifications non enregistrées dans votre bloc-notes. Êtes-vous sûr de vouloir les supprimer ?",
|
||||
"action": {
|
||||
"discard": "",
|
||||
"keepEditing": ""
|
||||
"discard": "Ignorer les modifications",
|
||||
"keepEditing": "Continuer les modifications"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1743,7 +1743,7 @@
|
||||
"name": "Calendrier",
|
||||
"description": "Afficher les événements de vos intégrations dans une vue calendrier pendant une certaine période de temps relative",
|
||||
"duration": {
|
||||
"allDay": ""
|
||||
"allDay": "Tous les jours"
|
||||
},
|
||||
"option": {
|
||||
"releaseType": {
|
||||
@@ -1780,7 +1780,7 @@
|
||||
"description": "Uniquement sur la météo actuelle"
|
||||
},
|
||||
"useImperialSpeed": {
|
||||
"label": ""
|
||||
"label": "Utiliser mph pour la vitesse du vent"
|
||||
},
|
||||
"location": {
|
||||
"label": "Lieu de la météo"
|
||||
@@ -1941,19 +1941,19 @@
|
||||
"description": "Statistiques de vos conteneurs (Ce widget ne peut être ajouté qu'avec les privilèges d'administrateur)",
|
||||
"option": {
|
||||
"enableRowSorting": {
|
||||
"label": ""
|
||||
"label": "Activer le tri des éléments"
|
||||
},
|
||||
"defaultSort": {
|
||||
"label": "",
|
||||
"label": "Colonne de tri par défaut",
|
||||
"option": {
|
||||
"name": "",
|
||||
"state": "",
|
||||
"cpuUsage": "",
|
||||
"memoryUsage": ""
|
||||
"name": "Nom",
|
||||
"state": "État",
|
||||
"cpuUsage": "Utilisation du CPU",
|
||||
"memoryUsage": "Utilisation mémoire"
|
||||
}
|
||||
},
|
||||
"descendingDefaultSort": {
|
||||
"label": ""
|
||||
"label": "Inverser le tri"
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
@@ -2036,21 +2036,21 @@
|
||||
"name": "Nom",
|
||||
"id": "Id",
|
||||
"metadata": {
|
||||
"title": "",
|
||||
"title": "Statistiques détaillées",
|
||||
"video": {
|
||||
"title": "",
|
||||
"resolution": ""
|
||||
"title": "Vidéo",
|
||||
"resolution": "Résolution"
|
||||
},
|
||||
"audio": {
|
||||
"title": "",
|
||||
"channelCount": "",
|
||||
"codec": ""
|
||||
"title": "Audio",
|
||||
"channelCount": "Canaux audio",
|
||||
"codec": "Codec audio"
|
||||
},
|
||||
"transcoding": {
|
||||
"title": "",
|
||||
"container": "",
|
||||
"title": "Transcodage",
|
||||
"container": "Conteneur",
|
||||
"resolution": "Résolution",
|
||||
"target": ""
|
||||
"target": "Codec cible"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2248,7 +2248,7 @@
|
||||
"unknown": "Inconnu",
|
||||
"pending": "En attente",
|
||||
"processing": "Traitement en cours",
|
||||
"requested": "",
|
||||
"requested": "En attente",
|
||||
"partiallyAvailable": "Partiel",
|
||||
"available": "Disponible",
|
||||
"blacklisted": "Sur la liste noire",
|
||||
@@ -2361,7 +2361,7 @@
|
||||
"label": "Nombre maximum de publications"
|
||||
},
|
||||
"hideDescription": {
|
||||
"label": ""
|
||||
"label": "Masquer la description"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2542,7 +2542,7 @@
|
||||
},
|
||||
"firewall": {
|
||||
"name": "Surveillance du pare-feu",
|
||||
"description": "",
|
||||
"description": "Affiche un résumé des pare-feu",
|
||||
"tab": {
|
||||
"system": "Système",
|
||||
"interfaces": "Interfaces"
|
||||
@@ -2556,16 +2556,16 @@
|
||||
"widget": {
|
||||
"fwname": "Nom",
|
||||
"version": "Version",
|
||||
"versiontitle": "",
|
||||
"cputitle": "",
|
||||
"memorytitle": "",
|
||||
"cpu": "",
|
||||
"memory": "",
|
||||
"versiontitle": "Versions",
|
||||
"cputitle": "Utilisation du CPU",
|
||||
"memorytitle": "Utilisation de la mémoire",
|
||||
"cpu": "CPU",
|
||||
"memory": "Mémoire",
|
||||
"interfaces": {
|
||||
"name": "",
|
||||
"trans": "",
|
||||
"recv": "",
|
||||
"title": ""
|
||||
"name": "nom",
|
||||
"trans": "Transmis",
|
||||
"recv": "Reçus",
|
||||
"title": "Interfaces réseau"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2576,37 +2576,37 @@
|
||||
"option": {}
|
||||
},
|
||||
"systemResources": {
|
||||
"name": "",
|
||||
"description": "",
|
||||
"name": "Ressources du système",
|
||||
"description": "CPU, Mémoire, Disque et autre utilisation matérielle de votre système",
|
||||
"option": {
|
||||
"hasShadow": {
|
||||
"label": ""
|
||||
"label": "Activer l'ombrage des cartes"
|
||||
},
|
||||
"visibleCharts": {
|
||||
"label": "",
|
||||
"description": "",
|
||||
"label": "Graphiques visibles",
|
||||
"description": "Sélectionnez les graphiques à afficher.",
|
||||
"option": {
|
||||
"cpu": "",
|
||||
"memory": "",
|
||||
"network": ""
|
||||
"cpu": "CPU",
|
||||
"memory": "Mémoire",
|
||||
"network": "Réseau"
|
||||
}
|
||||
},
|
||||
"labelDisplayMode": {
|
||||
"label": "",
|
||||
"label": "Mode d'affichage de l'étiquette",
|
||||
"option": {
|
||||
"textWithIcon": "",
|
||||
"text": "",
|
||||
"icon": "",
|
||||
"hidden": ""
|
||||
"textWithIcon": "Afficher le texte avec l'icône",
|
||||
"text": "Afficher uniquement le texte",
|
||||
"icon": "Afficher uniquement l'icône",
|
||||
"hidden": "Masquer l'étiquette"
|
||||
}
|
||||
}
|
||||
},
|
||||
"card": {
|
||||
"cpu": "",
|
||||
"memory": "",
|
||||
"network": "",
|
||||
"up": "",
|
||||
"down": ""
|
||||
"cpu": "CPU",
|
||||
"memory": "RAM",
|
||||
"network": "NET",
|
||||
"up": "UP",
|
||||
"down": "HORS SERVICE"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3030,8 +3030,8 @@
|
||||
"integration": "Intégrations",
|
||||
"app": "Applications",
|
||||
"group": "Groupes",
|
||||
"searchEngine": "",
|
||||
"media": ""
|
||||
"searchEngine": "Moteurs de recherche",
|
||||
"media": "Médias"
|
||||
},
|
||||
"statisticLabel": {
|
||||
"boards": "Tableaux de bord",
|
||||
@@ -3040,8 +3040,8 @@
|
||||
"authorization": "Autorisation"
|
||||
},
|
||||
"heroBanner": {
|
||||
"title": "",
|
||||
"subtitle": ""
|
||||
"title": "Bienvenue sur votre",
|
||||
"subtitle": "Tableau {app}"
|
||||
}
|
||||
},
|
||||
"board": {
|
||||
@@ -3387,19 +3387,19 @@
|
||||
"label": "Conteneurs Docker"
|
||||
},
|
||||
"firewallCpu": {
|
||||
"label": ""
|
||||
"label": "Processeur du pare-feu"
|
||||
},
|
||||
"firewallMemory": {
|
||||
"label": ""
|
||||
"label": "Mémoire du pare-feu"
|
||||
},
|
||||
"firewallVersion": {
|
||||
"label": ""
|
||||
"label": "Version du pare-feu"
|
||||
},
|
||||
"firewallInterfaces": {
|
||||
"label": ""
|
||||
"label": "Interfaces du pare-feu"
|
||||
},
|
||||
"weather": {
|
||||
"label": ""
|
||||
"label": "Météo"
|
||||
}
|
||||
},
|
||||
"interval": {
|
||||
@@ -3410,10 +3410,10 @@
|
||||
"weeklyMonday": "Chaque semaine le lundi",
|
||||
"update": {
|
||||
"success": {
|
||||
"message": ""
|
||||
"message": "Intervalle mis à jour avec succès"
|
||||
},
|
||||
"error": {
|
||||
"message": ""
|
||||
"message": "L'intervalle de mise à jour a échoué"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3422,55 +3422,55 @@
|
||||
},
|
||||
"field": {
|
||||
"name": {
|
||||
"label": ""
|
||||
"label": "Nom"
|
||||
},
|
||||
"interval": {
|
||||
"label": "Intervalle de planification"
|
||||
},
|
||||
"lastExecution": {
|
||||
"label": ""
|
||||
"label": "Dernière exécution"
|
||||
},
|
||||
"actions": {
|
||||
"label": ""
|
||||
"label": "Actions"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"search": ""
|
||||
"search": "Rechercher des tâches {count}..."
|
||||
},
|
||||
"action": {
|
||||
"refresh": {
|
||||
"label": ""
|
||||
"label": "Rafraîchir"
|
||||
}
|
||||
},
|
||||
"refresh": {
|
||||
"success": {
|
||||
"message": ""
|
||||
"message": "Tâches actualisées avec succès"
|
||||
},
|
||||
"error": {
|
||||
"message": ""
|
||||
"message": "Échec de l'actualisation des tâches"
|
||||
}
|
||||
},
|
||||
"trigger": {
|
||||
"success": {
|
||||
"message": ""
|
||||
"message": "Tâche déclenchée avec succès"
|
||||
},
|
||||
"error": {
|
||||
"message": ""
|
||||
"message": "Échec du déclenchement de la tâche"
|
||||
}
|
||||
},
|
||||
"enable": {
|
||||
"success": {
|
||||
"message": ""
|
||||
"message": "Tâche activée avec succès"
|
||||
}
|
||||
},
|
||||
"disable": {
|
||||
"success": {
|
||||
"message": ""
|
||||
"message": "Tâche désactivée avec succès"
|
||||
}
|
||||
},
|
||||
"toggle": {
|
||||
"error": {
|
||||
"message": ""
|
||||
"message": "Impossible de basculer le statut de la tâche"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3527,19 +3527,19 @@
|
||||
"subtitle": "{count} utilisés dans le Code d'Homarr"
|
||||
},
|
||||
"hotkeys": {
|
||||
"title": "",
|
||||
"subtitle": "",
|
||||
"title": "Raccourcis clavier",
|
||||
"subtitle": "Raccourcis clavier pour améliorer votre flux de travail",
|
||||
"field": {
|
||||
"shortcut": "",
|
||||
"action": ""
|
||||
"shortcut": "Raccourci",
|
||||
"action": "Action"
|
||||
},
|
||||
"action": {
|
||||
"toggleBoardEdit": "",
|
||||
"toggleColorScheme": "",
|
||||
"saveNotebook": "",
|
||||
"openSpotlight": ""
|
||||
"toggleBoardEdit": "Activer/désactiver le mode d'édition du tableau",
|
||||
"toggleColorScheme": "Basculer en mode clair/sombre",
|
||||
"saveNotebook": "Enregistrer le bloc-notes (uniquement à l'intérieur du widget notebook)",
|
||||
"openSpotlight": "Ouvrir la recherche"
|
||||
},
|
||||
"note": ""
|
||||
"note": "Astuce : Mod correspond à la touche Ctrl ou ⌘ sur macOS"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3995,7 +3995,7 @@
|
||||
"tools": {
|
||||
"label": "Outils",
|
||||
"tasks": {
|
||||
"label": ""
|
||||
"label": "Tâches"
|
||||
},
|
||||
"docker": {
|
||||
"label": "Docker"
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -177,8 +177,8 @@
|
||||
}
|
||||
},
|
||||
"forgotPassword": {
|
||||
"label": "",
|
||||
"description": ""
|
||||
"label": "Ste pozabili geslo?",
|
||||
"description": "Administrator lahko zažene ukaz:"
|
||||
}
|
||||
},
|
||||
"register": {
|
||||
@@ -622,7 +622,7 @@
|
||||
"description": "",
|
||||
"action": ""
|
||||
},
|
||||
"add": ""
|
||||
"add": "Dodaj aplikacijo"
|
||||
}
|
||||
},
|
||||
"integration": {
|
||||
@@ -1059,10 +1059,10 @@
|
||||
"insert": "Vstavite",
|
||||
"remove": "Odstrani",
|
||||
"save": "Shrani",
|
||||
"saveChanges": "Shranjevanje sprememb",
|
||||
"saveChanges": "Shrani spremembe",
|
||||
"cancel": "Prekliči",
|
||||
"delete": "Izbriši",
|
||||
"discard": "",
|
||||
"discard": "Zapusti",
|
||||
"close": "",
|
||||
"confirm": "Potrdi",
|
||||
"continue": "",
|
||||
@@ -1125,13 +1125,13 @@
|
||||
"userAvatar": {
|
||||
"menu": {
|
||||
"switchToDarkMode": "",
|
||||
"switchToLightMode": "",
|
||||
"management": "",
|
||||
"preferences": "Vaše želje",
|
||||
"logout": "",
|
||||
"switchToLightMode": "Svetli način",
|
||||
"management": "Nastavitve",
|
||||
"preferences": "Prilagoditev",
|
||||
"logout": "Odjava",
|
||||
"login": "Prijava",
|
||||
"homeBoard": "",
|
||||
"loggedOut": "",
|
||||
"homeBoard": "Vaša nadzorna plošča",
|
||||
"loggedOut": "Odjava uspešna",
|
||||
"updateAvailable": ""
|
||||
}
|
||||
},
|
||||
@@ -1182,7 +1182,7 @@
|
||||
"section": {
|
||||
"dynamic": {
|
||||
"action": {
|
||||
"create": "",
|
||||
"create": "Nova dinamična vsebina",
|
||||
"remove": ""
|
||||
},
|
||||
"option": {
|
||||
@@ -1208,7 +1208,7 @@
|
||||
}
|
||||
},
|
||||
"action": {
|
||||
"create": "",
|
||||
"create": "Nova kategorija",
|
||||
"edit": "",
|
||||
"remove": "",
|
||||
"moveUp": "Premaknite se navzgor",
|
||||
@@ -1243,12 +1243,12 @@
|
||||
},
|
||||
"item": {
|
||||
"action": {
|
||||
"create": "",
|
||||
"create": "Nova vsebina",
|
||||
"import": "",
|
||||
"edit": "",
|
||||
"moveResize": "",
|
||||
"duplicate": "",
|
||||
"remove": ""
|
||||
"edit": "Uredi gradnik",
|
||||
"moveResize": "Premakni/spremeni",
|
||||
"duplicate": "Podvoji",
|
||||
"remove": "Izbriši"
|
||||
},
|
||||
"menu": {
|
||||
"label": {
|
||||
@@ -2638,8 +2638,8 @@
|
||||
"edit": {
|
||||
"notification": {
|
||||
"success": {
|
||||
"title": "",
|
||||
"message": ""
|
||||
"title": "Spremembe so uveljavljene",
|
||||
"message": "Vsebina je bila uspšeno shranjena"
|
||||
},
|
||||
"error": {
|
||||
"title": "",
|
||||
@@ -2647,8 +2647,8 @@
|
||||
}
|
||||
},
|
||||
"confirmLeave": {
|
||||
"title": "",
|
||||
"message": ""
|
||||
"title": "Neshranjene spremembe",
|
||||
"message": "Vsebina ni shranjena, želite nadaljevati?"
|
||||
}
|
||||
},
|
||||
"oldImport": {
|
||||
@@ -2716,16 +2716,16 @@
|
||||
},
|
||||
"field": {
|
||||
"pageTitle": {
|
||||
"label": ""
|
||||
"label": "Naslov strani"
|
||||
},
|
||||
"metaTitle": {
|
||||
"label": ""
|
||||
"label": "Meta naslov"
|
||||
},
|
||||
"logoImageUrl": {
|
||||
"label": ""
|
||||
"label": "URL logotipa"
|
||||
},
|
||||
"faviconImageUrl": {
|
||||
"label": ""
|
||||
"label": "URL ikone"
|
||||
},
|
||||
"backgroundImageUrl": {
|
||||
"label": "",
|
||||
@@ -2835,7 +2835,7 @@
|
||||
"metaTitle": ""
|
||||
},
|
||||
"setting": {
|
||||
"title": "",
|
||||
"title": "Nastavitve za {boardName} nadzorno ploščo",
|
||||
"section": {
|
||||
"general": {
|
||||
"title": "Splošno",
|
||||
@@ -2844,9 +2844,9 @@
|
||||
"layout": {
|
||||
"title": "Postavitev",
|
||||
"responsive": {
|
||||
"title": "",
|
||||
"title": "Predloga",
|
||||
"action": {
|
||||
"add": ""
|
||||
"add": "Dodaj predlogo"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2959,14 +2959,14 @@
|
||||
"layout": {
|
||||
"field": {
|
||||
"name": {
|
||||
"label": ""
|
||||
"label": "Ime"
|
||||
},
|
||||
"columnCount": {
|
||||
"label": ""
|
||||
"label": "Število stolpcev"
|
||||
},
|
||||
"breakpoint": {
|
||||
"label": "",
|
||||
"description": ""
|
||||
"label": "Prekinitvene točke",
|
||||
"description": "Postavitev bo uporabljena na vseh zaslonih, večjih od te prelomne točke, do naslednje večje prelomne točke."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -4046,7 +4046,7 @@
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "",
|
||||
"placeholder": "Iskanje vsebine",
|
||||
"nothingFound": "",
|
||||
"error": {
|
||||
"fetch": ""
|
||||
|
||||
@@ -3,4 +3,5 @@ import type { Icon123, IconProps } from "@tabler/icons-react";
|
||||
export * from "./src";
|
||||
|
||||
export type TablerIcon = typeof Icon123;
|
||||
|
||||
export type TablerIconProps = IconProps;
|
||||
@@ -32,7 +32,7 @@
|
||||
"@mantine/core": "^8.3.10",
|
||||
"@mantine/dates": "^8.3.10",
|
||||
"@mantine/hooks": "^8.3.10",
|
||||
"@tabler/icons-react": "^3.35.0",
|
||||
"@tabler/icons-react": "^3.36.0",
|
||||
"mantine-react-table": "2.0.0-beta.9",
|
||||
"next": "16.1.1",
|
||||
"react": "19.2.3",
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
"@mantine/charts": "^8.3.10",
|
||||
"@mantine/core": "^8.3.10",
|
||||
"@mantine/hooks": "^8.3.10",
|
||||
"@tabler/icons-react": "^3.35.0",
|
||||
"@tabler/icons-react": "^3.36.0",
|
||||
"@tiptap/extension-color": "3.14.0",
|
||||
"@tiptap/extension-highlight": "3.14.0",
|
||||
"@tiptap/extension-image": "3.14.0",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { TablerIcon } from "@tabler/icons-react";
|
||||
|
||||
import type { stringOrTranslation } from "@homarr/translation";
|
||||
import type { TablerIcon } from "@homarr/ui";
|
||||
|
||||
export abstract class ErrorBoundaryError extends Error {
|
||||
public abstract getErrorBoundaryData(): {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { Center, Divider, Group, Pagination, SegmentedControl, Stack, Text } from "@mantine/core";
|
||||
import type { TablerIcon } from "@tabler/icons-react";
|
||||
import { IconClipboardList, IconCpu2, IconReportAnalytics } from "@tabler/icons-react";
|
||||
|
||||
import { clientApi } from "@homarr/api/client";
|
||||
import { useI18n } from "@homarr/translation/client";
|
||||
import type { TablerIcon } from "@homarr/ui";
|
||||
|
||||
import { views } from ".";
|
||||
import type { WidgetComponentProps } from "../definition";
|
||||
|
||||
@@ -47,7 +47,7 @@ export const SystemResourceMemoryChart = ({
|
||||
return (
|
||||
<Paper px={3} py={2} withBorder shadow="md" radius="md">
|
||||
<Text c="dimmed" size="xs">
|
||||
{humanFileSize(value)} / {humanFileSize(totalCapacityInBytes)} (
|
||||
{humanFileSize(Math.round(value))} / {humanFileSize(totalCapacityInBytes)} (
|
||||
{Math.round((value / totalCapacityInBytes) * 100)}%)
|
||||
</Text>
|
||||
</Paper>
|
||||
|
||||
@@ -22,6 +22,7 @@ export default function SystemResources({ integrationIds, options }: WidgetCompo
|
||||
});
|
||||
const memoryCapacityInBytes =
|
||||
(data[0]?.healthInfo.memAvailableInBytes ?? 0) + (data[0]?.healthInfo.memUsedInBytes ?? 0);
|
||||
|
||||
const [items, setItems] = useState<{ cpu: number; memory: number; network: { up: number; down: number } | null }[]>(
|
||||
data.map((item) => ({
|
||||
cpu: item.healthInfo.cpuUtilization,
|
||||
|
||||
@@ -14,7 +14,7 @@ const labelDisplayModeOptions = {
|
||||
|
||||
export const { definition, componentLoader } = createWidgetDefinition("systemResources", {
|
||||
icon: IconGraphFilled,
|
||||
supportedIntegrations: ["dashDot", "openmediavault", "truenas"],
|
||||
supportedIntegrations: ["dashDot", "openmediavault", "truenas", "unraid"],
|
||||
createOptions() {
|
||||
return optionsBuilder.from((factory) => ({
|
||||
hasShadow: factory.switch({ defaultValue: true }),
|
||||
|
||||
Reference in new issue
Block a user