2026-03-12 09:26:58 -07:00
|
|
|
import type { ImageUpdateInfo } from "../../lib/types";
|
2026-08-09 11:35:42 -07:00
|
|
|
import Modal from "../ui/Modal";
|
|
|
|
|
import Button from "../ui/Button";
|
2026-03-12 09:26:58 -07:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
imageUpdateInfo: ImageUpdateInfo;
|
|
|
|
|
onDismiss: () => void;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function ImageUpdateDialog({
|
|
|
|
|
imageUpdateInfo,
|
|
|
|
|
onDismiss,
|
|
|
|
|
onClose,
|
|
|
|
|
}: Props) {
|
|
|
|
|
const shortDigest = (digest: string) => {
|
|
|
|
|
// Show first 16 chars of the hash part (after "sha256:")
|
|
|
|
|
const hash = digest.startsWith("sha256:") ? digest.slice(7) : digest;
|
|
|
|
|
return hash.slice(0, 16);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2026-08-09 11:35:42 -07:00
|
|
|
<Modal
|
|
|
|
|
title="Container Image Update"
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
widthClassName="w-[30rem]"
|
|
|
|
|
footer={
|
|
|
|
|
<>
|
|
|
|
|
<Button variant="ghost" onClick={onDismiss}>
|
|
|
|
|
Dismiss
|
|
|
|
|
</Button>
|
|
|
|
|
<Button onClick={onClose}>Close</Button>
|
|
|
|
|
</>
|
|
|
|
|
}
|
2026-03-12 09:26:58 -07:00
|
|
|
>
|
2026-08-09 11:35:42 -07:00
|
|
|
<p className="text-[13px] text-[var(--text-secondary)] mb-4">
|
|
|
|
|
A newer version of the container image is available in the registry. Re-pull the
|
|
|
|
|
image in Docker settings to get the latest tools and fixes.
|
|
|
|
|
</p>
|
2026-03-12 09:26:58 -07:00
|
|
|
|
2026-08-09 11:35:42 -07:00
|
|
|
<div className="space-y-2 mb-4 text-xs bg-[var(--bg-primary)] rounded-[var(--radius-control)] p-3 border border-[var(--border-color)]">
|
|
|
|
|
{imageUpdateInfo.local_digest && (
|
2026-03-12 09:26:58 -07:00
|
|
|
<div className="flex justify-between">
|
2026-08-09 11:35:42 -07:00
|
|
|
<span className="text-[var(--text-secondary)]">Local digest</span>
|
|
|
|
|
<span className="font-mono text-[var(--text-primary)]">
|
|
|
|
|
{shortDigest(imageUpdateInfo.local_digest)}…
|
2026-03-12 09:26:58 -07:00
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-08-09 11:35:42 -07:00
|
|
|
)}
|
|
|
|
|
<div className="flex justify-between">
|
|
|
|
|
<span className="text-[var(--text-secondary)]">Remote digest</span>
|
|
|
|
|
<span className="font-mono text-[var(--accent)]">
|
|
|
|
|
{shortDigest(imageUpdateInfo.remote_digest)}…
|
|
|
|
|
</span>
|
2026-03-12 09:26:58 -07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-08-09 11:35:42 -07:00
|
|
|
|
|
|
|
|
<p className="text-xs text-[var(--text-secondary)]">
|
|
|
|
|
Go to Settings > Container and click "Re-pull Image" to update.
|
|
|
|
|
Running containers will not be affected until restarted.
|
|
|
|
|
</p>
|
|
|
|
|
</Modal>
|
2026-03-12 09:26:58 -07:00
|
|
|
);
|
|
|
|
|
}
|