- P2.9: VNCtalk video meeting — create/update meeting from event modal, 'Join Meeting' link in event detail. Admin config vnctalkServerUrl. - P2.10: Collabora online editing — 'Edit with Collabora' for office files, WOPI discovery + edit URL. Admin config collaboraServerUrl. - P2.11: Calendar enhancements — clickable links in descriptions, participant contact popover, Reply/Reply All from event, timezone picker, map links for locations. - P2.13: VNCdirectory IDP admin panel — Connection, SAML/IDP, LDAP, Authentication, Federated Apps configuration. Secret masking on display.
33 lines
942 B
TypeScript
33 lines
942 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { getCollaboraEditUrl } from "@/lib/collabora/client";
|
|
import { logger } from "@/lib/logger";
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
const body = await request.json();
|
|
|
|
if (!body.fileId || !body.fileName) {
|
|
return NextResponse.json(
|
|
{ error: "Missing required fields: fileId, fileName" },
|
|
{ status: 400 }
|
|
);
|
|
}
|
|
|
|
const url = await getCollaboraEditUrl(
|
|
String(body.fileId),
|
|
String(body.fileName)
|
|
);
|
|
|
|
return NextResponse.json({ url });
|
|
} catch (error) {
|
|
const message = error instanceof Error ? error.message : "Unknown error";
|
|
logger.error("Collabora edit URL failed", { error: message });
|
|
|
|
if (message.includes("not configured")) {
|
|
return NextResponse.json({ error: message }, { status: 503 });
|
|
}
|
|
|
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
}
|
|
}
|