Compare commits
4
Commits
e7c7dd28d3
...
2.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a312ba055 | ||
|
|
8c65e4acd2 | ||
|
|
fcd73d0667 | ||
|
|
8830f42ac5 |
Generated
+22
-792
File diff suppressed because it is too large
Load Diff
+2
-7
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "redlight",
|
||||
"private": true,
|
||||
"version": "2.4.1",
|
||||
"version": "2.5.0",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -19,7 +19,6 @@
|
||||
"concurrently": "^9.0.0",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^17.3.1",
|
||||
"exceljs": "^4.4.0",
|
||||
"express": "^5.2.1",
|
||||
"express-rate-limit": "^8.5.2",
|
||||
"flatpickr": "^4.6.13",
|
||||
@@ -38,6 +37,7 @@
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-router-dom": "^7.15.1",
|
||||
"uuid": "^14.0.0",
|
||||
"write-excel-file": "^4.1.1",
|
||||
"xml2js": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -49,11 +49,6 @@
|
||||
"tailwindcss": "^4.3.0",
|
||||
"vite": "^8.0.0"
|
||||
},
|
||||
"overrides": {
|
||||
"exceljs": {
|
||||
"uuid": "^11.1.1"
|
||||
}
|
||||
},
|
||||
"allowScripts": {
|
||||
"better-sqlite3@12.11.1": true
|
||||
}
|
||||
|
||||
+16
-18
@@ -1,6 +1,6 @@
|
||||
import { Router, json } from 'express';
|
||||
import crypto from 'crypto';
|
||||
import ExcelJS from 'exceljs';
|
||||
import writeXlsxFile from 'write-excel-file/node';
|
||||
import PDFDocument from 'pdfkit';
|
||||
import { getDb } from '../config/database.js';
|
||||
import { authenticateToken } from '../middleware/auth.js';
|
||||
@@ -246,26 +246,24 @@ router.get('/:id/export/:format', authenticateToken, async (req, res) => {
|
||||
|
||||
if (format === 'xlsx') {
|
||||
// Prefix-escape strings that would otherwise be evaluated as formulas.
|
||||
const sanitizeXlsx = (r) => {
|
||||
const out = {};
|
||||
for (const k of Object.keys(r)) {
|
||||
const v = r[k];
|
||||
out[k] = (typeof v === 'string' && /^[=+\-@\t\r]/.test(v)) ? "'" + v : v;
|
||||
}
|
||||
return out;
|
||||
};
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
const sheet = workbook.addWorksheet('Analytics');
|
||||
sheet.columns = COLUMNS;
|
||||
rows.forEach(r => sheet.addRow(sanitizeXlsx(r)));
|
||||
// Style header row
|
||||
sheet.getRow(1).font = { bold: true };
|
||||
sheet.getRow(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE0E0E0' } };
|
||||
const sanitizeXlsx = (v) =>
|
||||
(typeof v === 'string' && /^[=+\-@\t\r]/.test(v)) ? "'" + v : v;
|
||||
|
||||
const headerRow = COLUMNS.map(c => ({
|
||||
value: c.header,
|
||||
fontWeight: 'bold',
|
||||
backgroundColor: '#e0e0e0',
|
||||
}));
|
||||
const dataRows = rows.map(r => COLUMNS.map(c => ({ value: sanitizeXlsx(r[c.key]) })));
|
||||
|
||||
const buffer = await writeXlsxFile([headerRow, ...dataRows], {
|
||||
columns: COLUMNS.map(c => ({ width: c.width })),
|
||||
sheet: 'Analytics',
|
||||
}).toBuffer();
|
||||
|
||||
res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${safeName}.xlsx"`);
|
||||
await workbook.xlsx.write(res);
|
||||
return res.end();
|
||||
return res.send(buffer);
|
||||
}
|
||||
|
||||
if (format === 'pdf') {
|
||||
|
||||
@@ -41,7 +41,7 @@ export function wellKnownHandler(req, res) {
|
||||
federation_api: '/api/federation',
|
||||
public_key: getPublicKey(),
|
||||
software: 'Redlight',
|
||||
version: '2.4.1',
|
||||
version: '2.5.0',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,8 @@ router.post('/', authenticateToken, async (req, res) => {
|
||||
record_meeting !== false ? 1 : 0,
|
||||
guest_access ? 1 : 0,
|
||||
moderator_code || null,
|
||||
recording_transcript ? 1 : 0,
|
||||
// Transcription/AI summary requires recording to be enabled
|
||||
(record_meeting !== false && recording_transcript) ? 1 : 0,
|
||||
]);
|
||||
|
||||
const room = await db.get('SELECT * FROM rooms WHERE id = ?', [result.lastInsertRowid]);
|
||||
@@ -306,6 +307,9 @@ router.put('/:uid', authenticateToken, async (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Transcription/AI summary requires recording — force it off when recording ends up disabled
|
||||
const effectiveRecordMeeting = record_meeting !== undefined ? !!record_meeting : !!room.record_meeting;
|
||||
|
||||
await db.run(`
|
||||
UPDATE rooms SET
|
||||
name = COALESCE(?, name),
|
||||
@@ -338,7 +342,7 @@ router.put('/:uid', authenticateToken, async (req, res) => {
|
||||
moderator_code !== undefined ? (moderator_code || null) : room.moderator_code,
|
||||
learning_analytics !== undefined ? (learning_analytics ? 1 : 0) : null,
|
||||
analytics_visibility && ['owner', 'shared'].includes(analytics_visibility) ? analytics_visibility : null,
|
||||
recording_transcript !== undefined ? (recording_transcript ? 1 : 0) : null,
|
||||
!effectiveRecordMeeting ? 0 : (recording_transcript !== undefined ? (recording_transcript ? 1 : 0) : null),
|
||||
req.params.uid,
|
||||
]);
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ export default function Modal({ title, children, onClose, maxWidth = 'max-w-lg'
|
||||
aria-modal="true"
|
||||
aria-labelledby={titleId}
|
||||
tabIndex={-1}
|
||||
className={`relative bg-th-card rounded-2xl border border-th-border shadow-2xl w-full ${maxWidth} focus:outline-hidden`}
|
||||
className={`relative bg-th-card rounded-2xl border border-th-border shadow-2xl w-full ${maxWidth} max-h-[calc(100vh-2rem)] flex flex-col focus:outline-hidden`}
|
||||
>
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between px-6 py-4 border-b border-th-border rounded-t-2xl">
|
||||
<div className="flex items-center justify-between px-6 py-4 border-b border-th-border rounded-t-2xl shrink-0">
|
||||
<h2 id={titleId} className="text-lg font-semibold text-th-text">{title}</h2>
|
||||
<button
|
||||
type="button"
|
||||
@@ -56,8 +56,8 @@ export default function Modal({ title, children, onClose, maxWidth = 'max-w-lg'
|
||||
<X size={20} />
|
||||
</button>
|
||||
</div>
|
||||
{/* Body */}
|
||||
<div className="p-6">
|
||||
{/* Body — scrolls inside the card instead of overflowing the viewport */}
|
||||
<div className="p-6 overflow-y-auto min-h-0">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -205,7 +205,7 @@ export default function RoomDetail() {
|
||||
moderator_code: editRoom.moderator_code,
|
||||
learning_analytics: !!editRoom.learning_analytics,
|
||||
analytics_visibility: editRoom.analytics_visibility || 'owner',
|
||||
recording_transcript: !!editRoom.recording_transcript,
|
||||
recording_transcript: !!editRoom.record_meeting && !!editRoom.recording_transcript,
|
||||
});
|
||||
setRoom(res.data.room);
|
||||
setEditRoom(res.data.room);
|
||||
@@ -674,7 +674,12 @@ export default function RoomDetail() {
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={!!editRoom.record_meeting}
|
||||
onChange={e => setEditRoom({ ...editRoom, record_meeting: e.target.checked })}
|
||||
onChange={e => setEditRoom({
|
||||
...editRoom,
|
||||
record_meeting: e.target.checked,
|
||||
// Transcription/AI summary requires recording — clear it when recording is turned off
|
||||
recording_transcript: e.target.checked ? editRoom.recording_transcript : false,
|
||||
})}
|
||||
className="w-4 h-4 rounded-sm border-th-border text-th-accent focus:ring-th-ring"
|
||||
/>
|
||||
<span className="text-sm text-th-text">{t('room.allowRecording')}</span>
|
||||
|
||||
Reference in New Issue
Block a user