Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 824695ef30 | |||
| 390d7a21ac |
@@ -32,7 +32,7 @@ var SETTINGS_KEY = "cfg";
|
|||||||
// Bump on every change deployed to a workstation. The panel reports this to
|
// Bump on every change deployed to a workstation. The panel reports this to
|
||||||
// the server on load, so Pipeline → Machines shows which version each machine
|
// the server on load, so Pipeline → Machines shows which version each machine
|
||||||
// is actually running and flags the ones left behind.
|
// is actually running and flags the ones left behind.
|
||||||
var PANEL_VERSION = "2.7.0";
|
var PANEL_VERSION = "2.7.1";
|
||||||
|
|
||||||
(function VFXReviewConnector(thisObj) {
|
(function VFXReviewConnector(thisObj) {
|
||||||
var uiState = {
|
var uiState = {
|
||||||
@@ -4710,7 +4710,6 @@ var PANEL_VERSION = "2.7.0";
|
|||||||
var importRendersButton;
|
var importRendersButton;
|
||||||
var btnRow6;
|
var btnRow6;
|
||||||
var pictureLockButton;
|
var pictureLockButton;
|
||||||
var btnRow7;
|
|
||||||
var incrementVersionButton;
|
var incrementVersionButton;
|
||||||
var btnRow6b;
|
var btnRow6b;
|
||||||
var setStartTCButton;
|
var setStartTCButton;
|
||||||
@@ -4868,6 +4867,7 @@ var PANEL_VERSION = "2.7.0";
|
|||||||
"Rebuild the MOV/MP4 slate and burn-ins for the delivered version.\n" +
|
"Rebuild the MOV/MP4 slate and burn-ins for the delivered version.\n" +
|
||||||
"Reuses the rendered EXRs and keeps the version number. Slate text is\n" +
|
"Reuses the rendered EXRs and keeps the version number. Slate text is\n" +
|
||||||
"re-read from the shot, so fix it on the web app's Slate tab first.";
|
"re-read from the shot, so fix it on the web app's Slate tab first.";
|
||||||
|
incrementVersionButton = pipelineRow3.add("button", undefined, "Increment Shot Version");
|
||||||
|
|
||||||
qcPanel = scrollContent.add("panel", undefined, "QC");
|
qcPanel = scrollContent.add("panel", undefined, "QC");
|
||||||
qcPanel.orientation = "column";
|
qcPanel.orientation = "column";
|
||||||
@@ -4974,12 +4974,6 @@ var PANEL_VERSION = "2.7.0";
|
|||||||
btnRow6b.spacing = 6;
|
btnRow6b.spacing = 6;
|
||||||
setStartTCButton = btnRow6b.add("button", undefined, "Set Start Timecode");
|
setStartTCButton = btnRow6b.add("button", undefined, "Set Start Timecode");
|
||||||
|
|
||||||
btnRow7 = buttonsPanel.add("group");
|
|
||||||
btnRow7.orientation = "row";
|
|
||||||
btnRow7.alignChildren = ["fill", "center"];
|
|
||||||
btnRow7.spacing = 6;
|
|
||||||
incrementVersionButton = btnRow7.add("button", undefined, "Increment Shot Version");
|
|
||||||
|
|
||||||
workspacePanel = scrollContent.add("panel", undefined, "Workspace");
|
workspacePanel = scrollContent.add("panel", undefined, "Workspace");
|
||||||
workspacePanel.orientation = "column";
|
workspacePanel.orientation = "column";
|
||||||
workspacePanel.alignChildren = ["fill", "top"];
|
workspacePanel.alignChildren = ["fill", "top"];
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ Same applies to `footageRoot`: change `V:/_FOOTAGE/UNG` → `V:/_FOOTAGE`.
|
|||||||
The panel is divided into seven sections:
|
The panel is divided into seven sections:
|
||||||
|
|
||||||
1. **Shot Builder** — Episode/shot selection and comp creation
|
1. **Shot Builder** — Episode/shot selection and comp creation
|
||||||
2. **Render Pipeline** — Queue Export, status polling, retry, regenerate previews
|
2. **Render Pipeline** — Queue Export, status polling, retry, regenerate previews, increment shot version
|
||||||
3. **QC** — Technical QC queue for rendered exports
|
3. **QC** — Technical QC queue for rendered exports
|
||||||
4. **Actions** — Per-shot and batch operations
|
4. **Actions** — Per-shot and batch operations
|
||||||
5. **Workspace** — One-time project initialisation
|
5. **Workspace** — One-time project initialisation
|
||||||
|
|||||||
@@ -73,6 +73,40 @@ export async function POST(req: NextRequest) {
|
|||||||
return NextResponse.json({ session: reviewSession, portalUrl }, { status: 201 });
|
return NextResponse.json({ session: reviewSession, portalUrl }, { status: 201 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reactivate a review link: push its expiry `expiresInDays` from now and turn
|
||||||
|
* it back on. The token is unchanged, so a URL the client already has works
|
||||||
|
* again rather than a new one having to be sent.
|
||||||
|
*/
|
||||||
|
export async function PATCH(req: NextRequest) {
|
||||||
|
const session = await auth();
|
||||||
|
if (!session?.user) {
|
||||||
|
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||||
|
}
|
||||||
|
if (!["ADMIN", "PRODUCER", "SUPERVISOR"].includes(session.user.role as string)) {
|
||||||
|
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
|
||||||
|
}
|
||||||
|
|
||||||
|
const id = req.nextUrl.searchParams.get("id");
|
||||||
|
if (!id) return NextResponse.json({ error: "id required" }, { status: 400 });
|
||||||
|
|
||||||
|
const body = await req.json().catch(() => ({}));
|
||||||
|
const expiresInDays = Number(body.expiresInDays ?? 30);
|
||||||
|
if (!Number.isInteger(expiresInDays) || expiresInDays < 1 || expiresInDays > 365) {
|
||||||
|
return NextResponse.json({ error: "expiresInDays must be 1–365" }, { status: 400 });
|
||||||
|
}
|
||||||
|
|
||||||
|
const existing = await db.reviewSession.findUnique({ where: { id }, select: { id: true } });
|
||||||
|
if (!existing) return NextResponse.json({ error: "Review link not found" }, { status: 404 });
|
||||||
|
|
||||||
|
const reviewSession = await db.reviewSession.update({
|
||||||
|
where: { id },
|
||||||
|
data: { expiresAt: addDays(new Date(), expiresInDays), isActive: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({ session: reviewSession });
|
||||||
|
}
|
||||||
|
|
||||||
export async function DELETE(req: NextRequest) {
|
export async function DELETE(req: NextRequest) {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user) {
|
if (!session?.user) {
|
||||||
|
|||||||
@@ -2,8 +2,15 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { ExternalLink, Copy, Check, Trash2, Clock, Film } from "lucide-react";
|
import { ExternalLink, Copy, Check, Trash2, Clock, Film, RotateCcw, Loader2 } from "lucide-react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuLabel,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
import { cn, formatRelativeDate } from "@/lib/utils";
|
import { cn, formatRelativeDate } from "@/lib/utils";
|
||||||
|
|
||||||
@@ -28,9 +35,36 @@ const APP_URL = process.env.NEXT_PUBLIC_APP_URL ?? "";
|
|||||||
export function ReviewSessionList({ sessions }: ReviewSessionListProps) {
|
export function ReviewSessionList({ sessions }: ReviewSessionListProps) {
|
||||||
const [copiedId, setCopiedId] = useState<string | null>(null);
|
const [copiedId, setCopiedId] = useState<string | null>(null);
|
||||||
const [deletingId, setDeletingId] = useState<string | null>(null);
|
const [deletingId, setDeletingId] = useState<string | null>(null);
|
||||||
|
const [reactivatingId, setReactivatingId] = useState<string | null>(null);
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
// Same token, new expiry — the URL the client already has starts working again.
|
||||||
|
const handleReactivate = async (id: string, days: number) => {
|
||||||
|
setReactivatingId(id);
|
||||||
|
try {
|
||||||
|
const res = await fetch(`/api/review-sessions?id=${id}`, {
|
||||||
|
method: "PATCH",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ expiresInDays: days }),
|
||||||
|
});
|
||||||
|
if (!res.ok) {
|
||||||
|
const body = await res.json().catch(() => ({}));
|
||||||
|
throw new Error(body.error);
|
||||||
|
}
|
||||||
|
toast({ title: "Review link reactivated", description: `Valid for ${days} more days — same URL.` });
|
||||||
|
router.refresh();
|
||||||
|
} catch (e) {
|
||||||
|
toast({
|
||||||
|
title: "Failed to reactivate link",
|
||||||
|
description: e instanceof Error && e.message ? e.message : undefined,
|
||||||
|
variant: "destructive",
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setReactivatingId(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleCopy = async (token: string, id: string) => {
|
const handleCopy = async (token: string, id: string) => {
|
||||||
const url = `${APP_URL}/client/${token}`;
|
const url = `${APP_URL}/client/${token}`;
|
||||||
await navigator.clipboard.writeText(url);
|
await navigator.clipboard.writeText(url);
|
||||||
@@ -122,6 +156,33 @@ export function ReviewSessionList({ sessions }: ReviewSessionListProps) {
|
|||||||
<span className="text-xs text-zinc-500 mr-2">
|
<span className="text-xs text-zinc-500 mr-2">
|
||||||
{session.accessCount} view{session.accessCount !== 1 ? "s" : ""}
|
{session.accessCount} view{session.accessCount !== 1 ? "s" : ""}
|
||||||
</span>
|
</span>
|
||||||
|
{expired && (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="outline"
|
||||||
|
className="h-7 px-2.5 gap-1.5 text-emerald-400 hover:bg-emerald-500/10 border-emerald-500/30"
|
||||||
|
disabled={reactivatingId === session.id}
|
||||||
|
>
|
||||||
|
{reactivatingId === session.id ? (
|
||||||
|
<Loader2 className="h-3.5 w-3.5 animate-spin" />
|
||||||
|
) : (
|
||||||
|
<RotateCcw className="h-3.5 w-3.5" />
|
||||||
|
)}
|
||||||
|
Reactivate
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent align="end">
|
||||||
|
<DropdownMenuLabel className="text-xs text-zinc-500">Valid for</DropdownMenuLabel>
|
||||||
|
{[7, 14, 30, 60, 90].map((d) => (
|
||||||
|
<DropdownMenuItem key={d} onClick={() => handleReactivate(session.id, d)}>
|
||||||
|
{d} days
|
||||||
|
</DropdownMenuItem>
|
||||||
|
))}
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
Reference in New Issue
Block a user