From 597f4bfca582e03cfb194a541ba13a8105a9e446 Mon Sep 17 00:00:00 2001 From: MikeHughes-BIN Date: Tue, 16 Dec 2025 15:26:15 +0100 Subject: [PATCH] Meeting Report Types connected from Backend to frontend --- electron/main/index.html | 10 ++--- electron/main/script.js | 11 ++++- main.js | 40 ++++++++++++------- ...meeting_report.txt => followup_report.txt} | 0 4 files changed, 40 insertions(+), 21 deletions(-) rename storage/documentType/{standard_meeting_report.txt => followup_report.txt} (100%) diff --git a/electron/main/index.html b/electron/main/index.html index 76ea47a..752283b 100644 --- a/electron/main/index.html +++ b/electron/main/index.html @@ -83,23 +83,23 @@
- +
- +
- +
- +
- + diff --git a/electron/main/script.js b/electron/main/script.js index 1ef9078..9eaf410 100644 --- a/electron/main/script.js +++ b/electron/main/script.js @@ -28,6 +28,7 @@ function checkBoxes() { document.getElementById("progressbar").style.visibility = "visible"; //assembly of the json for the main + /* const selectedStyles = [checkedCounter]; var iter = 0; checkboxes.forEach(function(checkbox){ @@ -37,6 +38,13 @@ function checkBoxes() { iter++; } }); + */ + + function getSelectedDocumentType() { + const checked = document.querySelector('input[name="docFormat"]:checked'); + return checked ? checked.value : null; + } + document.getElementById("testy").style.visibility = "visible" document.getElementById("box1").style.backgroundColor = "red"; document.getElementById("box2").style.backgroundColor = "red"; @@ -57,7 +65,8 @@ function checkBoxes() { }, "document": { "module":aiType.value, - "styles": selectedStyles + "type": getSelectedDocumentType() + //"styles": selectedStyles } }; window.submit.submit(sendingPackage) diff --git a/main.js b/main.js index 1e19c58..123617d 100644 --- a/main.js +++ b/main.js @@ -129,11 +129,21 @@ electron.ipcMain.handle('get-module-names', async () => { electron.ipcMain.on("file_submit", async (event, args) => { try { let curstep = 0 - let totalsteps = 3 + args.document.styles.length + let totalsteps = 4 - if(args.document.styles.length == 0) - throw new Error("At least one Document Style needed"); + const TEMPLATE_MAP = { + "followup-report": "followup_report.txt", + "agenda": "agenda.txt", + "result-protocol": "result_protocol.txt", + "sprint-planning": "sprint_planning_note.txt", + "custom": "custom_document.txt" + }; + const templateFile = TEMPLATE_MAP[args.document.type]; + + if (!templateFile) { + throw new Error("Unknown document type: " + args.document.type); + } console.log(args); let audiopath = "" @@ -182,19 +192,19 @@ electron.ipcMain.on("file_submit", async (event, args) => { console.log("\n\n Running the LLM module"); // TODO implement documentation module // This code handles the Text to Document processing module call - for (let i = 0; i < args.document.styles.length; i++) { - console.log(`\n\n Running the LLM for Document Style ${i+1}`); + + console.log(`\n\n Running the LLM for Document Style ${args.document.type}`); - await mapFunctions.get("module-handler").function(args.document.module, {inputTranscriptPath: transcriptpath, documentTypePath: "./storage/documentType/standard_meeting_report.txt", language: "en"}).then(resp => { - console.log(resp); - transcriptpath = resp - curstep++ - mainWindow.webContents.send("progress", {curstep:curstep, totalsteps:totalsteps}) - }).catch(err => { - mainWindow.webContents.send("error", err) - return - }) - } + await mapFunctions.get("module-handler").function(args.document.module, { inputTranscriptPath: transcriptpath, documentTypePath: "./storage/documentType/" + templateFile, language: "en" }).then(resp => { + console.log(resp); + transcriptpath = resp + curstep++ + mainWindow.webContents.send("progress", { curstep: curstep, totalsteps: totalsteps }) + }).catch(err => { + mainWindow.webContents.send("error", err) + return + }) + // TODO actually implement this functionality // Module to get the first few lines for each speaker to send to the frontend diff --git a/storage/documentType/standard_meeting_report.txt b/storage/documentType/followup_report.txt similarity index 100% rename from storage/documentType/standard_meeting_report.txt rename to storage/documentType/followup_report.txt