feat(FN-2663): add cached update-check setting, APIs, and banner
- Add global updateCheckEnabled setting to core schema/types and wire dashboard command to cache update checks in the CLI - Implement dashboard server update-check cache module plus REST routes for status and refresh behavior - Add dashboard client hook, legacy API helpers, and UpdateAvailableBanner UI to show cached CLI update notices - Cover update-check server routes, hook behavior, banner rendering, and route registration with focused tests - Document update-check configuration and API behavior in architecture and settings reference docs
This commit is contained in:
35
packages/dashboard/app/components/UpdateAvailableBanner.tsx
Normal file
35
packages/dashboard/app/components/UpdateAvailableBanner.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import "./UpdateAvailableBanner.css";
|
||||
import { X } from "lucide-react";
|
||||
|
||||
interface UpdateAvailableBannerProps {
|
||||
latestVersion: string;
|
||||
currentVersion: string;
|
||||
onDismiss: () => void;
|
||||
}
|
||||
|
||||
export function UpdateAvailableBanner({ latestVersion, currentVersion, onDismiss }: UpdateAvailableBannerProps) {
|
||||
return (
|
||||
<div className="update-available-banner" role="status" aria-live="polite">
|
||||
<p className="update-available-banner__text">
|
||||
Update available: v{latestVersion} (current: v{currentVersion}). Run <code>npm i -g @runfusion/fusion</code> to
|
||||
update. {" "}
|
||||
<a
|
||||
className="update-available-banner__link"
|
||||
href="https://github.com/Runfusion/Fusion/releases"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Release notes
|
||||
</a>
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
className="update-available-banner__dismiss touch-target"
|
||||
aria-label="Dismiss update notice"
|
||||
onClick={onDismiss}
|
||||
>
|
||||
<X size={16} aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user