Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd99dd6d7b | ||
|
|
e93e9ed839 | ||
|
|
dd23de7aaa | ||
|
|
f1602f67d4 | ||
|
|
c03cd97d3a | ||
|
|
a8e9a074d3 | ||
|
|
1e9d3e0656 | ||
|
|
01e0f3612d | ||
|
|
0015a6d88d | ||
|
|
77dc317da2 | ||
|
|
6aeda3faaf | ||
|
|
ca358d9f8b | ||
|
|
03e0683892 | ||
|
|
6ac4c6a7b9 | ||
|
|
a0e0bf65ff | ||
|
|
bc018e1fe0 | ||
|
|
5e39c8813a |
No files matched your search
@@ -60,7 +60,7 @@ jobs:
|
|||||||
TURBO_PLATFORM: linux/amd64
|
TURBO_PLATFORM: linux/amd64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
|
||||||
container:
|
container:
|
||||||
name: Container, E2E, and memory
|
name: Container and E2E
|
||||||
needs: fast-gate
|
needs: fast-gate
|
||||||
if: |
|
if: |
|
||||||
github.event_name == 'merge_group' ||
|
github.event_name == 'merge_group' ||
|
||||||
@@ -104,7 +104,7 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || '' }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || '' }}
|
||||||
@@ -113,11 +113,11 @@ jobs:
|
|||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Build container once
|
- name: Build container once
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -158,7 +158,7 @@ jobs:
|
|||||||
--tag homarr-ci --tag homarr-e2e "${secret_args[@]}" .
|
--tag homarr-ci --tag homarr-e2e "${secret_args[@]}" .
|
||||||
|
|
||||||
- name: Cache Playwright browsers
|
- name: Cache Playwright browsers
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
id: playwright-cache
|
id: playwright-cache
|
||||||
uses: actions/cache@v6
|
uses: actions/cache@v6
|
||||||
with:
|
with:
|
||||||
@@ -184,82 +184,6 @@ jobs:
|
|||||||
path: e2e/test-results/
|
path: e2e/test-results/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
- name: Run memory regression test
|
|
||||||
env:
|
|
||||||
CONTAINER_NAME: homarr-mem-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
SECRET_ENCRYPTION_KEY: 0000000000000000000000000000000000000000000000000000000000000000
|
|
||||||
run: |
|
|
||||||
docker run -d --name "$CONTAINER_NAME" -p 127.0.0.1::7575 \
|
|
||||||
-e NO_EXTERNAL_CONNECTION=true \
|
|
||||||
-e SECRET_ENCRYPTION_KEY="$SECRET_ENCRYPTION_KEY" \
|
|
||||||
homarr-ci
|
|
||||||
PORT=$(docker port "$CONTAINER_NAME" 7575/tcp | sed 's/.*://')
|
|
||||||
[[ "$PORT" =~ ^[0-9]+$ ]] || { echo "ERROR: invalid port mapping: '$PORT'"; exit 1; }
|
|
||||||
URL="http://127.0.0.1:${PORT}"
|
|
||||||
|
|
||||||
healthy=false
|
|
||||||
for i in $(seq 1 30); do
|
|
||||||
if curl -sf "$URL/api/health/ready" >/dev/null 2>&1; then
|
|
||||||
echo "Container healthy after $((i * 2))s"
|
|
||||||
healthy=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$healthy" != "true" ]; then
|
|
||||||
echo "ERROR: Container never became healthy"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
warmup_ok=0
|
|
||||||
for _ in $(seq 1 5); do
|
|
||||||
curl -sf "$URL/" >/dev/null 2>&1 && warmup_ok=$((warmup_ok + 1))
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
if [ "$warmup_ok" -eq 0 ]; then
|
|
||||||
echo "ERROR: All warmup requests failed"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 50
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME" | grep -qx true || {
|
|
||||||
echo "ERROR: Container died before memory measurement"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
RAW_MEMORY=$(docker stats --no-stream --format '{{.MemUsage}}' "$CONTAINER_NAME" | sed 's| /.*||')
|
|
||||||
MEMORY_MB=$(echo "$RAW_MEMORY" | awk '
|
|
||||||
/GiB/ { gsub(/GiB/, ""); print $1 * 1024; next }
|
|
||||||
/MiB/ { gsub(/MiB/, ""); print $1; next }
|
|
||||||
/KiB/ { gsub(/KiB/, ""); print $1 / 1024; next }
|
|
||||||
{ print $1 / 1048576 }
|
|
||||||
')
|
|
||||||
|
|
||||||
echo "Memory usage: ${MEMORY_MB} MB (${RAW_MEMORY})"
|
|
||||||
[[ "$MEMORY_MB" =~ ^[0-9]+(\.[0-9]+)?$ ]] || {
|
|
||||||
echo "ERROR: non-numeric memory value: '$MEMORY_MB' (raw: '$RAW_MEMORY')"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
if awk "BEGIN { exit !($MEMORY_MB < 50) }"; then
|
|
||||||
echo "ERROR: Memory suspiciously low (${MEMORY_MB} MB) — container may have crashed"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
elif awk "BEGIN { exit !($MEMORY_MB > 700) }"; then
|
|
||||||
echo "ERROR: Memory usage ${MEMORY_MB} MB exceeds 700 MB"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Clean up memory test container
|
|
||||||
if: always()
|
|
||||||
env:
|
|
||||||
CONTAINER_NAME: homarr-mem-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
run: docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
|
|
||||||
|
|
||||||
- name: Determine preview tag
|
- name: Determine preview tag
|
||||||
id: preview
|
id: preview
|
||||||
if: |
|
if: |
|
||||||
@@ -309,7 +233,7 @@ jobs:
|
|||||||
run: test -n "$PR_NUMBER" || { echo "pr_number is required for cleanup"; exit 1; }
|
run: test -n "$PR_NUMBER" || { echo "pr_number is required for cleanup"; exit 1; }
|
||||||
|
|
||||||
- name: Delete GHCR package version
|
- name: Delete GHCR package version
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v8
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
## [1.71.0](https://github.com/homarr-labs/homarr/compare/v1.70.0...v1.71.0) (2026-07-17)
|
||||||
|
|
||||||
## [1.70.0](https://github.com/homarr-labs/homarr/compare/v1.69.2...v1.70.0) (2026-07-10)
|
## [1.70.0](https://github.com/homarr-labs/homarr/compare/v1.69.2...v1.70.0) (2026-07-10)
|
||||||
|
|
||||||
## [1.69.2](https://github.com/homarr-labs/homarr/compare/v1.69.1...v1.69.2) (2026-07-06)
|
## [1.69.2](https://github.com/homarr-labs/homarr/compare/v1.69.1...v1.69.2) (2026-07-06)
|
||||||
|
|||||||
@@ -50,12 +50,11 @@ import { immichServerStatsWidget } from '../../widgets/immich-server-stats';
|
|||||||
<code>user.read</code>,{" "}
|
<code>user.read</code>,{" "}
|
||||||
<code>user.update</code>,{" "}
|
<code>user.update</code>,{" "}
|
||||||
<code>asset.read</code>,{" "}
|
<code>asset.read</code>,{" "}
|
||||||
|
<code>asset.view</code>,{" "}
|
||||||
<code>asset.download</code>,{" "}
|
<code>asset.download</code>,{" "}
|
||||||
<code>asset.statistics</code>,{" "}
|
<code>asset.statistics</code>,{" "}
|
||||||
<code>server.statistics</code>,{" "}
|
<code>server.statistics</code>,{" "}
|
||||||
<code>server.about</code>.
|
<code>server.about</code>.
|
||||||
<br />
|
|
||||||
Additional permissions may be required depending on your Immich version. If you encounter authorization errors, grant any missing permissions requested by the server.
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -193,6 +193,10 @@ export function DockerTable({ initialData }: DockerTableProps) {
|
|||||||
positionToolbarAlertBanner: "top",
|
positionToolbarAlertBanner: "top",
|
||||||
enableTableFooter: false,
|
enableTableFooter: false,
|
||||||
enableBottomToolbar: false,
|
enableBottomToolbar: false,
|
||||||
|
// MRT's built-in full-screen mode does not stretch the table to fill the
|
||||||
|
// viewport, so with few containers it renders as a thin strip (#6230). Disable
|
||||||
|
// it, matching the other management tables (users, invites).
|
||||||
|
enableFullScreenToggle: false,
|
||||||
positionGlobalFilter: "right",
|
positionGlobalFilter: "right",
|
||||||
mantineSearchTextInputProps: {
|
mantineSearchTextInputProps: {
|
||||||
placeholder: tDocker("table.search", { count: String(containers.length) }),
|
placeholder: tDocker("table.search", { count: String(containers.length) }),
|
||||||
|
|||||||
+18
@@ -31,6 +31,7 @@ import {
|
|||||||
userChangeHomeBoardsSchema,
|
userChangeHomeBoardsSchema,
|
||||||
userChangeSearchPreferencesSchema,
|
userChangeSearchPreferencesSchema,
|
||||||
userEditProfileSchema,
|
userEditProfileSchema,
|
||||||
|
userEnableRightClickOnWidgetsSchema,
|
||||||
userFirstDayOfWeekSchema,
|
userFirstDayOfWeekSchema,
|
||||||
userPingIconsEnabledSchema,
|
userPingIconsEnabledSchema,
|
||||||
} from "@homarr/validation/user";
|
} from "@homarr/validation/user";
|
||||||
@@ -51,6 +52,7 @@ const userGeneralSettingsSchema = z.object({
|
|||||||
ddgBangsEnabled: userChangeSearchPreferencesSchema.shape.ddgBangsEnabled,
|
ddgBangsEnabled: userChangeSearchPreferencesSchema.shape.ddgBangsEnabled,
|
||||||
firstDayOfWeek: userFirstDayOfWeekSchema.shape.firstDayOfWeek,
|
firstDayOfWeek: userFirstDayOfWeekSchema.shape.firstDayOfWeek,
|
||||||
pingIconsEnabled: userPingIconsEnabledSchema.shape.pingIconsEnabled,
|
pingIconsEnabled: userPingIconsEnabledSchema.shape.pingIconsEnabled,
|
||||||
|
enableRightClickOnWidgets: userEnableRightClickOnWidgetsSchema.shape.enableRightClickOnWidgets,
|
||||||
});
|
});
|
||||||
|
|
||||||
type FormValues = z.infer<typeof userGeneralSettingsSchema>;
|
type FormValues = z.infer<typeof userGeneralSettingsSchema>;
|
||||||
@@ -78,6 +80,7 @@ const buildInitialValues = (user: RouterOutputs["user"]["getById"]): FormValues
|
|||||||
ddgBangsEnabled: user.ddgBangs,
|
ddgBangsEnabled: user.ddgBangs,
|
||||||
firstDayOfWeek: user.firstDayOfWeek as DayOfWeek,
|
firstDayOfWeek: user.firstDayOfWeek as DayOfWeek,
|
||||||
pingIconsEnabled: user.pingIconsEnabled,
|
pingIconsEnabled: user.pingIconsEnabled,
|
||||||
|
enableRightClickOnWidgets: user.enableRightClickOnWidgets,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const UserGeneralSettingsForm = ({
|
export const UserGeneralSettingsForm = ({
|
||||||
@@ -95,6 +98,7 @@ export const UserGeneralSettingsForm = ({
|
|||||||
const changeSearchPreferencesMutation = clientApi.user.changeSearchPreferences.useMutation();
|
const changeSearchPreferencesMutation = clientApi.user.changeSearchPreferences.useMutation();
|
||||||
const changeFirstDayOfWeekMutation = clientApi.user.changeFirstDayOfWeek.useMutation();
|
const changeFirstDayOfWeekMutation = clientApi.user.changeFirstDayOfWeek.useMutation();
|
||||||
const changePingIconsEnabledMutation = clientApi.user.changePingIconsEnabled.useMutation();
|
const changePingIconsEnabledMutation = clientApi.user.changePingIconsEnabled.useMutation();
|
||||||
|
const changeEnableRightClickOnWidgetsMutation = clientApi.user.changeEnableRightClickOnWidgets.useMutation();
|
||||||
|
|
||||||
const initialValues = buildInitialValues(user);
|
const initialValues = buildInitialValues(user);
|
||||||
const initialValuesRef = useRef(initialValues);
|
const initialValuesRef = useRef(initialValues);
|
||||||
@@ -114,6 +118,7 @@ export const UserGeneralSettingsForm = ({
|
|||||||
changeSearchPreferencesMutation,
|
changeSearchPreferencesMutation,
|
||||||
changeFirstDayOfWeekMutation,
|
changeFirstDayOfWeekMutation,
|
||||||
changePingIconsEnabledMutation,
|
changePingIconsEnabledMutation,
|
||||||
|
changeEnableRightClickOnWidgetsMutation,
|
||||||
];
|
];
|
||||||
const isPending = mutations.some((m) => m.isPending);
|
const isPending = mutations.some((m) => m.isPending);
|
||||||
|
|
||||||
@@ -169,6 +174,14 @@ export const UserGeneralSettingsForm = ({
|
|||||||
action: () =>
|
action: () =>
|
||||||
changePingIconsEnabledMutation.mutateAsync({ id: user.id, pingIconsEnabled: parsed.data.pingIconsEnabled }),
|
changePingIconsEnabledMutation.mutateAsync({ id: user.id, pingIconsEnabled: parsed.data.pingIconsEnabled }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
when: changed("enableRightClickOnWidgets"),
|
||||||
|
action: () =>
|
||||||
|
changeEnableRightClickOnWidgetsMutation.mutateAsync({
|
||||||
|
id: user.id,
|
||||||
|
enableRightClickOnWidgets: parsed.data.enableRightClickOnWidgets,
|
||||||
|
}),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const promises = saveActions.filter((s) => s.when).map((s) => s.action());
|
const promises = saveActions.filter((s) => s.when).map((s) => s.action());
|
||||||
@@ -305,6 +318,11 @@ export const UserGeneralSettingsForm = ({
|
|||||||
label={t("user.field.pingIconsEnabled.label")}
|
label={t("user.field.pingIconsEnabled.label")}
|
||||||
{...form.getInputProps("pingIconsEnabled", { type: "checkbox" })}
|
{...form.getInputProps("pingIconsEnabled", { type: "checkbox" })}
|
||||||
/>
|
/>
|
||||||
|
<Switch
|
||||||
|
label={t("user.field.enableRightClickOnWidgets.label")}
|
||||||
|
description={t("user.field.enableRightClickOnWidgets.description")}
|
||||||
|
{...form.getInputProps("enableRightClickOnWidgets", { type: "checkbox" })}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
import { notFound } from "next/navigation";
|
|
||||||
|
|
||||||
import { ImageProxy } from "@homarr/image-proxy";
|
import { ImageProxy } from "@homarr/image-proxy";
|
||||||
|
|
||||||
export const GET = async (_request: Request, props: { params: Promise<{ id: string }> }) => {
|
export const GET = async (_request: Request, props: { params: Promise<{ id: string }> }) => {
|
||||||
const { id } = await props.params;
|
const { id } = await props.params;
|
||||||
|
|
||||||
const imageProxy = new ImageProxy();
|
const imageProxy = new ImageProxy();
|
||||||
const image = await imageProxy.forwardImageAsync(id);
|
const result = await imageProxy.forwardImageAsync(id);
|
||||||
if (!image) {
|
|
||||||
notFound();
|
if ("error" in result) {
|
||||||
|
const status = result.error === "upstream-error" ? result.statusCode : result.error === "fetch-error" ? 502 : 404;
|
||||||
|
return new Response(null, {
|
||||||
|
status,
|
||||||
|
headers: {
|
||||||
|
"X-Homarr-Image-Proxy-Error": result.error,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response(image, {
|
return new Response(result.image, {
|
||||||
headers: {
|
headers: {
|
||||||
"Cache-Control": "public, max-age=3600, immutable", // Cache for 1 hour
|
"Cache-Control": "public, max-age=3600, immutable", // Cache for 1 hour
|
||||||
|
...(result.contentType ? { "Content-Type": result.contentType } : {}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -48,6 +48,7 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetCont
|
|||||||
const tMenu = useScopedI18n("item.menu.label");
|
const tMenu = useScopedI18n("item.menu.label");
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
const isRightClickEnabled = settings.enableRightClickOnWidgets;
|
||||||
const { openModal } = useModalAction(WidgetEditModal);
|
const { openModal } = useModalAction(WidgetEditModal);
|
||||||
const { openModal: openMoveModal } = useModalAction(ItemMoveModal);
|
const { openModal: openMoveModal } = useModalAction(ItemMoveModal);
|
||||||
const { openConfirmModal } = useConfirmModal();
|
const { openConfirmModal } = useConfirmModal();
|
||||||
@@ -168,6 +169,7 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetCont
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!session) return <>{children}</>;
|
if (!session) return <>{children}</>;
|
||||||
|
if (!isRightClickEnabled) return <>{children}</>;
|
||||||
|
|
||||||
const visibleWidgetActions = widgetContextActions.filter((a) => !a.hidden);
|
const visibleWidgetActions = widgetContextActions.filter((a) => !a.hidden);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.18.0",
|
"node": ">=24.18.0",
|
||||||
"pnpm": ">=11.11.0"
|
"pnpm": ">=11.13.1"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@11.11.0"
|
"packageManager": "pnpm@11.13.1"
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homarr",
|
"name": "homarr",
|
||||||
"version": "1.70.0",
|
"version": "1.71.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env CI=true turbo build",
|
"build": "cross-env CI=true turbo build",
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.18.0",
|
"node": ">=24.18.0",
|
||||||
"pnpm": ">=11.11.0"
|
"pnpm": ">=11.13.1"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@11.11.0"
|
"packageManager": "pnpm@11.13.1"
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ import { z } from "zod/v4";
|
|||||||
|
|
||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
import { asc, eq, like } from "@homarr/db";
|
import { and, asc, eq, like } from "@homarr/db";
|
||||||
import { getServerSettingByKeyAsync, updateServerSettingByKeyAsync } from "@homarr/db/queries";
|
import { getServerSettingByKeyAsync, updateServerSettingByKeyAsync } from "@homarr/db/queries";
|
||||||
import { searchEngines, users } from "@homarr/db/schema";
|
import { searchEngines, users } from "@homarr/db/schema";
|
||||||
import { byIdSchema, paginatedSchema, searchSchema } from "@homarr/validation/common";
|
import { byIdSchema, paginatedSchema, searchSchema } from "@homarr/validation/common";
|
||||||
@@ -130,9 +130,15 @@ export const searchEngineRouter = createTRPCRouter({
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}),
|
}),
|
||||||
search: protectedProcedure.input(searchSchema).query(async ({ ctx, input }) => {
|
search: publicProcedure.input(searchSchema).query(async ({ ctx, input }) => {
|
||||||
return await ctx.db.query.searchEngines.findMany({
|
return await ctx.db.query.searchEngines.findMany({
|
||||||
where: like(searchEngines.short, `${input.query.toLowerCase().trim()}%`),
|
// Public dashboards have no session: restrict anonymous users to generic
|
||||||
|
// (non-integration) engines so custom search engines work there too (#4132),
|
||||||
|
// while integration-backed engines stay available only when signed in.
|
||||||
|
where: and(
|
||||||
|
like(searchEngines.short, `${input.query.toLowerCase().trim()}%`),
|
||||||
|
ctx.session?.user ? undefined : eq(searchEngines.type, "generic"),
|
||||||
|
),
|
||||||
with: {
|
with: {
|
||||||
integration: {
|
integration: {
|
||||||
columns: {
|
columns: {
|
||||||
|
|||||||
@@ -357,6 +357,83 @@ describe("delete should delete user", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("changeEnableRightClickOnWidgets should toggle the right-click preference", () => {
|
||||||
|
test("non-admin can toggle their own preference", async () => {
|
||||||
|
const db = createDb();
|
||||||
|
const caller = userRouter.createCaller({
|
||||||
|
db,
|
||||||
|
deviceType: undefined,
|
||||||
|
session: defaultSession,
|
||||||
|
});
|
||||||
|
|
||||||
|
await db.insert(users).values({
|
||||||
|
id: defaultOwnerId,
|
||||||
|
name: "owner",
|
||||||
|
});
|
||||||
|
|
||||||
|
await caller.changeEnableRightClickOnWidgets({ id: defaultOwnerId, enableRightClickOnWidgets: false });
|
||||||
|
|
||||||
|
const updated = await db.query.users.findFirst({
|
||||||
|
where: eq(users.id, defaultOwnerId),
|
||||||
|
columns: { enableRightClickOnWidgets: true },
|
||||||
|
});
|
||||||
|
expect(updated?.enableRightClickOnWidgets).toBe(false);
|
||||||
|
|
||||||
|
await caller.changeEnableRightClickOnWidgets({ id: defaultOwnerId, enableRightClickOnWidgets: true });
|
||||||
|
|
||||||
|
const restored = await db.query.users.findFirst({
|
||||||
|
where: eq(users.id, defaultOwnerId),
|
||||||
|
columns: { enableRightClickOnWidgets: true },
|
||||||
|
});
|
||||||
|
expect(restored?.enableRightClickOnWidgets).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("non-admin cannot toggle another user's preference", async () => {
|
||||||
|
const db = createDb();
|
||||||
|
const caller = userRouter.createCaller({
|
||||||
|
db,
|
||||||
|
deviceType: undefined,
|
||||||
|
session: defaultSession,
|
||||||
|
});
|
||||||
|
|
||||||
|
const otherUserId = createId();
|
||||||
|
await db.insert(users).values({ id: defaultOwnerId });
|
||||||
|
await db.insert(users).values({ id: otherUserId, name: "other" });
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
caller.changeEnableRightClickOnWidgets({ id: otherUserId, enableRightClickOnWidgets: false }),
|
||||||
|
).rejects.toThrow("User not found");
|
||||||
|
|
||||||
|
const other = await db.query.users.findFirst({
|
||||||
|
where: eq(users.id, otherUserId),
|
||||||
|
columns: { enableRightClickOnWidgets: true },
|
||||||
|
});
|
||||||
|
expect(other?.enableRightClickOnWidgets).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("admin can toggle another user's preference", async () => {
|
||||||
|
const db = createDb();
|
||||||
|
const adminSession = createSession(["admin"]);
|
||||||
|
const caller = userRouter.createCaller({
|
||||||
|
db,
|
||||||
|
deviceType: undefined,
|
||||||
|
session: adminSession,
|
||||||
|
});
|
||||||
|
|
||||||
|
const targetUserId = createId();
|
||||||
|
await db.insert(users).values({ id: defaultOwnerId });
|
||||||
|
await db.insert(users).values({ id: targetUserId, name: "target" });
|
||||||
|
|
||||||
|
await caller.changeEnableRightClickOnWidgets({ id: targetUserId, enableRightClickOnWidgets: false });
|
||||||
|
|
||||||
|
const target = await db.query.users.findFirst({
|
||||||
|
where: eq(users.id, targetUserId),
|
||||||
|
columns: { enableRightClickOnWidgets: true },
|
||||||
|
});
|
||||||
|
expect(target?.enableRightClickOnWidgets).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const createOnboardingStepAsync = async (db: Database, step: OnboardingStep) => {
|
const createOnboardingStepAsync = async (db: Database, step: OnboardingStep) => {
|
||||||
await db.insert(onboarding).values({
|
await db.insert(onboarding).values({
|
||||||
id: createId(),
|
id: createId(),
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
userCreateSchema,
|
userCreateSchema,
|
||||||
userDdgBangsSchema,
|
userDdgBangsSchema,
|
||||||
userEditProfileSchema,
|
userEditProfileSchema,
|
||||||
|
userEnableRightClickOnWidgetsSchema,
|
||||||
userFirstDayOfWeekSchema,
|
userFirstDayOfWeekSchema,
|
||||||
userInitSchema,
|
userInitSchema,
|
||||||
userPingIconsEnabledSchema,
|
userPingIconsEnabledSchema,
|
||||||
@@ -345,6 +346,7 @@ export const userRouter = createTRPCRouter({
|
|||||||
mobileHomeBoardId: true,
|
mobileHomeBoardId: true,
|
||||||
firstDayOfWeek: true,
|
firstDayOfWeek: true,
|
||||||
pingIconsEnabled: true,
|
pingIconsEnabled: true,
|
||||||
|
enableRightClickOnWidgets: true,
|
||||||
defaultSearchEngineId: true,
|
defaultSearchEngineId: true,
|
||||||
openSearchInNewTab: true,
|
openSearchInNewTab: true,
|
||||||
ddgBangs: true,
|
ddgBangs: true,
|
||||||
@@ -381,6 +383,7 @@ export const userRouter = createTRPCRouter({
|
|||||||
mobileHomeBoardId: true,
|
mobileHomeBoardId: true,
|
||||||
firstDayOfWeek: true,
|
firstDayOfWeek: true,
|
||||||
pingIconsEnabled: true,
|
pingIconsEnabled: true,
|
||||||
|
enableRightClickOnWidgets: true,
|
||||||
defaultSearchEngineId: true,
|
defaultSearchEngineId: true,
|
||||||
openSearchInNewTab: true,
|
openSearchInNewTab: true,
|
||||||
ddgBangs: true,
|
ddgBangs: true,
|
||||||
@@ -651,6 +654,32 @@ export const userRouter = createTRPCRouter({
|
|||||||
})
|
})
|
||||||
.where(eq(users.id, ctx.session.user.id));
|
.where(eq(users.id, ctx.session.user.id));
|
||||||
}),
|
}),
|
||||||
|
changeEnableRightClickOnWidgets: protectedProcedure
|
||||||
|
.meta({
|
||||||
|
openapi: {
|
||||||
|
method: "PATCH",
|
||||||
|
path: "/api/users/right-click-widgets",
|
||||||
|
tags: ["users"],
|
||||||
|
protect: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.input(convertIntersectionToZodObject(userEnableRightClickOnWidgetsSchema.and(byIdSchema)))
|
||||||
|
.output(z.void())
|
||||||
|
.mutation(async ({ input, ctx }) => {
|
||||||
|
if (!ctx.session.user.permissions.includes("admin") && ctx.session.user.id !== input.id) {
|
||||||
|
throw new TRPCError({
|
||||||
|
code: "NOT_FOUND",
|
||||||
|
message: "User not found",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await ctx.db
|
||||||
|
.update(users)
|
||||||
|
.set({
|
||||||
|
enableRightClickOnWidgets: input.enableRightClickOnWidgets,
|
||||||
|
})
|
||||||
|
.where(eq(users.id, input.id));
|
||||||
|
}),
|
||||||
changePingIconsEnabled: protectedProcedure
|
changePingIconsEnabled: protectedProcedure
|
||||||
.input(userPingIconsEnabledSchema.and(byIdSchema))
|
.input(userPingIconsEnabledSchema.and(byIdSchema))
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `user` ADD `enable_right_click_on_widgets` boolean DEFAULT true NOT NULL;
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -302,6 +302,13 @@
|
|||||||
"when": 1783176100870,
|
"when": 1783176100870,
|
||||||
"tag": "0042_add_widget_secret",
|
"tag": "0042_add_widget_secret",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 43,
|
||||||
|
"version": "5",
|
||||||
|
"when": 1783852800000,
|
||||||
|
"tag": "0043_add_right_click_preference",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "user" ADD COLUMN "enable_right_click_on_widgets" boolean DEFAULT true NOT NULL;
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -64,6 +64,13 @@
|
|||||||
"when": 1783176100870,
|
"when": 1783176100870,
|
||||||
"tag": "0008_add_widget_secret",
|
"tag": "0008_add_widget_secret",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 9,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1783786677702,
|
||||||
|
"tag": "0009_add_right_click_preference",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `user` ADD `enable_right_click_on_widgets` integer DEFAULT true NOT NULL;
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -288,6 +288,13 @@
|
|||||||
"when": 1783176100870,
|
"when": 1783176100870,
|
||||||
"tag": "0040_add_widget_secret",
|
"tag": "0040_add_widget_secret",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 41,
|
||||||
|
"version": "6",
|
||||||
|
"when": 1783786658943,
|
||||||
|
"tag": "0041_add_right_click_preference",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,7 @@ export const users = mysqlTable("user", {
|
|||||||
colorScheme: varchar({ length: 5 }).$type<ColorScheme>().default("dark").notNull(),
|
colorScheme: varchar({ length: 5 }).$type<ColorScheme>().default("dark").notNull(),
|
||||||
firstDayOfWeek: tinyint().$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
firstDayOfWeek: tinyint().$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
||||||
pingIconsEnabled: boolean().default(false).notNull(),
|
pingIconsEnabled: boolean().default(false).notNull(),
|
||||||
|
enableRightClickOnWidgets: boolean().default(true).notNull(),
|
||||||
completedManageTour: boolean().default(false).notNull(),
|
completedManageTour: boolean().default(false).notNull(),
|
||||||
completedBoardTour: boolean().default(false).notNull(),
|
completedBoardTour: boolean().default(false).notNull(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export const users = pgTable("user", {
|
|||||||
colorScheme: varchar({ length: 5 }).$type<ColorScheme>().default("dark").notNull(),
|
colorScheme: varchar({ length: 5 }).$type<ColorScheme>().default("dark").notNull(),
|
||||||
firstDayOfWeek: smallint().$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
firstDayOfWeek: smallint().$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
||||||
pingIconsEnabled: boolean().default(false).notNull(),
|
pingIconsEnabled: boolean().default(false).notNull(),
|
||||||
|
enableRightClickOnWidgets: boolean().default(true).notNull(),
|
||||||
completedManageTour: boolean().default(false).notNull(),
|
completedManageTour: boolean().default(false).notNull(),
|
||||||
completedBoardTour: boolean().default(false).notNull(),
|
completedBoardTour: boolean().default(false).notNull(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export const users = sqliteTable("user", {
|
|||||||
colorScheme: text().$type<ColorScheme>().default("dark").notNull(),
|
colorScheme: text().$type<ColorScheme>().default("dark").notNull(),
|
||||||
firstDayOfWeek: int().$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
firstDayOfWeek: int().$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
||||||
pingIconsEnabled: int({ mode: "boolean" }).default(false).notNull(),
|
pingIconsEnabled: int({ mode: "boolean" }).default(false).notNull(),
|
||||||
|
enableRightClickOnWidgets: int({ mode: "boolean" }).default(true).notNull(),
|
||||||
completedManageTour: int({ mode: "boolean" }).default(false).notNull(),
|
completedManageTour: int({ mode: "boolean" }).default(false).notNull(),
|
||||||
completedBoardTour: int({ mode: "boolean" }).default(false).notNull(),
|
completedBoardTour: int({ mode: "boolean" }).default(false).notNull(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,5 +37,5 @@ describe("Mysql Migration", () => {
|
|||||||
|
|
||||||
connection.end();
|
connection.end();
|
||||||
await mysqlContainer.stop();
|
await mysqlContainer.stop();
|
||||||
}, 40_000);
|
}, 120_000);
|
||||||
});
|
});
|
||||||
@@ -467,7 +467,6 @@ export const integrationDefs = {
|
|||||||
iconUrl: "https://cdn.jsdelivr.net/gh/selfhst/icons/png/archiveteam-warrior.png",
|
iconUrl: "https://cdn.jsdelivr.net/gh/selfhst/icons/png/archiveteam-warrior.png",
|
||||||
category: ["archiving"],
|
category: ["archiving"],
|
||||||
documentationUrl: null,
|
documentationUrl: null,
|
||||||
defaultUrl: "http://localhost:8001",
|
|
||||||
},
|
},
|
||||||
// This integration only returns mock data, it is used during development (but can also be used in production by directly going to the create page)
|
// This integration only returns mock data, it is used during development (but can also be used in production by directly going to the create page)
|
||||||
mock: {
|
mock: {
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ const createUrlByIdChannel = (id: string) =>
|
|||||||
headers: `${string}.${string}`;
|
headers: `${string}.${string}`;
|
||||||
}>(`image-proxy:url:${id}`);
|
}>(`image-proxy:url:${id}`);
|
||||||
|
|
||||||
|
export type ForwardImageResult =
|
||||||
|
| { image: ArrayBuffer; contentType: string | null }
|
||||||
|
| { error: "not-found" }
|
||||||
|
| { error: "upstream-error"; statusCode: number }
|
||||||
|
| { error: "fetch-error" };
|
||||||
|
|
||||||
export class ImageProxy {
|
export class ImageProxy {
|
||||||
private static hmacKey: Buffer<ArrayBuffer> | null = null;
|
private static hmacKey: Buffer<ArrayBuffer> | null = null;
|
||||||
|
|
||||||
@@ -47,17 +53,34 @@ export class ImageProxy {
|
|||||||
return this.createImageUrl(id);
|
return this.createImageUrl(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async forwardImageAsync(id: string): Promise<ArrayBuffer | null> {
|
public async forwardImageAsync(id: string): Promise<ForwardImageResult> {
|
||||||
const urlAndHeaders = await this.getImageUrlAndHeadersAsync(id);
|
const urlAndHeaders = await this.getImageUrlAndHeadersAsync(id);
|
||||||
if (!urlAndHeaders) {
|
if (!urlAndHeaders) {
|
||||||
return null;
|
return { error: "not-found" };
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetchWithTrustedCertificatesAsync(urlAndHeaders.url, {
|
|
||||||
headers: urlAndHeaders.headers ?? {},
|
|
||||||
});
|
|
||||||
|
|
||||||
const proxyUrl = this.createImageUrl(id);
|
const proxyUrl = this.createImageUrl(id);
|
||||||
|
let response: Awaited<ReturnType<typeof fetchWithTrustedCertificatesAsync>>;
|
||||||
|
try {
|
||||||
|
response = await fetchWithTrustedCertificatesAsync(urlAndHeaders.url, {
|
||||||
|
headers: urlAndHeaders.headers ?? {},
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(
|
||||||
|
new ErrorWithMetadata(
|
||||||
|
"Failed to connect to image source",
|
||||||
|
{
|
||||||
|
id,
|
||||||
|
url: this.redactUrl(urlAndHeaders.url),
|
||||||
|
headers: this.redactHeaders(urlAndHeaders.headers),
|
||||||
|
proxyUrl,
|
||||||
|
},
|
||||||
|
{ cause: error },
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return { error: "fetch-error" };
|
||||||
|
}
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
logger.error(
|
logger.error(
|
||||||
new ErrorWithMetadata("Failed to fetch image", {
|
new ErrorWithMetadata("Failed to fetch image", {
|
||||||
@@ -68,7 +91,7 @@ export class ImageProxy {
|
|||||||
statusCode: response.status,
|
statusCode: response.status,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return null;
|
return { error: "upstream-error", statusCode: response.status };
|
||||||
}
|
}
|
||||||
|
|
||||||
const arrayBuffer = await response.arrayBuffer();
|
const arrayBuffer = await response.arrayBuffer();
|
||||||
@@ -80,7 +103,7 @@ export class ImageProxy {
|
|||||||
size: `${(arrayBuffer.byteLength / 1024).toFixed(1)}KB`,
|
size: `${(arrayBuffer.byteLength / 1024).toFixed(1)}KB`,
|
||||||
});
|
});
|
||||||
|
|
||||||
return arrayBuffer;
|
return { image: arrayBuffer, contentType: response.headers.get("content-type") };
|
||||||
}
|
}
|
||||||
|
|
||||||
private createImageUrl(id: string): string {
|
private createImageUrl(id: string): string {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
AssetMediaSize,
|
||||||
getAlbumInfo,
|
getAlbumInfo,
|
||||||
getAllAlbums,
|
getAllAlbums,
|
||||||
getMyUser,
|
getMyUser,
|
||||||
@@ -75,7 +76,9 @@ export class ImmichIntegration extends Integration {
|
|||||||
assets: await Promise.all(
|
assets: await Promise.all(
|
||||||
albumAssets.map(async (asset) => {
|
albumAssets.map(async (asset) => {
|
||||||
const publicLink = await imageProxy.createImageAsync(
|
const publicLink = await imageProxy.createImageAsync(
|
||||||
this.url(`/api/assets/${asset.id}/original`).toString(),
|
// This is the URL generated by the SDK's viewAsset call. Preview images are
|
||||||
|
// browser-compatible while avoiding the large original asset download.
|
||||||
|
this.url(`/api/assets/${asset.id}/thumbnail`, { size: AssetMediaSize.Preview }).toString(),
|
||||||
{
|
{
|
||||||
"x-api-key": this.getSecretValue("apiKey"),
|
"x-api-key": this.getSecretValue("apiKey"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -745,6 +745,19 @@ const linuxServerIOReleasesSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Parse a github.com project URL (as returned by the LSIO registry) into an
|
||||||
|
// "owner/repo" identifier, or null if it is not a github.com repository URL.
|
||||||
|
const parseGithubRepo = (url: string): string | null => {
|
||||||
|
try {
|
||||||
|
const parsed = new URL(url);
|
||||||
|
if (parsed.hostname !== "github.com") return null;
|
||||||
|
const [owner, repo] = parsed.pathname.replace(/^\/+/, "").split("/");
|
||||||
|
return owner && repo ? `${owner}/${repo}` : null;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const getLinuxServerIOReleaseAsync = async (
|
const getLinuxServerIOReleaseAsync = async (
|
||||||
baseUrl: string,
|
baseUrl: string,
|
||||||
identifier: string,
|
identifier: string,
|
||||||
@@ -774,6 +787,29 @@ const getLinuxServerIOReleaseAsync = async (
|
|||||||
error: { code: "noReleasesFound", message: `Image "${parsed.name}" not found in LinuxServer.io registry` },
|
error: { code: "noReleasesFound", message: `Image "${parsed.name}" not found in LinuxServer.io registry` },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// LSIO's /api/v1/images only exposes the single latest version, so a version
|
||||||
|
// filter can never surface an older release (#4351). When the image has a GitHub
|
||||||
|
// repository, delegate to the GitHub release provider to fetch the real release
|
||||||
|
// history and apply the filter, while keeping LSIO's own image metadata. Any
|
||||||
|
// GitHub failure (no repo, no releases, rate limit) falls back to the LSIO latest.
|
||||||
|
const githubRepo = parseGithubRepo(release.github_url);
|
||||||
|
if (githubRepo) {
|
||||||
|
const githubResult = await getGithubReleaseAsync(getReleaseProviderDefaultUrl("github"), githubRepo, versionRegex);
|
||||||
|
if (githubResult.success) {
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: {
|
||||||
|
...githubResult.data,
|
||||||
|
projectUrl: release.github_url,
|
||||||
|
projectDescription: release.description,
|
||||||
|
isArchived: release.deprecated,
|
||||||
|
starsCount: release.stars,
|
||||||
|
createdAt: release.initial_date ?? githubResult.data.createdAt,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const regex = compileVersionRegex(versionRegex);
|
const regex = compileVersionRegex(versionRegex);
|
||||||
if (versionRegex && !regex) {
|
if (versionRegex && !regex) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export type SettingsContextProps = Pick<
|
|||||||
| "openSearchInNewTab"
|
| "openSearchInNewTab"
|
||||||
| "ddgBangs"
|
| "ddgBangs"
|
||||||
| "pingIconsEnabled"
|
| "pingIconsEnabled"
|
||||||
|
| "enableRightClickOnWidgets"
|
||||||
> &
|
> &
|
||||||
Pick<ServerSettings["board"], "enableStatusByDefault" | "forceDisableStatus"> &
|
Pick<ServerSettings["board"], "enableStatusByDefault" | "forceDisableStatus"> &
|
||||||
Pick<ServerSettings["user"], "enableGravatar">;
|
Pick<ServerSettings["user"], "enableGravatar">;
|
||||||
@@ -32,6 +33,7 @@ export type UserSettings = Pick<
|
|||||||
| "openSearchInNewTab"
|
| "openSearchInNewTab"
|
||||||
| "ddgBangs"
|
| "ddgBangs"
|
||||||
| "pingIconsEnabled"
|
| "pingIconsEnabled"
|
||||||
|
| "enableRightClickOnWidgets"
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const createSettings = ({
|
export const createSettings = ({
|
||||||
@@ -48,6 +50,7 @@ export const createSettings = ({
|
|||||||
homeBoardId: user?.homeBoardId ?? serverSettings.board.homeBoardId,
|
homeBoardId: user?.homeBoardId ?? serverSettings.board.homeBoardId,
|
||||||
mobileHomeBoardId: user?.mobileHomeBoardId ?? serverSettings.board.mobileHomeBoardId,
|
mobileHomeBoardId: user?.mobileHomeBoardId ?? serverSettings.board.mobileHomeBoardId,
|
||||||
pingIconsEnabled: user?.pingIconsEnabled ?? false,
|
pingIconsEnabled: user?.pingIconsEnabled ?? false,
|
||||||
|
enableRightClickOnWidgets: user?.enableRightClickOnWidgets ?? true,
|
||||||
enableStatusByDefault: serverSettings.board.enableStatusByDefault,
|
enableStatusByDefault: serverSettings.board.enableStatusByDefault,
|
||||||
forceDisableStatus: serverSettings.board.forceDisableStatus,
|
forceDisableStatus: serverSettings.board.forceDisableStatus,
|
||||||
enableGravatar: serverSettings.user.enableGravatar,
|
enableGravatar: serverSettings.user.enableGravatar,
|
||||||
|
|||||||
@@ -56,6 +56,13 @@ export const userPreferenceDefinitions = [
|
|||||||
mutationGroup: "pingIconsEnabled",
|
mutationGroup: "pingIconsEnabled",
|
||||||
aliases: ["ping", "icon", "status"],
|
aliases: ["ping", "icon", "status"],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "enableRightClickOnWidgets",
|
||||||
|
kind: "boolean",
|
||||||
|
guest: false,
|
||||||
|
mutationGroup: "enableRightClickOnWidgets",
|
||||||
|
aliases: ["right click", "context menu", "tile", "widget menu"],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "fullPreferencesPage",
|
key: "fullPreferencesPage",
|
||||||
kind: "link",
|
kind: "link",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import {
|
import {
|
||||||
IconActivity,
|
IconActivity,
|
||||||
IconCalendarWeek,
|
IconCalendarWeek,
|
||||||
|
IconClick,
|
||||||
IconDeviceDesktop,
|
IconDeviceDesktop,
|
||||||
IconExternalLink,
|
IconExternalLink,
|
||||||
IconHome,
|
IconHome,
|
||||||
@@ -46,6 +47,7 @@ export const preferenceIcons: Record<UserPreferenceKey, TablerIcon> = {
|
|||||||
homeBoardId: IconHome,
|
homeBoardId: IconHome,
|
||||||
mobileHomeBoardId: IconLayoutBoard,
|
mobileHomeBoardId: IconLayoutBoard,
|
||||||
pingIconsEnabled: IconActivity,
|
pingIconsEnabled: IconActivity,
|
||||||
|
enableRightClickOnWidgets: IconClick,
|
||||||
fullPreferencesPage: IconSettings,
|
fullPreferencesPage: IconSettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export const useUserPreferences = () => {
|
|||||||
const homeBoardsMutation = clientApi.user.changeHomeBoards.useMutation({ onSuccess: refresh });
|
const homeBoardsMutation = clientApi.user.changeHomeBoards.useMutation({ onSuccess: refresh });
|
||||||
const firstDayMutation = clientApi.user.changeFirstDayOfWeek.useMutation({ onSuccess: refresh });
|
const firstDayMutation = clientApi.user.changeFirstDayOfWeek.useMutation({ onSuccess: refresh });
|
||||||
const pingMutation = clientApi.user.changePingIconsEnabled.useMutation({ onSuccess: refresh });
|
const pingMutation = clientApi.user.changePingIconsEnabled.useMutation({ onSuccess: refresh });
|
||||||
|
const rightClickMutation = clientApi.user.changeEnableRightClickOnWidgets.useMutation({ onSuccess: refresh });
|
||||||
|
|
||||||
const getEffective = (key: UserPreferenceKey): unknown =>
|
const getEffective = (key: UserPreferenceKey): unknown =>
|
||||||
key in optimisticRef.current ? optimisticRef.current[key] : settingsRef.current[key as keyof SettingsContextProps];
|
key in optimisticRef.current ? optimisticRef.current[key] : settingsRef.current[key as keyof SettingsContextProps];
|
||||||
@@ -116,6 +117,8 @@ export const useUserPreferences = () => {
|
|||||||
}),
|
}),
|
||||||
firstDayOfWeek: (uid, _key, value) => firstDayMutation.mutateAsync({ id: uid, firstDayOfWeek: value as DayOfWeek }),
|
firstDayOfWeek: (uid, _key, value) => firstDayMutation.mutateAsync({ id: uid, firstDayOfWeek: value as DayOfWeek }),
|
||||||
pingIconsEnabled: (uid, _key, value) => pingMutation.mutateAsync({ id: uid, pingIconsEnabled: value as boolean }),
|
pingIconsEnabled: (uid, _key, value) => pingMutation.mutateAsync({ id: uid, pingIconsEnabled: value as boolean }),
|
||||||
|
enableRightClickOnWidgets: (uid, _key, value) =>
|
||||||
|
rightClickMutation.mutateAsync({ id: uid, enableRightClickOnWidgets: value as boolean }),
|
||||||
};
|
};
|
||||||
|
|
||||||
const groupPending: Record<string, boolean> = {
|
const groupPending: Record<string, boolean> = {
|
||||||
@@ -123,6 +126,7 @@ export const useUserPreferences = () => {
|
|||||||
homeBoards: homeBoardsMutation.isPending,
|
homeBoards: homeBoardsMutation.isPending,
|
||||||
firstDayOfWeek: firstDayMutation.isPending,
|
firstDayOfWeek: firstDayMutation.isPending,
|
||||||
pingIconsEnabled: pingMutation.isPending,
|
pingIconsEnabled: pingMutation.isPending,
|
||||||
|
enableRightClickOnWidgets: rightClickMutation.isPending,
|
||||||
};
|
};
|
||||||
|
|
||||||
const persistedValues = useMemo<Record<UserPreferenceKey, unknown>>(() => {
|
const persistedValues = useMemo<Record<UserPreferenceKey, unknown>>(() => {
|
||||||
|
|||||||
@@ -198,6 +198,10 @@
|
|||||||
"pingIconsEnabled": {
|
"pingIconsEnabled": {
|
||||||
"label": "Use icons for pings"
|
"label": "Use icons for pings"
|
||||||
},
|
},
|
||||||
|
"enableRightClickOnWidgets": {
|
||||||
|
"label": "Enable right-click on widgets",
|
||||||
|
"description": "Show Homarr's context menu when right-clicking a widget. Disable to use the browser's default menu (e.g. \"Open link in new tab\")."
|
||||||
|
},
|
||||||
"defaultSearchEngine": {
|
"defaultSearchEngine": {
|
||||||
"label": "Default search engine"
|
"label": "Default search engine"
|
||||||
},
|
},
|
||||||
@@ -5953,6 +5957,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"enableRightClickOnWidgets": {
|
||||||
|
"label": "Enable right-click on widgets",
|
||||||
|
"children": {
|
||||||
|
"detail": {
|
||||||
|
"title": "Enable right-click on widgets"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"fullPreferencesPage": {
|
"fullPreferencesPage": {
|
||||||
"label": "Open full preferences page"
|
"label": "Open full preferences page"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,10 @@ export const userPingIconsEnabledSchema = z.object({
|
|||||||
pingIconsEnabled: z.boolean(),
|
pingIconsEnabled: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const userEnableRightClickOnWidgetsSchema = z.object({
|
||||||
|
enableRightClickOnWidgets: z.boolean(),
|
||||||
|
});
|
||||||
|
|
||||||
export const userDdgBangsSchema = z.object({
|
export const userDdgBangsSchema = z.object({
|
||||||
ddgBangs: z.boolean(),
|
ddgBangs: z.boolean(),
|
||||||
});
|
});
|
||||||
@@ -66,16 +66,20 @@ export default function MediaServerWidget({ options, integrationIds }: WidgetCom
|
|||||||
const currentlyPlaying = row.original.currentlyPlaying;
|
const currentlyPlaying = row.original.currentlyPlaying;
|
||||||
if (!currentlyPlaying) return null;
|
if (!currentlyPlaying) return null;
|
||||||
|
|
||||||
const isPaused = currentlyPlaying.playback.state === "paused";
|
const playback = currentlyPlaying.playback;
|
||||||
|
const isPaused = playback?.state === "paused";
|
||||||
const Icon = isPaused ? IconPlayerPause : mediaTypeIconMap[currentlyPlaying.type];
|
const Icon = isPaused ? IconPlayerPause : mediaTypeIconMap[currentlyPlaying.type];
|
||||||
|
|
||||||
const { positionMs, durationMs } = currentlyPlaying.playback;
|
const positionMs = playback?.positionMs ?? null;
|
||||||
|
const durationMs = playback?.durationMs ?? null;
|
||||||
const progressPercent =
|
const progressPercent =
|
||||||
positionMs !== null && durationMs !== null && durationMs > 0
|
positionMs !== null && durationMs !== null && durationMs > 0
|
||||||
? Math.min(100, Math.round((positionMs / durationMs) * 100))
|
? Math.min(100, Math.round((positionMs / durationMs) * 100))
|
||||||
: null;
|
: null;
|
||||||
const remainingMinutes =
|
const remainingMinutes =
|
||||||
positionMs !== null && durationMs !== null ? Math.max(0, Math.round((durationMs - positionMs) / 60_000)) : null;
|
positionMs !== null && durationMs !== null
|
||||||
|
? Math.max(0, Math.round((durationMs - positionMs) / 60_000))
|
||||||
|
: null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap={4} style={{ minWidth: 0 }}>
|
<Stack gap={4} style={{ minWidth: 0 }}>
|
||||||
@@ -122,8 +126,8 @@ export default function MediaServerWidget({ options, integrationIds }: WidgetCom
|
|||||||
|
|
||||||
const isTranscoding = Boolean(
|
const isTranscoding = Boolean(
|
||||||
currentlyPlaying.metadata?.transcoding.target.videoCodec ??
|
currentlyPlaying.metadata?.transcoding.target.videoCodec ??
|
||||||
currentlyPlaying.metadata?.transcoding.target.audioCodec ??
|
currentlyPlaying.metadata?.transcoding.target.audioCodec ??
|
||||||
currentlyPlaying.metadata?.transcoding.container,
|
currentlyPlaying.metadata?.transcoding.container,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[{"login":"ajnart","avatar_url":"https://avatars.githubusercontent.com/u/49837342?v=4"},{"login":"manuel-rw","avatar_url":"https://avatars.githubusercontent.com/u/30572287?v=4"},{"login":"Meierschlumpf","avatar_url":"https://avatars.githubusercontent.com/u/63781622?v=4"},{"login":"SeDemal","avatar_url":"https://avatars.githubusercontent.com/u/26098587?v=4"},{"login":"lammersbjorn","avatar_url":"https://avatars.githubusercontent.com/u/71191962?v=4"},{"login":"LarveyOfficial","avatar_url":"https://avatars.githubusercontent.com/u/39219859?v=4"},{"login":"c00ldude1oo","avatar_url":"https://avatars.githubusercontent.com/u/15677803?v=4"},{"login":"InterN0te","avatar_url":"https://avatars.githubusercontent.com/u/10882916?v=4"},{"login":"Aimsucks","avatar_url":"https://avatars.githubusercontent.com/u/1828486?v=4"},{"login":"JannesV","avatar_url":"https://avatars.githubusercontent.com/u/5984244?v=4"},{"login":"MauriceNino","avatar_url":"https://avatars.githubusercontent.com/u/18658092?v=4"},{"login":"hillaliy","avatar_url":"https://avatars.githubusercontent.com/u/950010?v=4"},{"login":"Skeeww","avatar_url":"https://avatars.githubusercontent.com/u/9639992?v=4"},{"login":"RichyHBM","avatar_url":"https://avatars.githubusercontent.com/u/5472275?v=4"},{"login":"Bonfire","avatar_url":"https://avatars.githubusercontent.com/u/5704760?v=4"},{"login":"wieli99","avatar_url":"https://avatars.githubusercontent.com/u/46794825?v=4"},{"login":"ishaanparlikar","avatar_url":"https://avatars.githubusercontent.com/u/43013132?v=4"},{"login":"Zareix","avatar_url":"https://avatars.githubusercontent.com/u/29818713?v=4"},{"login":"tuggan","avatar_url":"https://avatars.githubusercontent.com/u/4325608?v=4"},{"login":"Spillebulle","avatar_url":"https://avatars.githubusercontent.com/u/46653946?v=4"},{"login":"marektancak0106","avatar_url":"https://avatars.githubusercontent.com/u/25422667?v=4"},{"login":"spkesDE","avatar_url":"https://avatars.githubusercontent.com/u/1682314?v=4"},{"login":"j3lte","avatar_url":"https://avatars.githubusercontent.com/u/2557568?v=4"},{"login":"dslatt","avatar_url":"https://avatars.githubusercontent.com/u/5211001?v=4"},{"login":"Malong11-007","avatar_url":"https://avatars.githubusercontent.com/u/40298510?v=4"},{"login":"StefanB7","avatar_url":"https://avatars.githubusercontent.com/u/22056509?v=4"},{"login":"souravghosh01","avatar_url":"https://avatars.githubusercontent.com/u/37548139?v=4"},{"login":"SR3u","avatar_url":"https://avatars.githubusercontent.com/u/2380522?v=4"},{"login":"Rikpat","avatar_url":"https://avatars.githubusercontent.com/u/33869814?v=4"},{"login":"NormanJS","avatar_url":"https://avatars.githubusercontent.com/u/83409549?v=4"},{"login":"No-Maines-Land","avatar_url":"https://avatars.githubusercontent.com/u/20687725?v=4"},{"login":"stark1tty","avatar_url":"https://avatars.githubusercontent.com/u/69326376?v=4"},{"login":"Momcilo42","avatar_url":"https://avatars.githubusercontent.com/u/10118137?v=4"},{"login":"marius-arch","avatar_url":"https://avatars.githubusercontent.com/u/72494359?v=4"},{"login":"Lumilias","avatar_url":"https://avatars.githubusercontent.com/u/10852161?v=4"},{"login":"Havock94","avatar_url":"https://avatars.githubusercontent.com/u/7635248?v=4"},{"login":"Lollyde","avatar_url":"https://avatars.githubusercontent.com/u/11347524?v=4"},{"login":"krishnamuppaneni","avatar_url":"https://avatars.githubusercontent.com/u/4703366?v=4"},{"login":"devtobi","avatar_url":"https://avatars.githubusercontent.com/u/28538704?v=4"},{"login":"TyxTang","avatar_url":"https://avatars.githubusercontent.com/u/90897955?v=4"},{"login":"beanbag420","avatar_url":"https://avatars.githubusercontent.com/u/19630511?v=4"},{"login":"WillyJL","avatar_url":"https://avatars.githubusercontent.com/u/49810075?v=4"},{"login":"anonysoul","avatar_url":"https://avatars.githubusercontent.com/u/105715150?v=4"},{"login":"cospeedster","avatar_url":"https://avatars.githubusercontent.com/u/52749645?v=4"},{"login":"diederbert","avatar_url":"https://avatars.githubusercontent.com/u/162878798?v=4"},{"login":"digdilem","avatar_url":"https://avatars.githubusercontent.com/u/4052275?v=4"},{"login":"dinghino","avatar_url":"https://avatars.githubusercontent.com/u/14729459?v=4"},{"login":"gfomichev","avatar_url":"https://avatars.githubusercontent.com/u/1596146?v=4"},{"login":"gnattu","avatar_url":"https://avatars.githubusercontent.com/u/12995396?v=4"},{"login":"tuxpizza","avatar_url":"https://avatars.githubusercontent.com/u/84710786?v=4"},{"login":"xmarkurion","avatar_url":"https://avatars.githubusercontent.com/u/46654687?v=4"},{"login":"huanga","avatar_url":"https://avatars.githubusercontent.com/u/732970?v=4"},{"login":"taos15","avatar_url":"https://avatars.githubusercontent.com/u/122130728?v=4"},{"login":"arghyadipchak","avatar_url":"https://avatars.githubusercontent.com/u/32430374?v=4"},{"login":"AuthorShin","avatar_url":"https://avatars.githubusercontent.com/u/4959043?v=4"},{"login":"benniblot","avatar_url":"https://avatars.githubusercontentLine truncated
|
[{"login":"ajnart","avatar_url":"https://avatars.githubusercontent.com/u/49837342?v=4"},{"login":"manuel-rw","avatar_url":"https://avatars.githubusercontent.com/u/30572287?v=4"},{"login":"Meierschlumpf","avatar_url":"https://avatars.githubusercontent.com/u/63781622?v=4"},{"login":"SeDemal","avatar_url":"https://avatars.githubusercontent.com/u/26098587?v=4"},{"login":"lammersbjorn","avatar_url":"https://avatars.githubusercontent.com/u/71191962?v=4"},{"login":"LarveyOfficial","avatar_url":"https://avatars.githubusercontent.com/u/39219859?v=4"},{"login":"c00ldude1oo","avatar_url":"https://avatars.githubusercontent.com/u/15677803?v=4"},{"login":"InterN0te","avatar_url":"https://avatars.githubusercontent.com/u/10882916?v=4"},{"login":"Aimsucks","avatar_url":"https://avatars.githubusercontent.com/u/1828486?v=4"},{"login":"JannesV","avatar_url":"https://avatars.githubusercontent.com/u/5984244?v=4"},{"login":"MauriceNino","avatar_url":"https://avatars.githubusercontent.com/u/18658092?v=4"},{"login":"hillaliy","avatar_url":"https://avatars.githubusercontent.com/u/950010?v=4"},{"login":"Skeeww","avatar_url":"https://avatars.githubusercontent.com/u/9639992?v=4"},{"login":"RichyHBM","avatar_url":"https://avatars.githubusercontent.com/u/5472275?v=4"},{"login":"Bonfire","avatar_url":"https://avatars.githubusercontent.com/u/5704760?v=4"},{"login":"wieli99","avatar_url":"https://avatars.githubusercontent.com/u/46794825?v=4"},{"login":"ishaanparlikar","avatar_url":"https://avatars.githubusercontent.com/u/43013132?v=4"},{"login":"Zareix","avatar_url":"https://avatars.githubusercontent.com/u/29818713?v=4"},{"login":"tuggan","avatar_url":"https://avatars.githubusercontent.com/u/4325608?v=4"},{"login":"Spillebulle","avatar_url":"https://avatars.githubusercontent.com/u/46653946?v=4"},{"login":"marektancak0106","avatar_url":"https://avatars.githubusercontent.com/u/25422667?v=4"},{"login":"spkesDE","avatar_url":"https://avatars.githubusercontent.com/u/1682314?v=4"},{"login":"j3lte","avatar_url":"https://avatars.githubusercontent.com/u/2557568?v=4"},{"login":"dslatt","avatar_url":"https://avatars.githubusercontent.com/u/5211001?v=4"},{"login":"Malong11-007","avatar_url":"https://avatars.githubusercontent.com/u/40298510?v=4"},{"login":"StefanB7","avatar_url":"https://avatars.githubusercontent.com/u/22056509?v=4"},{"login":"souravghosh01","avatar_url":"https://avatars.githubusercontent.com/u/37548139?v=4"},{"login":"SR3u","avatar_url":"https://avatars.githubusercontent.com/u/2380522?v=4"},{"login":"Rikpat","avatar_url":"https://avatars.githubusercontent.com/u/33869814?v=4"},{"login":"NormanJS","avatar_url":"https://avatars.githubusercontent.com/u/83409549?v=4"},{"login":"No-Maines-Land","avatar_url":"https://avatars.githubusercontent.com/u/20687725?v=4"},{"login":"stark1tty","avatar_url":"https://avatars.githubusercontent.com/u/69326376?v=4"},{"login":"Momcilo42","avatar_url":"https://avatars.githubusercontent.com/u/10118137?v=4"},{"login":"marius-arch","avatar_url":"https://avatars.githubusercontent.com/u/72494359?v=4"},{"login":"Lumilias","avatar_url":"https://avatars.githubusercontent.com/u/10852161?v=4"},{"login":"Havock94","avatar_url":"https://avatars.githubusercontent.com/u/7635248?v=4"},{"login":"Lollyde","avatar_url":"https://avatars.githubusercontent.com/u/11347524?v=4"},{"login":"krishnamuppaneni","avatar_url":"https://avatars.githubusercontent.com/u/4703366?v=4"},{"login":"devtobi","avatar_url":"https://avatars.githubusercontent.com/u/28538704?v=4"},{"login":"TyxTang","avatar_url":"https://avatars.githubusercontent.com/u/90897955?v=4"},{"login":"beanbag420","avatar_url":"https://avatars.githubusercontent.com/u/19630511?v=4"},{"login":"WillyJL","avatar_url":"https://avatars.githubusercontent.com/u/49810075?v=4"},{"login":"anonysoul","avatar_url":"https://avatars.githubusercontent.com/u/105715150?v=4"},{"login":"cospeedster","avatar_url":"https://avatars.githubusercontent.com/u/52749645?v=4"},{"login":"diederbert","avatar_url":"https://avatars.githubusercontent.com/u/162878798?v=4"},{"login":"digdilem","avatar_url":"https://avatars.githubusercontent.com/u/4052275?v=4"},{"login":"dinghino","avatar_url":"https://avatars.githubusercontent.com/u/14729459?v=4"},{"login":"gfomichev","avatar_url":"https://avatars.githubusercontent.com/u/1596146?v=4"},{"login":"gnattu","avatar_url":"https://avatars.githubusercontent.com/u/12995396?v=4"},{"login":"tuxpizza","avatar_url":"https://avatars.githubusercontent.com/u/84710786?v=4"},{"login":"xmarkurion","avatar_url":"https://avatars.githubusercontent.com/u/46654687?v=4"},{"login":"huanga","avatar_url":"https://avatars.githubusercontent.com/u/732970?v=4"},{"login":"taos15","avatar_url":"https://avatars.githubusercontent.com/u/122130728?v=4"},{"login":"arghyadipchak","avatar_url":"https://avatars.githubusercontent.com/u/32430374?v=4"},{"login":"AuthorShin","avatar_url":"https://avatars.githubusercontent.com/u/4959043?v=4"},{"login":"benniblot","avatar_url":"https://avatars.githubusercontentLine truncated
|
||||||
Reference in new issue
Block a user