Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f

### Added

- **Download images from the image viewer.** The full-screen preview's toolbar now includes Download, using the original image rather than its thumbnail. External images may open in a new tab instead when the browser disallows cross-origin downloads.
- **Upgrades check the session omp before they switch.** `ompweb preflight` resolves omp exactly as the host does for a new session (`OMP_WEB_OMP_BIN` or this version's downloaded `ompweb-omp`), starts it headless with `--no-session`, and waits up to 30 s for its hello: it prints `preflight ok: <omp> <version>`, or exits 1 naming the binary and why (not found, not executable, exited with its code, or no hello with omp's last stderr). The host updater and the web app's in-app update run the new release's preflight in the live environment before they stop anything, and abort with the current install still running when it fails. Before the preflight, both run the new release's `ompweb fetch-omp`, so its runner is in place first. A release without the preflight command is checked only if it ships `ompweb-omp`; then the update fails.
- **Rename the cluster.** Settings → Hosts shows the cluster's name with a **Rename cluster** button; the sidebar group follows. The cluster is still created as "Cluster" when the first host joins, so rename it afterwards. `PATCH /api/hosts { poolId, label }` renames a pool without replacing the pool registry.
- **Cluster members use this machine's omp configuration.**
Expand Down
15 changes: 13 additions & 2 deletions components/ImageLightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useEffect, useLayoutEffect, useRef, useState, type ImgHTMLAttributes } from "react";
import { createPortal } from "react-dom";
import { Maximize } from "lucide-react";
import { Download, Maximize } from "lucide-react";
import { useI18n } from "@/lib/i18n";

const ZOOM_MAX = 8;
Expand Down Expand Up @@ -89,7 +89,7 @@ export function ClickableImage({ src, fullSrc, alt, ...imgProps }: ClickableImag
);
}

function ImageLightbox({ src, alt, onClose }: { src: ClickableImageProps["src"]; alt: string; onClose: () => void }) {
function ImageLightbox({ src, alt, onClose }: { src: string; alt: string; onClose: () => void }) {
const dialogRef = useRef<HTMLDialogElement>(null);
const viewportRef = useRef<HTMLDivElement>(null);
// "fit" follows the window as it resizes; a number is a zoom the user chose.
Expand Down Expand Up @@ -231,6 +231,17 @@ function ImageLightbox({ src, alt, onClose }: { src: ClickableImageProps["src"];
>
1:1
</button>
<a
href={src}
download
target="_blank"
rel="noopener noreferrer"
className="image-lightbox-icon-button"
title={t("fileViewer.downloadFile")}
aria-label={t("fileViewer.downloadFile")}
>
<Download size={13} aria-hidden="true" />
</a>
<button
type="button"
className="image-lightbox-icon-button"
Expand Down
Loading