Checkbox change from array to single value and value fix in html.

This commit is contained in:
2025-12-16 15:50:28 +01:00
parent bd47a194c7
commit c1e79b6603
3 changed files with 95 additions and 87 deletions
+5 -5
View File
@@ -83,23 +83,23 @@
<div class="checkbox-group"> <div class="checkbox-group">
<label id="checkbox-label" for="checkbox-group">Choose prefered document style:</label> <label id="checkbox-label" for="checkbox-group">Choose prefered document style:</label>
<div class="checkbox-container"> <div class="checkbox-container">
<input type="checkbox" name ="docFormat" id="docFormat" value="Meeting report"> <input type="checkbox" name ="docFormat" id="docFormat" value="followup-report">
<label id="label_format" for="docFormat">Follow-up Report</label> <label id="label_format" for="docFormat">Follow-up Report</label>
</div> </div>
<div class="checkbox-container"> <div class="checkbox-container">
<input type="checkbox" name="docFormat" id="docFormatSummary1" value="Summary with timestamps"> <input type="checkbox" name="docFormat" id="docFormatSummary1" value="agenda">
<label id="label_summary" for="docFormatSummary">Agenda</label> <label id="label_summary" for="docFormatSummary">Agenda</label>
</div> </div>
<div class="checkbox-container"> <div class="checkbox-container">
<input type="checkbox" name="docFormat" id="docFormatSummary2" value="Summary with timestamps"> <input type="checkbox" name="docFormat" id="docFormatSummary2" value="result-protocol">
<label id="label_summary" for="docFormatSummary">Resultprotocol</label> <label id="label_summary" for="docFormatSummary">Resultprotocol</label>
</div> </div>
<div class="checkbox-container"> <div class="checkbox-container">
<input type="checkbox" name="docFormat" id="docFormatSummary3" value="Summary with timestamps"> <input type="checkbox" name="docFormat" id="docFormatSummary3" value="sprint-planning">
<label id="label_summary" for="docFormatSummary">Sprint Planning Note</label> <label id="label_summary" for="docFormatSummary">Sprint Planning Note</label>
</div> </div>
<div class="checkbox-container"> <div class="checkbox-container">
<input type="checkbox" name="docFormat" id="docFormatCustom" value="Summary with timestamps"> <input type="checkbox" name="docFormat" id="docFormatCustom" value="custom">
<select name="ai_type" id="ai_type"> <select name="ai_type" id="ai_type">
<option>nichts</option> <option>nichts</option>
</select> </select>
+8 -10
View File
@@ -27,15 +27,13 @@ function checkBoxes() {
if(testEndings.some(e => pathToLower.endsWith(e))){ if(testEndings.some(e => pathToLower.endsWith(e))){
//assembly of the json for the main //assembly of the json for the main
const selectedStyles = [checkedCounter]; var typeCheckbox;
var iter = 0; if(document.getElementById("docFormat").checked) typeCheckbox = document.getElementById("docFormat").value;
checkboxes.forEach(function(checkbox){ if(document.getElementById("docFormatSummary1").checked) typeCheckbox = document.getElementById("docFormatSummary1").value;
if(checkbox.checked){ if(document.getElementById("docFormatSummary2").checked) typeCheckbox = document.getElementById("docFormatSummary2").value;
console.log(checkbox.value); if(document.getElementById("docFormatSummary3").checked) typeCheckbox = document.getElementById("docFormatSummary3").value;
selectedStyles[iter] = {iter: checkbox.value}; if(document.getElementById("docFormatCustom").checked) typeCheckbox = document.getElementById("docFormatCustom").value;
iter++;
}
});
document.getElementById("testy").style.visibility = "visible" document.getElementById("testy").style.visibility = "visible"
document.getElementById("box1").style.backgroundColor = "red"; document.getElementById("box1").style.backgroundColor = "red";
document.getElementById("box2").style.backgroundColor = "red"; document.getElementById("box2").style.backgroundColor = "red";
@@ -55,7 +53,7 @@ function checkBoxes() {
}, },
"document": { "document": {
"module":aiType.value, "module":aiType.value,
"styles": selectedStyles, "type": typeCheckbox,
"outputType": outputType.value "outputType": outputType.value
} }
}; };
+18 -8
View File
@@ -61,7 +61,7 @@ let mainWindow;
function createWindow() { function createWindow() {
mainWindow = new electron.BrowserWindow({ mainWindow = new electron.BrowserWindow({
width: 800, width: 1200,
height: 800, height: 800,
webPreferences: { webPreferences: {
nodeIntegration: false, nodeIntegration: false,
@@ -129,11 +129,21 @@ electron.ipcMain.handle('get-module-names', async () => {
electron.ipcMain.on("file_submit", async (event, args) => { electron.ipcMain.on("file_submit", async (event, args) => {
try { try {
let curstep = 0 let curstep = 0
let totalsteps = 3 + args.document.styles.length let totalsteps = 4
if(args.document.styles.length == 0) const TEMPLATE_MAP = {
throw new Error("At least one Document Style needed"); "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); console.log(args);
let audiopath = "" let audiopath = ""
@@ -182,10 +192,10 @@ electron.ipcMain.on("file_submit", async (event, args) => {
console.log("\n\n Running the LLM module"); console.log("\n\n Running the LLM module");
// TODO implement documentation module // TODO implement documentation module
// This code handles the Text to Document processing module call // 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}`);
await mapFunctions.get("module-handler").function(args.document.module, {inputTranscriptPath: transcriptpath, documentTypePath: "/Users/mikehughes/PROJ/video2document/storage/documentType/meetingReport.json", language: "en"}).then(resp => { 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/" + templateFile, language: "en" }).then(resp => {
console.log(resp); console.log(resp);
transcriptpath = resp transcriptpath = resp
curstep++ curstep++
@@ -194,7 +204,7 @@ electron.ipcMain.on("file_submit", async (event, args) => {
mainWindow.webContents.send("error", err) mainWindow.webContents.send("error", err)
return return
}) })
}
// TODO actually implement this functionality // TODO actually implement this functionality
// Module to get the first few lines for each speaker to send to the frontend // Module to get the first few lines for each speaker to send to the frontend