benkada commited on
Commit
ef512e6
·
verified ·
1 Parent(s): 0133631

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +10 -18
index.html CHANGED
@@ -5,6 +5,7 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
  <title>Smart Analyzer</title>
7
  <style>
 
8
  :root {
9
  --primary-color: #4A90E2;
10
  --secondary-color: #f4f6f8;
@@ -27,15 +28,8 @@
27
  display: flex;
28
  justify-content: center;
29
  }
30
- .container {
31
- width: 100%;
32
- max-width: var(--max-width);
33
- }
34
- h1 {
35
- text-align: center;
36
- color: var(--primary-color);
37
- margin-bottom: 40px;
38
- }
39
  .section {
40
  background: var(--card-bg);
41
  padding: 20px;
@@ -51,11 +45,7 @@
51
  border-bottom: 2px solid var(--secondary-color);
52
  padding-bottom: 5px;
53
  }
54
- label {
55
- display: block;
56
- margin-top: 15px;
57
- font-weight: bold;
58
- }
59
  input[type="file"], input[type="text"], button, textarea {
60
  width: 100%;
61
  padding: 10px;
@@ -134,14 +124,16 @@
134
  try {
135
  const res = await fetch(url, { method: 'POST', body: formData });
136
  const data = await res.json();
137
- document.getElementById(resultId).textContent = data.summary || data.answer || data.description || data.error || JSON.stringify(data);
 
138
  } catch (err) {
139
  document.getElementById(resultId).textContent = 'Error: ' + err.message;
140
  }
141
  }
142
 
 
143
  document.getElementById('summarize-btn').addEventListener('click', () => {
144
- sendData('/analyze', 'summary-file', null, 'summary-result');
145
  });
146
 
147
  document.getElementById('qa-btn').addEventListener('click', () => {
@@ -150,11 +142,11 @@
150
  document.getElementById('qa-result').textContent = 'Please enter a question.';
151
  return;
152
  }
153
- sendData('/ask', 'qa-file', { question }, 'qa-result');
154
  });
155
 
156
  document.getElementById('image-btn').addEventListener('click', () => {
157
- sendData('/interpret_image', 'image-file', null, 'image-result');
158
  });
159
  </script>
160
  </div>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
  <title>Smart Analyzer</title>
7
  <style>
8
+ /* ⤵ unchanged styles */
9
  :root {
10
  --primary-color: #4A90E2;
11
  --secondary-color: #f4f6f8;
 
28
  display: flex;
29
  justify-content: center;
30
  }
31
+ .container { width: 100%; max-width: var(--max-width); }
32
+ h1 { text-align: center; color: var(--primary-color); margin-bottom: 40px; }
 
 
 
 
 
 
 
33
  .section {
34
  background: var(--card-bg);
35
  padding: 20px;
 
45
  border-bottom: 2px solid var(--secondary-color);
46
  padding-bottom: 5px;
47
  }
48
+ label { display: block; margin-top: 15px; font-weight: bold; }
 
 
 
 
49
  input[type="file"], input[type="text"], button, textarea {
50
  width: 100%;
51
  padding: 10px;
 
124
  try {
125
  const res = await fetch(url, { method: 'POST', body: formData });
126
  const data = await res.json();
127
+ document.getElementById(resultId).textContent =
128
+ data.result || data.summary || data.answer || data.description || data.error || JSON.stringify(data);
129
  } catch (err) {
130
  document.getElementById(resultId).textContent = 'Error: ' + err.message;
131
  }
132
  }
133
 
134
+ // ▸ updated paths
135
  document.getElementById('summarize-btn').addEventListener('click', () => {
136
+ sendData('/api/summarize', 'summary-file', null, 'summary-result');
137
  });
138
 
139
  document.getElementById('qa-btn').addEventListener('click', () => {
 
142
  document.getElementById('qa-result').textContent = 'Please enter a question.';
143
  return;
144
  }
145
+ sendData('/api/qa', 'qa-file', { question }, 'qa-result');
146
  });
147
 
148
  document.getElementById('image-btn').addEventListener('click', () => {
149
+ sendData('/api/caption', 'image-file', null, 'image-result');
150
  });
151
  </script>
152
  </div>