Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83738bfebf | ||
|
|
5089a2ae6b |
No files matched your search
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"oxc.oxc-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"yoavbls.pretty-ts-errors",
|
"yoavbls.pretty-ts-errors",
|
||||||
"million.million-lint",
|
"million.million-lint",
|
||||||
"lokalise.i18n-ally"
|
"lokalise.i18n-ally"
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ RUN mkdir -p /var/cache/nginx && \
|
|||||||
|
|
||||||
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
||||||
COPY --from=builder /app/apps/nextjs/package.json .
|
COPY --from=builder /app/apps/nextjs/package.json .
|
||||||
COPY --from=builder /app/pnpm-workspace.yaml ./pnpm-workspace.yaml
|
|
||||||
|
|
||||||
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
|
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
---
|
|
||||||
title: 'Docker labels'
|
|
||||||
description: 'Configure Homarr apps automatically using Docker container labels during onboarding.'
|
|
||||||
hide_title: true
|
|
||||||
---
|
|
||||||
|
|
||||||
# Docker label discovery
|
|
||||||
|
|
||||||
Homarr can read `homarr.*` labels on your containers to pre-populate apps during onboarding. Homepage-style `homepage.*` labels are supported as a fallback when no `homarr.name` label is set.
|
|
||||||
|
|
||||||
## Required labels
|
|
||||||
|
|
||||||
| Label | Description |
|
|
||||||
| --- | --- |
|
|
||||||
| `homarr.name` | Display name for the app |
|
|
||||||
| `homarr.group` | Category section name on the board |
|
|
||||||
| `homarr.href` | URL opened when clicking the app |
|
|
||||||
|
|
||||||
## Optional labels
|
|
||||||
|
|
||||||
| Label | Description |
|
|
||||||
| --- | --- |
|
|
||||||
| `homarr.icon` | Icon URL |
|
|
||||||
| `homarr.description` | App description |
|
|
||||||
| `homarr.ping` | Ping URL for status checks |
|
|
||||||
| `homarr.id` | Stable external ID (defaults to container ID) |
|
|
||||||
| `homarr.board` | Target board name |
|
|
||||||
| `homarr.integration` | Integration kind (e.g. `sonarr`) for onboarding integration setup |
|
|
||||||
| `homarr.widget` | Widget kind hint (parsed, not auto-placed yet) |
|
|
||||||
| `homarr.hide` | Hide container from discovery |
|
|
||||||
|
|
||||||
## Homepage fallback
|
|
||||||
|
|
||||||
When `homarr.name` is absent, Homarr reads `homepage.name`, `homepage.group`, `homepage.href`, `homepage.icon`, and `homepage.description` if homepage label reading is enabled (default: on).
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
sonarr:
|
|
||||||
image: lscr.io/linuxserver/sonarr:latest
|
|
||||||
labels:
|
|
||||||
homarr.name: "Sonarr"
|
|
||||||
homarr.group: "Media"
|
|
||||||
homarr.href: "http://sonarr:8989"
|
|
||||||
homarr.icon: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sonarr.svg"
|
|
||||||
homarr.integration: "sonarr"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Onboarding behavior
|
|
||||||
|
|
||||||
During the integrations step, Homarr scans labeled containers first. Labeled services appear with their configured name, group, and URL. Unlabeled running containers still use image-based discovery as a fallback.
|
|
||||||
|
|
||||||
When you finish onboarding, selected label-based apps are synced into category sections on your board. Integration widgets are placed separately in the default section.
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { IntegrationDefinition } from "@site/src/types";
|
|
||||||
|
|
||||||
export const dockerLabelsIntegration: IntegrationDefinition = {
|
|
||||||
name: "Docker labels",
|
|
||||||
description: "Configure Homarr apps automatically using Docker container labels.",
|
|
||||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/docker.svg",
|
|
||||||
path: "../../integrations/docker-labels",
|
|
||||||
};
|
|
||||||
@@ -93,11 +93,9 @@ They are then available in the app list and can be used as normally added apps.
|
|||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Homarr supports Docker labels for automatic app discovery during onboarding. See [Docker labels](../docker-labels/index.mdx) for the full reference.
|
Currently Homarr supports one label for configuration of the containers:
|
||||||
|
|
||||||
Currently Homarr supports one label for hiding containers:
|
- **homarr.hide:** If set to any value, the container will be hidden from the Docker Containers widget and tools page.
|
||||||
|
|
||||||
- **homarr.hide:** If set to any value, the container will be hidden from the Docker Containers widget, tools page, and label discovery.
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
Mounting docker sockets can be risky, as they permit full control over your docker service.
|
Mounting docker sockets can be risky, as they permit full control over your docker service.
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
title: 'FileFlows'
|
||||||
|
description: "FileFlows is a distributed media processing system that allows you to encode, compress and process your media files across multiple nodes."
|
||||||
|
hide_title: true
|
||||||
|
---
|
||||||
|
|
||||||
|
import { IntegrationHeader } from '@site/src/components/integrations/header';
|
||||||
|
import { IntegrationCapabilites } from '@site/src/components/integrations/widgets';
|
||||||
|
import { AddingIntegration } from '@site/src/components/integrations/adding';
|
||||||
|
import {IntegrationSecrets} from '@site/src/components/integrations/secrets';
|
||||||
|
import { IconTransform } from "@tabler/icons-react";
|
||||||
|
import { fileFlowsIntegration } from '.';
|
||||||
|
import { mediaTranscodingWidget } from '@site/docs/widgets/media-transcoding';
|
||||||
|
|
||||||
|
|
||||||
|
<IntegrationHeader
|
||||||
|
integration={fileFlowsIntegration}
|
||||||
|
categories={['Media Transcoding']}
|
||||||
|
/>
|
||||||
|
|
||||||
|
### Widgets & Capabilities
|
||||||
|
<IntegrationCapabilites
|
||||||
|
items={[{ widget: mediaTranscodingWidget }]}
|
||||||
|
/>
|
||||||
|
|
||||||
|
### Adding the integration
|
||||||
|
<AddingIntegration />
|
||||||
|
|
||||||
|
### Secrets
|
||||||
|
<IntegrationSecrets secrets={[{
|
||||||
|
credentials: ['apiKey'],
|
||||||
|
steps: []
|
||||||
|
}, {
|
||||||
|
credentials: [],
|
||||||
|
steps: []
|
||||||
|
}]} />
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { IntegrationDefinition } from "@site/src/types";
|
||||||
|
export const fileFlowsIntegration: IntegrationDefinition = {
|
||||||
|
name: "FileFlows",
|
||||||
|
description:
|
||||||
|
"FileFlows is a distributed media processing system that allows you to encode, compress and process your media files across multiple nodes.",
|
||||||
|
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/fileflows.png",
|
||||||
|
path: "../../integrations/fileflows",
|
||||||
|
};
|
||||||
@@ -50,7 +50,7 @@ interface IntegrationDraft {
|
|||||||
initialUrl: string;
|
initialUrl: string;
|
||||||
initialName?: string;
|
initialName?: string;
|
||||||
dockerPort?: number | null;
|
dockerPort?: number | null;
|
||||||
source: "manual" | "docker" | "label";
|
source: "manual" | "docker";
|
||||||
}
|
}
|
||||||
|
|
||||||
export const InitIntegrations = () => {
|
export const InitIntegrations = () => {
|
||||||
@@ -65,7 +65,6 @@ export const InitIntegrations = () => {
|
|||||||
|
|
||||||
const { mutateAsync: setupIntegrations } = clientApi.onboard.setupIntegrations.useMutation();
|
const { mutateAsync: setupIntegrations } = clientApi.onboard.setupIntegrations.useMutation();
|
||||||
const { mutateAsync: createApps } = clientApi.onboard.createAppsFromDiscovery.useMutation();
|
const { mutateAsync: createApps } = clientApi.onboard.createAppsFromDiscovery.useMutation();
|
||||||
const { mutateAsync: syncLabelApps } = clientApi.onboard.syncDockerLabelApps.useMutation();
|
|
||||||
|
|
||||||
const { data: dockerData, isPending: isDockerLoading } = clientApi.onboard.discoverDockerServices.useQuery(
|
const { data: dockerData, isPending: isDockerLoading } = clientApi.onboard.discoverDockerServices.useQuery(
|
||||||
undefined,
|
undefined,
|
||||||
@@ -99,7 +98,7 @@ export const InitIntegrations = () => {
|
|||||||
initialUrl: item.suggestedUrl,
|
initialUrl: item.suggestedUrl,
|
||||||
initialName: item.containerName,
|
initialName: item.containerName,
|
||||||
dockerPort: item.publishedPort,
|
dockerPort: item.publishedPort,
|
||||||
source: item.source,
|
source: "docker",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
newKinds.add(item.kind);
|
newKinds.add(item.kind);
|
||||||
@@ -133,8 +132,7 @@ export const InitIntegrations = () => {
|
|||||||
const newDrafts = new Map(drafts);
|
const newDrafts = new Map(drafts);
|
||||||
for (const kind of selectedKinds) {
|
for (const kind of selectedKinds) {
|
||||||
const existing = newDrafts.get(kind);
|
const existing = newDrafts.get(kind);
|
||||||
const useUrlTemplate = baseHost && existing?.source !== "label";
|
if (baseHost) {
|
||||||
if (useUrlTemplate) {
|
|
||||||
newDrafts.set(kind, {
|
newDrafts.set(kind, {
|
||||||
kind,
|
kind,
|
||||||
initialUrl: buildIntegrationUrl(kind, baseHost, urlMode, existing?.dockerPort ?? undefined),
|
initialUrl: buildIntegrationUrl(kind, baseHost, urlMode, existing?.dockerPort ?? undefined),
|
||||||
@@ -154,32 +152,10 @@ export const InitIntegrations = () => {
|
|||||||
const finishSetupAsync = async () => {
|
const finishSetupAsync = async () => {
|
||||||
setPhase("done");
|
setPhase("done");
|
||||||
try {
|
try {
|
||||||
const selectedApps = dockerApps.filter((app) => selectedAppIds.has(app.containerId));
|
const appsToCreate = dockerApps.filter((app) => selectedAppIds.has(app.containerId));
|
||||||
const labelApps = selectedApps.filter((app) => app.source === "label");
|
if (appsToCreate.length > 0) {
|
||||||
const imageApps = selectedApps.filter((app) => app.source !== "label");
|
|
||||||
|
|
||||||
if (labelApps.length > 0) {
|
|
||||||
const labelAppsWithHost = labelApps.filter((app): app is typeof app & { host: string } => Boolean(app.host));
|
|
||||||
const missingHostCount = labelApps.length - labelAppsWithHost.length;
|
|
||||||
if (missingHostCount > 0) {
|
|
||||||
throw new Error("Some selected Docker label apps are missing host metadata");
|
|
||||||
}
|
|
||||||
if (labelAppsWithHost.length > 0) {
|
|
||||||
const syncResult = await syncLabelApps(
|
|
||||||
labelAppsWithHost.map((app) => ({
|
|
||||||
containerId: app.containerId,
|
|
||||||
host: app.host,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
if (syncResult.notFound > 0) {
|
|
||||||
throw new Error("Some selected Docker label apps were not found");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imageApps.length > 0) {
|
|
||||||
await createApps(
|
await createApps(
|
||||||
imageApps.map((app) => {
|
appsToCreate.map((app) => {
|
||||||
const href = baseHost
|
const href = baseHost
|
||||||
? buildAppUrl(app.containerName, baseHost, urlMode, app.publishedPort ?? undefined)
|
? buildAppUrl(app.containerName, baseHost, urlMode, app.publishedPort ?? undefined)
|
||||||
: app.suggestedUrl;
|
: app.suggestedUrl;
|
||||||
@@ -191,7 +167,6 @@ export const InitIntegrations = () => {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await setupIntegrations();
|
await setupIntegrations();
|
||||||
router.refresh();
|
router.refresh();
|
||||||
} catch {
|
} catch {
|
||||||
@@ -361,16 +336,9 @@ export const InitIntegrations = () => {
|
|||||||
>
|
>
|
||||||
<Stack justify="space-between" h="100%" gap={4} align="center">
|
<Stack justify="space-between" h="100%" gap={4} align="center">
|
||||||
<Group justify="space-between" w="100%" wrap="nowrap">
|
<Group justify="space-between" w="100%" wrap="nowrap">
|
||||||
<Stack gap={0} style={{ flex: 1, minWidth: 0 }}>
|
<Text size="xs" fw={500} lineClamp={1} style={{ flex: 1, minWidth: 0 }}>
|
||||||
<Text size="xs" fw={500} lineClamp={1}>
|
{app.containerName}
|
||||||
{app.containerName}
|
</Text>
|
||||||
</Text>
|
|
||||||
{app.group && (
|
|
||||||
<Text size="xs" c="dimmed" lineClamp={1}>
|
|
||||||
{app.group}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
{isSelected && <IconCheck size={14} color="var(--mantine-color-blue-6)" />}
|
{isSelected && <IconCheck size={14} color="var(--mantine-color-blue-6)" />}
|
||||||
</Group>
|
</Group>
|
||||||
<Avatar size="sm" radius="sm" src={app.iconUrl} styles={{ image: { objectFit: "contain" } }}>
|
<Avatar size="sm" radius="sm" src={app.iconUrl} styles={{ image: { objectFit: "contain" } }}>
|
||||||
@@ -391,14 +359,8 @@ export const InitIntegrations = () => {
|
|||||||
{t("action.skip")}
|
{t("action.skip")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={handleContinueToConfig}
|
||||||
if (selectedKinds.length === 0) {
|
disabled={selectedKinds.length === 0 || undefined}
|
||||||
void finishSetupAsync();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
handleContinueToConfig();
|
|
||||||
}}
|
|
||||||
disabled={(selectedKinds.length === 0 && selectedAppCount === 0) || undefined}
|
|
||||||
rightSection={<IconArrowRight size={16} stroke={1.5} />}
|
rightSection={<IconArrowRight size={16} stroke={1.5} />}
|
||||||
suppressHydrationWarning
|
suppressHydrationWarning
|
||||||
>
|
>
|
||||||
@@ -442,8 +404,7 @@ const ConfigurePhase = ({
|
|||||||
const currentKind = selectedKinds[currentIndex]!;
|
const currentKind = selectedKinds[currentIndex]!;
|
||||||
const draft = drafts.get(currentKind);
|
const draft = drafts.get(currentKind);
|
||||||
const progress = ((currentIndex + 1) / selectedKinds.length) * 100;
|
const progress = ((currentIndex + 1) / selectedKinds.length) * 100;
|
||||||
const useUrlTemplate = baseHost && draft?.source !== "label";
|
const computedUrl = baseHost
|
||||||
const computedUrl = useUrlTemplate
|
|
||||||
? buildIntegrationUrl(currentKind, baseHost, urlMode, draft?.dockerPort ?? undefined)
|
? buildIntegrationUrl(currentKind, baseHost, urlMode, draft?.dockerPort ?? undefined)
|
||||||
: draft?.initialUrl;
|
: draft?.initialUrl;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { extractBaseUrlFromHeaders } from "@homarr/common";
|
|||||||
import { getScopedI18n } from "@homarr/translation/server";
|
import { getScopedI18n } from "@homarr/translation/server";
|
||||||
|
|
||||||
import { createMetaTitle } from "~/metadata";
|
import { createMetaTitle } from "~/metadata";
|
||||||
import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
|
||||||
import { extractMcpTools } from "~/app/api/mcp/_extract-tools";
|
import { extractMcpTools } from "~/app/api/mcp/_extract-tools";
|
||||||
import { ApiKeysManagement } from "./components/api-keys";
|
import { ApiKeysManagement } from "./components/api-keys";
|
||||||
import { ApiPageTabs } from "./components/api-page-tabs";
|
import { ApiPageTabs } from "./components/api-page-tabs";
|
||||||
@@ -80,20 +79,17 @@ export default async function ApiPage() {
|
|||||||
const toolGroups = getMcpToolGroups();
|
const toolGroups = getMcpToolGroups();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Stack>
|
||||||
<DynamicBreadcrumb />
|
<ApiPageTabs
|
||||||
<Stack>
|
documentationLabel={t("documentation.label")}
|
||||||
<ApiPageTabs
|
apiKeyLabel={t("apiKey.label")}
|
||||||
documentationLabel={t("documentation.label")}
|
mcpLabel={t("mcp.label")}
|
||||||
apiKeyLabel={t("apiKey.label")}
|
documentationPanel={<ScalarApiReference document={document} />}
|
||||||
mcpLabel={t("mcp.label")}
|
authenticationPanel={<ApiKeysManagement apiKeys={apiKeys} />}
|
||||||
documentationPanel={<ScalarApiReference document={document} />}
|
baseUrl={baseUrl}
|
||||||
authenticationPanel={<ApiKeysManagement apiKeys={apiKeys} />}
|
hasApiKeys={apiKeys.length > 0}
|
||||||
baseUrl={baseUrl}
|
toolGroups={toolGroups}
|
||||||
hasApiKeys={apiKeys.length > 0}
|
/>
|
||||||
toolGroups={toolGroups}
|
</Stack>
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ import { dbEnv } from "@homarr/core/infrastructure/db/env";
|
|||||||
import { getScopedI18n } from "@homarr/translation/server";
|
import { getScopedI18n } from "@homarr/translation/server";
|
||||||
|
|
||||||
import { createMetaTitle } from "~/metadata";
|
import { createMetaTitle } from "~/metadata";
|
||||||
import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
|
||||||
import { BackupExportCard } from "./_components/backup-export-card";
|
import { BackupExportCard } from "./_components/backup-export-card";
|
||||||
import { BackupImportCard } from "./_components/backup-import-card";
|
import { BackupImportCard } from "./_components/backup-import-card";
|
||||||
|
|
||||||
@@ -32,13 +31,10 @@ export default async function BackupPage() {
|
|||||||
const t = await getScopedI18n("management.page.tool.backup");
|
const t = await getScopedI18n("management.page.tool.backup");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Stack>
|
||||||
<DynamicBreadcrumb />
|
<Title>{t("title")}</Title>
|
||||||
<Stack>
|
<BackupExportCard />
|
||||||
<Title>{t("title")}</Title>
|
<BackupImportCard />
|
||||||
<BackupExportCard />
|
</Stack>
|
||||||
<BackupImportCard />
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@ import { getI18n, getScopedI18n } from "@homarr/translation/server";
|
|||||||
import { Link } from "@homarr/ui";
|
import { Link } from "@homarr/ui";
|
||||||
|
|
||||||
import { ManageContainer } from "~/components/manage/manage-container";
|
import { ManageContainer } from "~/components/manage/manage-container";
|
||||||
import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
|
||||||
import { NavigationLink } from "./_navigation";
|
import { NavigationLink } from "./_navigation";
|
||||||
|
|
||||||
interface LayoutProps {
|
interface LayoutProps {
|
||||||
@@ -25,7 +24,6 @@ export default async function Layout(props: PropsWithChildren<LayoutProps>) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ManageContainer size="xl">
|
<ManageContainer size="xl">
|
||||||
<DynamicBreadcrumb dynamicMappings={new Map([[params.id, group.name]])} />
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<GridCol span={12}>
|
<GridCol span={12}>
|
||||||
<Group justify="space-between" align="center">
|
<Group justify="space-between" align="center">
|
||||||
|
|||||||
@@ -10,8 +10,3 @@
|
|||||||
background-color: var(--background-color) !important;
|
background-color: var(--background-color) !important;
|
||||||
border-color: var(--border-color) !important;
|
border-color: var(--border-color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.itemCard:global(.iframe-wrapper) {
|
|
||||||
background-color: transparent !important;
|
|
||||||
border-color: transparent !important;
|
|
||||||
}
|
|
||||||
@@ -14,8 +14,6 @@ interface DynamicBreadcrumbProps {
|
|||||||
nonInteractable?: string[];
|
nonInteractable?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const categorySegments = new Set(["tools"]);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Breadcrumb is client side rendered. Elements are automatically
|
* Breadcrumb is client side rendered. Elements are automatically
|
||||||
* calculated and translated using dynamic keys.
|
* calculated and translated using dynamic keys.
|
||||||
@@ -62,11 +60,8 @@ export const DynamicBreadcrumb = ({
|
|||||||
const translationKey = `${pathnameParts.slice(0, index + 1).join(".")}`;
|
const translationKey = `${pathnameParts.slice(0, index + 1).join(".")}`;
|
||||||
const mappedValue = dynamicMappings?.get(pathnamePart);
|
const mappedValue = dynamicMappings?.get(pathnamePart);
|
||||||
|
|
||||||
const isNonInteractable =
|
|
||||||
nonInteractable?.includes(pathnamePart) === true || categorySegments.has(pathnamePart);
|
|
||||||
|
|
||||||
if (mappedValue) {
|
if (mappedValue) {
|
||||||
if (isNonInteractable) {
|
if (nonInteractable?.includes(pathnamePart)) {
|
||||||
return <Text key={href}>{mappedValue}</Text>;
|
return <Text key={href}>{mappedValue}</Text>;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
@@ -76,7 +71,7 @@ export const DynamicBreadcrumb = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNonInteractable) {
|
if (nonInteractable?.includes(pathnamePart)) {
|
||||||
return <Text key={href}>{t(`${translationKey}.label` as TranslationKeys)}</Text>;
|
return <Text key={href}>{t(`${translationKey}.label` as TranslationKeys)}</Text>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,22 +35,14 @@ export const getDependenciesAsync = async (): Promise<PackageJsonDependencies> =
|
|||||||
type DependencyCatalog = Map<string, string>;
|
type DependencyCatalog = Map<string, string>;
|
||||||
const parseDependencyCatalogsAsync = async (): Promise<DependencyCatalog> => {
|
const parseDependencyCatalogsAsync = async (): Promise<DependencyCatalog> => {
|
||||||
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const workspaceConfigPath = path.join(currentDir, "..", "..", "..", "..", "pnpm-workspace.yaml");
|
const workspaceConfigContent = await fsPromises.readFile(
|
||||||
|
path.join(currentDir, "..", "..", "..", "..", "pnpm-workspace.yaml"),
|
||||||
|
"utf-8",
|
||||||
|
);
|
||||||
|
const workspaceConfig: unknown = parseYaml(workspaceConfigContent);
|
||||||
|
const parseResult = workspaceConfigCatalogSchema.parse(workspaceConfig);
|
||||||
|
|
||||||
try {
|
return new Map(Object.entries(parseResult.catalog ?? {}));
|
||||||
const workspaceConfigContent = await fsPromises.readFile(workspaceConfigPath, "utf-8");
|
|
||||||
const workspaceConfig: unknown = parseYaml(workspaceConfigContent);
|
|
||||||
const parseResult = workspaceConfigCatalogSchema.parse(workspaceConfig);
|
|
||||||
return new Map(Object.entries(parseResult.catalog ?? {}));
|
|
||||||
} catch (error) {
|
|
||||||
// The workspace config is absent in Docker (only the runner stage is shipped),
|
|
||||||
// so a missing file is expected. Surface any other failure (e.g. malformed YAML).
|
|
||||||
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
|
|
||||||
return new Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const workspaceConfigCatalogSchema = z.object({
|
const workspaceConfigCatalogSchema = z.object({
|
||||||
|
|||||||
@@ -3,13 +3,10 @@ import { z } from "zod/v4";
|
|||||||
|
|
||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
import { encryptSecret } from "@homarr/common/server";
|
import { encryptSecret } from "@homarr/common/server";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { eq, like, or } from "@homarr/db";
|
||||||
import { asc, eq, inArray, like, or } from "@homarr/db";
|
|
||||||
import { placeAllWidgetsAsync } from "@homarr/db/queries";
|
import { placeAllWidgetsAsync } from "@homarr/db/queries";
|
||||||
import { getServerSettingsAsync } from "@homarr/db/queries";
|
|
||||||
import {
|
import {
|
||||||
apps,
|
apps,
|
||||||
boards,
|
|
||||||
groups,
|
groups,
|
||||||
icons,
|
icons,
|
||||||
integrationItems,
|
integrationItems,
|
||||||
@@ -36,8 +33,6 @@ import { MissingSecretError, testConnectionAsync } from "../integration/integrat
|
|||||||
import { mapTestConnectionError } from "../integration/map-test-connection-error";
|
import { mapTestConnectionError } from "../integration/map-test-connection-error";
|
||||||
import { getOnboardingOrFallbackAsync, nextOnboardingStepAsync } from "./onboard-queries";
|
import { getOnboardingOrFallbackAsync, nextOnboardingStepAsync } from "./onboard-queries";
|
||||||
|
|
||||||
const logger = createLogger({ module: "onboardDockerDiscovery" });
|
|
||||||
|
|
||||||
interface PortInfo {
|
interface PortInfo {
|
||||||
IP?: string;
|
IP?: string;
|
||||||
PublicPort?: number;
|
PublicPort?: number;
|
||||||
@@ -48,30 +43,6 @@ interface SuggestedUrlResult {
|
|||||||
publishedPort: number | null;
|
publishedPort: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
type DockerDiscoverySource = "label" | "docker";
|
|
||||||
|
|
||||||
interface DiscoveredIntegration {
|
|
||||||
containerId: string;
|
|
||||||
containerName: string;
|
|
||||||
kind: IntegrationKind;
|
|
||||||
suggestedUrl: string;
|
|
||||||
publishedPort: number | null;
|
|
||||||
iconUrl: string | null;
|
|
||||||
source: DockerDiscoverySource;
|
|
||||||
group?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DiscoveredApp {
|
|
||||||
containerId: string;
|
|
||||||
containerName: string;
|
|
||||||
suggestedUrl: string;
|
|
||||||
publishedPort: number | null;
|
|
||||||
iconUrl: string | null;
|
|
||||||
source: DockerDiscoverySource;
|
|
||||||
group?: string;
|
|
||||||
host?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const buildSuggestedUrl = (ports: PortInfo[] | undefined, host: string): SuggestedUrlResult => {
|
const buildSuggestedUrl = (ports: PortInfo[] | undefined, host: string): SuggestedUrlResult => {
|
||||||
const port = ports?.[0];
|
const port = ports?.[0];
|
||||||
if (port?.PublicPort) {
|
if (port?.PublicPort) {
|
||||||
@@ -174,91 +145,51 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
}),
|
}),
|
||||||
discoverDockerServices: onboardingProcedure.requiresStep("integrations").query(async ({ ctx }) => {
|
discoverDockerServices: onboardingProcedure.requiresStep("integrations").query(async ({ ctx }) => {
|
||||||
const emptyResult = {
|
const emptyResult = {
|
||||||
integrations: [] as DiscoveredIntegration[],
|
integrations: [] as {
|
||||||
apps: [] as DiscoveredApp[],
|
containerId: string;
|
||||||
|
containerName: string;
|
||||||
|
kind: IntegrationKind;
|
||||||
|
suggestedUrl: string;
|
||||||
|
publishedPort: number | null;
|
||||||
|
iconUrl: string | null;
|
||||||
|
}[],
|
||||||
|
apps: [] as {
|
||||||
|
containerId: string;
|
||||||
|
containerName: string;
|
||||||
|
suggestedUrl: string;
|
||||||
|
publishedPort: number | null;
|
||||||
|
iconUrl: string | null;
|
||||||
|
}[],
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { DockerSingleton, dockerLabels, listDiscoveredContainersAsync } = await import("@homarr/docker");
|
const { DockerSingleton, dockerLabels } = await import("@homarr/docker");
|
||||||
const serverSettings = await getServerSettingsAsync(ctx.db);
|
|
||||||
|
|
||||||
const labeledServices = await listDiscoveredContainersAsync({
|
|
||||||
readHomepageLabels: serverSettings.docker.readHomepageLabels,
|
|
||||||
});
|
|
||||||
const labeledContainerIds = new Set(labeledServices.map((service) => service.containerId));
|
|
||||||
const seenKinds = new Set<IntegrationKind>();
|
|
||||||
const discoveredIntegrations: DiscoveredIntegration[] = [];
|
|
||||||
const discoveredApps: DiscoveredApp[] = [];
|
|
||||||
|
|
||||||
for (const service of labeledServices) {
|
|
||||||
if (service.integrationKind && !seenKinds.has(service.integrationKind)) {
|
|
||||||
seenKinds.add(service.integrationKind);
|
|
||||||
discoveredIntegrations.push({
|
|
||||||
containerId: service.containerId,
|
|
||||||
containerName: service.name,
|
|
||||||
kind: service.integrationKind,
|
|
||||||
suggestedUrl: service.href,
|
|
||||||
publishedPort: null,
|
|
||||||
iconUrl: service.icon ?? null,
|
|
||||||
source: "label",
|
|
||||||
group: service.group,
|
|
||||||
});
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
discoveredApps.push({
|
|
||||||
containerId: service.containerId,
|
|
||||||
containerName: service.name,
|
|
||||||
suggestedUrl: service.href,
|
|
||||||
publishedPort: null,
|
|
||||||
iconUrl: service.icon ?? null,
|
|
||||||
source: "label",
|
|
||||||
group: service.group,
|
|
||||||
host: service.host,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const dockerInstances = DockerSingleton.getInstances();
|
const dockerInstances = DockerSingleton.getInstances();
|
||||||
if (dockerInstances.length === 0) {
|
if (dockerInstances.length === 0) {
|
||||||
const hasResults = discoveredIntegrations.length > 0 || discoveredApps.length > 0;
|
return { status: "empty" as const, ...emptyResult };
|
||||||
return {
|
|
||||||
status: hasResults ? ("success" as const) : ("empty" as const),
|
|
||||||
integrations: discoveredIntegrations,
|
|
||||||
apps: discoveredApps,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const results = await Promise.allSettled(
|
const results = await Promise.allSettled(
|
||||||
dockerInstances.map(async ({ instance, host }) => {
|
dockerInstances.map(async ({ instance, host }) => {
|
||||||
const containerList = await instance.listContainers({ all: false });
|
const containerList = await instance.listContainers({ all: false });
|
||||||
return containerList
|
return containerList.filter((c) => !(dockerLabels.hide in c.Labels)).map((c) => ({ ...c, host }));
|
||||||
.filter((container) => !(dockerLabels.hide in container.Labels))
|
|
||||||
.filter((container) => !labeledContainerIds.has(container.Id))
|
|
||||||
.map((container) => ({ ...container, host }));
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const containers = results.flatMap((result, index) => {
|
const containers = results.flatMap((r) => (r.status === "fulfilled" ? r.value : []));
|
||||||
if (result.status === "fulfilled") {
|
|
||||||
return result.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.warn("Failed to list containers for onboarding discovery", {
|
if (containers.length === 0) {
|
||||||
host: dockerInstances[index]?.host,
|
|
||||||
cause: result.reason,
|
|
||||||
});
|
|
||||||
return [];
|
|
||||||
});
|
|
||||||
|
|
||||||
if (containers.length === 0 && discoveredIntegrations.length === 0 && discoveredApps.length === 0) {
|
|
||||||
return { status: "empty" as const, ...emptyResult };
|
return { status: "empty" as const, ...emptyResult };
|
||||||
}
|
}
|
||||||
|
|
||||||
const likeQueries = containers.map((container) =>
|
const likeQueries = containers.map((c) => like(icons.name, `%${extractContainerImageName(c.Image)}%`));
|
||||||
like(icons.name, `%${extractContainerImageName(container.Image)}%`),
|
|
||||||
);
|
|
||||||
const dbIcons = likeQueries.length > 0 ? await ctx.db.query.icons.findMany({ where: or(...likeQueries) }) : [];
|
const dbIcons = likeQueries.length > 0 ? await ctx.db.query.icons.findMany({ where: or(...likeQueries) }) : [];
|
||||||
|
|
||||||
|
const seenKinds = new Set<IntegrationKind>();
|
||||||
|
const discoveredIntegrations = emptyResult.integrations;
|
||||||
|
const discoveredApps = emptyResult.apps;
|
||||||
|
|
||||||
const cdnIconUrl = (slug: string) =>
|
const cdnIconUrl = (slug: string) =>
|
||||||
`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/${slug}.svg`;
|
`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/${slug}.svg`;
|
||||||
|
|
||||||
@@ -292,7 +223,6 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
suggestedUrl,
|
suggestedUrl,
|
||||||
publishedPort,
|
publishedPort,
|
||||||
iconUrl,
|
iconUrl,
|
||||||
source: "docker",
|
|
||||||
});
|
});
|
||||||
} else if (!kind && dbIcon) {
|
} else if (!kind && dbIcon) {
|
||||||
discoveredApps.push({
|
discoveredApps.push({
|
||||||
@@ -301,61 +231,19 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
suggestedUrl,
|
suggestedUrl,
|
||||||
publishedPort,
|
publishedPort,
|
||||||
iconUrl,
|
iconUrl,
|
||||||
source: "docker",
|
|
||||||
host: container.host,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasResults = discoveredIntegrations.length > 0 || discoveredApps.length > 0;
|
|
||||||
return {
|
return {
|
||||||
status: hasResults ? ("success" as const) : ("empty" as const),
|
status: "success" as const,
|
||||||
integrations: discoveredIntegrations,
|
integrations: discoveredIntegrations,
|
||||||
apps: discoveredApps,
|
apps: discoveredApps,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch {
|
||||||
logger.warn("Docker discovery failed during onboarding", { cause: error });
|
|
||||||
return { status: "unavailable" as const, ...emptyResult };
|
return { status: "unavailable" as const, ...emptyResult };
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
syncDockerLabelApps: onboardingProcedure
|
|
||||||
.requiresStep("integrations")
|
|
||||||
.input(
|
|
||||||
z.array(
|
|
||||||
z.object({
|
|
||||||
containerId: z.string(),
|
|
||||||
host: z.string(),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.mutation(async ({ ctx, input }) => {
|
|
||||||
if (input.length === 0) {
|
|
||||||
return { created: 0, updated: 0, skipped: 0, notFound: 0 };
|
|
||||||
}
|
|
||||||
|
|
||||||
const { listDiscoveredContainersAsync, syncDiscoveredServicesAsync } = await import("@homarr/docker");
|
|
||||||
const serverSettings = await getServerSettingsAsync(ctx.db);
|
|
||||||
const labeledServices = await listDiscoveredContainersAsync({
|
|
||||||
readHomepageLabels: serverSettings.docker.readHomepageLabels,
|
|
||||||
});
|
|
||||||
const selectedKeys = new Set(input.map((entry) => `${entry.host}/${entry.containerId}`));
|
|
||||||
const selectedServices = labeledServices.filter((service) =>
|
|
||||||
selectedKeys.has(`${service.host}/${service.containerId}`),
|
|
||||||
);
|
|
||||||
|
|
||||||
const syncResult = await syncDiscoveredServicesAsync(selectedServices, {
|
|
||||||
targetBoardName: serverSettings.docker.targetBoardName,
|
|
||||||
enableStatusByDefault: serverSettings.board.enableStatusByDefault,
|
|
||||||
forceDisableStatus: serverSettings.board.forceDisableStatus,
|
|
||||||
defaultItemWidth: serverSettings.docker.defaultItemWidth,
|
|
||||||
defaultItemHeight: serverSettings.docker.defaultItemHeight,
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
...syncResult,
|
|
||||||
notFound: input.length - selectedServices.length,
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
createAppsFromDiscovery: onboardingProcedure
|
createAppsFromDiscovery: onboardingProcedure
|
||||||
.requiresStep("integrations")
|
.requiresStep("integrations")
|
||||||
.input(
|
.input(
|
||||||
@@ -369,17 +257,9 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
)
|
)
|
||||||
.mutation(async ({ ctx, input }) => {
|
.mutation(async ({ ctx, input }) => {
|
||||||
if (input.length === 0) return;
|
if (input.length === 0) return;
|
||||||
|
|
||||||
const existingApps = await ctx.db.query.apps.findMany({ columns: { href: true } });
|
|
||||||
const existingHrefs = new Set(
|
|
||||||
existingApps.map((app) => app.href).filter((href): href is string => Boolean(href)),
|
|
||||||
);
|
|
||||||
const appsToCreate = input.filter((app) => !app.href || !existingHrefs.has(app.href));
|
|
||||||
if (appsToCreate.length === 0) return;
|
|
||||||
|
|
||||||
const defaultIcon = "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/homarr.svg";
|
const defaultIcon = "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/homarr.svg";
|
||||||
await ctx.db.insert(apps).values(
|
await ctx.db.insert(apps).values(
|
||||||
appsToCreate.map((app) => ({
|
input.map((app) => ({
|
||||||
id: createId(),
|
id: createId(),
|
||||||
name: app.name,
|
name: app.name,
|
||||||
iconUrl: app.iconUrl ?? defaultIcon,
|
iconUrl: app.iconUrl ?? defaultIcon,
|
||||||
@@ -390,26 +270,16 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
}),
|
}),
|
||||||
setupIntegrations: onboardingProcedure.requiresStep("integrations").mutation(async ({ ctx }) => {
|
setupIntegrations: onboardingProcedure.requiresStep("integrations").mutation(async ({ ctx }) => {
|
||||||
const db = ctx.db;
|
const db = ctx.db;
|
||||||
const serverSettings = await getServerSettingsAsync(db);
|
|
||||||
|
|
||||||
const allIntegrations = await db.query.integrations.findMany();
|
const allIntegrations = await db.query.integrations.findMany();
|
||||||
const allApps = await db.query.apps.findMany();
|
const allApps = await db.query.apps.findMany();
|
||||||
const labelSyncedAppIds = new Set(
|
|
||||||
(await db.query.dockerAppSources.findMany({ columns: { appId: true } })).map((source) => source.appId),
|
|
||||||
);
|
|
||||||
const appsForWidgetPlacement = allApps.filter((app) => !labelSyncedAppIds.has(app.id));
|
|
||||||
|
|
||||||
const boardList = await db.query.boards.findMany({
|
const board = await db.query.boards.findFirst({
|
||||||
orderBy: asc(boards.name),
|
|
||||||
with: {
|
with: {
|
||||||
sections: true,
|
sections: true,
|
||||||
layouts: true,
|
layouts: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const targetBoardName = serverSettings.docker.targetBoardName;
|
|
||||||
const board = targetBoardName
|
|
||||||
? (boardList.find((entry) => entry.name === targetBoardName) ?? boardList.at(0))
|
|
||||||
: boardList.at(0);
|
|
||||||
|
|
||||||
if (!board) {
|
if (!board) {
|
||||||
await nextOnboardingStepAsync(db, undefined);
|
await nextOnboardingStepAsync(db, undefined);
|
||||||
@@ -427,16 +297,15 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
const layout = board.layouts[0];
|
const layout = board.layouts[0];
|
||||||
|
|
||||||
if (section && layout) {
|
if (section && layout) {
|
||||||
const emptySectionLayouts = await db.query.itemLayouts.findMany({
|
const existingItems = await db.query.items.findMany({
|
||||||
where: eq(itemLayouts.sectionId, section.id),
|
where: eq(items.boardId, board.id),
|
||||||
columns: { itemId: true },
|
|
||||||
});
|
});
|
||||||
const emptySectionItemIds = emptySectionLayouts.map((entry) => entry.itemId);
|
for (const item of existingItems) {
|
||||||
|
await db.delete(integrationItems).where(eq(integrationItems.itemId, item.id));
|
||||||
if (emptySectionItemIds.length > 0) {
|
await db.delete(itemLayouts).where(eq(itemLayouts.itemId, item.id));
|
||||||
await db.delete(integrationItems).where(inArray(integrationItems.itemId, emptySectionItemIds));
|
}
|
||||||
await db.delete(itemLayouts).where(inArray(itemLayouts.itemId, emptySectionItemIds));
|
if (existingItems.length > 0) {
|
||||||
await db.delete(items).where(inArray(items.id, emptySectionItemIds));
|
await db.delete(items).where(eq(items.boardId, board.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
await placeAllWidgetsAsync(
|
await placeAllWidgetsAsync(
|
||||||
@@ -448,7 +317,7 @@ export const onboardRouter = createTRPCRouter({
|
|||||||
columnCount: layout.columnCount,
|
columnCount: layout.columnCount,
|
||||||
},
|
},
|
||||||
allIntegrations,
|
allIntegrations,
|
||||||
appsForWidgetPlacement,
|
allApps,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
CREATE TABLE `docker_app_source` (
|
|
||||||
`host` varchar(512) NOT NULL,
|
|
||||||
`container_id` varchar(128) NOT NULL,
|
|
||||||
`external_id` varchar(512) NOT NULL,
|
|
||||||
`app_id` varchar(64) NOT NULL,
|
|
||||||
`board_id` varchar(64) NOT NULL,
|
|
||||||
`item_id` varchar(64),
|
|
||||||
`integration_id` varchar(64),
|
|
||||||
`updated_at` timestamp NOT NULL DEFAULT (now()),
|
|
||||||
CONSTRAINT `docker_app_source_host_container_id_pk` PRIMARY KEY(`host`,`container_id`)
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
ALTER TABLE `docker_app_source` ADD CONSTRAINT `docker_app_source_app_id_app_id_fk` FOREIGN KEY (`app_id`) REFERENCES `app`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
||||||
ALTER TABLE `docker_app_source` ADD CONSTRAINT `docker_app_source_board_id_board_id_fk` FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
||||||
ALTER TABLE `docker_app_source` ADD CONSTRAINT `docker_app_source_item_id_item_id_fk` FOREIGN KEY (`item_id`) REFERENCES `item`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
||||||
ALTER TABLE `docker_app_source` ADD CONSTRAINT `docker_app_source_integration_id_integration_id_fk` FOREIGN KEY (`integration_id`) REFERENCES `integration`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
||||||
CREATE INDEX `docker_app_source__external_id_idx` ON `docker_app_source` (`host`,`external_id`);
|
|
||||||
@@ -295,13 +295,6 @@
|
|||||||
"when": 1780764500000,
|
"when": 1780764500000,
|
||||||
"tag": "0041_merge_custom_widget_url",
|
"tag": "0041_merge_custom_widget_url",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"idx": 42,
|
|
||||||
"version": "5",
|
|
||||||
"when": 1780764600000,
|
|
||||||
"tag": "0042_add_docker_app_source",
|
|
||||||
"breakpoints": true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
CREATE TABLE "docker_app_source" (
|
|
||||||
"host" varchar(512) NOT NULL,
|
|
||||||
"container_id" varchar(128) NOT NULL,
|
|
||||||
"external_id" varchar(512) NOT NULL,
|
|
||||||
"app_id" varchar(64) NOT NULL,
|
|
||||||
"board_id" varchar(64) NOT NULL,
|
|
||||||
"item_id" varchar(64),
|
|
||||||
"integration_id" varchar(64),
|
|
||||||
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
||||||
CONSTRAINT "docker_app_source_host_container_id_pk" PRIMARY KEY("host","container_id")
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
ALTER TABLE "docker_app_source" ADD CONSTRAINT "docker_app_source_app_id_app_id_fk" FOREIGN KEY ("app_id") REFERENCES "public"."app"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
||||||
ALTER TABLE "docker_app_source" ADD CONSTRAINT "docker_app_source_board_id_board_id_fk" FOREIGN KEY ("board_id") REFERENCES "public"."board"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
||||||
ALTER TABLE "docker_app_source" ADD CONSTRAINT "docker_app_source_item_id_item_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."item"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
||||||
ALTER TABLE "docker_app_source" ADD CONSTRAINT "docker_app_source_integration_id_integration_id_fk" FOREIGN KEY ("integration_id") REFERENCES "public"."integration"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
||||||
CREATE INDEX "docker_app_source__external_id_idx" ON "docker_app_source" USING btree ("host","external_id");
|
|
||||||
@@ -57,13 +57,6 @@
|
|||||||
"when": 1780764500000,
|
"when": 1780764500000,
|
||||||
"tag": "0007_merge_custom_widget_url",
|
"tag": "0007_merge_custom_widget_url",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"idx": 8,
|
|
||||||
"version": "7",
|
|
||||||
"when": 1780764600000,
|
|
||||||
"tag": "0008_add_docker_app_source",
|
|
||||||
"breakpoints": true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
CREATE TABLE `docker_app_source` (
|
|
||||||
`host` text NOT NULL,
|
|
||||||
`container_id` text NOT NULL,
|
|
||||||
`external_id` text NOT NULL,
|
|
||||||
`app_id` text NOT NULL,
|
|
||||||
`board_id` text NOT NULL,
|
|
||||||
`item_id` text,
|
|
||||||
`integration_id` text,
|
|
||||||
`updated_at` integer NOT NULL,
|
|
||||||
PRIMARY KEY(`host`, `container_id`),
|
|
||||||
FOREIGN KEY (`app_id`) REFERENCES `app`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
||||||
FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
||||||
FOREIGN KEY (`item_id`) REFERENCES `item`(`id`) ON UPDATE no action ON DELETE set null,
|
|
||||||
FOREIGN KEY (`integration_id`) REFERENCES `integration`(`id`) ON UPDATE no action ON DELETE set null
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE INDEX `docker_app_source__external_id_idx` ON `docker_app_source` (`host`,`external_id`);
|
|
||||||
@@ -281,13 +281,6 @@
|
|||||||
"when": 1780764500000,
|
"when": 1780764500000,
|
||||||
"tag": "0039_merge_custom_widget_url",
|
"tag": "0039_merge_custom_widget_url",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"idx": 40,
|
|
||||||
"version": "6",
|
|
||||||
"when": 1780764600000,
|
|
||||||
"tag": "0040_add_docker_app_source",
|
|
||||||
"breakpoints": true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,6 @@ export const {
|
|||||||
cronJobConfigurations,
|
cronJobConfigurations,
|
||||||
customWidgetDefinitions,
|
customWidgetDefinitions,
|
||||||
customWidgetSecrets,
|
customWidgetSecrets,
|
||||||
dockerAppSources,
|
|
||||||
} = schema;
|
} = schema;
|
||||||
|
|
||||||
export type User = InferSelectModel<typeof schema.users>;
|
export type User = InferSelectModel<typeof schema.users>;
|
||||||
|
|||||||
@@ -547,33 +547,6 @@ export const cronJobConfigurations = mysqlTable("cron_job_configuration", {
|
|||||||
isEnabled: boolean().default(true).notNull(),
|
isEnabled: boolean().default(true).notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const dockerAppSources = mysqlTable(
|
|
||||||
"docker_app_source",
|
|
||||||
{
|
|
||||||
host: varchar({ length: 512 }).notNull(),
|
|
||||||
containerId: varchar({ length: 128 }).notNull(),
|
|
||||||
externalId: varchar({ length: 512 }).notNull(),
|
|
||||||
appId: varchar({ length: 64 })
|
|
||||||
.notNull()
|
|
||||||
.references(() => apps.id, { onDelete: "cascade" }),
|
|
||||||
boardId: varchar({ length: 64 })
|
|
||||||
.notNull()
|
|
||||||
.references(() => boards.id, { onDelete: "cascade" }),
|
|
||||||
itemId: varchar({ length: 64 }).references(() => items.id, { onDelete: "set null" }),
|
|
||||||
integrationId: varchar({ length: 64 }).references(() => integrations.id, { onDelete: "set null" }),
|
|
||||||
updatedAt: timestamp()
|
|
||||||
.notNull()
|
|
||||||
.$onUpdateFn(() => new Date())
|
|
||||||
.$defaultFn(() => new Date()),
|
|
||||||
},
|
|
||||||
(table) => ({
|
|
||||||
compoundKey: primaryKey({
|
|
||||||
columns: [table.host, table.containerId],
|
|
||||||
}),
|
|
||||||
externalIdIdx: index("docker_app_source__external_id_idx").on(table.host, table.externalId),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||||
user: one(users, {
|
user: one(users, {
|
||||||
fields: [accounts.userId],
|
fields: [accounts.userId],
|
||||||
@@ -853,22 +826,3 @@ export const customWidgetSecretRelations = relations(customWidgetSecrets, ({ one
|
|||||||
references: [customWidgetDefinitions.id],
|
references: [customWidgetDefinitions.id],
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const dockerAppSourceRelations = relations(dockerAppSources, ({ one }) => ({
|
|
||||||
app: one(apps, {
|
|
||||||
fields: [dockerAppSources.appId],
|
|
||||||
references: [apps.id],
|
|
||||||
}),
|
|
||||||
board: one(boards, {
|
|
||||||
fields: [dockerAppSources.boardId],
|
|
||||||
references: [boards.id],
|
|
||||||
}),
|
|
||||||
item: one(items, {
|
|
||||||
fields: [dockerAppSources.itemId],
|
|
||||||
references: [items.id],
|
|
||||||
}),
|
|
||||||
integration: one(integrations, {
|
|
||||||
fields: [dockerAppSources.integrationId],
|
|
||||||
references: [integrations.id],
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
@@ -546,33 +546,6 @@ export const cronJobConfigurations = pgTable("cron_job_configuration", {
|
|||||||
isEnabled: boolean().default(true).notNull(),
|
isEnabled: boolean().default(true).notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const dockerAppSources = pgTable(
|
|
||||||
"docker_app_source",
|
|
||||||
{
|
|
||||||
host: varchar({ length: 512 }).notNull(),
|
|
||||||
containerId: varchar({ length: 128 }).notNull(),
|
|
||||||
externalId: varchar({ length: 512 }).notNull(),
|
|
||||||
appId: varchar({ length: 64 })
|
|
||||||
.notNull()
|
|
||||||
.references(() => apps.id, { onDelete: "cascade" }),
|
|
||||||
boardId: varchar({ length: 64 })
|
|
||||||
.notNull()
|
|
||||||
.references(() => boards.id, { onDelete: "cascade" }),
|
|
||||||
itemId: varchar({ length: 64 }).references(() => items.id, { onDelete: "set null" }),
|
|
||||||
integrationId: varchar({ length: 64 }).references(() => integrations.id, { onDelete: "set null" }),
|
|
||||||
updatedAt: timestamp()
|
|
||||||
.notNull()
|
|
||||||
.$onUpdateFn(() => new Date())
|
|
||||||
.$defaultFn(() => new Date()),
|
|
||||||
},
|
|
||||||
(table) => ({
|
|
||||||
compoundKey: primaryKey({
|
|
||||||
columns: [table.host, table.containerId],
|
|
||||||
}),
|
|
||||||
externalIdIdx: index("docker_app_source__external_id_idx").on(table.host, table.externalId),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||||
user: one(users, {
|
user: one(users, {
|
||||||
fields: [accounts.userId],
|
fields: [accounts.userId],
|
||||||
@@ -852,22 +825,3 @@ export const customWidgetSecretRelations = relations(customWidgetSecrets, ({ one
|
|||||||
references: [customWidgetDefinitions.id],
|
references: [customWidgetDefinitions.id],
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const dockerAppSourceRelations = relations(dockerAppSources, ({ one }) => ({
|
|
||||||
app: one(apps, {
|
|
||||||
fields: [dockerAppSources.appId],
|
|
||||||
references: [apps.id],
|
|
||||||
}),
|
|
||||||
board: one(boards, {
|
|
||||||
fields: [dockerAppSources.boardId],
|
|
||||||
references: [boards.id],
|
|
||||||
}),
|
|
||||||
item: one(items, {
|
|
||||||
fields: [dockerAppSources.itemId],
|
|
||||||
references: [items.id],
|
|
||||||
}),
|
|
||||||
integration: one(integrations, {
|
|
||||||
fields: [dockerAppSources.integrationId],
|
|
||||||
references: [integrations.id],
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
@@ -536,33 +536,6 @@ export const cronJobConfigurations = sqliteTable("cron_job_configuration", {
|
|||||||
isEnabled: int({ mode: "boolean" }).default(true).notNull(),
|
isEnabled: int({ mode: "boolean" }).default(true).notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const dockerAppSources = sqliteTable(
|
|
||||||
"docker_app_source",
|
|
||||||
{
|
|
||||||
host: text().notNull(),
|
|
||||||
containerId: text().notNull(),
|
|
||||||
externalId: text().notNull(),
|
|
||||||
appId: text()
|
|
||||||
.notNull()
|
|
||||||
.references(() => apps.id, { onDelete: "cascade" }),
|
|
||||||
boardId: text()
|
|
||||||
.notNull()
|
|
||||||
.references(() => boards.id, { onDelete: "cascade" }),
|
|
||||||
itemId: text().references(() => items.id, { onDelete: "set null" }),
|
|
||||||
integrationId: text().references(() => integrations.id, { onDelete: "set null" }),
|
|
||||||
updatedAt: int({ mode: "timestamp" })
|
|
||||||
.$onUpdateFn(() => new Date())
|
|
||||||
.notNull()
|
|
||||||
.$defaultFn(() => new Date()),
|
|
||||||
},
|
|
||||||
(table) => ({
|
|
||||||
compoundKey: primaryKey({
|
|
||||||
columns: [table.host, table.containerId],
|
|
||||||
}),
|
|
||||||
externalIdIdx: index("docker_app_source__external_id_idx").on(table.host, table.externalId),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||||
user: one(users, {
|
user: one(users, {
|
||||||
fields: [accounts.userId],
|
fields: [accounts.userId],
|
||||||
@@ -842,22 +815,3 @@ export const customWidgetSecretRelations = relations(customWidgetSecrets, ({ one
|
|||||||
references: [customWidgetDefinitions.id],
|
references: [customWidgetDefinitions.id],
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const dockerAppSourceRelations = relations(dockerAppSources, ({ one }) => ({
|
|
||||||
app: one(apps, {
|
|
||||||
fields: [dockerAppSources.appId],
|
|
||||||
references: [apps.id],
|
|
||||||
}),
|
|
||||||
board: one(boards, {
|
|
||||||
fields: [dockerAppSources.boardId],
|
|
||||||
references: [boards.id],
|
|
||||||
}),
|
|
||||||
item: one(items, {
|
|
||||||
fields: [dockerAppSources.itemId],
|
|
||||||
references: [items.id],
|
|
||||||
}),
|
|
||||||
integration: one(integrations, {
|
|
||||||
fields: [dockerAppSources.integrationId],
|
|
||||||
references: [integrations.id],
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
@@ -36,6 +36,7 @@ const integrationAliases: Partial<Record<IntegrationKind, readonly string[]>> =
|
|||||||
linuxServerIO: ["linuxserver"],
|
linuxServerIO: ["linuxserver"],
|
||||||
coolify: ["coolify"],
|
coolify: ["coolify"],
|
||||||
truenas: ["truenas"],
|
truenas: ["truenas"],
|
||||||
|
fileFlows: ["fileflows"],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const matchIntegrationKind = (search: string): IntegrationKind | null => {
|
export const matchIntegrationKind = (search: string): IntegrationKind | null => {
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ export type HomarrDocumentationPath =
|
|||||||
| "/docs/integrations/dash-dot"
|
| "/docs/integrations/dash-dot"
|
||||||
| "/docs/integrations/glances"
|
| "/docs/integrations/glances"
|
||||||
| "/docs/integrations/tdarr"
|
| "/docs/integrations/tdarr"
|
||||||
|
| "/docs/integrations/fileflows"
|
||||||
| "/docs/integrations/proxmox"
|
| "/docs/integrations/proxmox"
|
||||||
| "/docs/integrations/nextcloud"
|
| "/docs/integrations/nextcloud"
|
||||||
| "/docs/integrations/unifi-controller"
|
| "/docs/integrations/unifi-controller"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export const integrationDocSlugs: Record<IntegrationKind, string | null> = {
|
|||||||
dashDot: "dash-dot",
|
dashDot: "dash-dot",
|
||||||
glances: "glances",
|
glances: "glances",
|
||||||
tdarr: "tdarr",
|
tdarr: "tdarr",
|
||||||
|
fileFlows: "fileflows",
|
||||||
proxmox: "proxmox",
|
proxmox: "proxmox",
|
||||||
nextcloud: "nextcloud",
|
nextcloud: "nextcloud",
|
||||||
unifiController: "unifi-controller",
|
unifiController: "unifi-controller",
|
||||||
|
|||||||
@@ -251,6 +251,14 @@ export const integrationDefs = {
|
|||||||
documentationUrl: createDocumentationLink("/docs/integrations/tdarr"),
|
documentationUrl: createDocumentationLink("/docs/integrations/tdarr"),
|
||||||
defaultPort: 8265,
|
defaultPort: 8265,
|
||||||
},
|
},
|
||||||
|
fileFlows: {
|
||||||
|
name: "FileFlows",
|
||||||
|
secretKinds: [[], ["apiKey"]],
|
||||||
|
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/fileflows.png",
|
||||||
|
category: ["mediaTranscoding"],
|
||||||
|
documentationUrl: createDocumentationLink("/docs/integrations/fileflows"),
|
||||||
|
defaultPort: 5000,
|
||||||
|
},
|
||||||
proxmox: {
|
proxmox: {
|
||||||
name: "Proxmox",
|
name: "Proxmox",
|
||||||
secretKinds: [["username", "tokenId", "apiKey", "realm"]],
|
secretKinds: [["username", "tokenId", "apiKey", "realm"]],
|
||||||
|
|||||||
@@ -25,15 +25,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"dockerode": "catalog:"
|
||||||
"@homarr/definitions": "workspace:^0.1.0",
|
|
||||||
"dockerode": "catalog:",
|
|
||||||
"superjson": "catalog:"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/dockerode": "catalog:",
|
"@types/dockerode": "catalog:",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:"
|
||||||
"vitest": "catalog:"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,472 +0,0 @@
|
|||||||
import type { ContainerInfo } from "dockerode";
|
|
||||||
import { describe, expect, test } from "vitest";
|
|
||||||
|
|
||||||
import { dockerLabels, homepageLabels } from "../../labels";
|
|
||||||
import { parseContainerLabels } from "../parse-container-labels";
|
|
||||||
|
|
||||||
const createContainer = (
|
|
||||||
labels: Record<string, string>,
|
|
||||||
id = "container-abc123",
|
|
||||||
): Pick<ContainerInfo, "Id" | "Labels"> => ({
|
|
||||||
Id: id,
|
|
||||||
Labels: labels,
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("parseContainerLabels", () => {
|
|
||||||
describe("homarr native labels", () => {
|
|
||||||
test("parses all homarr labels into DiscoveredService", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Jellyfin",
|
|
||||||
[dockerLabels.href]: "https://jellyfin.local",
|
|
||||||
[dockerLabels.icon]: "https://cdn.example/icon.png",
|
|
||||||
[dockerLabels.description]: "Media server",
|
|
||||||
[dockerLabels.ping]: "https://jellyfin.local/health",
|
|
||||||
[dockerLabels.id]: "jellyfin-1",
|
|
||||||
[dockerLabels.board]: "homelab",
|
|
||||||
[dockerLabels.integration]: "jellyfin",
|
|
||||||
[dockerLabels.widget]: "mediaServer",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toEqual({
|
|
||||||
containerId: "container-abc123",
|
|
||||||
host: "socket",
|
|
||||||
group: "Media",
|
|
||||||
name: "Jellyfin",
|
|
||||||
href: "https://jellyfin.local",
|
|
||||||
icon: "https://cdn.example/icon.png",
|
|
||||||
description: "Media server",
|
|
||||||
pingUrl: "https://jellyfin.local/health",
|
|
||||||
externalId: "jellyfin-1",
|
|
||||||
boardName: "homelab",
|
|
||||||
integrationKind: "jellyfin",
|
|
||||||
widgetKind: "mediaServer",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test("parses minimal required homarr labels (name, group, href)", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Networking",
|
|
||||||
[dockerLabels.name]: "Pi-hole",
|
|
||||||
[dockerLabels.href]: "http://pihole:80/admin",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toEqual({
|
|
||||||
containerId: "container-abc123",
|
|
||||||
host: "socket",
|
|
||||||
group: "Networking",
|
|
||||||
name: "Pi-hole",
|
|
||||||
href: "http://pihole:80/admin",
|
|
||||||
externalId: "container-abc123",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test("uses container ID as externalId when homarr.id is absent", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer(
|
|
||||||
{
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Plex",
|
|
||||||
[dockerLabels.href]: "http://plex:32400",
|
|
||||||
},
|
|
||||||
"sha256:deadbeef1234",
|
|
||||||
),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.externalId).toBe("sha256:deadbeef1234");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("uses homarr.id as externalId when present", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Plex",
|
|
||||||
[dockerLabels.href]: "http://plex:32400",
|
|
||||||
[dockerLabels.id]: "plex-server-main",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.externalId).toBe("plex-server-main");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("homepage fallback labels", () => {
|
|
||||||
test("uses homepage labels when homarr.name is absent", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[homepageLabels.group]: "Downloads",
|
|
||||||
[homepageLabels.name]: "Sonarr",
|
|
||||||
[homepageLabels.href]: "https://sonarr.local",
|
|
||||||
[homepageLabels.icon]: "https://cdn.example/sonarr.png",
|
|
||||||
[homepageLabels.description]: "TV shows",
|
|
||||||
}),
|
|
||||||
"192.168.1.10:2375",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toEqual({
|
|
||||||
containerId: "container-abc123",
|
|
||||||
host: "192.168.1.10:2375",
|
|
||||||
group: "Downloads",
|
|
||||||
name: "Sonarr",
|
|
||||||
href: "https://sonarr.local",
|
|
||||||
icon: "https://cdn.example/sonarr.png",
|
|
||||||
description: "TV shows",
|
|
||||||
externalId: "container-abc123",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test("does not use homepage fallback when readHomepageLabels is false", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[homepageLabels.group]: "Downloads",
|
|
||||||
[homepageLabels.name]: "Sonarr",
|
|
||||||
[homepageLabels.href]: "https://sonarr.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
{ readHomepageLabels: false },
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("homepage labels have no ping, board, integration, or widget support", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[homepageLabels.group]: "Media",
|
|
||||||
[homepageLabels.name]: "Emby",
|
|
||||||
[homepageLabels.href]: "http://emby:8096",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.pingUrl).toBeUndefined();
|
|
||||||
expect(result?.boardName).toBeUndefined();
|
|
||||||
expect(result?.integrationKind).toBeUndefined();
|
|
||||||
expect(result?.widgetKind).toBeUndefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("label priority and mixing", () => {
|
|
||||||
test("prefers homarr labels over homepage when both are present", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Homarr Group",
|
|
||||||
[dockerLabels.name]: "Homarr Name",
|
|
||||||
[dockerLabels.href]: "https://homarr.local",
|
|
||||||
[homepageLabels.group]: "Homepage Group",
|
|
||||||
[homepageLabels.name]: "Homepage Name",
|
|
||||||
[homepageLabels.href]: "https://homepage.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.group).toBe("Homarr Group");
|
|
||||||
expect(result?.name).toBe("Homarr Name");
|
|
||||||
expect(result?.href).toBe("https://homarr.local");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("disables homepage fallback entirely when homarr.name is present", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.name]: "MyApp",
|
|
||||||
[dockerLabels.href]: "http://myapp:3000",
|
|
||||||
[homepageLabels.group]: "FromHomepage",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("uses homarr icon with homepage name/group/href when homarr.name absent but homarr.icon present", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[homepageLabels.group]: "Media",
|
|
||||||
[homepageLabels.name]: "Jellyfin",
|
|
||||||
[homepageLabels.href]: "http://jellyfin:8096",
|
|
||||||
[dockerLabels.icon]: "https://custom-icon.example/jf.png",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.name).toBe("Jellyfin");
|
|
||||||
expect(result?.icon).toBe("https://custom-icon.example/jf.png");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("homarr.hide", () => {
|
|
||||||
test("skips container when homarr.hide is present with value 'true'", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.hide]: "true",
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Hidden",
|
|
||||||
[dockerLabels.href]: "https://hidden.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("skips container when homarr.hide is present with empty value", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.hide]: "",
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Hidden",
|
|
||||||
[dockerLabels.href]: "https://hidden.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("skips container when homarr.hide is any string (key presence is enough)", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.hide]: "anything",
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Hidden",
|
|
||||||
[dockerLabels.href]: "https://hidden.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("missing required labels", () => {
|
|
||||||
test("returns null when group is missing", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.name]: "NoGroup",
|
|
||||||
[dockerLabels.href]: "https://nogroup.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("returns null when name is missing", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.href]: "https://noname.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("returns null when href is missing", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "NoHref",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("returns null when homepage labels are incomplete (missing group)", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[homepageLabels.name]: "Incomplete",
|
|
||||||
[homepageLabels.href]: "http://incomplete.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("whitespace handling", () => {
|
|
||||||
test("trims whitespace from all label values", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: " Media ",
|
|
||||||
[dockerLabels.name]: " Jellyfin ",
|
|
||||||
[dockerLabels.href]: " https://jellyfin.local ",
|
|
||||||
[dockerLabels.icon]: " https://icon.png ",
|
|
||||||
[dockerLabels.description]: " A media server ",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.group).toBe("Media");
|
|
||||||
expect(result?.name).toBe("Jellyfin");
|
|
||||||
expect(result?.href).toBe("https://jellyfin.local");
|
|
||||||
expect(result?.icon).toBe("https://icon.png");
|
|
||||||
expect(result?.description).toBe("A media server");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("treats whitespace-only values as empty (missing)", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: " ",
|
|
||||||
[dockerLabels.href]: "https://example.local",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("integration and widget kind validation", () => {
|
|
||||||
test("parses valid integration kind", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Radarr",
|
|
||||||
[dockerLabels.href]: "http://radarr:7878",
|
|
||||||
[dockerLabels.integration]: "radarr",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.integrationKind).toBe("radarr");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("ignores invalid integration kind", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Custom App",
|
|
||||||
[dockerLabels.href]: "http://custom:3000",
|
|
||||||
[dockerLabels.integration]: "nonExistentIntegration",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.integrationKind).toBeUndefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("parses valid widget kind", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Jellyfin",
|
|
||||||
[dockerLabels.href]: "http://jellyfin:8096",
|
|
||||||
[dockerLabels.widget]: "mediaServer",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.widgetKind).toBe("mediaServer");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("ignores invalid widget kind", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "Custom",
|
|
||||||
[dockerLabels.href]: "http://custom:3000",
|
|
||||||
[dockerLabels.widget]: "totallyFakeWidget",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.widgetKind).toBeUndefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("handles empty integration kind gracefully", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Media",
|
|
||||||
[dockerLabels.name]: "App",
|
|
||||||
[dockerLabels.href]: "http://app:3000",
|
|
||||||
[dockerLabels.integration]: "",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.integrationKind).toBeUndefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("real-world scenarios", () => {
|
|
||||||
test("homepage-only service (common migration use case)", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[homepageLabels.group]: "Monitoring",
|
|
||||||
[homepageLabels.name]: "Grafana",
|
|
||||||
[homepageLabels.href]: "http://grafana:3000",
|
|
||||||
[homepageLabels.icon]: "grafana",
|
|
||||||
[homepageLabels.description]: "Metrics and dashboards",
|
|
||||||
}),
|
|
||||||
"tcp://192.168.1.50:2375",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result).toEqual({
|
|
||||||
containerId: "container-abc123",
|
|
||||||
host: "tcp://192.168.1.50:2375",
|
|
||||||
group: "Monitoring",
|
|
||||||
name: "Grafana",
|
|
||||||
href: "http://grafana:3000",
|
|
||||||
icon: "grafana",
|
|
||||||
description: "Metrics and dashboards",
|
|
||||||
externalId: "container-abc123",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test("service targeting a specific board", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer({
|
|
||||||
[dockerLabels.group]: "Infrastructure",
|
|
||||||
[dockerLabels.name]: "Traefik",
|
|
||||||
[dockerLabels.href]: "http://traefik:8080",
|
|
||||||
[dockerLabels.board]: "networking-board",
|
|
||||||
[dockerLabels.icon]: "https://cdn.example/traefik.svg",
|
|
||||||
}),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.boardName).toBe("networking-board");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("service with all optional fields empty uses defaults", () => {
|
|
||||||
const result = parseContainerLabels(
|
|
||||||
createContainer(
|
|
||||||
{
|
|
||||||
[dockerLabels.group]: "Tools",
|
|
||||||
[dockerLabels.name]: "Portainer",
|
|
||||||
[dockerLabels.href]: "http://portainer:9000",
|
|
||||||
},
|
|
||||||
"abc123def456",
|
|
||||||
),
|
|
||||||
"socket",
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(result?.icon).toBeUndefined();
|
|
||||||
expect(result?.description).toBeUndefined();
|
|
||||||
expect(result?.pingUrl).toBeUndefined();
|
|
||||||
expect(result?.boardName).toBeUndefined();
|
|
||||||
expect(result?.integrationKind).toBeUndefined();
|
|
||||||
expect(result?.widgetKind).toBeUndefined();
|
|
||||||
expect(result?.externalId).toBe("abc123def456");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("container with no labels returns null", () => {
|
|
||||||
const result = parseContainerLabels(createContainer({}), "socket");
|
|
||||||
expect(result).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export type { DiscoveredService } from "./types";
|
|
||||||
export { parseContainerLabels, type ParseContainerLabelsOptions } from "./parse-container-labels";
|
|
||||||
export { listDiscoveredContainersAsync } from "./list-discovered-containers";
|
|
||||||
export {
|
|
||||||
syncDiscoveredServicesAsync,
|
|
||||||
type SyncDiscoveredServicesOptions,
|
|
||||||
type SyncDiscoveredServicesResult,
|
|
||||||
} from "./sync-discovered-services";
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
|
||||||
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
|
||||||
|
|
||||||
import { dockerLabels, homepageLabels } from "../labels";
|
|
||||||
import { DockerSingleton } from "../singleton";
|
|
||||||
import type { ParseContainerLabelsOptions } from "./parse-container-labels";
|
|
||||||
import { parseContainerLabels } from "./parse-container-labels";
|
|
||||||
import type { DiscoveredService } from "./types";
|
|
||||||
|
|
||||||
const logger = createLogger({ module: "dockerDiscovery" });
|
|
||||||
|
|
||||||
const hasDiscoveryLabels = (labels: Record<string, string>) =>
|
|
||||||
Object.values(dockerLabels).some((label) => label !== dockerLabels.hide && label in labels) ||
|
|
||||||
Object.values(homepageLabels).some((label) => label in labels);
|
|
||||||
|
|
||||||
export const listDiscoveredContainersAsync = async (
|
|
||||||
options: ParseContainerLabelsOptions = {},
|
|
||||||
): Promise<DiscoveredService[]> => {
|
|
||||||
const dockerInstances = DockerSingleton.getInstances();
|
|
||||||
const results = await Promise.allSettled(
|
|
||||||
dockerInstances.map(async ({ instance, host }) => {
|
|
||||||
const containers = await instance.listContainers({ all: true });
|
|
||||||
return containers
|
|
||||||
.filter((container) => hasDiscoveryLabels(container.Labels ?? {}))
|
|
||||||
.map((container) => parseContainerLabels(container, host, options))
|
|
||||||
.filter((service): service is DiscoveredService => service !== null);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
return results.flatMap((result, index) => {
|
|
||||||
if (result.status === "fulfilled") {
|
|
||||||
return result.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.warn(
|
|
||||||
new ErrorWithMetadata(
|
|
||||||
"Failed to list containers for discovery",
|
|
||||||
{ host: dockerInstances[index]?.host },
|
|
||||||
{ cause: result.reason },
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return [];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
import type { ContainerInfo } from "dockerode";
|
|
||||||
|
|
||||||
import { integrationKinds, widgetKinds } from "@homarr/definitions";
|
|
||||||
import type { IntegrationKind, WidgetKind } from "@homarr/definitions";
|
|
||||||
|
|
||||||
import { dockerLabels, homepageLabels } from "../labels";
|
|
||||||
import type { DiscoveredService } from "./types";
|
|
||||||
|
|
||||||
export interface ParseContainerLabelsOptions {
|
|
||||||
readHomepageLabels?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const homarrLabelKeys = {
|
|
||||||
group: dockerLabels.group,
|
|
||||||
name: dockerLabels.name,
|
|
||||||
href: dockerLabels.href,
|
|
||||||
icon: dockerLabels.icon,
|
|
||||||
description: dockerLabels.description,
|
|
||||||
ping: dockerLabels.ping,
|
|
||||||
id: dockerLabels.id,
|
|
||||||
board: dockerLabels.board,
|
|
||||||
integration: dockerLabels.integration,
|
|
||||||
widget: dockerLabels.widget,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
const homepageLabelKeys = {
|
|
||||||
group: homepageLabels.group,
|
|
||||||
name: homepageLabels.name,
|
|
||||||
href: homepageLabels.href,
|
|
||||||
icon: homepageLabels.icon,
|
|
||||||
description: homepageLabels.description,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
const integrationKindSet = new Set<string>(integrationKinds);
|
|
||||||
const widgetKindSet = new Set<string>(widgetKinds);
|
|
||||||
|
|
||||||
const readLabel = (labels: Record<string, string>, key: string) => {
|
|
||||||
const value = labels[key]?.trim();
|
|
||||||
if (!value) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|
||||||
const resolveLabelValue = (
|
|
||||||
labels: Record<string, string>,
|
|
||||||
homarrKey: string,
|
|
||||||
homepageKey: string,
|
|
||||||
useHomepageFallback: boolean,
|
|
||||||
) => readLabel(labels, homarrKey) ?? (useHomepageFallback ? readLabel(labels, homepageKey) : undefined);
|
|
||||||
|
|
||||||
export const parseContainerLabels = (
|
|
||||||
container: Pick<ContainerInfo, "Id" | "Labels">,
|
|
||||||
host: string,
|
|
||||||
options: ParseContainerLabelsOptions = {},
|
|
||||||
): DiscoveredService | null => {
|
|
||||||
const labels = container.Labels ?? {};
|
|
||||||
|
|
||||||
if (dockerLabels.hide in labels) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const readHomepageLabels = options.readHomepageLabels ?? true;
|
|
||||||
const hasHomarrName = Boolean(readLabel(labels, dockerLabels.name));
|
|
||||||
const useHomepageFallback = readHomepageLabels && !hasHomarrName;
|
|
||||||
|
|
||||||
const name = resolveLabelValue(labels, homarrLabelKeys.name, homepageLabelKeys.name, useHomepageFallback);
|
|
||||||
const href = resolveLabelValue(labels, homarrLabelKeys.href, homepageLabelKeys.href, useHomepageFallback);
|
|
||||||
const group = resolveLabelValue(labels, homarrLabelKeys.group, homepageLabelKeys.group, useHomepageFallback);
|
|
||||||
|
|
||||||
if (!name || !href || !group) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const icon =
|
|
||||||
readLabel(labels, homarrLabelKeys.icon) ??
|
|
||||||
(useHomepageFallback ? readLabel(labels, homepageLabelKeys.icon) : undefined);
|
|
||||||
const description =
|
|
||||||
readLabel(labels, homarrLabelKeys.description) ??
|
|
||||||
(useHomepageFallback ? readLabel(labels, homepageLabelKeys.description) : undefined);
|
|
||||||
const pingUrl = readLabel(labels, homarrLabelKeys.ping);
|
|
||||||
const boardName = readLabel(labels, homarrLabelKeys.board);
|
|
||||||
const externalId = readLabel(labels, homarrLabelKeys.id) ?? container.Id;
|
|
||||||
|
|
||||||
const integrationKind = parseIntegrationKind(readLabel(labels, homarrLabelKeys.integration));
|
|
||||||
const widgetKind = parseWidgetKind(readLabel(labels, homarrLabelKeys.widget));
|
|
||||||
|
|
||||||
return {
|
|
||||||
containerId: container.Id,
|
|
||||||
host,
|
|
||||||
group,
|
|
||||||
name,
|
|
||||||
href,
|
|
||||||
icon,
|
|
||||||
description,
|
|
||||||
pingUrl,
|
|
||||||
externalId,
|
|
||||||
boardName,
|
|
||||||
integrationKind,
|
|
||||||
widgetKind,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const parseIntegrationKind = (value: string | undefined): IntegrationKind | undefined => {
|
|
||||||
if (!value || !integrationKindSet.has(value)) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return value as IntegrationKind;
|
|
||||||
};
|
|
||||||
|
|
||||||
const parseWidgetKind = (value: string | undefined): WidgetKind | undefined => {
|
|
||||||
if (!value || !widgetKindSet.has(value)) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return value as WidgetKind;
|
|
||||||
};
|
|
||||||
@@ -1,471 +0,0 @@
|
|||||||
import SuperJSON from "superjson";
|
|
||||||
|
|
||||||
import { createId } from "@homarr/common";
|
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
|
||||||
import { emptySuperJSON } from "@homarr/definitions";
|
|
||||||
import type { InferInsertModel, InferSelectModel } from "@homarr/db";
|
|
||||||
import { and, asc, db, eq, handleTransactionsAsync } from "@homarr/db";
|
|
||||||
import { createDbInsertCollectionForTransaction } from "@homarr/db/collection";
|
|
||||||
import { apps, boards, dockerAppSources, itemLayouts, items, layouts, sections } from "@homarr/db/schema";
|
|
||||||
|
|
||||||
import type { DiscoveredService } from "./types";
|
|
||||||
|
|
||||||
const logger = createLogger({ module: "dockerDiscoverySync" });
|
|
||||||
|
|
||||||
export interface SyncDiscoveredServicesOptions {
|
|
||||||
targetBoardName?: string | null;
|
|
||||||
enableStatusByDefault?: boolean;
|
|
||||||
forceDisableStatus?: boolean;
|
|
||||||
defaultItemWidth?: number;
|
|
||||||
defaultItemHeight?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SyncDiscoveredServicesResult {
|
|
||||||
created: number;
|
|
||||||
updated: number;
|
|
||||||
skipped: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SyncMetadata {
|
|
||||||
appId: string;
|
|
||||||
itemId?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AppItemOptions {
|
|
||||||
appId: string;
|
|
||||||
openInNewTab: boolean;
|
|
||||||
showTitle: boolean;
|
|
||||||
descriptionDisplayMode: "hidden";
|
|
||||||
layout: "column";
|
|
||||||
pingEnabled: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
type AppRow = InferSelectModel<typeof apps>;
|
|
||||||
|
|
||||||
type BoardWithRelations = NonNullable<Awaited<ReturnType<typeof loadBoardsWithRelationsAsync>>>[number];
|
|
||||||
|
|
||||||
type BoardItem = BoardWithRelations["items"][number];
|
|
||||||
|
|
||||||
const createSyncKey = (service: DiscoveredService) => `${service.host}/${service.containerId}`;
|
|
||||||
|
|
||||||
const appsMatchByHref = (app: Pick<AppRow, "href">, href: string) => app.href === href;
|
|
||||||
|
|
||||||
export const syncDiscoveredServicesAsync = async (
|
|
||||||
discoveredServices: DiscoveredService[],
|
|
||||||
options: SyncDiscoveredServicesOptions = {},
|
|
||||||
): Promise<SyncDiscoveredServicesResult> => {
|
|
||||||
const itemWidth = options.defaultItemWidth ?? 1;
|
|
||||||
const itemHeight = options.defaultItemHeight ?? 1;
|
|
||||||
const result: SyncDiscoveredServicesResult = { created: 0, updated: 0, skipped: 0 };
|
|
||||||
const syncMetadata = new Map<string, SyncMetadata>();
|
|
||||||
const existingApps = await db.query.apps.findMany();
|
|
||||||
const existingSources = await db.query.dockerAppSources.findMany();
|
|
||||||
const boardList = await loadBoardsWithRelationsAsync();
|
|
||||||
|
|
||||||
const appsToInsert: InferInsertModel<typeof apps>[] = [];
|
|
||||||
const appsToUpdate: { id: string; values: Partial<InferInsertModel<typeof apps>> }[] = [];
|
|
||||||
const sectionsToInsert: InferInsertModel<typeof sections>[] = [];
|
|
||||||
const itemsToInsert: InferInsertModel<typeof items>[] = [];
|
|
||||||
const itemLayoutsToInsert: InferInsertModel<typeof itemLayouts>[] = [];
|
|
||||||
|
|
||||||
const pendingSectionsByBoard = new Map<string, InferInsertModel<typeof sections>[]>();
|
|
||||||
const sectionYOffsetByBoard = new Map<string, number>();
|
|
||||||
const itemYOffsetBySection = new Map<string, number>();
|
|
||||||
const pendingItemLayouts: InferInsertModel<typeof itemLayouts>[] = [];
|
|
||||||
|
|
||||||
for (const service of discoveredServices) {
|
|
||||||
const syncKey = createSyncKey(service);
|
|
||||||
|
|
||||||
if (syncMetadata.has(syncKey)) {
|
|
||||||
result.skipped += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const board = resolveTargetBoard(boardList, service, options.targetBoardName);
|
|
||||||
if (!board) {
|
|
||||||
logger.warn("No target board found for discovered service", { syncKey, boardName: service.boardName });
|
|
||||||
result.skipped += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const firstLayout = getFirstLayout(board.layouts);
|
|
||||||
if (!firstLayout) {
|
|
||||||
logger.warn("Board has no layouts for discovered service", { boardId: board.id, syncKey });
|
|
||||||
result.skipped += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const existingSource = existingSources.find(
|
|
||||||
(source) => source.host === service.host && source.externalId === service.externalId,
|
|
||||||
);
|
|
||||||
const existingApp = existingSource
|
|
||||||
? existingApps.find((app) => app.id === existingSource.appId)
|
|
||||||
: existingApps.find((app) => appsMatchByHref(app, service.href));
|
|
||||||
let appId: string;
|
|
||||||
let wasCreated = false;
|
|
||||||
let wasUpdated = false;
|
|
||||||
|
|
||||||
if (existingApp) {
|
|
||||||
appId = existingApp.id;
|
|
||||||
const updateValues = buildAppUpdateValues(service, existingApp);
|
|
||||||
if (updateValues) {
|
|
||||||
appsToUpdate.push({ id: appId, values: updateValues });
|
|
||||||
wasUpdated = true;
|
|
||||||
Object.assign(existingApp, updateValues);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
appId = createId();
|
|
||||||
const newApp = buildAppInsert(service, appId);
|
|
||||||
appsToInsert.push(newApp);
|
|
||||||
existingApps.push(newApp as AppRow);
|
|
||||||
wasCreated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const categorySection = findOrCreateCategorySection(
|
|
||||||
board,
|
|
||||||
service.group,
|
|
||||||
sectionsToInsert,
|
|
||||||
pendingSectionsByBoard,
|
|
||||||
sectionYOffsetByBoard,
|
|
||||||
);
|
|
||||||
|
|
||||||
const existingItem = findAppItemForApp(board.items, itemsToInsert, pendingItemLayouts, appId, categorySection.id);
|
|
||||||
|
|
||||||
if (!existingItem) {
|
|
||||||
const newItemId = createId();
|
|
||||||
|
|
||||||
const newItemLayouts = board.layouts.map((layout) => ({
|
|
||||||
itemId: newItemId,
|
|
||||||
sectionId: categorySection.id,
|
|
||||||
layoutId: layout.id,
|
|
||||||
xOffset: 0,
|
|
||||||
yOffset: getNextItemYOffset(
|
|
||||||
board,
|
|
||||||
categorySection.id,
|
|
||||||
layout.id,
|
|
||||||
itemYOffsetBySection,
|
|
||||||
pendingItemLayouts,
|
|
||||||
itemHeight,
|
|
||||||
),
|
|
||||||
width: itemWidth,
|
|
||||||
height: itemHeight,
|
|
||||||
}));
|
|
||||||
|
|
||||||
itemsToInsert.push({
|
|
||||||
id: newItemId,
|
|
||||||
boardId: board.id,
|
|
||||||
kind: "app",
|
|
||||||
options: SuperJSON.stringify(buildAppItemOptions(appId, service, options)),
|
|
||||||
advancedOptions: SuperJSON.stringify({
|
|
||||||
title: null,
|
|
||||||
customCssClasses: [],
|
|
||||||
borderColor: "",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
itemLayoutsToInsert.push(...newItemLayouts);
|
|
||||||
pendingItemLayouts.push(...newItemLayouts);
|
|
||||||
syncMetadata.set(syncKey, { appId, itemId: newItemId });
|
|
||||||
wasCreated = true;
|
|
||||||
} else {
|
|
||||||
syncMetadata.set(syncKey, { appId, itemId: existingItem.id });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wasCreated) {
|
|
||||||
result.created += 1;
|
|
||||||
} else if (wasUpdated) {
|
|
||||||
result.updated += 1;
|
|
||||||
} else {
|
|
||||||
result.skipped += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const sourcesToUpsert: InferInsertModel<typeof dockerAppSources>[] = [];
|
|
||||||
for (const [syncKey, meta] of syncMetadata.entries()) {
|
|
||||||
const service = discoveredServices.find((svc) => createSyncKey(svc) === syncKey);
|
|
||||||
if (!service) continue;
|
|
||||||
|
|
||||||
const board = resolveTargetBoard(boardList, service, options.targetBoardName);
|
|
||||||
if (!board) continue;
|
|
||||||
|
|
||||||
sourcesToUpsert.push({
|
|
||||||
host: service.host,
|
|
||||||
containerId: service.containerId,
|
|
||||||
externalId: service.externalId,
|
|
||||||
appId: meta.appId,
|
|
||||||
boardId: board.id,
|
|
||||||
itemId: meta.itemId ?? null,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
appsToInsert.length === 0 &&
|
|
||||||
appsToUpdate.length === 0 &&
|
|
||||||
sectionsToInsert.length === 0 &&
|
|
||||||
itemsToInsert.length === 0 &&
|
|
||||||
sourcesToUpsert.length === 0
|
|
||||||
) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
const insertCollection = createDbInsertCollectionForTransaction(["apps", "sections", "items", "itemLayouts"]);
|
|
||||||
insertCollection.apps.push(...appsToInsert);
|
|
||||||
insertCollection.sections.push(...sectionsToInsert);
|
|
||||||
insertCollection.items.push(...itemsToInsert);
|
|
||||||
insertCollection.itemLayouts.push(...itemLayoutsToInsert);
|
|
||||||
|
|
||||||
await handleTransactionsAsync(db, {
|
|
||||||
async handleAsync(innerDb) {
|
|
||||||
for (const { id, values } of appsToUpdate) {
|
|
||||||
await innerDb
|
|
||||||
.update(apps as never)
|
|
||||||
.set(values)
|
|
||||||
.where(eq(apps.id, id));
|
|
||||||
}
|
|
||||||
await insertCollection.insertAllAsync(innerDb);
|
|
||||||
const table = dockerAppSources as never;
|
|
||||||
for (const source of sourcesToUpsert) {
|
|
||||||
const existing = await innerDb.query.dockerAppSources.findFirst({
|
|
||||||
where: and(eq(dockerAppSources.host, source.host), eq(dockerAppSources.containerId, source.containerId)),
|
|
||||||
});
|
|
||||||
if (existing) {
|
|
||||||
await innerDb
|
|
||||||
.update(table)
|
|
||||||
.set({
|
|
||||||
appId: source.appId,
|
|
||||||
boardId: source.boardId,
|
|
||||||
itemId: source.itemId,
|
|
||||||
externalId: source.externalId,
|
|
||||||
updatedAt: new Date(),
|
|
||||||
})
|
|
||||||
.where(and(eq(dockerAppSources.host, source.host), eq(dockerAppSources.containerId, source.containerId)));
|
|
||||||
} else {
|
|
||||||
await innerDb.insert(table).values(source as never);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleSync(innerDb) {
|
|
||||||
for (const { id, values } of appsToUpdate) {
|
|
||||||
innerDb
|
|
||||||
.update(apps as never)
|
|
||||||
.set(values)
|
|
||||||
.where(eq(apps.id, id))
|
|
||||||
.run();
|
|
||||||
}
|
|
||||||
insertCollection.insertAll(innerDb);
|
|
||||||
for (const source of sourcesToUpsert) {
|
|
||||||
try {
|
|
||||||
innerDb.insert(dockerAppSources).values(source).run();
|
|
||||||
} catch {
|
|
||||||
innerDb
|
|
||||||
.update(dockerAppSources)
|
|
||||||
.set({
|
|
||||||
appId: source.appId,
|
|
||||||
boardId: source.boardId,
|
|
||||||
itemId: source.itemId,
|
|
||||||
externalId: source.externalId,
|
|
||||||
updatedAt: new Date(),
|
|
||||||
})
|
|
||||||
.where(and(eq(dockerAppSources.host, source.host), eq(dockerAppSources.containerId, source.containerId)))
|
|
||||||
.run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
const loadBoardsWithRelationsAsync = async () =>
|
|
||||||
db.query.boards.findMany({
|
|
||||||
orderBy: asc(boards.name),
|
|
||||||
with: {
|
|
||||||
layouts: true,
|
|
||||||
sections: true,
|
|
||||||
items: {
|
|
||||||
with: {
|
|
||||||
layouts: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const resolveTargetBoard = (
|
|
||||||
boardList: BoardWithRelations[],
|
|
||||||
service: DiscoveredService,
|
|
||||||
defaultBoardName: string | null | undefined,
|
|
||||||
) => {
|
|
||||||
const boardName = service.boardName ?? defaultBoardName ?? undefined;
|
|
||||||
if (boardName) {
|
|
||||||
return boardList.find((board) => board.name === boardName) ?? boardList.at(0);
|
|
||||||
}
|
|
||||||
return boardList.at(0);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getFirstLayout = (boardLayouts: InferSelectModel<typeof layouts>[]) =>
|
|
||||||
[...boardLayouts].sort((layoutA, layoutB) => layoutA.breakpoint - layoutB.breakpoint).at(0);
|
|
||||||
|
|
||||||
const buildAppInsert = (service: DiscoveredService, appId: string): InferInsertModel<typeof apps> => ({
|
|
||||||
id: appId,
|
|
||||||
name: service.name,
|
|
||||||
description: service.description ?? null,
|
|
||||||
iconUrl: service.icon ?? "",
|
|
||||||
href: service.href,
|
|
||||||
pingUrl: service.pingUrl ?? null,
|
|
||||||
});
|
|
||||||
|
|
||||||
const buildAppUpdateValues = (
|
|
||||||
service: DiscoveredService,
|
|
||||||
existingApp: AppRow,
|
|
||||||
): Partial<InferInsertModel<typeof apps>> | null => {
|
|
||||||
const values: Partial<InferInsertModel<typeof apps>> = {};
|
|
||||||
|
|
||||||
if (existingApp.name !== service.name) {
|
|
||||||
values.name = service.name;
|
|
||||||
}
|
|
||||||
if (existingApp.href !== service.href) {
|
|
||||||
values.href = service.href;
|
|
||||||
}
|
|
||||||
if (service.icon !== undefined && existingApp.iconUrl !== service.icon) {
|
|
||||||
values.iconUrl = service.icon;
|
|
||||||
}
|
|
||||||
if (service.description !== undefined && existingApp.description !== service.description) {
|
|
||||||
values.description = service.description;
|
|
||||||
}
|
|
||||||
if (service.pingUrl !== undefined && existingApp.pingUrl !== service.pingUrl) {
|
|
||||||
values.pingUrl = service.pingUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Object.keys(values).length > 0 ? values : null;
|
|
||||||
};
|
|
||||||
|
|
||||||
const buildAppItemOptions = (
|
|
||||||
appId: string,
|
|
||||||
service: DiscoveredService,
|
|
||||||
options: SyncDiscoveredServicesOptions,
|
|
||||||
): AppItemOptions => ({
|
|
||||||
appId,
|
|
||||||
openInNewTab: true,
|
|
||||||
showTitle: true,
|
|
||||||
descriptionDisplayMode: "hidden",
|
|
||||||
layout: "column",
|
|
||||||
pingEnabled:
|
|
||||||
!(options.forceDisableStatus ?? false) && (Boolean(service.pingUrl) || (options.enableStatusByDefault ?? true)),
|
|
||||||
});
|
|
||||||
|
|
||||||
const findOrCreateCategorySection = (
|
|
||||||
board: BoardWithRelations,
|
|
||||||
groupName: string,
|
|
||||||
sectionsToInsert: InferInsertModel<typeof sections>[],
|
|
||||||
pendingSectionsByBoard: Map<string, InferInsertModel<typeof sections>[]>,
|
|
||||||
sectionYOffsetByBoard: Map<string, number>,
|
|
||||||
): InferInsertModel<typeof sections> & { id: string } => {
|
|
||||||
const pendingForBoard = pendingSectionsByBoard.get(board.id) ?? [];
|
|
||||||
const pendingMatch = pendingForBoard.find((section) => section.kind === "category" && section.name === groupName);
|
|
||||||
if (pendingMatch) {
|
|
||||||
return pendingMatch as InferInsertModel<typeof sections> & { id: string };
|
|
||||||
}
|
|
||||||
|
|
||||||
const existingSection = board.sections.find((section) => section.kind === "category" && section.name === groupName);
|
|
||||||
if (existingSection) {
|
|
||||||
return existingSection;
|
|
||||||
}
|
|
||||||
|
|
||||||
const categorySections = board.sections.filter((section) => section.kind === "category");
|
|
||||||
const pendingCategorySections = pendingForBoard.filter((section) => section.kind === "category");
|
|
||||||
const maxYOffset = Math.max(
|
|
||||||
0,
|
|
||||||
...categorySections.map((section) => section.yOffset ?? 0),
|
|
||||||
...pendingCategorySections.map((section) => section.yOffset ?? 0),
|
|
||||||
sectionYOffsetByBoard.get(board.id) ?? 0,
|
|
||||||
);
|
|
||||||
const yOffset = maxYOffset + 1;
|
|
||||||
sectionYOffsetByBoard.set(board.id, yOffset);
|
|
||||||
|
|
||||||
const newSection: InferInsertModel<typeof sections> = {
|
|
||||||
id: createId(),
|
|
||||||
boardId: board.id,
|
|
||||||
kind: "category",
|
|
||||||
xOffset: 0,
|
|
||||||
yOffset,
|
|
||||||
name: groupName,
|
|
||||||
options: emptySuperJSON,
|
|
||||||
};
|
|
||||||
|
|
||||||
sectionsToInsert.push(newSection);
|
|
||||||
board.sections.push(newSection as BoardWithRelations["sections"][number]);
|
|
||||||
pendingSectionsByBoard.set(board.id, [...pendingForBoard, newSection]);
|
|
||||||
|
|
||||||
return newSection as InferInsertModel<typeof sections> & { id: string };
|
|
||||||
};
|
|
||||||
|
|
||||||
const findAppItemForApp = (
|
|
||||||
boardItems: BoardItem[],
|
|
||||||
pendingItems: InferInsertModel<typeof items>[],
|
|
||||||
pendingLayouts: InferInsertModel<typeof itemLayouts>[],
|
|
||||||
appId: string,
|
|
||||||
sectionId: string,
|
|
||||||
) => {
|
|
||||||
const dbMatch = boardItems.find((item) => itemMatchesAppInSection(item, appId, sectionId));
|
|
||||||
if (dbMatch) {
|
|
||||||
return dbMatch;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pendingMatch = pendingItems.find((item) => {
|
|
||||||
if (item.kind !== "app") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const itemOptions = SuperJSON.parse<AppItemOptions>(item.options ?? emptySuperJSON);
|
|
||||||
if (itemOptions.appId !== appId) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pendingLayouts.some((layout) => layout.itemId === item.id && layout.sectionId === sectionId);
|
|
||||||
});
|
|
||||||
|
|
||||||
return pendingMatch ? { id: pendingMatch.id } : undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
const itemMatchesAppInSection = (item: BoardItem, appId: string, sectionId: string) => {
|
|
||||||
if (item.kind !== "app") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const itemOptions = SuperJSON.parse<AppItemOptions>(item.options);
|
|
||||||
if (itemOptions.appId !== appId) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return item.layouts.some((layout) => layout.sectionId === sectionId);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getNextItemYOffset = (
|
|
||||||
board: BoardWithRelations,
|
|
||||||
sectionId: string,
|
|
||||||
layoutId: string,
|
|
||||||
itemYOffsetBySection: Map<string, number>,
|
|
||||||
pendingLayouts: InferInsertModel<typeof itemLayouts>[],
|
|
||||||
itemHeight: number,
|
|
||||||
) => {
|
|
||||||
const sectionKey = `${board.id}/${sectionId}/${layoutId}`;
|
|
||||||
const trackedYOffset = itemYOffsetBySection.get(sectionKey);
|
|
||||||
if (trackedYOffset !== undefined) {
|
|
||||||
const nextYOffset = trackedYOffset + itemHeight;
|
|
||||||
itemYOffsetBySection.set(sectionKey, nextYOffset);
|
|
||||||
return trackedYOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
const dbLayouts = board.items.flatMap((item) =>
|
|
||||||
item.layouts.filter((layout) => layout.sectionId === sectionId && layout.layoutId === layoutId),
|
|
||||||
);
|
|
||||||
const pendingSectionLayouts = pendingLayouts.filter(
|
|
||||||
(layout) => layout.sectionId === sectionId && layout.layoutId === layoutId,
|
|
||||||
);
|
|
||||||
|
|
||||||
const maxYOffset = [...dbLayouts, ...pendingSectionLayouts].reduce(
|
|
||||||
(max, layout) => Math.max(max, layout.yOffset + layout.height),
|
|
||||||
0,
|
|
||||||
);
|
|
||||||
|
|
||||||
itemYOffsetBySection.set(sectionKey, maxYOffset + itemHeight);
|
|
||||||
return maxYOffset;
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import type { IntegrationKind, WidgetKind } from "@homarr/definitions";
|
|
||||||
|
|
||||||
export interface DiscoveredService {
|
|
||||||
containerId: string;
|
|
||||||
host: string;
|
|
||||||
group: string;
|
|
||||||
name: string;
|
|
||||||
href: string;
|
|
||||||
icon?: string;
|
|
||||||
description?: string;
|
|
||||||
pingUrl?: string;
|
|
||||||
externalId: string;
|
|
||||||
boardName?: string;
|
|
||||||
integrationKind?: IntegrationKind;
|
|
||||||
widgetKind?: WidgetKind;
|
|
||||||
}
|
|
||||||
@@ -9,4 +9,3 @@ export const containerStates = ["created", "running", "paused", "restarting", "e
|
|||||||
|
|
||||||
export type ContainerState = (typeof containerStates)[number];
|
export type ContainerState = (typeof containerStates)[number];
|
||||||
export * from "./labels";
|
export * from "./labels";
|
||||||
export * from "./discovery";
|
|
||||||
@@ -1,21 +1,4 @@
|
|||||||
export const dockerLabels = {
|
export const dockerLabels = {
|
||||||
|
// Label to hide a container from Homarrs docker integration
|
||||||
hide: "homarr.hide",
|
hide: "homarr.hide",
|
||||||
group: "homarr.group",
|
|
||||||
name: "homarr.name",
|
|
||||||
href: "homarr.href",
|
|
||||||
icon: "homarr.icon",
|
|
||||||
description: "homarr.description",
|
|
||||||
ping: "homarr.ping",
|
|
||||||
id: "homarr.id",
|
|
||||||
board: "homarr.board",
|
|
||||||
integration: "homarr.integration",
|
|
||||||
widget: "homarr.widget",
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const homepageLabels = {
|
|
||||||
group: "homepage.group",
|
|
||||||
name: "homepage.name",
|
|
||||||
href: "homepage.href",
|
|
||||||
icon: "homepage.icon",
|
|
||||||
description: "homepage.description",
|
|
||||||
} as const;
|
} as const;
|
||||||
@@ -33,6 +33,7 @@ import { RadarrIntegration } from "../media-organizer/radarr/radarr-integration"
|
|||||||
import { ReadarrIntegration } from "../media-organizer/readarr/readarr-integration";
|
import { ReadarrIntegration } from "../media-organizer/readarr/readarr-integration";
|
||||||
import { SonarrIntegration } from "../media-organizer/sonarr/sonarr-integration";
|
import { SonarrIntegration } from "../media-organizer/sonarr/sonarr-integration";
|
||||||
import { TdarrIntegration } from "../media-transcoding/tdarr-integration";
|
import { TdarrIntegration } from "../media-transcoding/tdarr-integration";
|
||||||
|
import { FileFlowsIntegration } from "../media-transcoding/fileflows-integration";
|
||||||
import { MockIntegration } from "../mock/mock-integration";
|
import { MockIntegration } from "../mock/mock-integration";
|
||||||
import { NavidromeIntegration } from "../navidrome/navidrome-integration";
|
import { NavidromeIntegration } from "../navidrome/navidrome-integration";
|
||||||
import { NextcloudIntegration } from "../nextcloud/nextcloud.integration";
|
import { NextcloudIntegration } from "../nextcloud/nextcloud.integration";
|
||||||
@@ -109,6 +110,7 @@ export const integrationCreators = {
|
|||||||
readarr: ReadarrIntegration,
|
readarr: ReadarrIntegration,
|
||||||
dashDot: DashDotIntegration,
|
dashDot: DashDotIntegration,
|
||||||
tdarr: TdarrIntegration,
|
tdarr: TdarrIntegration,
|
||||||
|
fileFlows: FileFlowsIntegration,
|
||||||
proxmox: ProxmoxIntegration,
|
proxmox: ProxmoxIntegration,
|
||||||
emby: EmbyIntegration,
|
emby: EmbyIntegration,
|
||||||
nextcloud: NextcloudIntegration,
|
nextcloud: NextcloudIntegration,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class GlancesIntegration extends Integration implements ISystemHealthMoni
|
|||||||
|
|
||||||
if (session == null) throw new Error("Session was unexpectitly null");
|
if (session == null) throw new Error("Session was unexpectitly null");
|
||||||
|
|
||||||
const [stats, cpuTemp] = await Promise.all([this.getAllStatsAsync(), this.getCpuTempAsync()]);
|
const stats = await this.getAllStatsAsync();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cpuUtilization: stats.cpu.total,
|
cpuUtilization: stats.cpu.total,
|
||||||
@@ -58,7 +58,7 @@ export class GlancesIntegration extends Integration implements ISystemHealthMoni
|
|||||||
cpuModelName: stats.quicklook?.cpu_name ?? "Unknown",
|
cpuModelName: stats.quicklook?.cpu_name ?? "Unknown",
|
||||||
loadAverage: null,
|
loadAverage: null,
|
||||||
smart: [],
|
smart: [],
|
||||||
cpuTemp,
|
cpuTemp: undefined,
|
||||||
gpu: stats.gpu.map((gpu) => ({
|
gpu: stats.gpu.map((gpu) => ({
|
||||||
gpuId: gpu.gpu_id,
|
gpuId: gpu.gpu_id,
|
||||||
name: gpu.name,
|
name: gpu.name,
|
||||||
@@ -80,23 +80,6 @@ export class GlancesIntegration extends Integration implements ISystemHealthMoni
|
|||||||
return await response.text();
|
return await response.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getCpuTempAsync(): Promise<number | undefined> {
|
|
||||||
// CPU temperature is optional data, so a transport error or payload drift on
|
|
||||||
// /api/4/sensors must not fail the whole getSystemInfoAsync() call.
|
|
||||||
try {
|
|
||||||
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/4/sensors"));
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const sensors = await sensorsSchema.parseAsync(await response.json());
|
|
||||||
return parseGlancesCpuTempFromSensors(sensors);
|
|
||||||
} catch {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async getAllStatsAsync() {
|
private async getAllStatsAsync() {
|
||||||
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/4/all"));
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/4/all"));
|
||||||
|
|
||||||
@@ -190,33 +173,3 @@ const allSchema = z.object({
|
|||||||
)
|
)
|
||||||
.default([]),
|
.default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
const sensorsSchema = z.array(
|
|
||||||
z.object({
|
|
||||||
label: z.string(),
|
|
||||||
value: z.number(),
|
|
||||||
type: z.string().optional(),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
const cpuTempLabelPriority = ["CPU", "Package id 0"] as const;
|
|
||||||
|
|
||||||
export const parseGlancesCpuTempFromSensors = (sensors: z.infer<typeof sensorsSchema>): number | undefined => {
|
|
||||||
const temperatureSensors = sensors.filter(
|
|
||||||
(sensor) => sensor.type === "temperature_core" || sensor.type === "temperature",
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const label of cpuTempLabelPriority) {
|
|
||||||
const match = temperatureSensors.find((sensor) => sensor.label === label);
|
|
||||||
if (match) {
|
|
||||||
return match.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const firstCore = temperatureSensors[0];
|
|
||||||
if (firstCore) {
|
|
||||||
return firstCore.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
};
|
|
||||||
@@ -69,24 +69,36 @@ export class LidarrIntegration extends Integration implements ICalendarIntegrati
|
|||||||
private getLinksForLidarrCalendarEvent = (event: z.infer<typeof lidarrCalendarEventSchema>) => {
|
private getLinksForLidarrCalendarEvent = (event: z.infer<typeof lidarrCalendarEventSchema>) => {
|
||||||
const links: CalendarLink[] = [];
|
const links: CalendarLink[] = [];
|
||||||
|
|
||||||
// titleSlug is only present when Lidarr returns it; guard so a missing value
|
|
||||||
// neither breaks the link nor drops the event.
|
|
||||||
if (event.artist.titleSlug) {
|
|
||||||
links.push({
|
|
||||||
href: this.externalUrl(`/artist/${event.artist.titleSlug}`).toString(),
|
|
||||||
name: "Lidarr",
|
|
||||||
logo: "/images/apps/lidarr.svg",
|
|
||||||
color: undefined,
|
|
||||||
isDark: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const link of event.artist.links) {
|
for (const link of event.artist.links) {
|
||||||
const externalLink = lidarrExternalCalendarLinks[link.name];
|
switch (link.name) {
|
||||||
if (!externalLink) {
|
case "vgmdb":
|
||||||
continue;
|
links.push({
|
||||||
|
href: link.url,
|
||||||
|
name: "VgmDB",
|
||||||
|
color: "#f5c518",
|
||||||
|
isDark: false,
|
||||||
|
logo: "/images/apps/vgmdb.svg",
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "imdb":
|
||||||
|
links.push({
|
||||||
|
href: link.url,
|
||||||
|
name: "IMDb",
|
||||||
|
color: "#f5c518",
|
||||||
|
isDark: false,
|
||||||
|
logo: "/images/apps/imdb.png",
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "last":
|
||||||
|
links.push({
|
||||||
|
href: link.url,
|
||||||
|
name: "LastFM",
|
||||||
|
color: "#cf222a",
|
||||||
|
isDark: false,
|
||||||
|
logo: "/images/apps/lastfm.svg",
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
links.push({ ...externalLink, href: link.url });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return links;
|
return links;
|
||||||
@@ -97,7 +109,7 @@ export class LidarrIntegration extends Integration implements ICalendarIntegrati
|
|||||||
): z.infer<typeof lidarrCalendarEventSchema>["images"][number] | undefined => {
|
): z.infer<typeof lidarrCalendarEventSchema>["images"][number] | undefined => {
|
||||||
const flatImages = [...event.images];
|
const flatImages = [...event.images];
|
||||||
|
|
||||||
const sortedImages = flatImages.toSorted(
|
const sortedImages = flatImages.sort(
|
||||||
(imageA, imageB) =>
|
(imageA, imageB) =>
|
||||||
mediaOrganizerPriorities.indexOf(imageA.coverType) - mediaOrganizerPriorities.indexOf(imageB.coverType),
|
mediaOrganizerPriorities.indexOf(imageA.coverType) - mediaOrganizerPriorities.indexOf(imageB.coverType),
|
||||||
);
|
);
|
||||||
@@ -137,16 +149,6 @@ const lidarrCalendarEventSchema = z.object({
|
|||||||
title: z.string(),
|
title: z.string(),
|
||||||
overview: z.string().optional(),
|
overview: z.string().optional(),
|
||||||
images: lidarrCalendarEventImageSchema,
|
images: lidarrCalendarEventImageSchema,
|
||||||
artist: z.object({
|
artist: z.object({ links: z.array(z.object({ url: z.string().url(), name: z.string() })), artistName: z.string() }),
|
||||||
links: z.array(z.object({ url: z.string().url(), name: z.string() })),
|
|
||||||
artistName: z.string(),
|
|
||||||
titleSlug: z.string().optional(),
|
|
||||||
}),
|
|
||||||
releaseDate: z.string().transform((value) => new Date(value)),
|
releaseDate: z.string().transform((value) => new Date(value)),
|
||||||
});
|
});
|
||||||
|
|
||||||
const lidarrExternalCalendarLinks: Record<string, Omit<CalendarLink, "href">> = {
|
|
||||||
vgmdb: { name: "VgmDB", color: "#f5c518", isDark: false, logo: "/images/apps/vgmdb.svg" },
|
|
||||||
imdb: { name: "IMDb", color: "#f5c518", isDark: false, logo: "/images/apps/imdb.png" },
|
|
||||||
last: { name: "LastFM", color: "#cf222a", isDark: false, logo: "/images/apps/lastfm.svg" },
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,200 @@
|
|||||||
|
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||||
|
|
||||||
|
import type { IntegrationTestingInput } from "../base/integration";
|
||||||
|
import { Integration } from "../base/integration";
|
||||||
|
import { TestConnectionError } from "../base/test-connection/test-connection-error";
|
||||||
|
import type { TestingResult } from "../base/test-connection/test-connection-service";
|
||||||
|
import type { IMediaTranscodingIntegration } from "../interfaces/media-transcoding/media-transcoding-integration";
|
||||||
|
import type { TdarrQueue, TdarrStatistics, TdarrWorker } from "../interfaces/media-transcoding/media-transcoding-types";
|
||||||
|
import {
|
||||||
|
libraryStatusSchema,
|
||||||
|
recentlyFinishedSchema,
|
||||||
|
shrinkageGroupsSchema,
|
||||||
|
statusResponseSchema,
|
||||||
|
upcomingFilesSchema,
|
||||||
|
workersResponseSchema,
|
||||||
|
} from "./fileflows-validation-schemas";
|
||||||
|
|
||||||
|
export class FileFlowsIntegration extends Integration implements IMediaTranscodingIntegration {
|
||||||
|
protected async testingAsync(input: IntegrationTestingInput): Promise<TestingResult> {
|
||||||
|
const response = await input.fetchAsync(this.url("/api/system/version"), {
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
accept: "application/json",
|
||||||
|
...(super.hasSecretValue("apiKey") ? { "X-Api-Key": super.getSecretValue("apiKey") } : {}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) return TestConnectionError.StatusResult(response);
|
||||||
|
|
||||||
|
return { success: true };
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getStatisticsAsync(): Promise<TdarrStatistics> {
|
||||||
|
const headerParams = {
|
||||||
|
accept: "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
...(super.hasSecretValue("apiKey") ? { "X-Api-Key": super.getSecretValue("apiKey") } : {}),
|
||||||
|
};
|
||||||
|
|
||||||
|
const [statusData, libraryStatusData, shrinkageData] = await Promise.all([
|
||||||
|
this.fetchStatusAsync(headerParams),
|
||||||
|
this.fetchLibraryStatusAsync(headerParams),
|
||||||
|
this.fetchShrinkageAsync(headerParams),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const failedCount = libraryStatusData
|
||||||
|
.filter((item) => item.Status === 4)
|
||||||
|
.reduce((sum, item) => sum + item.Count, 0);
|
||||||
|
const processedCount = libraryStatusData
|
||||||
|
.filter((item) => item.Status === 3)
|
||||||
|
.reduce((sum, item) => sum + item.Count, 0);
|
||||||
|
const queuedCount = libraryStatusData
|
||||||
|
.filter((item) => item.Status === 1 || item.Status === 5)
|
||||||
|
.reduce((sum, item) => sum + item.Count, 0);
|
||||||
|
|
||||||
|
const totalSavedSpace = Object.values(shrinkageData).reduce(
|
||||||
|
(sum, group) => sum + Math.max(0, group.OriginalSize - group.FinalSize),
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
|
||||||
|
const transcodeStatus = [
|
||||||
|
{ name: "Processed", value: statusData.processed },
|
||||||
|
{ name: "Queued", value: statusData.queue },
|
||||||
|
{ name: "Processing", value: statusData.processing },
|
||||||
|
{ name: "Failed", value: failedCount },
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
libraryName: "All",
|
||||||
|
totalFileCount: processedCount + queuedCount + statusData.processing + failedCount,
|
||||||
|
totalTranscodeCount: statusData.processed,
|
||||||
|
totalHealthCheckCount: 0,
|
||||||
|
failedTranscodeCount: failedCount,
|
||||||
|
failedHealthCheckCount: 0,
|
||||||
|
stagedTranscodeCount: statusData.queue,
|
||||||
|
stagedHealthCheckCount: 0,
|
||||||
|
totalSavedSpace,
|
||||||
|
transcodeStatus,
|
||||||
|
healthCheckStatus: [],
|
||||||
|
videoCodecs: [],
|
||||||
|
videoContainers: [],
|
||||||
|
videoResolutions: [],
|
||||||
|
audioCodecs: [],
|
||||||
|
audioContainers: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getWorkersAsync(): Promise<TdarrWorker[]> {
|
||||||
|
const headerParams = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
...(super.hasSecretValue("apiKey") ? { "X-Api-Key": super.getSecretValue("apiKey") } : {}),
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = this.url("/api/worker");
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(url, {
|
||||||
|
method: "GET",
|
||||||
|
headers: headerParams,
|
||||||
|
});
|
||||||
|
|
||||||
|
const workersData = await workersResponseSchema.parseAsync(await response.json());
|
||||||
|
|
||||||
|
return workersData.map((worker) => ({
|
||||||
|
id: worker.Uid,
|
||||||
|
filePath: worker.RelativeFile ?? "",
|
||||||
|
fps: 0,
|
||||||
|
percentage: worker.CurrentPartPercent,
|
||||||
|
ETA: worker.ProcessingTime?.TotalSeconds ? `${Math.round(worker.ProcessingTime.TotalSeconds)}s` : "",
|
||||||
|
jobType: worker.CurrentPartName ?? "Processing",
|
||||||
|
status: "Processing",
|
||||||
|
step: worker.CurrentPartName ?? "",
|
||||||
|
originalSize: worker.LibraryFile?.OriginalSize ?? 0,
|
||||||
|
estimatedSize: null,
|
||||||
|
outputSize: null,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getQueueAsync(firstItemIndex: number, pageSize: number): Promise<TdarrQueue> {
|
||||||
|
const headerParams = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
...(super.hasSecretValue("apiKey") ? { "X-Api-Key": super.getSecretValue("apiKey") } : {}),
|
||||||
|
};
|
||||||
|
|
||||||
|
const [upcomingItems, recentlyFinishedItems] = await Promise.all([
|
||||||
|
this.fetchUpcomingAsync(headerParams),
|
||||||
|
this.fetchRecentlyFinishedAsync(headerParams),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const queueArray = [
|
||||||
|
...upcomingItems.map((item) => ({
|
||||||
|
id: item.Uid,
|
||||||
|
healthCheck: "",
|
||||||
|
transcode: item.Flow ?? "Default",
|
||||||
|
filePath: item.RelativePath ?? item.Name ?? "",
|
||||||
|
fileSize: item.OriginalSize ?? 0,
|
||||||
|
container: "",
|
||||||
|
codec: "",
|
||||||
|
resolution: "",
|
||||||
|
type: "transcode" as const,
|
||||||
|
})),
|
||||||
|
...recentlyFinishedItems.map((item) => ({
|
||||||
|
id: item.Uid,
|
||||||
|
healthCheck: "",
|
||||||
|
transcode: item.Flow ?? "Default",
|
||||||
|
filePath: item.RelativePath ?? item.Name ?? "",
|
||||||
|
fileSize: item.FinalSize ?? item.OriginalSize ?? 0,
|
||||||
|
container: "",
|
||||||
|
codec: "",
|
||||||
|
resolution: "",
|
||||||
|
type: "health-check" as const,
|
||||||
|
})),
|
||||||
|
].slice(0, pageSize);
|
||||||
|
|
||||||
|
return {
|
||||||
|
array: queueArray,
|
||||||
|
totalCount: upcomingItems.length + recentlyFinishedItems.length,
|
||||||
|
startIndex: firstItemIndex,
|
||||||
|
endIndex: firstItemIndex + queueArray.length - 1,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private async fetchStatusAsync(headerParams: Record<string, string>) {
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/status"), {
|
||||||
|
method: "GET",
|
||||||
|
headers: headerParams,
|
||||||
|
});
|
||||||
|
return statusResponseSchema.parseAsync(await response.json());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async fetchLibraryStatusAsync(headerParams: Record<string, string>) {
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/library-file/status"), {
|
||||||
|
method: "GET",
|
||||||
|
headers: headerParams,
|
||||||
|
});
|
||||||
|
return libraryStatusSchema.parseAsync(await response.json());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async fetchShrinkageAsync(headerParams: Record<string, string>) {
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/library-file/shrinkage-groups"), {
|
||||||
|
method: "GET",
|
||||||
|
headers: headerParams,
|
||||||
|
});
|
||||||
|
return shrinkageGroupsSchema.parseAsync(await response.json());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async fetchUpcomingAsync(headerParams: Record<string, string>) {
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/library-file/upcoming"), {
|
||||||
|
method: "GET",
|
||||||
|
headers: headerParams,
|
||||||
|
});
|
||||||
|
return upcomingFilesSchema.parseAsync(await response.json());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async fetchRecentlyFinishedAsync(headerParams: Record<string, string>) {
|
||||||
|
const response = await fetchWithTrustedCertificatesAsync(this.url("/api/library-file/recently-finished"), {
|
||||||
|
method: "GET",
|
||||||
|
headers: headerParams,
|
||||||
|
});
|
||||||
|
return recentlyFinishedSchema.parseAsync(await response.json());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
|
export const statusResponseSchema = z.object({
|
||||||
|
queue: z.number(),
|
||||||
|
processing: z.number(),
|
||||||
|
processed: z.number(),
|
||||||
|
processingFiles: z
|
||||||
|
.array(
|
||||||
|
z.object({
|
||||||
|
name: z.string().nullable(),
|
||||||
|
relativePath: z.string().nullable(),
|
||||||
|
library: z.string().nullable(),
|
||||||
|
step: z.string().nullable(),
|
||||||
|
stepPercent: z.number(),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.optional()
|
||||||
|
.transform((arr) => arr ?? []),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const libraryStatusSchema = z.array(
|
||||||
|
z.object({
|
||||||
|
Name: z.string().nullable(),
|
||||||
|
Status: z.number(),
|
||||||
|
Count: z.number(),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
export const shrinkageGroupsSchema = z.record(
|
||||||
|
z.string(),
|
||||||
|
z.object({
|
||||||
|
Library: z.string().nullable(),
|
||||||
|
OriginalSize: z.number(),
|
||||||
|
FinalSize: z.number(),
|
||||||
|
Items: z.number(),
|
||||||
|
Difference: z.number().optional(),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
export const workersResponseSchema = z.array(
|
||||||
|
z.object({
|
||||||
|
Uid: z.string(),
|
||||||
|
NodeName: z.string().nullable(),
|
||||||
|
RelativeFile: z.string().nullable(),
|
||||||
|
CurrentPart: z.number(),
|
||||||
|
CurrentPartName: z.string().nullable(),
|
||||||
|
CurrentPartPercent: z.number(),
|
||||||
|
StartedAt: z.string(),
|
||||||
|
LastUpdate: z.string(),
|
||||||
|
ProcessingTime: z
|
||||||
|
.object({
|
||||||
|
TotalSeconds: z.number().optional(),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
LibraryFile: z
|
||||||
|
.object({
|
||||||
|
OriginalSize: z.number(),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
Library: z
|
||||||
|
.object({
|
||||||
|
Name: z.string().nullable(),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
export const upcomingFilesSchema = z.array(
|
||||||
|
z.object({
|
||||||
|
Uid: z.string(),
|
||||||
|
Name: z.string().nullable(),
|
||||||
|
RelativePath: z.string().nullable(),
|
||||||
|
OriginalSize: z.number().nullable(),
|
||||||
|
FinalSize: z.number().nullable(),
|
||||||
|
Status: z.number(),
|
||||||
|
Library: z.string().nullable(),
|
||||||
|
Flow: z.string().nullable(),
|
||||||
|
Node: z.string().nullable(),
|
||||||
|
ProcessingTime: z
|
||||||
|
.object({
|
||||||
|
TotalSeconds: z.number().optional(),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
export const recentlyFinishedSchema = z.array(
|
||||||
|
z.object({
|
||||||
|
Uid: z.string(),
|
||||||
|
Name: z.string().nullable(),
|
||||||
|
RelativePath: z.string().nullable(),
|
||||||
|
OriginalSize: z.number().nullable(),
|
||||||
|
FinalSize: z.number().nullable(),
|
||||||
|
Status: z.number(),
|
||||||
|
Library: z.string().nullable(),
|
||||||
|
Flow: z.string().nullable(),
|
||||||
|
}),
|
||||||
|
);
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
// @vitest-environment node
|
// @vitest-environment node
|
||||||
|
|
||||||
import { beforeEach, describe, expect, test, vi } from "vitest";
|
import { describe, expect, test, vi } from "vitest";
|
||||||
|
|
||||||
import { createDb } from "@homarr/db/test";
|
import { createDb } from "@homarr/db/test";
|
||||||
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||||
|
|
||||||
import { GlancesIntegration, parseGlancesCpuTempFromSensors } from "../src/glances/glances-integration";
|
import { GlancesIntegration } from "../src/glances/glances-integration";
|
||||||
|
|
||||||
// ─── module mocks ────────────────────────────────────────────────────────────
|
// ─── module mocks ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -64,19 +64,6 @@ function makeResponse(body: unknown) {
|
|||||||
} as never;
|
} as never;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mockGlancesFetch(statsBody: unknown, sensorsBody: unknown) {
|
|
||||||
mockFetch.mockImplementation(((url: string | URL) => {
|
|
||||||
const urlString = url.toString();
|
|
||||||
if (urlString.endsWith("/api/4/all")) {
|
|
||||||
return Promise.resolve(makeResponse(statsBody));
|
|
||||||
}
|
|
||||||
if (urlString.endsWith("/api/4/sensors")) {
|
|
||||||
return Promise.resolve(makeResponse(sensorsBody));
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(`Unexpected fetch URL: ${urlString}`));
|
|
||||||
}) as typeof fetchWithTrustedCertificatesAsync);
|
|
||||||
}
|
|
||||||
|
|
||||||
const integrationInput = {
|
const integrationInput = {
|
||||||
id: "test-glances",
|
id: "test-glances",
|
||||||
name: "Glances",
|
name: "Glances",
|
||||||
@@ -88,12 +75,8 @@ const integrationInput = {
|
|||||||
// ─── tests ───────────────────────────────────────────────────────────────────
|
// ─── tests ───────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
describe("GlancesIntegration schema", () => {
|
describe("GlancesIntegration schema", () => {
|
||||||
beforeEach(() => {
|
|
||||||
mockFetch.mockReset();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("parses stats when quicklook is present", async () => {
|
test("parses stats when quicklook is present", async () => {
|
||||||
mockGlancesFetch({ ...baseStats, quicklook: { cpu_name: "Apple M1" } }, []);
|
mockFetch.mockResolvedValueOnce(makeResponse({ ...baseStats, quicklook: { cpu_name: "Apple M1" } }));
|
||||||
|
|
||||||
const integration = new GlancesIntegration(integrationInput);
|
const integration = new GlancesIntegration(integrationInput);
|
||||||
const result = await integration.getSystemInfoAsync();
|
const result = await integration.getSystemInfoAsync();
|
||||||
@@ -103,7 +86,7 @@ describe("GlancesIntegration schema", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("returns Unknown cpuModelName when quicklook is absent (macOS scenario)", async () => {
|
test("returns Unknown cpuModelName when quicklook is absent (macOS scenario)", async () => {
|
||||||
mockGlancesFetch(baseStats, []);
|
mockFetch.mockResolvedValueOnce(makeResponse(baseStats));
|
||||||
|
|
||||||
const integration = new GlancesIntegration(integrationInput);
|
const integration = new GlancesIntegration(integrationInput);
|
||||||
const result = await integration.getSystemInfoAsync();
|
const result = await integration.getSystemInfoAsync();
|
||||||
@@ -112,41 +95,9 @@ describe("GlancesIntegration schema", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("does not throw a Zod parse error when quicklook is missing", async () => {
|
test("does not throw a Zod parse error when quicklook is missing", async () => {
|
||||||
mockGlancesFetch(baseStats, []);
|
mockFetch.mockResolvedValueOnce(makeResponse(baseStats));
|
||||||
|
|
||||||
const integration = new GlancesIntegration(integrationInput);
|
const integration = new GlancesIntegration(integrationInput);
|
||||||
await expect(integration.getSystemInfoAsync()).resolves.not.toThrow();
|
await expect(integration.getSystemInfoAsync()).resolves.not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("reads CPU temperature from sensors", async () => {
|
|
||||||
mockGlancesFetch(baseStats, [
|
|
||||||
{ label: "CPU", unit: "C", value: 58, type: "temperature_core" },
|
|
||||||
{ label: "Core 0", unit: "C", value: 54, type: "temperature_core" },
|
|
||||||
]);
|
|
||||||
|
|
||||||
const integration = new GlancesIntegration(integrationInput);
|
|
||||||
const result = await integration.getSystemInfoAsync();
|
|
||||||
|
|
||||||
expect(result.cpuTemp).toBe(58);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("parseGlancesCpuTempFromSensors", () => {
|
|
||||||
test("prefers CPU label over core sensors", () => {
|
|
||||||
const result = parseGlancesCpuTempFromSensors([
|
|
||||||
{ label: "Core 0", value: 54, type: "temperature_core" },
|
|
||||||
{ label: "CPU", value: 58, type: "temperature_core" },
|
|
||||||
]);
|
|
||||||
|
|
||||||
expect(result).toBe(58);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("falls back to Package id 0", () => {
|
|
||||||
const result = parseGlancesCpuTempFromSensors([
|
|
||||||
{ label: "Core 0", value: 54, type: "temperature_core" },
|
|
||||||
{ label: "Package id 0", value: 62, type: "temperature_core" },
|
|
||||||
]);
|
|
||||||
|
|
||||||
expect(result).toBe(62);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
// @vitest-environment node
|
|
||||||
|
|
||||||
import { describe, expect, test, vi } from "vitest";
|
|
||||||
|
|
||||||
import { createDb } from "@homarr/db/test";
|
|
||||||
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
|
||||||
|
|
||||||
import { LidarrIntegration } from "../src/media-organizer/lidarr/lidarr-integration";
|
|
||||||
|
|
||||||
vi.mock("@homarr/db", async (importActual) => {
|
|
||||||
const actual = await importActual<typeof import("@homarr/db")>();
|
|
||||||
return { ...actual, db: createDb() };
|
|
||||||
});
|
|
||||||
|
|
||||||
vi.mock("@homarr/core/infrastructure/certificates", async (importActual) => {
|
|
||||||
const actual = await importActual<typeof import("@homarr/core/infrastructure/certificates")>();
|
|
||||||
return {
|
|
||||||
...actual,
|
|
||||||
getTrustedCertificateHostnamesAsync: vi.fn().mockResolvedValue([]),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
vi.mock("@homarr/core/infrastructure/http", () => ({
|
|
||||||
fetchWithTrustedCertificatesAsync: vi.fn(),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const mockFetch = vi.mocked(fetchWithTrustedCertificatesAsync);
|
|
||||||
|
|
||||||
const integrationInput = {
|
|
||||||
id: "test-lidarr",
|
|
||||||
name: "Lidarr",
|
|
||||||
url: "http://localhost:8686",
|
|
||||||
decryptedSecrets: [{ kind: "apiKey" as const, value: "test-key" }],
|
|
||||||
externalUrl: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
describe("LidarrIntegration calendar", () => {
|
|
||||||
test("includes Lidarr artist link in calendar events", async () => {
|
|
||||||
mockFetch.mockResolvedValueOnce({
|
|
||||||
ok: true,
|
|
||||||
json: () =>
|
|
||||||
Promise.resolve([
|
|
||||||
{
|
|
||||||
title: "Test Album",
|
|
||||||
overview: "Overview",
|
|
||||||
images: [],
|
|
||||||
artist: {
|
|
||||||
artistName: "Test Artist",
|
|
||||||
titleSlug: "test-artist",
|
|
||||||
links: [{ name: "last", url: "https://last.fm/music/Test+Artist" }],
|
|
||||||
},
|
|
||||||
releaseDate: "2026-01-01T00:00:00Z",
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
} as never);
|
|
||||||
|
|
||||||
const integration = new LidarrIntegration(integrationInput);
|
|
||||||
const events = await integration.getCalendarEventsAsync(new Date("2026-01-01"), new Date("2026-01-31"));
|
|
||||||
|
|
||||||
expect(events[0]?.links[0]).toMatchObject({
|
|
||||||
name: "Lidarr",
|
|
||||||
href: "http://localhost:8686/artist/test-artist",
|
|
||||||
logo: "/images/apps/lidarr.svg",
|
|
||||||
});
|
|
||||||
// The existing external artist link must survive the Lidarr-link prepend.
|
|
||||||
expect(events[0]?.links).toEqual(
|
|
||||||
expect.arrayContaining([
|
|
||||||
expect.objectContaining({
|
|
||||||
name: "LastFM",
|
|
||||||
href: "https://last.fm/music/Test+Artist",
|
|
||||||
logo: "/images/apps/lastfm.svg",
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -5,7 +5,6 @@ export const defaultServerSettingsKeys = [
|
|||||||
"analytics",
|
"analytics",
|
||||||
"crawlingAndIndexing",
|
"crawlingAndIndexing",
|
||||||
"board",
|
"board",
|
||||||
"docker",
|
|
||||||
"user",
|
"user",
|
||||||
"appearance",
|
"appearance",
|
||||||
"culture",
|
"culture",
|
||||||
@@ -31,14 +30,6 @@ export const defaultServerSettings = {
|
|||||||
enableStatusByDefault: true,
|
enableStatusByDefault: true,
|
||||||
forceDisableStatus: false,
|
forceDisableStatus: false,
|
||||||
},
|
},
|
||||||
docker: {
|
|
||||||
targetBoardName: null as string | null,
|
|
||||||
readHomepageLabels: true,
|
|
||||||
pruneRemoved: false,
|
|
||||||
createIntegrations: true,
|
|
||||||
defaultItemWidth: 1,
|
|
||||||
defaultItemHeight: 1,
|
|
||||||
},
|
|
||||||
user: {
|
user: {
|
||||||
enableGravatar: true,
|
enableGravatar: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
transition: scale 0.2s ease-in-out;
|
transition: scale 0.2s ease-in-out;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
-webkit-user-drag: none;
|
|
||||||
touch-action: manipulation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.appWithUrl:hover > .appIcon {
|
.appWithUrl:hover > .appIcon {
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
|
|||||||
justify="center"
|
justify="center"
|
||||||
align="center"
|
align="center"
|
||||||
gap={isColumnLayout ? 0 : "sm"}
|
gap={isColumnLayout ? 0 : "sm"}
|
||||||
onContextMenu={isEditMode ? (e) => e.preventDefault() : undefined}
|
|
||||||
>
|
>
|
||||||
<Stack gap={0}>
|
<Stack gap={0}>
|
||||||
{options.showTitle && (
|
{options.showTitle && (
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { MouseEvent as ReactMouseEvent } from "react";
|
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
@@ -264,21 +263,8 @@ export function Notebook({ options, setOptions, isEditMode, boardId, itemId }: W
|
|||||||
setIsEditing(handleEditToggleCallback);
|
setIsEditing(handleEditToggleCallback);
|
||||||
}, [setIsEditing, handleEditToggleCallback]);
|
}, [setIsEditing, handleEditToggleCallback]);
|
||||||
|
|
||||||
const handleDoubleClick = useCallback(
|
|
||||||
(event: ReactMouseEvent<HTMLDivElement>) => {
|
|
||||||
if (!canChange || isEditing) return;
|
|
||||||
// Ignore double-clicks bubbling up from interactive controls (e.g. the
|
|
||||||
// edit/save ActionIcon), which would otherwise toggle edit mode twice.
|
|
||||||
if (event.target instanceof Element && event.target.closest("button, a")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setIsEditing(handleEditToggleCallback);
|
|
||||||
},
|
|
||||||
[canChange, isEditing, setIsEditing, handleEditToggleCallback],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box h="100%" onDoubleClick={handleDoubleClick}>
|
<Box h="100%">
|
||||||
<RichTextEditor
|
<RichTextEditor
|
||||||
p={0}
|
p={0}
|
||||||
mt={0}
|
mt={0}
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ export default function ReleasesWidget({ options }: WidgetComponentProps<"releas
|
|||||||
!hasError &&
|
!hasError &&
|
||||||
formatter.relativeTime(repository.latestReleaseAt, {
|
formatter.relativeTime(repository.latestReleaseAt, {
|
||||||
now,
|
now,
|
||||||
style: "long",
|
style: "narrow",
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
{hasError ? (
|
{hasError ? (
|
||||||
@@ -564,7 +564,7 @@ const ExpandedDisplay = ({
|
|||||||
<Text className="releases-repository-expanded-createdAt-date" span fw={700}>
|
<Text className="releases-repository-expanded-createdAt-date" span fw={700}>
|
||||||
{formatter.relativeTime(repository.createdAt, {
|
{formatter.relativeTime(repository.createdAt, {
|
||||||
now,
|
now,
|
||||||
style: "long",
|
style: "narrow",
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
Generated
+119
-143
@@ -106,8 +106,8 @@ catalogs:
|
|||||||
specifier: ^1.61.1
|
specifier: ^1.61.1
|
||||||
version: 1.61.1
|
version: 1.61.1
|
||||||
'@scalar/api-reference-react':
|
'@scalar/api-reference-react':
|
||||||
specifier: ^0.9.49
|
specifier: ^0.9.48
|
||||||
version: 0.9.49
|
version: 0.9.48
|
||||||
'@semantic-release/changelog':
|
'@semantic-release/changelog':
|
||||||
specifier: ^6.0.3
|
specifier: ^6.0.3
|
||||||
version: 6.0.3
|
version: 6.0.3
|
||||||
@@ -445,7 +445,7 @@ catalogs:
|
|||||||
specifier: ^1.18.0
|
specifier: ^1.18.0
|
||||||
version: 1.18.0
|
version: 1.18.0
|
||||||
posthog-js:
|
posthog-js:
|
||||||
specifier: ^1.395.0
|
specifier: ^1.393.5
|
||||||
version: 1.395.0
|
version: 1.395.0
|
||||||
posthog-node:
|
posthog-node:
|
||||||
specifier: ^4.18.0
|
specifier: ^4.18.0
|
||||||
@@ -705,7 +705,7 @@ importers:
|
|||||||
version: 0.99.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
version: 0.99.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
||||||
'@scalar/api-reference-react':
|
'@scalar/api-reference-react':
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 0.9.49(nprogress@0.2.0)(react@19.2.7)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
version: 0.9.48(nprogress@0.2.0)(react@19.2.7)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
||||||
'@signalwire/docusaurus-plugin-llms-txt':
|
'@signalwire/docusaurus-plugin-llms-txt':
|
||||||
specifier: ^1.2.2
|
specifier: ^1.2.2
|
||||||
version: 1.2.2(@docusaurus/core@3.10.1(@docusaurus/faster@3.10.1(@docusaurus/types@3.10.1(@swc/core@1.15.3(@swc/helpers@0.5.15))(esbuild@0.28.1)(postcss@8.5.15)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(@swc/helpers@0.5.15)(esbuild@0.28.1)(postcss@8.5.15))(@mdx-js/react@3.1.1(@types/react@19.2.17)(react@19.2.7))(@rspack/core@1.7.11(@swc/helpers@0.5.15))(@swc/core@1.15.3(@swc/helpers@0.5.15))(esbuild@0.28.1)(postcss@8.5.15)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(typescript@6.0.3))
|
version: 1.2.2(@docusaurus/core@3.10.1(@docusaurus/faster@3.10.1(@docusaurus/types@3.10.1(@swc/core@1.15.3(@swc/helpers@0.5.15))(esbuild@0.28.1)(postcss@8.5.15)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(@swc/helpers@0.5.15)(esbuild@0.28.1)(postcss@8.5.15))(@mdx-js/react@3.1.1(@types/react@19.2.17)(react@19.2.7))(@rspack/core@1.7.11(@swc/helpers@0.5.15))(@swc/core@1.15.3(@swc/helpers@0.5.15))(esbuild@0.28.1)(postcss@8.5.15)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(typescript@6.0.3))
|
||||||
@@ -916,7 +916,7 @@ importers:
|
|||||||
version: 1.29.0(zod@4.4.3)
|
version: 1.29.0(zod@4.4.3)
|
||||||
'@scalar/api-reference-react':
|
'@scalar/api-reference-react':
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 0.9.49(nprogress@0.2.0)(react@19.2.7)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
version: 0.9.48(nprogress@0.2.0)(react@19.2.7)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
||||||
'@tabler/icons-react':
|
'@tabler/icons-react':
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 3.44.0(react@19.2.7)
|
version: 3.44.0(react@19.2.7)
|
||||||
@@ -1769,18 +1769,9 @@ importers:
|
|||||||
'@homarr/core':
|
'@homarr/core':
|
||||||
specifier: workspace:^0.1.0
|
specifier: workspace:^0.1.0
|
||||||
version: link:../core
|
version: link:../core
|
||||||
'@homarr/db':
|
|
||||||
specifier: workspace:^0.1.0
|
|
||||||
version: link:../db
|
|
||||||
'@homarr/definitions':
|
|
||||||
specifier: workspace:^0.1.0
|
|
||||||
version: link:../definitions
|
|
||||||
dockerode:
|
dockerode:
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 5.0.1
|
version: 5.0.1
|
||||||
superjson:
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 2.2.6
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@homarr/tsconfig':
|
'@homarr/tsconfig':
|
||||||
specifier: workspace:^0.1.0
|
specifier: workspace:^0.1.0
|
||||||
@@ -1791,9 +1782,6 @@ importers:
|
|||||||
typescript:
|
typescript:
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 6.0.3
|
version: 6.0.3
|
||||||
vitest:
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 4.1.9(@opentelemetry/api@1.9.0)(@types/node@24.13.2)(@vitest/coverage-v8@4.1.9)(@vitest/ui@4.1.9)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.14.6(@types/node@24.13.2)(typescript@6.0.3))(vite@8.1.0(@types/node@24.13.2)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.101.0)(sugarss@5.0.0(postcss@8.5.15))(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0))
|
|
||||||
|
|
||||||
packages/form:
|
packages/form:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -6719,50 +6707,46 @@ packages:
|
|||||||
'@rvf/set-get@7.0.1':
|
'@rvf/set-get@7.0.1':
|
||||||
resolution: {integrity: sha512-GkTSn9K1GrTYoTUqlUs36k6nJnzjQaFBTTEIqUYmzBcsGsoJM8xG7EAx2WLHWAA4QzFjcwWUSHQ3vM3Fbw50Tg==}
|
resolution: {integrity: sha512-GkTSn9K1GrTYoTUqlUs36k6nJnzjQaFBTTEIqUYmzBcsGsoJM8xG7EAx2WLHWAA4QzFjcwWUSHQ3vM3Fbw50Tg==}
|
||||||
|
|
||||||
'@scalar/agent-chat@0.12.13':
|
'@scalar/agent-chat@0.12.12':
|
||||||
resolution: {integrity: sha512-JPjwnOqIRb/TF+0bVNL7rg9SSjce3p0G++GF8uNvoGthixWuQxzo2pems4npZwe6Aw57icRTsZ3GBFgs9VmJvw==}
|
resolution: {integrity: sha512-9PxyiNnSXuMDXcjPXgvFAPgfvUUsH/iS80Fpa0GGl3lO3ThsGDL2Lr+Y1UjxG1Tc2huGE/EDiUuT5osz9RwzMw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/api-client@3.12.0':
|
'@scalar/api-client@3.11.0':
|
||||||
resolution: {integrity: sha512-NBZTMuqG9Qu+C0bUtMJPQEbGBLC5skXj55A/oDSzPwvTmWKV6I9Xc4wcrqVZMMidx315uC/WWyrB9WCUMgNi3Q==}
|
resolution: {integrity: sha512-6nxj8Saw/sfUM6xDxbMDfKKLDC933Vtig6m8hB0pSfXSlwXEvA5C9mUNO8ytodGPqBc/wphgFqTpfahOxp7R0w==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/api-reference-react@0.9.49':
|
'@scalar/api-reference-react@0.9.48':
|
||||||
resolution: {integrity: sha512-dtOrWZ++rFfsihNZKZ2pJ722bSkI3qp5CZKdiOY98PoJUWwPoSxT7C3NAn4NX59jQ0kuLhWDEELDpAcA779cvA==}
|
resolution: {integrity: sha512-NmdQcmMDXIhKPIDRlA5m7cxGUAuiK42jOhaRsTT05TOcPXTF1lazcuN25o3ghevKtznIDqT+2/y/IYhbWS/UBw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^18.0.0 || ^19.0.0
|
react: ^18.0.0 || ^19.0.0
|
||||||
|
|
||||||
'@scalar/api-reference@1.62.0':
|
'@scalar/api-reference@1.61.0':
|
||||||
resolution: {integrity: sha512-QYPqMPfy4vyVLysHeSFZsD+717ua/gHIhYYu7UjqPzJUOVh2R+/9hINKKzvoP13lQWCQTmuzs2VEl8rQOIfDjw==}
|
resolution: {integrity: sha512-r0U9Nqh3yV0BnU5mV2J/wDUcqwWorAUzXThHq0pbT09OzoKYO7asNB+d+bX5xhlLSvIuCMe5lAppQRfjlXzxWg==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/blocks@0.1.0':
|
'@scalar/code-highlight@0.3.6':
|
||||||
resolution: {integrity: sha512-oFnIa6dAkCt0N5yw5aqCABbP7r7YsI7ERNrGtlTDdrCteDRatMJg9y03LT+9Vhf2/K3VHWrdCZMruUdfU1uPzQ==}
|
resolution: {integrity: sha512-G/EtLF6a3IFGfIv5b7Uj5v/yXFY9+ktViVkfAkSoWJdHNBNk0S/Rb2OgRq24kp0D2TDXhLYF3E9OSHzquS7WqQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/code-highlight@0.4.0':
|
'@scalar/components@0.27.3':
|
||||||
resolution: {integrity: sha512-ajUQ9oq5MwVHrXGze0SZVatgSXP/WbN4qgE0usYDFt1XuJ+O56TaBsCWb043r3Y9ZnHSnK9GHreVaLOxXsbf1A==}
|
resolution: {integrity: sha512-WiCMId4MFsbne1iy5N36Ej4fM+1TX6gg4DkbjWSNPTDtVWLMQ6VHdl46fxC6yOCtO59awJ7Ex6oKpbaXQsZiCA==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/components@0.27.4':
|
'@scalar/helpers@0.8.2':
|
||||||
resolution: {integrity: sha512-1sbsMYGJcWiQ+5GouI1hHCn1VrytHPhzhHhCAZTXxi1Tw4SzsPSQuACARehXca+w2p7RK9ayGRYQ+K5bX18SaQ==}
|
resolution: {integrity: sha512-qNbqUjSB3S4Gr4A0oANcm5G1Ip+EqBxICYKhe9YzmnaBpbmW6shxqpiivApTvvuDf+uIhR3uMwWyVQbYcGLsxA==}
|
||||||
engines: {node: '>=22'}
|
|
||||||
|
|
||||||
'@scalar/helpers@0.9.0':
|
|
||||||
resolution: {integrity: sha512-M34CLRCttqC1bXthI/QSzQj0s5C6nrU2PFWf/vOT3RpycbiGDGQbqR+5RfFzpOIQvRqbHfNdcRbeiZBw+vCbkQ==}
|
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/icons@0.7.3':
|
'@scalar/icons@0.7.3':
|
||||||
resolution: {integrity: sha512-5uSUvumj6yJEAZT7/MKpgrkNl76waDXUpu0kUBBFJ83GhZirBIK+Z9SktShEvJT0+rk/j9Zaer3BHoEhYwAEBQ==}
|
resolution: {integrity: sha512-5uSUvumj6yJEAZT7/MKpgrkNl76waDXUpu0kUBBFJ83GhZirBIK+Z9SktShEvJT0+rk/j9Zaer3BHoEhYwAEBQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/json-magic@0.12.17':
|
'@scalar/json-magic@0.12.16':
|
||||||
resolution: {integrity: sha512-Vw2nrUDIjhvMP6vxFtkiiFlabJ6SyTtfn1BsOxgnr1hIB+/rkngMguiDzl5em21VjyfFGIoADia+QWKM2hdcdA==}
|
resolution: {integrity: sha512-w8cDbZhHCzmIblWx92IVWoAXsbI4Fz3m++jiBANTSO1hgphF6UqEPQiCt3wnMPaxaanjMQxjS/iBk1UGXR2EGA==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/oas-utils@0.19.1':
|
'@scalar/oas-utils@0.19.0':
|
||||||
resolution: {integrity: sha512-FflVWiFDm0s4a+FqKJ0uYsVhDzbAtVyXSyUWsGe9BGPPQSXYYvVEVp9H2ir4xueaw4TZb1cDEZbteHLx7h7vqg==}
|
resolution: {integrity: sha512-t9CBiH0we2rKlFaFJUt+dOAKYQPNhHdrrfX9Wx1Yfg9og1NM2H2BQSO7NoCaUN/+G86GNWIm+fr5R8iCM+/psw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/openapi-types@0.9.1':
|
'@scalar/openapi-types@0.9.1':
|
||||||
@@ -6773,27 +6757,27 @@ packages:
|
|||||||
resolution: {integrity: sha512-D5b0rGLLZgmkO9mdW2j/ND1KBlH1u3RCpr87HPxv9P9ZSr6PtM5iLqFOJq0ACiaHjY2mikCrxgDmnUEhTzRpHQ==}
|
resolution: {integrity: sha512-D5b0rGLLZgmkO9mdW2j/ND1KBlH1u3RCpr87HPxv9P9ZSr6PtM5iLqFOJq0ACiaHjY2mikCrxgDmnUEhTzRpHQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/schemas@0.7.0':
|
'@scalar/schemas@0.6.0':
|
||||||
resolution: {integrity: sha512-Roj0e7S29yTbGojwdx/b8C1H5arVN4h/VSPrtQ5vb9NT2ZAbrfPQVmpQYrF845rKOWX7kSzIvyBwrKNEMIAkxA==}
|
resolution: {integrity: sha512-Oacaq7RTLhe3vWOoNc8tZufqthetu1VjWkdrGMMYoVSyMBQpvDI48gwBBQO6+iySeNpk9y8NHaGxqhHeoLbDiQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/sidebar@0.9.25':
|
'@scalar/sidebar@0.9.24':
|
||||||
resolution: {integrity: sha512-RoMKTvCo801kj5J59Myqhc6YYtvjlXGNvP7qbj/TY2hfQ4XS5dH5S7t8JKJje+78MLC2Xg9OsEmCjv+gb8ta4w==}
|
resolution: {integrity: sha512-whfvictmBQrtdNANLzDe4cXNlhj3p1RUtSbwiSERf5TSYCQwU5J2JAG2zUPUJhNdpNUzg1wdQnE5Q3lp+MAcHQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/snippetz@0.9.19':
|
'@scalar/snippetz@0.9.18':
|
||||||
resolution: {integrity: sha512-RVTZQqUxOiBhAuPywDmser1xOatVj7HCNmg+qpW8172MsMpx00lRGZ940WVAhjHgKglTkwHPaTdVX7gQeDrFUQ==}
|
resolution: {integrity: sha512-C0lflx3Az9epM4dFsDl73w5fxgyw68ZMTr8W0fkLHJvWTM8q26jjDDrgDCDivG0SBc2UUs3xRKSjjsfC6TkZKw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/themes@0.16.2':
|
'@scalar/themes@0.16.1':
|
||||||
resolution: {integrity: sha512-4mAn7z2W5/ASi1OF06dqf04xjxTHnMzESC2E+qVMukJsEsV4kDlYSIfm/g5hwWxhqWsBMjorF9Dtlqd0ycJ92g==}
|
resolution: {integrity: sha512-yTMjqlTAYZrlJsHIuDiCVJjMJZ1UzL33C/60c88JYuvuuwSXm15TAEcLXkRrPa7u8PPz/llKGgWjMEiMhsOAGA==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/typebox@0.1.3':
|
'@scalar/typebox@0.1.3':
|
||||||
resolution: {integrity: sha512-lU055AUccECZMIfGA0z/C1StYmboAYIPJLDFBzOO81yXBi35Pxdq+I4fWX6iUZ8qcoHneiLGk9jAUM1rA93iEg==}
|
resolution: {integrity: sha512-lU055AUccECZMIfGA0z/C1StYmboAYIPJLDFBzOO81yXBi35Pxdq+I4fWX6iUZ8qcoHneiLGk9jAUM1rA93iEg==}
|
||||||
|
|
||||||
'@scalar/types@0.16.0':
|
'@scalar/types@0.15.0':
|
||||||
resolution: {integrity: sha512-26OSrvZjKWZ7F236wWmJajBGDVFJuvXFJqKPFqbt/PxlgZKXQXfJsZorASRQmdNogT576nxYalQ7oaYWEnQwfw==}
|
resolution: {integrity: sha512-Rn9XAFrnQL4cAINCyNlPdvSbd3+Cvqgv2SBX1J8WgtZLxqC32+8Ptmns51Lvn6zKeiX+mFHk1UdvIWmqiG1xRg==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@scalar/use-codemirror@0.14.12':
|
'@scalar/use-codemirror@0.14.12':
|
||||||
@@ -6812,8 +6796,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-tpmmG+/xRE2Kn9RpflU3AIyZv08v10+E1ZrJCx7z6+/91zHVxy0M73kC1LT4/8PbYNt85ywyC8+n+D99JdMcGA==}
|
resolution: {integrity: sha512-tpmmG+/xRE2Kn9RpflU3AIyZv08v10+E1ZrJCx7z6+/91zHVxy0M73kC1LT4/8PbYNt85ywyC8+n+D99JdMcGA==}
|
||||||
engines: {node: '>=20'}
|
engines: {node: '>=20'}
|
||||||
|
|
||||||
'@scalar/workspace-store@0.55.0':
|
'@scalar/workspace-store@0.54.5':
|
||||||
resolution: {integrity: sha512-4EkaLfONW8qu2vigJopbjg9ahE/Z9Q+IInnVoUTZfxLp4rb2Z3ztx8LmQOym8DPpv62BvuMtJcNdQOnQ6tVLHA==}
|
resolution: {integrity: sha512-MMaELRxKNwJ1dxbDcFNRwh229jAX5DQhkQpHgDSbr+oAt6AqFf2BTr9Fr/8kbLIJK+L4P2C8rANE8xrnqjKGLg==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@schummar/icu-type-parser@1.21.5':
|
'@schummar/icu-type-parser@1.21.5':
|
||||||
@@ -12029,6 +12013,11 @@ packages:
|
|||||||
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==}
|
||||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||||
|
|
||||||
|
nanoid@5.1.15:
|
||||||
|
resolution: {integrity: sha512-kBg3RpGtIe+RpTbyXwoI6pk5yD7KUiI3sygUqgeBMRst42KmhB4RZC7eiO9Wa1HIpaCCtpE2DJ6OI4Wi5ebwFw==}
|
||||||
|
engines: {node: ^18 || >=20}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
nanoid@5.1.16:
|
nanoid@5.1.16:
|
||||||
resolution: {integrity: sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ==}
|
resolution: {integrity: sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ==}
|
||||||
engines: {node: ^18 || >=20}
|
engines: {node: ^18 || >=20}
|
||||||
@@ -20131,21 +20120,21 @@ snapshots:
|
|||||||
|
|
||||||
'@rvf/set-get@7.0.1': {}
|
'@rvf/set-get@7.0.1': {}
|
||||||
|
|
||||||
'@scalar/agent-chat@0.12.13(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)':
|
'@scalar/agent-chat@0.12.12(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@ai-sdk/vue': 3.0.33(vue@3.5.35(typescript@6.0.3))(zod@4.4.3)
|
'@ai-sdk/vue': 3.0.33(vue@3.5.35(typescript@6.0.3))(zod@4.4.3)
|
||||||
'@scalar/api-client': 3.12.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/api-client': 3.11.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/components': 0.27.4(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/components': 0.27.3(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
||||||
'@scalar/json-magic': 0.12.17
|
'@scalar/json-magic': 0.12.16
|
||||||
'@scalar/openapi-types': 0.9.1
|
'@scalar/openapi-types': 0.9.1
|
||||||
'@scalar/schemas': 0.7.0
|
'@scalar/schemas': 0.6.0
|
||||||
'@scalar/themes': 0.16.2
|
'@scalar/themes': 0.16.1
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
'@scalar/use-toasts': 0.10.2(typescript@6.0.3)
|
'@scalar/use-toasts': 0.10.2(typescript@6.0.3)
|
||||||
'@scalar/validation': 0.6.0
|
'@scalar/validation': 0.6.0
|
||||||
'@scalar/workspace-store': 0.55.0(typescript@6.0.3)
|
'@scalar/workspace-store': 0.54.5(typescript@6.0.3)
|
||||||
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
||||||
ai: 6.0.33(zod@4.4.3)
|
ai: 6.0.33(zod@4.4.3)
|
||||||
js-base64: 3.7.8
|
js-base64: 3.7.8
|
||||||
@@ -20169,32 +20158,33 @@ snapshots:
|
|||||||
- universal-cookie
|
- universal-cookie
|
||||||
- zod
|
- zod
|
||||||
|
|
||||||
'@scalar/api-client@3.12.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)':
|
'@scalar/api-client@3.11.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@headlessui/tailwindcss': 0.2.2(tailwindcss@4.3.1)
|
'@headlessui/tailwindcss': 0.2.2(tailwindcss@4.3.1)
|
||||||
'@headlessui/vue': 1.7.23(vue@3.5.35(typescript@6.0.3))
|
'@headlessui/vue': 1.7.23(vue@3.5.35(typescript@6.0.3))
|
||||||
'@scalar/blocks': 0.1.0(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/components': 0.27.3(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/components': 0.27.4(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/helpers': 0.9.0
|
|
||||||
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
||||||
'@scalar/oas-utils': 0.19.1(typescript@6.0.3)
|
'@scalar/json-magic': 0.12.16
|
||||||
|
'@scalar/oas-utils': 0.19.0(typescript@6.0.3)
|
||||||
'@scalar/openapi-types': 0.9.1
|
'@scalar/openapi-types': 0.9.1
|
||||||
'@scalar/sidebar': 0.9.25(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/sidebar': 0.9.24(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/snippetz': 0.9.19
|
'@scalar/snippetz': 0.9.18
|
||||||
'@scalar/themes': 0.16.2
|
'@scalar/themes': 0.16.1
|
||||||
'@scalar/typebox': 0.1.3
|
'@scalar/typebox': 0.1.3
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
'@scalar/use-codemirror': 0.14.12(typescript@6.0.3)
|
'@scalar/use-codemirror': 0.14.12(typescript@6.0.3)
|
||||||
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
||||||
'@scalar/use-toasts': 0.10.2(typescript@6.0.3)
|
'@scalar/use-toasts': 0.10.2(typescript@6.0.3)
|
||||||
'@scalar/workspace-store': 0.55.0(typescript@6.0.3)
|
'@scalar/workspace-store': 0.54.5(typescript@6.0.3)
|
||||||
|
'@types/har-format': 1.2.16
|
||||||
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
||||||
'@vueuse/integrations': 13.9.0(focus-trap@7.8.0)(fuse.js@7.4.2)(nprogress@0.2.0)(vue@3.5.35(typescript@6.0.3))
|
'@vueuse/integrations': 13.9.0(focus-trap@7.8.0)(fuse.js@7.4.2)(nprogress@0.2.0)(vue@3.5.35(typescript@6.0.3))
|
||||||
focus-trap: 7.8.0
|
focus-trap: 7.8.0
|
||||||
fuse.js: 7.4.2
|
fuse.js: 7.4.2
|
||||||
js-base64: 3.7.8
|
js-base64: 3.7.8
|
||||||
jsonc-parser: 3.3.1
|
jsonc-parser: 3.3.1
|
||||||
nanoid: 5.1.16
|
nanoid: 5.1.15
|
||||||
pretty-ms: 9.3.0
|
pretty-ms: 9.3.0
|
||||||
radix-vue: 1.9.17(vue@3.5.35(typescript@6.0.3))
|
radix-vue: 1.9.17(vue@3.5.35(typescript@6.0.3))
|
||||||
set-cookie-parser: 3.1.0
|
set-cookie-parser: 3.1.0
|
||||||
@@ -20217,10 +20207,10 @@ snapshots:
|
|||||||
- typescript
|
- typescript
|
||||||
- universal-cookie
|
- universal-cookie
|
||||||
|
|
||||||
'@scalar/api-reference-react@0.9.49(nprogress@0.2.0)(react@19.2.7)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)':
|
'@scalar/api-reference-react@0.9.48(nprogress@0.2.0)(react@19.2.7)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/api-reference': 1.62.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
'@scalar/api-reference': 1.61.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
react: 19.2.7
|
react: 19.2.7
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@vue/composition-api'
|
- '@vue/composition-api'
|
||||||
@@ -20239,31 +20229,30 @@ snapshots:
|
|||||||
- universal-cookie
|
- universal-cookie
|
||||||
- zod
|
- zod
|
||||||
|
|
||||||
'@scalar/api-reference@1.62.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)':
|
'@scalar/api-reference@1.61.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@headlessui/vue': 1.7.23(vue@3.5.35(typescript@6.0.3))
|
'@headlessui/vue': 1.7.23(vue@3.5.35(typescript@6.0.3))
|
||||||
'@scalar/agent-chat': 0.12.13(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
'@scalar/agent-chat': 0.12.12(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)(zod@4.4.3)
|
||||||
'@scalar/api-client': 3.12.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/api-client': 3.11.0(nprogress@0.2.0)(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/blocks': 0.1.0(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/code-highlight': 0.3.6
|
||||||
'@scalar/code-highlight': 0.4.0
|
'@scalar/components': 0.27.3(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/components': 0.27.4(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/helpers': 0.9.0
|
|
||||||
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
||||||
'@scalar/oas-utils': 0.19.1(typescript@6.0.3)
|
'@scalar/oas-utils': 0.19.0(typescript@6.0.3)
|
||||||
'@scalar/schemas': 0.7.0
|
'@scalar/schemas': 0.6.0
|
||||||
'@scalar/sidebar': 0.9.25(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/sidebar': 0.9.24(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/snippetz': 0.9.19
|
'@scalar/snippetz': 0.9.18
|
||||||
'@scalar/themes': 0.16.2
|
'@scalar/themes': 0.16.1
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
||||||
'@scalar/use-toasts': 0.10.2(typescript@6.0.3)
|
'@scalar/use-toasts': 0.10.2(typescript@6.0.3)
|
||||||
'@scalar/validation': 0.6.0
|
'@scalar/validation': 0.6.0
|
||||||
'@scalar/workspace-store': 0.55.0(typescript@6.0.3)
|
'@scalar/workspace-store': 0.54.5(typescript@6.0.3)
|
||||||
'@unhead/vue': 2.1.15(vue@3.5.35(typescript@6.0.3))
|
'@unhead/vue': 2.1.15(vue@3.5.35(typescript@6.0.3))
|
||||||
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
||||||
fuse.js: 7.4.2
|
fuse.js: 7.4.2
|
||||||
microdiff: 1.5.0
|
microdiff: 1.5.0
|
||||||
nanoid: 5.1.16
|
nanoid: 5.1.15
|
||||||
vue: 3.5.35(typescript@6.0.3)
|
vue: 3.5.35(typescript@6.0.3)
|
||||||
yaml: 2.9.0
|
yaml: 2.9.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -20283,25 +20272,7 @@ snapshots:
|
|||||||
- universal-cookie
|
- universal-cookie
|
||||||
- zod
|
- zod
|
||||||
|
|
||||||
'@scalar/blocks@0.1.0(tailwindcss@4.3.1)(typescript@6.0.3)':
|
'@scalar/code-highlight@0.3.6':
|
||||||
dependencies:
|
|
||||||
'@scalar/components': 0.27.4(tailwindcss@4.3.1)(typescript@6.0.3)
|
|
||||||
'@scalar/helpers': 0.9.0
|
|
||||||
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
|
||||||
'@scalar/snippetz': 0.9.19
|
|
||||||
'@scalar/themes': 0.16.2
|
|
||||||
'@scalar/types': 0.16.0
|
|
||||||
'@scalar/workspace-store': 0.55.0(typescript@6.0.3)
|
|
||||||
'@types/har-format': 1.2.16
|
|
||||||
js-base64: 3.7.8
|
|
||||||
vue: 3.5.35(typescript@6.0.3)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- '@vue/composition-api'
|
|
||||||
- supports-color
|
|
||||||
- tailwindcss
|
|
||||||
- typescript
|
|
||||||
|
|
||||||
'@scalar/code-highlight@0.4.0':
|
|
||||||
dependencies:
|
dependencies:
|
||||||
hast-util-to-text: 4.0.2
|
hast-util-to-text: 4.0.2
|
||||||
highlight.js: 11.11.1
|
highlight.js: 11.11.1
|
||||||
@@ -20321,16 +20292,16 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@scalar/components@0.27.4(tailwindcss@4.3.1)(typescript@6.0.3)':
|
'@scalar/components@0.27.3(tailwindcss@4.3.1)(typescript@6.0.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@floating-ui/utils': 0.2.10
|
'@floating-ui/utils': 0.2.10
|
||||||
'@floating-ui/vue': 1.1.9(vue@3.5.35(typescript@6.0.3))
|
'@floating-ui/vue': 1.1.9(vue@3.5.35(typescript@6.0.3))
|
||||||
'@headlessui/tailwindcss': 0.2.2(tailwindcss@4.3.1)
|
'@headlessui/tailwindcss': 0.2.2(tailwindcss@4.3.1)
|
||||||
'@headlessui/vue': 1.7.23(vue@3.5.35(typescript@6.0.3))
|
'@headlessui/vue': 1.7.23(vue@3.5.35(typescript@6.0.3))
|
||||||
'@scalar/code-highlight': 0.4.0
|
'@scalar/code-highlight': 0.3.6
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
||||||
'@scalar/themes': 0.16.2
|
'@scalar/themes': 0.16.1
|
||||||
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
||||||
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
'@vueuse/core': 13.9.0(vue@3.5.35(typescript@6.0.3))
|
||||||
cva: 1.0.0-beta.4(typescript@6.0.3)
|
cva: 1.0.0-beta.4(typescript@6.0.3)
|
||||||
@@ -20343,7 +20314,7 @@ snapshots:
|
|||||||
- tailwindcss
|
- tailwindcss
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@scalar/helpers@0.9.0': {}
|
'@scalar/helpers@0.8.2': {}
|
||||||
|
|
||||||
'@scalar/icons@0.7.3(typescript@6.0.3)':
|
'@scalar/icons@0.7.3(typescript@6.0.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -20354,18 +20325,18 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@scalar/json-magic@0.12.17':
|
'@scalar/json-magic@0.12.16':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
yaml: 2.9.0
|
yaml: 2.9.0
|
||||||
|
|
||||||
'@scalar/oas-utils@0.19.1(typescript@6.0.3)':
|
'@scalar/oas-utils@0.19.0(typescript@6.0.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/themes': 0.16.2
|
'@scalar/themes': 0.16.1
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
'@scalar/workspace-store': 0.55.0(typescript@6.0.3)
|
'@scalar/workspace-store': 0.54.5(typescript@6.0.3)
|
||||||
flatted: 3.4.2
|
flatted: 3.4.2
|
||||||
vue: 3.5.35(typescript@6.0.3)
|
vue: 3.5.35(typescript@6.0.3)
|
||||||
yaml: 2.9.0
|
yaml: 2.9.0
|
||||||
@@ -20378,19 +20349,19 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/openapi-types': 0.9.1
|
'@scalar/openapi-types': 0.9.1
|
||||||
|
|
||||||
'@scalar/schemas@0.7.0':
|
'@scalar/schemas@0.6.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/validation': 0.6.0
|
'@scalar/validation': 0.6.0
|
||||||
|
|
||||||
'@scalar/sidebar@0.9.25(tailwindcss@4.3.1)(typescript@6.0.3)':
|
'@scalar/sidebar@0.9.24(tailwindcss@4.3.1)(typescript@6.0.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/components': 0.27.4(tailwindcss@4.3.1)(typescript@6.0.3)
|
'@scalar/components': 0.27.3(tailwindcss@4.3.1)(typescript@6.0.3)
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
'@scalar/icons': 0.7.3(typescript@6.0.3)
|
||||||
'@scalar/themes': 0.16.2
|
'@scalar/themes': 0.16.1
|
||||||
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
'@scalar/use-hooks': 0.4.7(typescript@6.0.3)
|
||||||
'@scalar/workspace-store': 0.55.0(typescript@6.0.3)
|
'@scalar/workspace-store': 0.54.5(typescript@6.0.3)
|
||||||
vue: 3.5.35(typescript@6.0.3)
|
vue: 3.5.35(typescript@6.0.3)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@vue/composition-api'
|
- '@vue/composition-api'
|
||||||
@@ -20398,24 +20369,24 @@ snapshots:
|
|||||||
- tailwindcss
|
- tailwindcss
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@scalar/snippetz@0.9.19':
|
'@scalar/snippetz@0.9.18':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
js-base64: 3.7.8
|
js-base64: 3.7.8
|
||||||
stringify-object: 6.0.0
|
stringify-object: 6.0.0
|
||||||
|
|
||||||
'@scalar/themes@0.16.2':
|
'@scalar/themes@0.16.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 5.1.16
|
nanoid: 5.1.15
|
||||||
|
|
||||||
'@scalar/typebox@0.1.3': {}
|
'@scalar/typebox@0.1.3': {}
|
||||||
|
|
||||||
'@scalar/types@0.16.0':
|
'@scalar/types@0.15.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
nanoid: 5.1.16
|
nanoid: 5.1.15
|
||||||
type-fest: 5.7.0
|
type-fest: 5.6.0
|
||||||
zod: 4.4.3
|
zod: 4.4.3
|
||||||
|
|
||||||
'@scalar/use-codemirror@0.14.12(typescript@6.0.3)':
|
'@scalar/use-codemirror@0.14.12(typescript@6.0.3)':
|
||||||
@@ -20458,18 +20429,18 @@ snapshots:
|
|||||||
|
|
||||||
'@scalar/validation@0.6.0': {}
|
'@scalar/validation@0.6.0': {}
|
||||||
|
|
||||||
'@scalar/workspace-store@0.55.0(typescript@6.0.3)':
|
'@scalar/workspace-store@0.54.5(typescript@6.0.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scalar/helpers': 0.9.0
|
'@scalar/helpers': 0.8.2
|
||||||
'@scalar/json-magic': 0.12.17
|
'@scalar/json-magic': 0.12.16
|
||||||
'@scalar/openapi-upgrader': 0.2.9
|
'@scalar/openapi-upgrader': 0.2.9
|
||||||
'@scalar/schemas': 0.7.0
|
'@scalar/schemas': 0.6.0
|
||||||
'@scalar/snippetz': 0.9.19
|
'@scalar/snippetz': 0.9.18
|
||||||
'@scalar/typebox': 0.1.3
|
'@scalar/typebox': 0.1.3
|
||||||
'@scalar/types': 0.16.0
|
'@scalar/types': 0.15.0
|
||||||
'@scalar/validation': 0.6.0
|
'@scalar/validation': 0.6.0
|
||||||
js-base64: 3.7.8
|
js-base64: 3.7.8
|
||||||
type-fest: 5.7.0
|
type-fest: 5.6.0
|
||||||
vue: 3.5.35(typescript@6.0.3)
|
vue: 3.5.35(typescript@6.0.3)
|
||||||
yaml: 2.9.0
|
yaml: 2.9.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -21797,6 +21768,7 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
msw: 2.14.6(@types/node@24.13.2)(typescript@6.0.3)
|
msw: 2.14.6(@types/node@24.13.2)(typescript@6.0.3)
|
||||||
vite: 8.1.0(@types/node@24.13.2)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.101.0)(sugarss@5.0.0(postcss@8.5.15))(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0)
|
vite: 8.1.0(@types/node@24.13.2)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.101.0)(sugarss@5.0.0(postcss@8.5.15))(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0)
|
||||||
|
optional: true
|
||||||
|
|
||||||
'@vitest/pretty-format@4.1.9':
|
'@vitest/pretty-format@4.1.9':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -26370,6 +26342,8 @@ snapshots:
|
|||||||
|
|
||||||
nanoid@3.3.12: {}
|
nanoid@3.3.12: {}
|
||||||
|
|
||||||
|
nanoid@5.1.15: {}
|
||||||
|
|
||||||
nanoid@5.1.16: {}
|
nanoid@5.1.16: {}
|
||||||
|
|
||||||
nanostores@1.3.0: {}
|
nanostores@1.3.0: {}
|
||||||
@@ -29641,6 +29615,7 @@ snapshots:
|
|||||||
terser: 5.46.1
|
terser: 5.46.1
|
||||||
tsx: 4.21.0
|
tsx: 4.21.0
|
||||||
yaml: 2.9.0
|
yaml: 2.9.0
|
||||||
|
optional: true
|
||||||
|
|
||||||
vitest@4.1.9(@opentelemetry/api@1.9.0)(@types/node@24.13.2)(@vitest/coverage-v8@4.1.9)(@vitest/ui@4.1.9)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.14.6(@types/node@24.13.2)(typescript@6.0.3))(vite@8.1.0(@types/node@24.13.2)(esbuild@0.28.0)(jiti@2.7.0)(sass@1.101.0)(sugarss@5.0.0(postcss@8.5.15))(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0)):
|
vitest@4.1.9(@opentelemetry/api@1.9.0)(@types/node@24.13.2)(@vitest/coverage-v8@4.1.9)(@vitest/ui@4.1.9)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.14.6(@types/node@24.13.2)(typescript@6.0.3))(vite@8.1.0(@types/node@24.13.2)(esbuild@0.28.0)(jiti@2.7.0)(sass@1.101.0)(sugarss@5.0.0(postcss@8.5.15))(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -29703,6 +29678,7 @@ snapshots:
|
|||||||
jsdom: 29.1.1(@noble/hashes@2.0.1)
|
jsdom: 29.1.1(@noble/hashes@2.0.1)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- msw
|
- msw
|
||||||
|
optional: true
|
||||||
|
|
||||||
vue-component-type-helpers@3.3.4: {}
|
vue-component-type-helpers@3.3.4: {}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -88,11 +88,11 @@ catalog:
|
|||||||
"@types/prismjs": ^1.26.6
|
"@types/prismjs": ^1.26.6
|
||||||
"@types/react": 19.2.17
|
"@types/react": 19.2.17
|
||||||
"@types/react-dom": 19.2.3
|
"@types/react-dom": 19.2.3
|
||||||
"@scalar/api-reference-react": ^0.9.49
|
"@scalar/api-reference-react": ^0.9.48
|
||||||
"@types/video.js": ^7.3.58
|
"@types/video.js": ^7.3.58
|
||||||
"@types/ws": ^8.18.1
|
"@types/ws": ^8.18.1
|
||||||
"@types/xml2js": ^0.4.14
|
"@types/xml2js": ^0.4.14
|
||||||
posthog-js: ^1.395.0
|
posthog-js: ^1.393.5
|
||||||
posthog-node: ^4.18.0
|
posthog-node: ^4.18.0
|
||||||
"@vitejs/plugin-react": ^6.0.3
|
"@vitejs/plugin-react": ^6.0.3
|
||||||
"@vitest/coverage-v8": ^4.1.9
|
"@vitest/coverage-v8": ^4.1.9
|
||||||
|
|||||||
Reference in new issue
Block a user