SandhyaMadhunagula commited on
Commit
581ecf9
·
verified ·
1 Parent(s): 9c63aa8

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +257 -372
templates/index.html CHANGED
@@ -1,373 +1,258 @@
1
- <!DOCTYPE html>
2
-
3
- <html lang="en">
4
-
5
- <head>
6
-
7
- <meta charset="UTF-8">
8
-
9
- <title>GNN Knowledge Extraction Dashboard</title>
10
-
11
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
12
-
13
- <style>
14
-
15
- :root {
16
-
17
- --primary-color: #0d6efd;
18
-
19
- --glass-bg: rgba(255, 255, 255, 0.88);
20
-
21
- }
22
-
23
-
24
-
25
- body {
26
-
27
- font-family: 'Segoe UI', sans-serif;
28
-
29
- /* Using your uploaded background pattern style */
30
-
31
- background: black url('static/network_bg.png') no-repeat center center fixed;
32
-
33
- background-size: cover;
34
-
35
- margin: 0;
36
-
37
- padding: 20px;
38
-
39
- height: 100vh;
40
-
41
- overflow: hidden;
42
-
43
- }
44
-
45
-
46
-
47
- .project-header {
48
-
49
- text-align: center;
50
-
51
- color: white; /* Changed to white to pop against dark bg */
52
-
53
- margin-bottom: 20px;
54
-
55
- text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
56
-
57
- }
58
-
59
-
60
-
61
- .dashboard-container {
62
-
63
- display: flex;
64
-
65
- max-width: 1600px;
66
-
67
- margin: 0 auto;
68
-
69
- gap: 20px;
70
-
71
- height: calc(100vh - 120px);
72
-
73
- }
74
-
75
-
76
-
77
- .control-panel {
78
-
79
- flex: 1;
80
-
81
- background: var(--glass-bg);
82
-
83
- padding: 25px;
84
-
85
- border-radius: 15px;
86
-
87
- box-shadow: 0 10px 40px rgba(0,0,0,0.5);
88
-
89
- overflow-y: auto;
90
-
91
- backdrop-filter: blur(10px); /* Makes it look modern */
92
-
93
- }
94
-
95
-
96
-
97
- .graph-panel {
98
-
99
- flex: 2;
100
-
101
- background: rgba(255, 255, 255, 0.95);
102
-
103
- padding: 10px;
104
-
105
- border-radius: 15px;
106
-
107
- box-shadow: 0 10px 40px rgba(0,0,0,0.5);
108
-
109
- display: flex;
110
-
111
- flex-direction: column;
112
-
113
- }
114
-
115
-
116
-
117
- .card-section {
118
-
119
- background: white;
120
-
121
- padding: 15px;
122
-
123
- border-radius: 10px;
124
-
125
- margin-bottom: 20px;
126
-
127
- border: 1px solid #dee2e6;
128
-
129
- }
130
-
131
-
132
-
133
- .answer-box {
134
-
135
- background: #e3f2fd;
136
-
137
- border-left: 5px solid #1976d2;
138
-
139
- padding: 15px;
140
-
141
- border-radius: 8px;
142
-
143
- margin-top: 15px;
144
-
145
- }
146
-
147
-
148
-
149
- iframe {
150
-
151
- flex-grow: 1;
152
-
153
- width: 100%;
154
-
155
- border-radius: 10px;
156
-
157
- border: none;
158
-
159
- }
160
-
161
-
162
-
163
- .badge-interactive {
164
-
165
- background: #6c5ce7;
166
-
167
- color: white;
168
-
169
- padding: 5px 10px;
170
-
171
- border-radius: 20px;
172
-
173
- font-size: 0.8rem;
174
-
175
- }
176
-
177
-
178
-
179
- /* --- GLOWING NODES CONFIGURATION --- */
180
-
181
- /* This makes the bubbles in the graph look like they belong on your background */
182
-
183
- .graph-panel iframe {
184
-
185
- filter: drop-shadow(0 0 10px rgba(108, 92, 231, 0.3));
186
-
187
- }
188
-
189
- /* ------------------------------------ */
190
-
191
- </style>
192
-
193
- </head>
194
-
195
- <body>
196
-
197
-
198
-
199
- <div class="project-header">
200
-
201
- <h2 class="fw-bold">🧠 GNN Knowledge Graph Extractor</h2>
202
-
203
- <p>Intelligent Entity-Relationship Mapping & Discovery</p>
204
-
205
- </div>
206
-
207
- <div class="dashboard-container">
208
-
209
- <div class="control-panel">
210
-
211
- <form method="POST" enctype="multipart/form-data">
212
-
213
- <div class="card-section shadow-sm">
214
-
215
- <h5>1. Text & Documents</h5>
216
-
217
- <!-- <textarea name="text" class="form-control mb-3" rows="5" placeholder="Paste text here...">{{ user_text }}</textarea>--->
218
- <textarea name="text" class="form-control mb-3" rows="5" placeholder="Paste text here...">{{ session.get('user_text', '') }}</textarea>
219
-
220
- <input type="file" name="file" class="form-control mb-3" accept=".pdf,.docx,.txt">
221
-
222
- <button type="submit" class="btn btn-primary w-100">Process & Expand Graph</button>
223
-
224
- </div>
225
-
226
- </form>
227
-
228
- <div class="card-section shadow-sm">
229
- <h5>2. Ask the Graph</h5>
230
- <form method="POST">
231
-
232
- <input type="text" name="query" class="form-control mb-3" placeholder="Search entity..." value="{{ user_query }}">
233
-
234
- <div class="d-flex gap-2">
235
-
236
- <button type="submit" class="btn btn-success flex-grow-1">Ask Question</button>
237
-
238
- <a href="/" class="btn btn-outline-secondary">Clear Query</a>
239
- </div>
240
- </form>
241
-
242
- {% if answer %}
243
-
244
- <div class="answer-box shadow-sm">
245
-
246
- <strong>Result:</strong><br>
247
-
248
- <div class="mt-2">{{ answer | safe }}</div>
249
-
250
- </div>
251
-
252
- {% endif %}
253
-
254
- </div>
255
-
256
- <div class="mt-auto">
257
- <button type="button" class="btn btn-outline-info w-100 mb-2" data-bs-toggle="modal" data-bs-target="#dbModal">
258
- 🔍 View Database Table
259
- </button>
260
- <a href="/clear" class="btn btn-danger w-100 opacity-75" onclick="return confirm('ERASE ALL KNOWLEDGE?')">
261
- Reset Full Database
262
- </a>
263
- </div>
264
-
265
- </div>
266
-
267
-
268
-
269
- <div class="graph-panel">
270
-
271
- <div class="d-flex justify-content-between align-items-center mb-2 px-2">
272
-
273
- <h5 class="m-0">Graph Visualization</h5>
274
-
275
- <span class="badge-interactive">Live Interactive Nodes</span>
276
-
277
- </div>
278
-
279
- {% if graph %}
280
-
281
- <iframe src="{{ url_for('static', filename='graph.html') }}"></iframe>
282
-
283
- {% else %}
284
-
285
- <div class="h-100 d-flex align-items-center justify-content-center text-muted border rounded">
286
-
287
- Waiting for data to map relationships...
288
-
289
- </div>
290
-
291
- {% endif %}
292
-
293
- </div>
294
-
295
- </div>
296
-
297
- <div class="modal fade" id="dbModal" tabindex="-1" aria-hidden="true">
298
-
299
- <div class="modal-dialog modal-lg modal-dialog-scrollable">
300
-
301
- <div class="modal-content">
302
-
303
- <div class="modal-header">
304
-
305
- <h5 class="modal-title">Extracted Knowledge Base (Triples)</h5>
306
- <a href="/export_csv" class="btn btn-success btn-sm ms-3">
307
- 📊 Download CSV
308
- </a>
309
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
310
-
311
- </div>
312
-
313
- <div class="modal-body">
314
-
315
- <table class="table table-hover">
316
-
317
- <thead class="table-dark">
318
-
319
- <tr>
320
-
321
- <th>Subject</th>
322
-
323
- <th>Relationship</th>
324
-
325
- <th>Object</th>
326
-
327
- </tr>
328
-
329
- </thead>
330
-
331
- <tbody>
332
-
333
- {% for triple in db_triples %}
334
-
335
- <tr>
336
-
337
- <td><strong>{{ triple.s }}</strong></td>
338
-
339
- <td><span class="badge bg-primary">{{ triple.r }}</span></td>
340
-
341
- <td><strong>{{ triple.o }}</strong></td>
342
-
343
- </tr>
344
-
345
- {% else %}
346
-
347
- <tr>
348
-
349
- <td colspan="3" class="text-center text-muted">No data in database yet.</td>
350
-
351
- </tr>
352
-
353
- {% endfor %}
354
-
355
- </tbody>
356
-
357
- </table>
358
-
359
- </div>
360
-
361
- </div>
362
-
363
- </div>
364
-
365
- </div>
366
-
367
-
368
-
369
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
370
-
371
- </body>
372
-
373
  </html>
 
1
+ <!DOCTYPE html>
2
+
3
+ <html lang="en">
4
+
5
+ <head>
6
+
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
+
9
+ <title>GNN Knowledge Extraction Dashboard</title>
10
+
11
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
12
+
13
+ <style>
14
+ /* 1. Base Variables */
15
+ :root {
16
+ --primary-color: #0d6efd;
17
+ --glass-bg: rgba(255, 255, 255, 0.88);
18
+ }
19
+
20
+ /* 2. Desktop/Standard Styles (The stuff you already have) */
21
+ body {
22
+ font-family: 'Segoe UI', sans-serif;
23
+ background: black url('static/network_bg.png') no-repeat center center fixed;
24
+ background-size: cover;
25
+ margin: 0;
26
+ padding: 20px;
27
+ height: 100vh;
28
+ overflow: hidden; /* This is what we need to override for mobile */
29
+ }
30
+
31
+ .dashboard-container {
32
+ display: flex;
33
+ max-width: 1600px;
34
+ margin: 0 auto;
35
+ gap: 20px;
36
+ height: calc(100vh - 120px);
37
+ }
38
+
39
+ /* ... (rest of your styles: .control-panel, .graph-panel, etc.) ... */
40
+
41
+ .graph-panel iframe {
42
+ filter: drop-shadow(0 0 10px rgba(108, 92, 231, 0.3));
43
+ }
44
+
45
+ /* 3. MOBILE RESPONSIVENESS (MUST BE AT THE END) */
46
+ @media (max-width: 768px) {
47
+ body {
48
+ height: auto;
49
+ overflow-y: auto;
50
+ padding: 10px;
51
+ }
52
+
53
+ .dashboard-container {
54
+ flex-direction: column;
55
+ height: auto;
56
+ gap: 15px;
57
+ }
58
+
59
+ .control-panel, .graph-panel {
60
+ flex: none;
61
+ width: 100%;
62
+ max-height: none;
63
+ }
64
+
65
+ .graph-panel {
66
+ height: 500px;
67
+ }
68
+
69
+ .project-header h2 {
70
+ font-size: 1.4rem;
71
+ }
72
+
73
+ textarea {
74
+ font-size: 16px !important;
75
+ }
76
+ }
77
+ </style>
78
+ </head>
79
+
80
+ <body>
81
+
82
+
83
+
84
+ <div class="project-header">
85
+
86
+ <h2 class="fw-bold">🧠 GNN Knowledge Graph Extractor</h2>
87
+
88
+ <p>Intelligent Entity-Relationship Mapping & Discovery</p>
89
+
90
+ </div>
91
+
92
+ <div class="dashboard-container">
93
+
94
+ <div class="control-panel">
95
+
96
+ <form method="POST" enctype="multipart/form-data">
97
+
98
+ <div class="card-section shadow-sm">
99
+
100
+ <h5>1. Text & Documents</h5>
101
+
102
+ <!-- <textarea name="text" class="form-control mb-3" rows="5" placeholder="Paste text here...">{{ user_text }}</textarea>--->
103
+ <textarea name="text" class="form-control mb-3" rows="5" placeholder="Paste text here...">{{ session.get('user_text', '') }}</textarea>
104
+
105
+ <input type="file" name="file" class="form-control mb-3" accept=".pdf,.docx,.txt">
106
+
107
+ <button type="submit" class="btn btn-primary w-100">Process & Expand Graph</button>
108
+
109
+ </div>
110
+
111
+ </form>
112
+
113
+ <div class="card-section shadow-sm">
114
+ <h5>2. Ask the Graph</h5>
115
+ <form method="POST">
116
+
117
+ <input type="text" name="query" class="form-control mb-3" placeholder="Search entity..." value="{{ user_query }}">
118
+
119
+ <div class="d-flex gap-2">
120
+
121
+ <button type="submit" class="btn btn-success flex-grow-1">Ask Question</button>
122
+
123
+ <a href="/" class="btn btn-outline-secondary">Clear Query</a>
124
+ </div>
125
+ </form>
126
+
127
+ {% if answer %}
128
+
129
+ <div class="answer-box shadow-sm">
130
+
131
+ <strong>Result:</strong><br>
132
+
133
+ <div class="mt-2">{{ answer | safe }}</div>
134
+
135
+ </div>
136
+
137
+ {% endif %}
138
+
139
+ </div>
140
+
141
+ <div class="mt-auto">
142
+ <button type="button" class="btn btn-outline-info w-100 mb-2" data-bs-toggle="modal" data-bs-target="#dbModal">
143
+ 🔍 View Database Table
144
+ </button>
145
+ <a href="/clear" class="btn btn-danger w-100 opacity-75" onclick="return confirm('ERASE ALL KNOWLEDGE?')">
146
+ Reset Full Database
147
+ </a>
148
+ </div>
149
+
150
+ </div>
151
+
152
+
153
+
154
+ <div class="graph-panel">
155
+
156
+ <div class="d-flex justify-content-between align-items-center mb-2 px-2">
157
+
158
+ <h5 class="m-0">Graph Visualization</h5>
159
+
160
+ <span class="badge-interactive">Live Interactive Nodes</span>
161
+
162
+ </div>
163
+
164
+ {% if graph %}
165
+
166
+ <iframe src="{{ url_for('static', filename='graph.html') }}"></iframe>
167
+
168
+ {% else %}
169
+
170
+ <div class="h-100 d-flex align-items-center justify-content-center text-muted border rounded">
171
+
172
+ Waiting for data to map relationships...
173
+
174
+ </div>
175
+
176
+ {% endif %}
177
+
178
+ </div>
179
+
180
+ </div>
181
+
182
+ <div class="modal fade" id="dbModal" tabindex="-1" aria-hidden="true">
183
+
184
+ <div class="modal-dialog modal-lg modal-dialog-scrollable">
185
+
186
+ <div class="modal-content">
187
+
188
+ <div class="modal-header">
189
+
190
+ <h5 class="modal-title">Extracted Knowledge Base (Triples)</h5>
191
+ <a href="/export_csv" class="btn btn-success btn-sm ms-3">
192
+ 📊 Download CSV
193
+ </a>
194
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
195
+
196
+ </div>
197
+
198
+ <div class="modal-body">
199
+
200
+ <table class="table table-hover">
201
+
202
+ <thead class="table-dark">
203
+
204
+ <tr>
205
+
206
+ <th>Subject</th>
207
+
208
+ <th>Relationship</th>
209
+
210
+ <th>Object</th>
211
+
212
+ </tr>
213
+
214
+ </thead>
215
+
216
+ <tbody>
217
+
218
+ {% for triple in db_triples %}
219
+
220
+ <tr>
221
+
222
+ <td><strong>{{ triple.s }}</strong></td>
223
+
224
+ <td><span class="badge bg-primary">{{ triple.r }}</span></td>
225
+
226
+ <td><strong>{{ triple.o }}</strong></td>
227
+
228
+ </tr>
229
+
230
+ {% else %}
231
+
232
+ <tr>
233
+
234
+ <td colspan="3" class="text-center text-muted">No data in database yet.</td>
235
+
236
+ </tr>
237
+
238
+ {% endfor %}
239
+
240
+ </tbody>
241
+
242
+ </table>
243
+
244
+ </div>
245
+
246
+ </div>
247
+
248
+ </div>
249
+
250
+ </div>
251
+
252
+
253
+
254
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
255
+
256
+ </body>
257
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  </html>