chore(release): automatic release v0.1.0

This commit is contained in:
homarr-releases[bot]
2024-12-13 19:13:52 +00:00
committed by GitHub
71 changed files with 1390 additions and 698 deletions

View File

@@ -4,9 +4,9 @@ on:
types: [opened, synchronize]
jobs:
approve-renovate-prs:
approve-automatic-prs:
runs-on: ubuntu-latest
if: github.actor_id == 158783068 # Id of renovate bot see https://api.github.com/users/homarr-renovate%5Bbot%5D
if: github.actor_id == 158783068 || github.actor_id == 190541745 # Id of renovate bot and crowdin bot see https://api.github.com/users/homarr-renovate%5Bbot%5D and https://api.github.com/users/homarr-crowdin%5Bbot%5D
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -18,7 +18,7 @@ jobs:
app_id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
- name: Install GitHub CLI
run: sudo apt-get install -y gh
- name: Approve Renovate PRs
- name: Approve automatic PRs
env:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
run: |

View File

@@ -21,6 +21,7 @@ jobs:
app_id: ${{ secrets.CROWDIN_APP_ID }}
- name: Download Crowdin translations
id: crowdin-download
uses: crowdin/github-action@v2
with:
upload_sources: false
@@ -30,6 +31,7 @@ jobs:
create_pull_request: true
pull_request_title: "chore(lang): updated translations from crowdin"
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)"
commit_message: "chore(lang): update translations from crowdin"
pull_request_base_branch_name: "dev"
github_user_name: "Crowdin Homarr"
github_user_email: "190541745+homarr-crowdin[bot]@users.noreply.github.com"
@@ -38,3 +40,9 @@ jobs:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- name: Enable auto-merge
env:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
run: |
gh pr merge ${{steps.crowdin-download.pull_request_number}} --auto --merge --squash --delete-branch --title "chore(lang): updated translations from crowdin"

View File

@@ -14,6 +14,11 @@
"gridstack",
"homarr",
"jellyfin",
"llen",
"lpop",
"lpush",
"lrange",
"ltrim",
"mantine",
"manuel-rw",
"Meierschlumpf",

View File

@@ -37,17 +37,17 @@
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@homarr/widgets": "workspace:^0.1.0",
"@mantine/colors-generator": "^7.14.3",
"@mantine/core": "^7.14.3",
"@mantine/hooks": "^7.14.3",
"@mantine/modals": "^7.14.3",
"@mantine/tiptap": "^7.14.3",
"@million/lint": "1.0.13",
"@mantine/colors-generator": "^7.15.1",
"@mantine/core": "^7.15.1",
"@mantine/hooks": "^7.15.1",
"@mantine/modals": "^7.15.1",
"@mantine/tiptap": "^7.15.1",
"@million/lint": "1.0.14",
"@t3-oss/env-nextjs": "^0.11.1",
"@tabler/icons-react": "^3.24.0",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-query-devtools": "^5.62.3",
"@tanstack/react-query-next-experimental": "5.62.3",
"@tanstack/react-query": "^5.62.7",
"@tanstack/react-query-devtools": "^5.62.7",
"@tanstack/react-query-next-experimental": "5.62.7",
"@trpc/client": "next",
"@trpc/next": "next",
"@trpc/react-query": "next",
@@ -66,11 +66,11 @@
"next": "^14.2.20",
"postcss-preset-mantine": "^1.17.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-error-boundary": "^4.1.2",
"react-simple-code-editor": "^0.14.1",
"sass": "^1.82.0",
"sass": "^1.83.0",
"superjson": "2.2.2",
"swagger-ui-react": "^5.18.2",
"use-deep-compare-effect": "^1.8.1"
@@ -80,10 +80,10 @@
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/chroma-js": "2.4.4",
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
"@types/prismjs": "^1.26.5",
"@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@types/swagger-ui-react": "^4.18.3",
"concurrently": "^9.1.0",
"eslint": "^9.16.0",

View File

@@ -1,4 +1,4 @@
import type { PropsWithChildren } from "react";
import type { JSX, PropsWithChildren } from "react";
import { notFound } from "next/navigation";
import { AppShellMain } from "@mantine/core";
import { TRPCError } from "@trpc/server";

