Merge branch 'dev'
CI/CD / deploy (push) Has been cancelled
Details
CI/CD / deploy (push) Has been cancelled
Details
This commit is contained in:
commit
48a5bf7d8a
|
|
@ -38,6 +38,13 @@ const MI_API_URL = process.env.MEETING_INTELLIGENCE_API_URL || "http://meeting-i
|
||||||
const MI_INTERNAL_KEY = process.env.MI_INTERNAL_KEY || "";
|
const MI_INTERNAL_KEY = process.env.MI_INTERNAL_KEY || "";
|
||||||
const routes = new Hono();
|
const routes = new Hono();
|
||||||
|
|
||||||
|
// Subdomain-aware base for this module: `/rmeets` on {space}.rspace.online,
|
||||||
|
// `/{space}/rmeets` on localhost or bare domain.
|
||||||
|
function rmeetsBase(c: any): string {
|
||||||
|
const space = c.req.param("space") || "demo";
|
||||||
|
return c.get("isSubdomain") ? "/rmeets" : `/${escapeHtml(space)}/rmeets`;
|
||||||
|
}
|
||||||
|
|
||||||
// ── Meeting Intelligence API helper ──
|
// ── Meeting Intelligence API helper ──
|
||||||
|
|
||||||
async function miApiFetch(path: string, options?: { method?: string; body?: any }): Promise<{ ok: boolean; data?: any; error?: string }> {
|
async function miApiFetch(path: string, options?: { method?: string; body?: any }): Promise<{ ok: boolean; data?: any; error?: string }> {
|
||||||
|
|
@ -184,7 +191,7 @@ routes.get("/meet", (c) => {
|
||||||
|
|
||||||
routes.get("/recordings", async (c) => {
|
routes.get("/recordings", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const prefix = encodeURIComponent(space + "_");
|
const prefix = encodeURIComponent(space + "_");
|
||||||
const result = await miApiFetch(`/meetings?limit=50&sort=-created_at&conference_prefix=${prefix}`);
|
const result = await miApiFetch(`/meetings?limit=50&sort=-created_at&conference_prefix=${prefix}`);
|
||||||
|
|
||||||
|
|
@ -240,7 +247,7 @@ routes.get("/recordings/:id", (c) => {
|
||||||
|
|
||||||
routes.get("/recordings/:id/:tab", async (c) => {
|
routes.get("/recordings/:id/:tab", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const id = c.req.param("id");
|
const id = c.req.param("id");
|
||||||
const tab = c.req.param("tab") || "overview";
|
const tab = c.req.param("tab") || "overview";
|
||||||
const validTabs = ["overview", "transcript", "summary", "speakers"];
|
const validTabs = ["overview", "transcript", "summary", "speakers"];
|
||||||
|
|
@ -365,7 +372,7 @@ ${speakerList}`;
|
||||||
|
|
||||||
routes.get("/search", async (c) => {
|
routes.get("/search", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const q = c.req.query("q") || "";
|
const q = c.req.query("q") || "";
|
||||||
|
|
||||||
let resultsHtml = "";
|
let resultsHtml = "";
|
||||||
|
|
@ -445,7 +452,7 @@ routes.all("/api/mi-proxy/*", async (c) => {
|
||||||
|
|
||||||
routes.get("/", (c) => {
|
routes.get("/", (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const randomId = Math.random().toString(36).slice(2, 10);
|
const randomId = Math.random().toString(36).slice(2, 10);
|
||||||
return c.html(renderShell({
|
return c.html(renderShell({
|
||||||
title: `rMeets — ${space} | rSpace`,
|
title: `rMeets — ${space} | rSpace`,
|
||||||
|
|
@ -526,7 +533,7 @@ routes.get("/", (c) => {
|
||||||
|
|
||||||
routes.get("/meeting-intelligence", async (c) => {
|
routes.get("/meeting-intelligence", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const prefix = encodeURIComponent(space + "_");
|
const prefix = encodeURIComponent(space + "_");
|
||||||
|
|
||||||
// Fetch space-scoped meetings from MI API
|
// Fetch space-scoped meetings from MI API
|
||||||
|
|
@ -674,7 +681,7 @@ routes.get("/:room", (c) => {
|
||||||
|
|
||||||
// Default: clean full-screen Jitsi — no rSpace shell, mobile-friendly
|
// Default: clean full-screen Jitsi — no rSpace shell, mobile-friendly
|
||||||
const jitsiRoom = encodeURIComponent(space + "_" + room);
|
const jitsiRoom = encodeURIComponent(space + "_" + room);
|
||||||
const meetsBase = `/${escapeHtml(space)}/rmeets`;
|
const meetsBase = rmeetsBase(c);
|
||||||
return c.html(`<!DOCTYPE html>
|
return c.html(`<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ export function renderShell(opts: ShellOptions): string {
|
||||||
|
|
||||||
// Service worker registration + update detection
|
// Service worker registration + update detection
|
||||||
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
|
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
|
||||||
navigator.serviceWorker.register("/sw.js?v=8").then((reg) => {
|
navigator.serviceWorker.register("/sw.js?v=9").then((reg) => {
|
||||||
function showUpdateBanner() {
|
function showUpdateBanner() {
|
||||||
if (!isStandalone) return; // Only show update prompt in installed PWA
|
if (!isStandalone) return; // Only show update prompt in installed PWA
|
||||||
if (sessionStorage.getItem('rspace_update_dismissed')) return; // dismissed this session
|
if (sessionStorage.getItem('rspace_update_dismissed')) return; // dismissed this session
|
||||||
|
|
@ -2304,7 +2304,7 @@ export function renderModuleLanding(opts: ModuleLandingOptions): string {
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import '/shell.js';
|
import '/shell.js';
|
||||||
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
|
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
|
||||||
navigator.serviceWorker.register("/sw.js?v=8").catch(() => {});
|
navigator.serviceWorker.register("/sw.js?v=9").catch(() => {});
|
||||||
}
|
}
|
||||||
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
|
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
|
||||||
try {
|
try {
|
||||||
|
|
@ -2644,7 +2644,7 @@ export function renderSubPageInfo(opts: SubPageInfoOptions): string {
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import '/shell.js';
|
import '/shell.js';
|
||||||
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
|
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
|
||||||
navigator.serviceWorker.register("/sw.js?v=8").catch(() => {});
|
navigator.serviceWorker.register("/sw.js?v=9").catch(() => {});
|
||||||
}
|
}
|
||||||
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
|
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/// <reference lib="webworker" />
|
/// <reference lib="webworker" />
|
||||||
declare const self: ServiceWorkerGlobalScope;
|
declare const self: ServiceWorkerGlobalScope;
|
||||||
|
|
||||||
const CACHE_VERSION = "rspace-v8";
|
const CACHE_VERSION = "rspace-v9";
|
||||||
const STATIC_CACHE = `${CACHE_VERSION}-static`;
|
const STATIC_CACHE = `${CACHE_VERSION}-static`;
|
||||||
const HTML_CACHE = `${CACHE_VERSION}-html`;
|
const HTML_CACHE = `${CACHE_VERSION}-html`;
|
||||||
const API_CACHE = `${CACHE_VERSION}-api`;
|
const API_CACHE = `${CACHE_VERSION}-api`;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue