mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Merge branch 'benphelps:main' into main
This commit is contained in:
commit
82a6553c58
32
Dockerfile
32
Dockerfile
@ -7,12 +7,10 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --link package.json pnpm-lock.yaml* ./
|
COPY --link package.json pnpm-lock.yaml* ./
|
||||||
|
|
||||||
RUN <<EOF
|
SHELL ["/bin/ash", "-xeo", "pipefail", "-c"]
|
||||||
set -xe
|
RUN apk add --no-cache libc6-compat \
|
||||||
apk add libc6-compat
|
&& apk add --no-cache --virtual .gyp python3 make g++ \
|
||||||
apk add --virtual .gyp python3 make g++
|
&& npm install -g pnpm
|
||||||
npm install -g pnpm
|
|
||||||
EOF
|
|
||||||
|
|
||||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store pnpm fetch | grep -v "cross-device link not permitted\|Falling back to copying packages from store"
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store pnpm fetch | grep -v "cross-device link not permitted\|Falling back to copying packages from store"
|
||||||
|
|
||||||
@ -29,12 +27,10 @@ ARG REVISION
|
|||||||
COPY --link --from=deps /app/node_modules ./node_modules/
|
COPY --link --from=deps /app/node_modules ./node_modules/
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN <<EOF
|
SHELL ["/bin/ash", "-xeo", "pipefail", "-c"]
|
||||||
set -xe
|
RUN npm run telemetry \
|
||||||
npm run telemetry
|
&& mkdir config && echo '---' > config/settings.yaml \
|
||||||
mkdir config && echo '-' > config/settings.yaml
|
&& NEXT_PUBLIC_BUILDTIME=$BUILDTIME NEXT_PUBLIC_VERSION=$VERSION NEXT_PUBLIC_REVISION=$REVISION npm run build
|
||||||
NEXT_PUBLIC_BUILDTIME=$BUILDTIME NEXT_PUBLIC_VERSION=$VERSION NEXT_PUBLIC_REVISION=$REVISION npm run build
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM docker.io/node:18-alpine AS runner
|
FROM docker.io/node:18-alpine AS runner
|
||||||
@ -50,12 +46,15 @@ ENV NODE_ENV production
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy files from context (this allows the files to copy before the builder stage is done).
|
# Copy files from context (this allows the files to copy before the builder stage is done).
|
||||||
COPY --link package.json next.config.js ./
|
COPY --link --chown=1000:1000 package.json next.config.js ./
|
||||||
COPY --link /public ./public
|
COPY --link --chown=1000:1000 /public ./public/
|
||||||
|
|
||||||
# Copy files from builder
|
# Copy files from builder
|
||||||
COPY --link --from=builder /app/.next/standalone ./
|
COPY --link --from=builder --chown=1000:1000 /app/.next/standalone ./
|
||||||
COPY --link --from=builder /app/.next/static/ ./.next/static/
|
COPY --link --from=builder --chown=1000:1000 /app/.next/static/ ./.next/static/
|
||||||
|
COPY --link --chmod=755 docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
|
RUN apk add --no-cache su-exec
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
||||||
@ -63,4 +62,5 @@ EXPOSE $PORT
|
|||||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=20s \
|
HEALTHCHECK --interval=10s --timeout=3s --start-period=20s \
|
||||||
CMD wget --no-verbose --tries=1 --spider --no-check-certificate http://localhost:$PORT/api/healthcheck || exit 1
|
CMD wget --no-verbose --tries=1 --spider --no-check-certificate http://localhost:$PORT/api/healthcheck || exit 1
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
@ -2,8 +2,22 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Default to root, so old installations won't break
|
||||||
|
export PUID=${PUID:-0}
|
||||||
|
export PGID=${PGID:-0}
|
||||||
|
|
||||||
# This is in attempt to preserve the original behavior of the Dockerfile,
|
# This is in attempt to preserve the original behavior of the Dockerfile,
|
||||||
# while also supporting the lscr.io /config directory
|
# while also supporting the lscr.io /config directory
|
||||||
[ ! -d "/app/config" ] && ln -s /config /app/config
|
[ ! -d "/app/config" ] && ln -s /config /app/config
|
||||||
|
|
||||||
node server.js
|
# Set privileges for /app but only if pid 1 user is root and we are dropping privileges.
|
||||||
|
# If container is run as an unprivileged user, it means owner already handled ownership setup on their own.
|
||||||
|
# Running chown in that case (as non-root) will cause error
|
||||||
|
[ "$(id -u)" == "0" ] && [ "${PUID}" != "0" ] && chown -R ${PUID}:${PGID} /app
|
||||||
|
|
||||||
|
# Drop privileges (when asked to) if root, otherwise run as current user
|
||||||
|
if [ "$(id -u)" == "0" ] && [ "${PUID}" != "0" ]; then
|
||||||
|
su-exec ${PUID}:${PGID} "$@"
|
||||||
|
else
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -417,5 +417,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"layers": "Layers",
|
||||||
|
"print_progress": "Progress"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@
|
|||||||
"qbittorrent": {
|
"qbittorrent": {
|
||||||
"download": "Bajada",
|
"download": "Bajada",
|
||||||
"upload": "Subida",
|
"upload": "Subida",
|
||||||
"leech": "Leech",
|
"leech": "Depender",
|
||||||
"seed": "Semillas"
|
"seed": "Semillas"
|
||||||
},
|
},
|
||||||
"mastodon": {
|
"mastodon": {
|
||||||
@ -347,14 +347,14 @@
|
|||||||
"deluge": {
|
"deluge": {
|
||||||
"download": "Descarga",
|
"download": "Descarga",
|
||||||
"upload": "Subida",
|
"upload": "Subida",
|
||||||
"leech": "Leech",
|
"leech": "Depender",
|
||||||
"seed": "Semilla"
|
"seed": "Semilla"
|
||||||
},
|
},
|
||||||
"flood": {
|
"flood": {
|
||||||
"download": "Descargar",
|
"download": "Descargar",
|
||||||
"upload": "Subir",
|
"upload": "Subir",
|
||||||
"leech": "Leech",
|
"leech": "Depender",
|
||||||
"seed": "Seed"
|
"seed": "Semillas"
|
||||||
},
|
},
|
||||||
"tdarr": {
|
"tdarr": {
|
||||||
"queue": "Cola",
|
"queue": "Cola",
|
||||||
@ -403,5 +403,11 @@
|
|||||||
"memory": "Memoria activa",
|
"memory": "Memoria activa",
|
||||||
"wanUpload": "Carga WAN",
|
"wanUpload": "Carga WAN",
|
||||||
"wanDownload": "Descargar WAN"
|
"wanDownload": "Descargar WAN"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Estado de la impresora",
|
||||||
|
"print_status": "Estado de la impresora",
|
||||||
|
"print_progress": "Progreso",
|
||||||
|
"layers": "Capas"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Mém. Utilisée",
|
"memory": "Mém. Utilisée",
|
||||||
"wanUpload": "WAN Envoi",
|
"wanUpload": "WAN Envoi",
|
||||||
"wanDownload": "WAN Récep."
|
"wanDownload": "WAN Récep."
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "État Imprimante",
|
||||||
|
"print_status": "Statut Imprimante",
|
||||||
|
"print_progress": "Progression",
|
||||||
|
"layers": "Couches"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Aktivna memorija",
|
"memory": "Aktivna memorija",
|
||||||
"wanUpload": "WAN prijenos",
|
"wanUpload": "WAN prijenos",
|
||||||
"wanDownload": "WAN preuzimanje"
|
"wanDownload": "WAN preuzimanje"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"layers": "Layers",
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Memoria in uso",
|
"memory": "Memoria in uso",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -412,5 +412,11 @@
|
|||||||
"memory": "Memória Ativa",
|
"memory": "Memória Ativa",
|
||||||
"wanUpload": "Envio WAN",
|
"wanUpload": "Envio WAN",
|
||||||
"wanDownload": "WAN Descarga"
|
"wanDownload": "WAN Descarga"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Активна пам'ять",
|
"memory": "Активна пам'ять",
|
||||||
"wanUpload": "Вивантаження WAN",
|
"wanUpload": "Вивантаження WAN",
|
||||||
"wanDownload": "Завантаження WAN"
|
"wanDownload": "Завантаження WAN"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Стан принтера",
|
||||||
|
"print_status": "Статус друку",
|
||||||
|
"print_progress": "Прогрес",
|
||||||
|
"layers": "Шари"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers",
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN Upload",
|
"wanUpload": "WAN Upload",
|
||||||
"wanDownload": "WAN Download"
|
"wanDownload": "WAN Download"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,5 +403,11 @@
|
|||||||
"memory": "Active Memory",
|
"memory": "Active Memory",
|
||||||
"wanUpload": "WAN上傳",
|
"wanUpload": "WAN上傳",
|
||||||
"wanDownload": "WAN下載"
|
"wanDownload": "WAN下載"
|
||||||
|
},
|
||||||
|
"moonraker": {
|
||||||
|
"printer_state": "Printer State",
|
||||||
|
"print_status": "Print Status",
|
||||||
|
"print_progress": "Progress",
|
||||||
|
"layers": "Layers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ export default function Item({ bookmark }) {
|
|||||||
<div className="flex-shrink-0 flex items-center justify-center w-11 bg-theme-500/10 dark:bg-theme-900/50 text-theme-700 hover:text-theme-700 dark:text-theme-200 text-sm font-medium rounded-l-md">
|
<div className="flex-shrink-0 flex items-center justify-center w-11 bg-theme-500/10 dark:bg-theme-900/50 text-theme-700 hover:text-theme-700 dark:text-theme-200 text-sm font-medium rounded-l-md">
|
||||||
{bookmark.icon &&
|
{bookmark.icon &&
|
||||||
<div className="flex-shrink-0 w-5 h-5">
|
<div className="flex-shrink-0 w-5 h-5">
|
||||||
<ResolvedIcon icon={bookmark.icon} />
|
<ResolvedIcon icon={bookmark.icon} alt={bookmark.abbr} />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{!bookmark.icon && bookmark.abbr}
|
{!bookmark.icon && bookmark.abbr}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Image from "next/future/image";
|
import Image from "next/future/image";
|
||||||
|
|
||||||
export default function ResolvedIcon({ icon, width = 32, height = 32 }) {
|
export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "logo" }) {
|
||||||
// direct or relative URLs
|
// direct or relative URLs
|
||||||
if (icon.startsWith("http") || icon.startsWith("/")) {
|
if (icon.startsWith("http") || icon.startsWith("/")) {
|
||||||
return <Image src={`${icon}`} width={width} height={height} alt="logo" />;
|
return <Image src={`${icon}`} width={width} height={height} alt={alt} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mdi- prefixed, material design icons
|
// mdi- prefixed, material design icons
|
||||||
@ -31,7 +31,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32 }) {
|
|||||||
src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`}
|
src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
alt="logo"
|
alt={alt}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ const components = {
|
|||||||
medusa: dynamic(() => import("./medusa/component")),
|
medusa: dynamic(() => import("./medusa/component")),
|
||||||
miniflux: dynamic(() => import("./miniflux/component")),
|
miniflux: dynamic(() => import("./miniflux/component")),
|
||||||
mikrotik: dynamic(() => import("./mikrotik/component")),
|
mikrotik: dynamic(() => import("./mikrotik/component")),
|
||||||
|
moonraker: dynamic(() => import("./moonraker/component")),
|
||||||
navidrome: dynamic(() => import("./navidrome/component")),
|
navidrome: dynamic(() => import("./navidrome/component")),
|
||||||
nextdns: dynamic(() => import("./nextdns/component")),
|
nextdns: dynamic(() => import("./nextdns/component")),
|
||||||
npm: dynamic(() => import("./npm/component")),
|
npm: dynamic(() => import("./npm/component")),
|
||||||
|
51
src/widgets/moonraker/component.jsx
Normal file
51
src/widgets/moonraker/component.jsx
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import { useTranslation } from "next-i18next";
|
||||||
|
|
||||||
|
import Container from "components/services/widget/container";
|
||||||
|
import Block from "components/services/widget/block";
|
||||||
|
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||||
|
|
||||||
|
export default function Component({ service }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const { widget } = service;
|
||||||
|
|
||||||
|
const { data: printStats, error: printStatsError } = useWidgetAPI(widget, "print_stats");
|
||||||
|
const { data: displayStatus, error: displayStatsError } = useWidgetAPI(widget, "display_status");
|
||||||
|
const { data: webHooks, error: webHooksError } = useWidgetAPI(widget, "webhooks");
|
||||||
|
|
||||||
|
if (printStatsError || displayStatsError || webHooksError) {
|
||||||
|
const finalError = printStatsError ?? displayStatsError ?? webHooksError;
|
||||||
|
return <Container error={finalError} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!printStats || !displayStatus || !webHooks) {
|
||||||
|
return (
|
||||||
|
<Container service={service}>
|
||||||
|
<Block label="moonraker.printer_state" />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (webHooks.result.status.webhooks.state === "shutdown") {
|
||||||
|
return (
|
||||||
|
<Container service={service}>
|
||||||
|
<Block label="moonraker.printer_state" value={webHooks.result.status.webhooks.state} />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let currentLayer = "-";
|
||||||
|
let totalLayer = "-";
|
||||||
|
if (printStats.result.status.print_stats.info.total_layer !== null) {
|
||||||
|
currentLayer = printStats.result.status.print_stats.info.current_layer;
|
||||||
|
totalLayer = printStats.result.status.print_stats.info.total_layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container service={service}>
|
||||||
|
<Block label="moonraker.layers" value={`${currentLayer} / ${totalLayer}`} />
|
||||||
|
<Block label="moonraker.print_progress" value={t("common.percent", { value: (displayStatus.result.status.display_status.progress * 100) })} />
|
||||||
|
<Block label="moonraker.print_status" value={printStats.result.status.print_stats.state} />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
20
src/widgets/moonraker/widget.js
Normal file
20
src/widgets/moonraker/widget.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||||
|
|
||||||
|
const widget = {
|
||||||
|
api: "{url}/printer/objects/query?{endpoint}",
|
||||||
|
proxyHandler: genericProxyHandler,
|
||||||
|
|
||||||
|
mappings: {
|
||||||
|
print_stats: {
|
||||||
|
endpoint: "print_stats",
|
||||||
|
},
|
||||||
|
display_status: {
|
||||||
|
endpoint: "display_status",
|
||||||
|
},
|
||||||
|
webhooks: {
|
||||||
|
endpoint: "webhooks",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default widget;
|
@ -19,6 +19,7 @@ import mastodon from "./mastodon/widget";
|
|||||||
import medusa from "./medusa/widget";
|
import medusa from "./medusa/widget";
|
||||||
import miniflux from "./miniflux/widget";
|
import miniflux from "./miniflux/widget";
|
||||||
import mikrotik from "./mikrotik/widget";
|
import mikrotik from "./mikrotik/widget";
|
||||||
|
import moonraker from "./moonraker/widget";
|
||||||
import navidrome from "./navidrome/widget";
|
import navidrome from "./navidrome/widget";
|
||||||
import nextdns from "./nextdns/widget";
|
import nextdns from "./nextdns/widget";
|
||||||
import npm from "./npm/widget";
|
import npm from "./npm/widget";
|
||||||
@ -77,6 +78,7 @@ const widgets = {
|
|||||||
medusa,
|
medusa,
|
||||||
miniflux,
|
miniflux,
|
||||||
mikrotik,
|
mikrotik,
|
||||||
|
moonraker,
|
||||||
navidrome,
|
navidrome,
|
||||||
nextdns,
|
nextdns,
|
||||||
npm,
|
npm,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user