File size: 8,665 Bytes
03e275e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Classification Report</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/dropzone.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>

        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');



        :root {

            --primary-color: #4f46e5;

            --primary-dark: #4338ca;

            --success-color: #22c55e;

            --error-color: #ef4444;

            --background-color: #1a1a2e;

            --card-background: rgba(255, 255, 255, 0.1);

            --text-primary: #ffffff;

            --text-secondary: #a5b4fc;

            --border-color: rgba(255, 255, 255, 0.18);

        }



        body {

            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

            min-height: 100vh;

            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);

            margin: 0;

            padding: 2rem;

            color: var(--text-primary);

        }



        .container {

            max-width: 1200px;

            margin: 0 auto;

        }



        .glass-card {

            background: var(--card-background);

            backdrop-filter: blur(10px);

            border-radius: 20px;

            padding: 2rem;

            box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

            border: 1px solid var(--border-color);

        }



        .header {

            text-align: center;

            margin-bottom: 2rem;

        }



        .header h1 {

            font-size: 2rem;

            margin-bottom: 0.5rem;

        }



        #summary {

            background: var(--card-background);

            padding: 1rem;

            border-radius: 0.5rem;

            text-align: center;

            margin-bottom: 1.5rem;

            backdrop-filter: blur(5px);

        }



        .results-table {

            width: 100%;

            border-collapse: collapse;

            background: var(--card-background);

            border-radius: 0.5rem;

            overflow: hidden;

        }



        .results-table th,

        .results-table td {

            padding: 1rem;

            text-align: center;

            border: 1px solid var(--border-color);

        }



        .serial {

            width: 80px;

        }



        .image-col {

            width: 200px;

        }



        .result-col {

            width: 180px;

        }



        .labels-col {

            width: auto;

            min-width: 150px;

        }



        .thumbnail {

            width: 100px;

            height: 100px;

            object-fit: cover;

            border-radius: 0.5rem;

            cursor: pointer;

        }



        .result-pass,

        .result-fail {

            display: inline-block;

            padding: 0.5rem 1rem;

            border-radius: 9999px;

            text-align: center;

        }



        .result-pass {

            background: rgba(34, 197, 94, 0.1);

            color: var(--success-color);

        }



        .result-fail {

            background: rgba(239, 68, 68, 0.1);

            color: var(--error-color);

        }



        .labels {

            display: flex;

            flex-wrap: wrap;

            gap: 0.5rem;

            justify-content: center;

        }



        .label {

            display: inline-block;

            background: rgba(255, 255, 255, 0.1);

            padding: 0.5rem 1rem;

            border-radius: 9999px;

            margin: 0.25rem;

            color: var(--text-secondary);

        }



        .image-modal {

            display: none;

            position: fixed;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            background: rgba(0, 0, 0, 0.9);

            z-index: 1000;

            justify-content: center;

            align-items: center;

        }



        .modal-content {

            position: relative;

            max-width: 90%;

            max-height: 90vh;

        }



        .modal-image {

            max-width: 100%;

            max-height: 90vh;

            object-fit: contain;

            border-radius: 0.5rem;

        }



        .modal-close {

            position: absolute;

            top: -2rem;

            right: 0;

            color: white;

            font-size: 2rem;

            cursor: pointer;

            background: none;

            border: none;

            padding: 0.5rem;

        }



        #thumbnail-preview-box {

            display: none;

            position: absolute;

            z-index: 9999;

            background: var(--card-background);

            border: 1px solid var(--border-color);

            border-radius: 0.75rem;

            padding: 1rem;

            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);

            max-width: 300px;

        }



        #thumbnail-preview-box img {

            max-width: 100%;

            border-radius: 0.5rem;

            display: block;

        }



        .filename {

            margin-top: 0.5rem;

            font-size: 0.9rem;

            word-break: break-word;

        }

    </style>
</head>
<body>
    <div class="container">
        <div class="glass-card">
            <div class="header">
                <h1>Failed Images Report</h1>
                <p>Date: {date}  |  Time: {time}</p>
            </div>
            
            <div id="summary">
                {summary_content}
            </div>

            <div class="results-section">
                <table class="results-table" id="results-table">
                    <thead>
                        <tr>
                            <th class="serial">S.No</th>
                            <th class="image-col">Image</th>
                            <th class="result-col">Result</th>
                            <th class="labels-col">Labels</th>
                        </tr>
                    </thead>
                    <tbody>
                        {table_rows}
                    </tbody>
                </table>
            </div>

            <!-- Image Modal -->
            <div class="image-modal" id="image-modal">
                <div class="modal-content">
                    <button class="modal-close">
                        <i class="fas fa-times"></i>
                    </button>
                    <img class="modal-image" id="modal-image" src="" alt="">
                </div>
            </div>
        </div>
    </div>

    <div id="thumbnail-preview-box">
        <img id="thumbnail-preview-img" src="" alt="">
    </div>

    <script>

        document.addEventListener('DOMContentLoaded', function() {

            // Modal functionality

            const modal = document.getElementById('image-modal');

            const modalImg = modal.querySelector('.modal-image');

            const closeBtn = modal.querySelector('.modal-close');



            // Close modal events

            closeBtn.onclick = () => modal.style.display = 'none';

            modal.onclick = e => {

                if (e.target === modal) modal.style.display = 'none';

            };



            // Escape key to close modal

            document.addEventListener('keydown', e => {

                if (e.key === 'Escape') modal.style.display = 'none';

            });



            // Thumbnail preview functionality

            document.addEventListener('click', function(e) {

                if (e.target.classList.contains('thumbnail')) {

                    e.preventDefault();

                    const box = document.getElementById('thumbnail-preview-box');

                    const img = document.getElementById('thumbnail-preview-img');

                    img.src = e.target.src;

                    box.style.display = 'block';

                    box.style.left = (e.pageX + 10) + 'px';

                    box.style.top = (e.pageY + 10) + 'px';

                } else if (!e.target.closest('#thumbnail-preview-box')) {

                    document.getElementById('thumbnail-preview-box').style.display = 'none';

                }

            });

        });

    </script>
</body>
</html>