- 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.
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import { configManager } from "@/lib/admin/config-manager";
|
|
|
|
export interface CreateVncMeetingParams {
|
|
name: string;
|
|
start: string;
|
|
end: string;
|
|
invitees: string[];
|
|
password?: string;
|
|
description?: string;
|
|
}
|
|
|
|
export interface CreateVncMeetingResult {
|
|
meetingUrl: string;
|
|
meetingId: string;
|
|
}
|
|
|
|
export async function createVncMeeting(
|
|
params: CreateVncMeetingParams
|
|
): Promise<CreateVncMeetingResult> {
|
|
const serverUrl = configManager.get<string>("vnctalkServerUrl") || process.env.VNCTALK_SERVER_URL || "";
|
|
|
|
if (!serverUrl) {
|
|
throw new Error("VNCTALK_SERVER_URL is not configured");
|
|
}
|
|
|
|
const endpoint = `${serverUrl.replace(/\/+$/, "")}/api/createnewmeeting`;
|
|
|
|
const response = await fetch(endpoint, {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify({
|
|
name: params.name,
|
|
start: params.start,
|
|
end: params.end,
|
|
invitees: params.invitees,
|
|
password: params.password,
|
|
description: params.description,
|
|
}),
|
|
});
|
|
|
|
if (!response.ok) {
|
|
const text = await response.text().catch(() => "");
|
|
throw new Error(`VNCtalk API error ${response.status}: ${text}`);
|
|
}
|
|
|
|
const data = await response.json();
|
|
|
|
const meetingUrl: string = data.meetingUrl || data.meeting_url || data.url || "";
|
|
const meetingId: string = data.meetingId || data.meeting_id || data.id || "";
|
|
|
|
if (!meetingUrl) {
|
|
throw new Error("VNCtalk API did not return a meeting URL");
|
|
}
|
|
|
|
return { meetingUrl, meetingId };
|
|
}
|