ui tweak
This commit is contained in:
parent
241163d9ab
commit
40a927aa1c
18
ui.html
18
ui.html
|
|
@ -39,12 +39,20 @@
|
||||||
const data = await resp.json();
|
const data = await resp.json();
|
||||||
messages.lastChild.remove(); // remove 'Thinking...'
|
messages.lastChild.remove(); // remove 'Thinking...'
|
||||||
if (data.match) {
|
if (data.match) {
|
||||||
var txt = "Match: " + data.match + "\n";
|
let txt = '';
|
||||||
if (data.procedures) {
|
txt += `Match: ${data.match}\n`;
|
||||||
txt += "Procedures:\n";
|
if (data.notes) {
|
||||||
data.procedures.forEach(function(p) {
|
txt += `\nNotes: ${data.notes}\n`;
|
||||||
txt += `- ${p.name} (${p.price} Ft, ${p.duration_minutes} min${p.note ? ', ' + p.note : ''})\n`;
|
}
|
||||||
|
if (data.procedures && data.procedures.length > 0) {
|
||||||
|
txt += `\nProcedures:\n`;
|
||||||
|
data.procedures.forEach(function(p, idx) {
|
||||||
|
txt += ` ${idx+1}. ${p.name}\n`;
|
||||||
|
txt += ` Cost: ${p.price} Ft\n`;
|
||||||
|
txt += ` Time: ${p.duration_minutes} min\n`;
|
||||||
|
if (p.note && p.note.trim()) txt += ` Note: ${p.note}\n`;
|
||||||
});
|
});
|
||||||
|
txt += `\nTotal: ${data.total_price} Ft, ${data.total_duration} min\n`;
|
||||||
}
|
}
|
||||||
appendMsg(txt, 'bot');
|
appendMsg(txt, 'bot');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue