feat: add managed database capture and operator restore

PostgreSQL and MySQL backups run through paired outposts, with operator sign-in, off-site copies, and legacy import. Retention stays on each orbit, so the unused retention console is removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-10 23:26:49 +07:00
parent 30a1a9b8f0
commit 6320b6f244
96 changed files with 11061 additions and 725 deletions

View File

@@ -1,25 +1,40 @@
import { useLayoutEffect } from "react";
import { useLayoutEffect, useRef } from "react";
export function useGalaxyMotion(draw: (elapsed: number) => boolean) {
const latest = useRef(draw);
const wake = useRef<() => void>(undefined);
export function useGalaxyMotion(active: boolean, draw: (elapsed: number) => boolean) {
useLayoutEffect(() => {
let frame = 0;
let previous: number | undefined;
const tick = (now: number) => {
const keepDrawing = draw(previous === undefined ? 0 : (now - previous) / 1000);
previous = now;
if (keepDrawing) frame = requestAnimationFrame(tick);
frame = 0;
const keepDrawing = latest.current(previous === undefined ? 0 : (now - previous) / 1000);
previous = keepDrawing ? now : undefined;
if (keepDrawing) schedule();
};
const sync = () => {
const schedule = () => {
if (!frame && !document.hidden) frame = requestAnimationFrame(tick);
};
const visibilityChanged = () => {
cancelAnimationFrame(frame);
frame = 0;
previous = undefined;
if (!document.hidden && active) frame = requestAnimationFrame(tick);
if (!document.hidden && latest.current(0)) schedule();
};
draw(0);
sync();
document.addEventListener("visibilitychange", sync);
wake.current = schedule;
document.addEventListener("visibilitychange", visibilityChanged);
return () => {
cancelAnimationFrame(frame);
document.removeEventListener("visibilitychange", sync);
wake.current = undefined;
document.removeEventListener("visibilitychange", visibilityChanged);
};
}, [active, draw]);
}, []);
useLayoutEffect(() => {
latest.current = draw;
if (draw(0)) wake.current?.();
});
}