Ali2206 commited on
Commit
8bd27a5
Β·
1 Parent(s): e16fb73

Fix syntax error - add missing closing brace

Browse files
AIArchitecture/app/static/index.html CHANGED
@@ -70,12 +70,13 @@
70
  headers['Authorization'] = `Bearer ${apiKey}`;
71
  headers['x-openai-key'] = apiKey;
72
  }
73
- const r = await fetch('/arch/blueprint', { method:'POST', headers: headers, body: JSON.stringify(body) });
74
- const text = await r.text();
75
- let data={}; try{ data = text ? JSON.parse(text) : {}; }catch{ data = { error:text } }
76
- raw.textContent = JSON.stringify(data, null, 2);
77
- if(!r.ok){ out.textContent = 'Error generating blueprint'; return; }
78
- const comps = (data.components||[]).map(c=>`<li><strong>${c.name}</strong> β€” <em>${c.type}</em>: ${c.description}</li>`).join('');
 
79
  const apis = (data.apis||[]).map(a=>`<li><code>${a.method||''}</code> ${a.endpoint||''} β€” ${a.name||''}: ${a.description||''}</li>`).join('');
80
  const stores = (data.data_stores||[]).map(s=>`<li><strong>${s.name||''}</strong> β€” <em>${s.type||''}</em>: ${s.purpose||''}</li>`).join('');
81
  const sec = (data.security||[]).map(x=>`<li>${x}</li>`).join('');
@@ -110,7 +111,7 @@
110
  }).catch(()=>{ document.getElementById('mmraw').style.display='block'; document.getElementById('mmraw').textContent = mer; });
111
  } else { document.getElementById('mmraw').style.display='block'; document.getElementById('mmraw').textContent = mer; }
112
  }catch(e){ document.getElementById('mmraw').style.display='block'; document.getElementById('mmraw').textContent = mer; }
113
- } catch(err) {
114
  out.textContent = 'Error: ' + err.message;
115
  } finally {
116
  // Reset button state
 
70
  headers['Authorization'] = `Bearer ${apiKey}`;
71
  headers['x-openai-key'] = apiKey;
72
  }
73
+ try {
74
+ const r = await fetch('/arch/blueprint', { method:'POST', headers: headers, body: JSON.stringify(body) });
75
+ const text = await r.text();
76
+ let data={}; try{ data = text ? JSON.parse(text) : {}; }catch{ data = { error:text } }
77
+ raw.textContent = JSON.stringify(data, null, 2);
78
+ if(!r.ok){ out.textContent = 'Error generating blueprint'; return; }
79
+ const comps = (data.components||[]).map(c=>`<li><strong>${c.name}</strong> β€” <em>${c.type}</em>: ${c.description}</li>`).join('');
80
  const apis = (data.apis||[]).map(a=>`<li><code>${a.method||''}</code> ${a.endpoint||''} β€” ${a.name||''}: ${a.description||''}</li>`).join('');
81
  const stores = (data.data_stores||[]).map(s=>`<li><strong>${s.name||''}</strong> β€” <em>${s.type||''}</em>: ${s.purpose||''}</li>`).join('');
82
  const sec = (data.security||[]).map(x=>`<li>${x}</li>`).join('');
 
111
  }).catch(()=>{ document.getElementById('mmraw').style.display='block'; document.getElementById('mmraw').textContent = mer; });
112
  } else { document.getElementById('mmraw').style.display='block'; document.getElementById('mmraw').textContent = mer; }
113
  }catch(e){ document.getElementById('mmraw').style.display='block'; document.getElementById('mmraw').textContent = mer; }
114
+ } catch(err) {
115
  out.textContent = 'Error: ' + err.message;
116
  } finally {
117
  // Reset button state