View File

@@ -13,7 +13,7 @@ import classes from "./terminal.module.css";
export const TerminalComponent = () => {
const ref = useRef<HTMLDivElement>(null);
const terminalRef = useRef<Terminal>();
const terminalRef = useRef<Terminal>(null);
clientApi.log.subscribe.useSubscription(undefined, {
onData(data) {
terminalRef.current?.writeln(`${data.timestamp} ${data.level} ${data.message}`);

View File

@@ -149,6 +149,9 @@ const fileToBase64Async = async (file: File): Promise<string> =>
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
// The functionality below works as expected and doesn't result in [object Object].
// eslint-disable-next-line @typescript-eslint/no-base-to-string
reader.onload = () => resolve(reader.result?.toString() ?? "");
reader.onerror = reject;
});

View File

@@ -17,7 +17,7 @@ interface Props extends BoxProps {
height: number;
minWidth?: number;
minHeight?: number;
innerRef: React.RefObject<GridItemHTMLElement> | undefined;
innerRef: React.RefObject<GridItemHTMLElement | null> | undefined;
}
export const GridStackItem = ({

View File

@@ -1,4 +1,4 @@
import type { MutableRefObject, RefObject } from "react";
import type { RefObject } from "react";
import type { GridItemHTMLElement } from "@homarr/gridstack";
import { GridStack } from "@homarr/gridstack";
@@ -9,9 +9,9 @@ interface InitializeGridstackProps {
section: Omit<Section, "items">;
itemIds: string[];
refs: {
wrapper: RefObject<HTMLDivElement>;
items: MutableRefObject<Record<string, RefObject<GridItemHTMLElement>>>;
gridstack: MutableRefObject<GridStack | undefined>;
wrapper: RefObject<HTMLDivElement | null>;
items: RefObject<Record<string, RefObject<GridItemHTMLElement | null>>>;
gridstack: RefObject<GridStack | null>;
};
sectionColumnCount: number;
}

View File

@@ -1,4 +1,4 @@
import type { MutableRefObject, RefObject } from "react";
import type { RefObject } from "react";
import { createRef, useCallback, useEffect, useRef } from "react";
import { useElementSize } from "@mantine/hooks";
@@ -11,9 +11,9 @@ import { useSectionActions } from "../section-actions";
import { initializeGridstack } from "./init-gridstack";
export interface UseGridstackRefs {
wrapper: RefObject<HTMLDivElement>;
items: MutableRefObject<Record<string, RefObject<GridItemHTMLElement>>>;
gridstack: MutableRefObject<GridStack | undefined>;
wrapper: RefObject<HTMLDivElement | null>;
items: RefObject<Record<string, RefObject<GridItemHTMLElement | null>>>;
gridstack: RefObject<GridStack | null>;
}
interface UseGristackReturnType {
@@ -60,9 +60,9 @@ export const useGridstack = (section: Omit<Section, "items">, itemIds: string[])
// define reference for wrapper - is used to calculate the width of the wrapper
const { ref: wrapperRef, width, height } = useElementSize<HTMLDivElement>();
// references to the diffrent items contained in the gridstack
const itemRefs = useRef<Record<string, RefObject<GridItemHTMLElement>>>({});
const itemRefs = useRef<Record<string, RefObject<GridItemHTMLElement | null>>>({});
// reference of the gridstack object for modifications after initialization
const gridRef = useRef<GridStack>();
const gridRef = useRef<GridStack>(null);
const board = useRequiredBoard();

View File

@@ -1,3 +1,4 @@
import type { JSX } from "react";
import { AppShellNavbar, AppShellSection, ScrollArea } from "@mantine/core";
import type { TablerIcon } from "@homarr/ui";

View File

@@ -13,5 +13,5 @@
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": [".", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules", ".next"]
}

View File

@@ -44,7 +44,7 @@
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
"dotenv-cli": "^7.4.4",
"eslint": "^9.16.0",
"prettier": "^3.4.2",

View File

@@ -1,10 +1,3 @@
files:
- source: /packages/translation/src/lang/en.json
translation: /packages/translation/src/lang/%two_letters_code%.json
# Title of pull request and so the commit that will be used for squashed merge commit
pull_request_title: "chore(lang): updated translations from crowdin"
# Custom commit message that is not only appended
commit_message: "chore(lang): update translations %original_file_name% from crowdin [skip ci]"
append_commit_message: false

View File

@@ -49,6 +49,7 @@
"pnpm": {
"patchedDependencies": {
"pretty-print-error": "patches/pretty-print-error.patch"
}
},
"allowNonAppliedPatches": true
}
}

View File

@@ -41,7 +41,7 @@
"@trpc/server": "next",
"dockerode": "^4.0.2",
"next": "^14.2.20",
"react": "^18.3.1",
"react": "^19.0.0",
"superjson": "2.2.2",
"trpc-to-openapi": "^2.1.0"
},

View File

@@ -1,5 +1,6 @@
import { observable } from "@trpc/server/observable";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import type { HealthMonitoring } from "@homarr/integrations";
import { systemInfoRequestHandler } from "@homarr/request-handler/health-monitoring";
@@ -8,7 +9,7 @@ import { createTRPCRouter, publicProcedure } from "../../trpc";
export const healthMonitoringRouter = createTRPCRouter({
getHealthStatus: publicProcedure
.unstable_concat(createManyIntegrationMiddleware("query", "openmediavault"))
.unstable_concat(createManyIntegrationMiddleware("query", ...getIntegrationKindsByCategory("healthMonitoring")))
.query(async ({ ctx }) => {
return await Promise.all(
ctx.integrations.map(async (integration) => {
@@ -26,7 +27,7 @@ export const healthMonitoringRouter = createTRPCRouter({
}),
subscribeHealthStatus: publicProcedure
.unstable_concat(createManyIntegrationMiddleware("query", "openmediavault"))
.unstable_concat(createManyIntegrationMiddleware("query", ...getIntegrationKindsByCategory("healthMonitoring")))
.subscription(({ ctx }) => {
return observable<{ integrationId: string; healthInfo: HealthMonitoring; timestamp: Date }>((emit) => {
const unsubscribes: (() => void)[] = [];

View File

@@ -36,8 +36,8 @@
"ldapts": "7.2.2",
"next": "^14.2.20",
"next-auth": "5.0.0-beta.25",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -28,8 +28,8 @@
"@homarr/log": "workspace:^0.1.0",
"dayjs": "^1.11.13",
"next": "^14.2.20",
"react": "^18.3.1",
"tldts": "^6.1.65"
"react": "^19.0.0",
"tldts": "^6.1.67"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -43,11 +43,11 @@
"@homarr/server-settings": "workspace:^0.1.0",
"@paralleldrive/cuid2": "^2.2.2",
"@testcontainers/mysql": "^10.16.0",
"better-sqlite3": "^11.6.0",
"better-sqlite3": "^11.7.0",
"dotenv": "^16.4.7",
"drizzle-kit": "^0.29.1",
"drizzle-orm": "^0.37.0",
"drizzle-zod": "^0.5.1",
"drizzle-kit": "^0.30.1",
"drizzle-orm": "^0.38.1",
"drizzle-zod": "^0.6.0",
"mysql2": "3.11.5"
},
"devDependencies": {

View File

@@ -41,11 +41,13 @@ export type HomarrDocumentationPath =
| "/docs/tags/advanced"
| "/docs/tags/analytics"
| "/docs/tags/api"
| "/docs/tags/apps"
| "/docs/tags/banner"
| "/docs/tags/blocking"
| "/docs/tags/board"
| "/docs/tags/boards"
| "/docs/tags/bookmark"
| "/docs/tags/bookmarks"
| "/docs/tags/caddy"
| "/docs/tags/checklist"
| "/docs/tags/code"
@@ -91,6 +93,7 @@ export type HomarrDocumentationPath =
| "/docs/tags/overseerr"
| "/docs/tags/permissions"
| "/docs/tags/pi-hole"
| "/docs/tags/ping"
| "/docs/tags/preferences"
| "/docs/tags/programming"
| "/docs/tags/proxmox"
@@ -128,6 +131,7 @@ export type HomarrDocumentationPath =
| "/docs/advanced/customizations/user-preferences"
| "/docs/advanced/sso"
| "/docs/category/advanced"
| "/docs/category/developer-guide"
| "/docs/category/getting-started"
| "/docs/category/installation"
| "/docs/category/installation-1"
@@ -135,17 +139,18 @@ export type HomarrDocumentationPath =
| "/docs/category/management"
| "/docs/category/more"
| "/docs/category/widgets"
| "/docs/community/developer-guides"
| "/docs/community/donate"
| "/docs/community/faq"
| "/docs/community/get-in-touch"
| "/docs/community/license"
| "/docs/community/translations"
| "/docs/development/getting-started"
| "/docs/getting-started"
| "/docs/getting-started/after-the-installation"
| "/docs/getting-started/glossary"
| "/docs/getting-started/installation/docker"
| "/docs/getting-started/installation/easy-panel"
| "/docs/getting-started/installation/helm"
| "/docs/getting-started/installation/home-assistant"
| "/docs/getting-started/installation/kubernetes"
| "/docs/getting-started/installation/portainer"
@@ -164,6 +169,7 @@ export type HomarrDocumentationPath =
| "/docs/integrations/torrent"
| "/docs/integrations/usenet"
| "/docs/management/api"
| "/docs/management/apps"
| "/docs/management/boards"
| "/docs/management/integrations"
| "/docs/management/search-engines"

View File

@@ -144,6 +144,13 @@ export const integrationDefs = {
category: ["healthMonitoring"],
supportsSearch: false,
},
dashDot: {
name: "Dash.",
secretKinds: [[]],
category: ["healthMonitoring"],
iconUrl: "https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/dashdot.png",
supportsSearch: false,
},
} as const satisfies Record<string, integrationDefinition>;
export const integrationKinds = objectKeys(integrationDefs) as AtLeastOneOf<IntegrationKind>;

View File

@@ -24,7 +24,7 @@
"dependencies": {
"@homarr/translation": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/form": "^7.14.3"
"@mantine/form": "^7.15.1"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -4,6 +4,7 @@ import type { Integration as DbIntegration } from "@homarr/db/schema/sqlite";
import type { IntegrationKind, IntegrationSecretKind } from "@homarr/definitions";
import { AdGuardHomeIntegration } from "../adguard-home/adguard-home-integration";
import { DashDotIntegration } from "../dashdot/dashdot-integration";
import { DelugeIntegration } from "../download-client/deluge/deluge-integration";
import { NzbGetIntegration } from "../download-client/nzbget/nzbget-integration";
import { QBitTorrentIntegration } from "../download-client/qbittorrent/qbittorrent-integration";
@@ -68,4 +69,5 @@ export const integrationCreators = {
openmediavault: OpenMediaVaultIntegration,
lidarr: LidarrIntegration,
readarr: ReadarrIntegration,
dashDot: DashDotIntegration,
} satisfies Record<IntegrationKind, new (integration: IntegrationInput) => Integration>;

View File

@@ -0,0 +1,148 @@
import { humanFileSize } from "@homarr/common";
import "@homarr/redis";
import dayjs from "dayjs";
import { z } from "@homarr/validation";
import { createChannelEventHistory } from "../../../redis/src/lib/channel";
import { Integration } from "../base/integration";
import type { HealthMonitoring } from "../types";
export class DashDotIntegration extends Integration {
public async testConnectionAsync(): Promise<void> {
const response = await fetch(this.url("/info"));
await response.json();
}
public async getSystemInfoAsync(): Promise<HealthMonitoring> {
const info = await this.getInfoAsync();
const cpuLoad = await this.getCurrentCpuLoadAsync();
const memoryLoad = await this.getCurrentMemoryLoadAsync();
const storageLoad = await this.getCurrentStorageLoadAsync();
const channel = this.getChannel();
const history = await channel.getSliceUntilTimeAsync(dayjs().subtract(15, "minutes").toDate());
return {
cpuUtilization: cpuLoad.sumLoad,
memUsed: `${memoryLoad.loadInBytes}`,
memAvailable: `${info.maxAvailableMemoryBytes - memoryLoad.loadInBytes}`,
fileSystem: info.storage.map((storage, index) => ({
deviceName: `Storage ${index + 1}: (${storage.disks.map((disk) => disk.device).join(", ")})`,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
used: humanFileSize(storageLoad[index]!),
available: `${storage.size}`,
percentage: storageLoad[index] ? (storageLoad[index] / storage.size) * 100 : 0,
})),
cpuModelName: info.cpuModel === "" ? `Unknown Model (${info.cpuBrand})` : `${info.cpuModel} (${info.cpuBrand})`,
cpuTemp: cpuLoad.averageTemperature,
availablePkgUpdates: 0,
rebootRequired: false,
smart: [],
uptime: info.uptime,
version: `${info.operatingSystemVersion}`,
loadAverage: {
"1min": Math.round(this.getAverageOfCpu(history[0])),
"5min": Math.round(this.getAverageOfCpuFlat(history.slice(0, 4))),
"15min": Math.round(this.getAverageOfCpuFlat(history.slice(0, 14))),
},
};
}
private async getInfoAsync() {
const infoResponse = await fetch(this.url("/info"));
const serverInfo = await internalServerInfoApi.parseAsync(await infoResponse.json());
return {
maxAvailableMemoryBytes: serverInfo.ram.size,
storage: serverInfo.storage,
cpuBrand: serverInfo.cpu.brand,
cpuModel: serverInfo.cpu.model,
operatingSystemVersion: `${serverInfo.os.distro} ${serverInfo.os.release} (${serverInfo.os.kernel})`,
uptime: serverInfo.os.uptime,
};
}
private async getCurrentCpuLoadAsync() {
const channel = this.getChannel();
const cpu = await fetch(this.url("/load/cpu"));
const data = await cpuLoadPerCoreApiList.parseAsync(await cpu.json());
await channel.pushAsync(data);
return {
sumLoad: this.getAverageOfCpu(data),
averageTemperature: data.reduce((acc, current) => acc + current.temp, 0) / data.length,
};
}
private getAverageOfCpuFlat(cpuLoad: z.infer<typeof cpuLoadPerCoreApiList>[]) {
const averages = cpuLoad.map((load) => this.getAverageOfCpu(load));
return averages.reduce((acc, current) => acc + current, 0) / averages.length;
}
private getAverageOfCpu(cpuLoad?: z.infer<typeof cpuLoadPerCoreApiList>) {
if (!cpuLoad) {
return 0;
}
return cpuLoad.reduce((acc, current) => acc + current.load, 0) / cpuLoad.length;
}
private async getCurrentStorageLoadAsync() {
const storageLoad = await fetch(this.url("/load/storage"));
return (await storageLoad.json()) as number[];
}
private async getCurrentMemoryLoadAsync() {
const memoryLoad = await fetch(this.url("/load/ram"));
const data = await memoryLoadApi.parseAsync(await memoryLoad.json());
return {
loadInBytes: data.load,
};
}
private getChannel() {
return createChannelEventHistory<z.infer<typeof cpuLoadPerCoreApiList>>(
`integration:${this.integration.id}:history:cpu`,
100,
);
}
}
const cpuLoadPerCoreApi = z.object({
load: z.number().min(0),
temp: z.number().min(0),
});
const memoryLoadApi = z.object({
load: z.number().min(0),
});
const internalServerInfoApi = z.object({
os: z.object({
distro: z.string(),
kernel: z.string(),
release: z.string(),
uptime: z.number().min(0),
}),
cpu: z.object({
brand: z.string(),
model: z.string(),
}),
ram: z.object({
size: z.number().min(0),
}),
storage: z.array(
z.object({
size: z.number().min(0),
disks: z.array(
z.object({
device: z.string(),
brand: z.string(),
type: z.string(),
}),
),
}),
),
});
const cpuLoadPerCoreApiList = z.array(cpuLoadPerCoreApi);

View File

@@ -31,11 +31,11 @@
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^7.14.3",
"@mantine/core": "^7.15.1",
"@tabler/icons-react": "^3.24.0",
"dayjs": "^1.11.13",
"next": "^14.2.20",
"react": "^18.3.1"
"react": "^19.0.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -24,9 +24,9 @@
"dependencies": {
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@mantine/core": "^7.14.3",
"@mantine/hooks": "^7.14.3",
"react": "^18.3.1"
"@mantine/core": "^7.15.1",
"@mantine/hooks": "^7.15.1",
"react": "^19.0.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -24,7 +24,7 @@
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/ui": "workspace:^0.1.0",
"@mantine/notifications": "^7.14.3",
"@mantine/notifications": "^7.15.1",
"@tabler/icons-react": "^3.24.0"
},
"devDependencies": {

View File

@@ -22,7 +22,7 @@
},
"prettier": "@homarr/prettier-config",
"dependencies": {
"zod": "^3.23.8"
"zod": "^3.24.1"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -187,6 +187,67 @@ export const createItemChannel = <TData>(itemId: string) => {
return createChannelWithLatestAndEvents<TData>(`item:${itemId}`);
};
export const createChannelEventHistory = <TData>(channelName: string, maxElements = 15) => {
const popElementsOverMaxAsync = async () => {
const length = await getSetClient.llen(channelName);
if (length <= maxElements) {
return;
}
await getSetClient.ltrim(channelName, length - maxElements, length);
};
return {
subscribe: (callback: (data: TData) => void) => {
return ChannelSubscriptionTracker.subscribe(channelName, (message) => {
callback(superjson.parse(message));
});
},
publishAndPushAsync: async (data: TData) => {
await publisher.publish(channelName, superjson.stringify(data));
await getSetClient.lpush(channelName, superjson.stringify({ data, timestamp: new Date() }));
await popElementsOverMaxAsync();
},
pushAsync: async (data: TData) => {
await getSetClient.lpush(channelName, superjson.stringify({ data, timestamp: new Date() }));
await popElementsOverMaxAsync();
},
clearAsync: async () => {
await getSetClient.del(channelName);
},
getLastAsync: async () => {
const length = await getSetClient.llen(channelName);
const data = await getSetClient.lrange(channelName, length - 1, length);
if (data.length !== 1) return null;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return superjson.parse<{ data: TData; timestamp: Date }>(data[0]!);
},
getSliceAsync: async (startIndex: number, endIndex: number) => {
const range = await getSetClient.lrange(channelName, startIndex, endIndex);
return range.map((item) => superjson.parse<{ data: TData; timestamp: Date }>(item));
},
getSliceUntilTimeAsync: async (time: Date) => {
const length = await getSetClient.llen(channelName);
const items: TData[] = [];
const itemsInCollection = await getSetClient.lrange(channelName, 0, length - 1);
for (let i = 0; i < length - 1; i++) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const deserializedItem = superjson.parse<{ data: TData; timestamp: Date }>(itemsInCollection[i]!);
if (deserializedItem.timestamp < time) {
continue;
}
items.push(deserializedItem.data);
}
return items;
},
getLengthAsync: async () => {
return await getSetClient.llen(channelName);
},
name: channelName,
};
};
export const createChannelWithLatestAndEvents = <TData>(channelName: string) => {
return {
subscribe: (callback: (data: TData) => void) => {

View File

@@ -32,13 +32,13 @@
"@homarr/modals-collection": "workspace:^0.1.0",
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@mantine/core": "^7.14.3",
"@mantine/hooks": "^7.14.3",
"@mantine/spotlight": "^7.14.3",
"@mantine/core": "^7.15.1",
"@mantine/hooks": "^7.15.1",
"@mantine/spotlight": "^7.15.1",
"@tabler/icons-react": "^3.24.0",
"jotai": "^2.10.3",
"next": "^14.2.20",
"react": "^18.3.1",
"react": "^19.0.0",
"use-deep-compare-effect": "^1.8.1"
},
"devDependencies": {

View File

@@ -1,4 +1,4 @@
import type { ReactNode } from "react";
import type { JSX, ReactNode } from "react";
import type { inferSearchInteractionDefinition } from "./interaction";

View File

@@ -1,3 +1,4 @@
import type { JSX } from "react";
import type { UseTRPCQueryResult } from "@trpc/react-query/shared";
import type { stringOrTranslation } from "@homarr/translation";

View File

@@ -33,8 +33,8 @@
"deepmerge": "4.3.1",
"mantine-react-table": "2.0.0-beta.7",
"next": "^14.2.20",
"next-intl": "3.26.0",
"react": "^18.3.1"
"next-intl": "3.26.1",
"react": "^19.0.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID automatizace"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatiserings ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatisierungs-ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Αναγνωριστικό αυτοματισμού"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID de automatización"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": ""
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID de l'automatisation"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "מזהה אוטומציה"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": ""
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatizálási azonosító"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID automazione"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "オートメーションID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": ""
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatizavimo ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatizācijas ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatiserings-ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automatisering ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID automatyzacji"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID da automação"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Identificator automatizare"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID автоматизации"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID automatizácie"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -4,8 +4,8 @@
"name": "Uporabnik",
"page": {
"login": {
"title": "",
"subtitle": ""
"title": "Prijavite se v svoj račun",
"subtitle": "Dobrodošli nazaj! Prosimo vnesite svoje podatke"
},
"invite": {
"title": "",
@@ -39,7 +39,7 @@
"label": "Potrditev gesla"
},
"previousPassword": {
"label": ""
"label": "Prejšnje geslo"
},
"homeBoard": {
"label": ""
@@ -57,8 +57,8 @@
"labelWith": "",
"notification": {
"success": {
"title": "",
"message": ""
"title": "Prijava uspešna",
"message": "Zdaj ste prijavljeni"
},
"error": {
"title": "",
@@ -85,7 +85,7 @@
},
"create": "Ustvari uporabnika",
"changePassword": {
"label": "",
"label": "Spremeni geslo",
"notification": {
"success": {
"message": ""
@@ -142,7 +142,7 @@
}
},
"removeImage": {
"label": "",
"label": "Odstrani sliko",
"confirm": "",
"notification": {
"success": {
@@ -170,7 +170,7 @@
"confirm": ""
},
"select": {
"label": "",
"label": "Izberi uporabnika",
"notFound": ""
},
"transfer": {
@@ -1159,6 +1159,9 @@
"automationId": {
"label": ""
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Automations-ID"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "Otomasyon Kimliği"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": ""
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": "ID tự động hóa"
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -1159,6 +1159,9 @@
"automationId": {
"label": ""
}
},
"spotlightAction": {
"run": ""
}
},
"calendar": {
@@ -2450,6 +2453,9 @@
"command": {
"help": "",
"group": {
"localCommand": {
"title": ""
},
"globalCommand": {
"title": "",
"option": {
@@ -2559,6 +2565,13 @@
}
}
},
"home": {
"group": {
"local": {
"title": ""
}
}
},
"page": {
"help": "",
"group": {

View File

@@ -29,13 +29,13 @@
"@homarr/log": "workspace:^0.1.0",
"@homarr/translation": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^7.14.3",
"@mantine/dates": "^7.14.3",
"@mantine/hooks": "^7.14.3",
"@mantine/core": "^7.15.1",
"@mantine/dates": "^7.15.1",
"@mantine/hooks": "^7.15.1",
"@tabler/icons-react": "^3.24.0",
"mantine-react-table": "2.0.0-beta.7",
"next": "^14.2.20",
"react": "^18.3.1"
"react": "^19.0.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",

View File

@@ -26,7 +26,7 @@
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/old-schema": "workspace:^0.1.0",
"@homarr/translation": "workspace:^0.1.0",
"zod": "^3.23.8",
"zod": "^3.24.1",
"zod-form-data": "^2.0.2"
},
"devDependencies": {

View File

@@ -41,8 +41,8 @@
"@homarr/translation": "workspace:^0.1.0",
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@mantine/core": "^7.14.3",
"@mantine/hooks": "^7.14.3",
"@mantine/core": "^7.15.1",
"@mantine/hooks": "^7.15.1",
"@tabler/icons-react": "^3.24.0",
"@tiptap/extension-color": "2.10.3",
"@tiptap/extension-highlight": "2.10.3",
@@ -63,7 +63,7 @@
"dayjs": "^1.11.13",
"mantine-react-table": "2.0.0-beta.7",
"next": "^14.2.20",
"react": "^18.3.1",
"react": "^19.0.0",
"video.js": "^8.21.0"
},
"devDependencies": {

View File

@@ -44,8 +44,8 @@ interface UseCurrentTimeProps {
const useCurrentTime = ({ showSeconds }: UseCurrentTimeProps) => {
const [time, setTime] = useState(new Date());
const timeoutRef = useRef<NodeJS.Timeout>();
const intervalRef = useRef<NodeJS.Timeout>();
const timeoutRef = useRef<NodeJS.Timeout>(null);
const intervalRef = useRef<NodeJS.Timeout>(null);
const intervalMultiplier = useMemo(() => (showSeconds ? 1 : 60), [showSeconds]);
useEffect(() => {
@@ -62,8 +62,8 @@ const useCurrentTime = ({ showSeconds }: UseCurrentTimeProps) => {
);
return () => {
clearTimeout(timeoutRef.current);
clearInterval(intervalRef.current);
if (timeoutRef.current) clearTimeout(timeoutRef.current);
if (intervalRef.current) clearInterval(intervalRef.current);
};
}, [intervalMultiplier, showSeconds]);

View File

@@ -16,8 +16,8 @@ const TimerModal = ({ opened, close, selectedIntegrationIds, disableDns }: Timer
const t = useI18n();
const [hours, setHours] = useState(0);
const [minutes, setMinutes] = useState(0);
const hoursHandlers = useRef<NumberInputHandlers>();
const minutesHandlers = useRef<NumberInputHandlers>();
const hoursHandlers = useRef<NumberInputHandlers>(null);
const minutesHandlers = useRef<NumberInputHandlers>(null);
const handleSetTimer = () => {
const duration = hours * 3600 + minutes * 60;

View File

@@ -169,15 +169,15 @@ export default function HealthMonitoringWidget({ options, integrationIds }: Widg
</List.Item>
<List m="0.5cqmin" withPadding center spacing="0.5cqmin" icon={<IconCpu size="1cqmin" />}>
<List.Item className="health-monitoring-information-load-average-1min">
{t("widget.healthMonitoring.popover.minute")} {healthInfo.loadAverage["1min"]}
{t("widget.healthMonitoring.popover.minute")} {healthInfo.loadAverage["1min"]}%
</List.Item>
<List.Item className="health-monitoring-information-load-average-5min">
{t("widget.healthMonitoring.popover.minutes", { count: 5 })}{" "}
{healthInfo.loadAverage["5min"]}
{healthInfo.loadAverage["5min"]}%
</List.Item>
<List.Item className="health-monitoring-information-load-average-15min">
{t("widget.healthMonitoring.popover.minutes", { count: 15 })}{" "}
{healthInfo.loadAverage["15min"]}
{healthInfo.loadAverage["15min"]}%
</List.Item>
</List>
</List>
@@ -363,7 +363,7 @@ const CpuTempRing = ({ fahrenheit, cpuTemp }: { fahrenheit: boolean; cpuTemp: nu
label={
<Center style={{ flexDirection: "column" }}>
<Text className="health-monitoring-cpu-temp-value" size="3cqmin">
{fahrenheit ? `${(cpuTemp * 1.8 + 32).toFixed(1)}°F` : `${cpuTemp}°C`}
{fahrenheit ? `${(cpuTemp * 1.8 + 32).toFixed(1)}°F` : `${cpuTemp.toFixed(1)}°C`}
</Text>
<IconCpu className="health-monitoring-cpu-temp-icon" size="7cqmin" />
</Center>

View File

@@ -1,5 +1,7 @@
import { IconHeartRateMonitor, IconServerOff } from "@tabler/icons-react";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import { createWidgetDefinition } from "../definition";
import { optionsBuilder } from "../options";
@@ -19,7 +21,7 @@ export const { definition, componentLoader } = createWidgetDefinition("healthMon
defaultValue: true,
}),
})),
supportedIntegrations: ["openmediavault"],
supportedIntegrations: getIntegrationKindsByCategory("healthMonitoring"),
errors: {
INTERNAL_SERVER_ERROR: {
icon: IconServerOff,

1293
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"typescript-eslint": "^8.17.0"
"typescript-eslint": "^8.18.0"
},
"devDependencies": {
"@homarr/prettier-config": "workspace:^0.1.0",