Kea2-python 1.0.6b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Kea2-python might be problematic. Click here for more details.

Files changed (52) hide show
  1. kea2/__init__.py +3 -0
  2. kea2/absDriver.py +56 -0
  3. kea2/adbUtils.py +554 -0
  4. kea2/assets/config_version.json +16 -0
  5. kea2/assets/fastbot-thirdpart.jar +0 -0
  6. kea2/assets/fastbot_configs/abl.strings +2 -0
  7. kea2/assets/fastbot_configs/awl.strings +3 -0
  8. kea2/assets/fastbot_configs/max.config +7 -0
  9. kea2/assets/fastbot_configs/max.fuzzing.strings +699 -0
  10. kea2/assets/fastbot_configs/max.schema.strings +1 -0
  11. kea2/assets/fastbot_configs/max.strings +3 -0
  12. kea2/assets/fastbot_configs/max.tree.pruning +27 -0
  13. kea2/assets/fastbot_configs/teardown.py +18 -0
  14. kea2/assets/fastbot_configs/widget.block.py +38 -0
  15. kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so +0 -0
  16. kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so +0 -0
  17. kea2/assets/fastbot_libs/x86/libfastbot_native.so +0 -0
  18. kea2/assets/fastbot_libs/x86_64/libfastbot_native.so +0 -0
  19. kea2/assets/framework.jar +0 -0
  20. kea2/assets/kea2-thirdpart.jar +0 -0
  21. kea2/assets/monkeyq.jar +0 -0
  22. kea2/assets/quicktest.py +126 -0
  23. kea2/cli.py +320 -0
  24. kea2/fastbotManager.py +267 -0
  25. kea2/fastbotx/ActivityTimes.py +52 -0
  26. kea2/fastbotx/ReuseEntry.py +74 -0
  27. kea2/fastbotx/ReuseModel.py +63 -0
  28. kea2/fastbotx/__init__.py +7 -0
  29. kea2/fbm_parser.py +871 -0
  30. kea2/fs_lock.py +131 -0
  31. kea2/kea2_api.py +166 -0
  32. kea2/keaUtils.py +1112 -0
  33. kea2/kea_launcher.py +319 -0
  34. kea2/logWatcher.py +92 -0
  35. kea2/mixin.py +22 -0
  36. kea2/report/__init__.py +0 -0
  37. kea2/report/bug_report_generator.py +793 -0
  38. kea2/report/mixin.py +482 -0
  39. kea2/report/report_merger.py +797 -0
  40. kea2/report/templates/bug_report_template.html +3876 -0
  41. kea2/report/templates/merged_bug_report_template.html +3333 -0
  42. kea2/report/utils.py +10 -0
  43. kea2/resultSyncer.py +65 -0
  44. kea2/u2Driver.py +610 -0
  45. kea2/utils.py +184 -0
  46. kea2/version_manager.py +102 -0
  47. kea2_python-1.0.6b0.dist-info/METADATA +447 -0
  48. kea2_python-1.0.6b0.dist-info/RECORD +52 -0
  49. kea2_python-1.0.6b0.dist-info/WHEEL +5 -0
  50. kea2_python-1.0.6b0.dist-info/entry_points.txt +2 -0
  51. kea2_python-1.0.6b0.dist-info/licenses/LICENSE +16 -0
  52. kea2_python-1.0.6b0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3333 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Kea2 Merged Test Report</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
8
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
9
+ <style>
10
+ :root {
11
+ --primary-color: #3498db;
12
+ --secondary-color: #2ecc71;
13
+ --warning-color: #f39c12;
14
+ --danger-color: #e74c3c;
15
+ --dark-color: #2c3e50;
16
+ --light-color: #ecf0f1;
17
+ }
18
+
19
+ body {
20
+ font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
21
+ background-color: #f8f9fa;
22
+ color: #333;
23
+ line-height: 1.6;
24
+ }
25
+
26
+ /* Custom container width - wider than Bootstrap default */
27
+ .container {
28
+ max-width: 98% !important;
29
+ width: 98% !important;
30
+ }
31
+
32
+ @media (min-width: 1200px) {
33
+ .container {
34
+ max-width: 1800px !important;
35
+ width: 95% !important;
36
+ }
37
+ }
38
+
39
+ @media (min-width: 1400px) {
40
+ .container {
41
+ max-width: 2000px !important;
42
+ width: 92% !important;
43
+ }
44
+ }
45
+
46
+ @media (min-width: 1600px) {
47
+ .container {
48
+ max-width: 2200px !important;
49
+ width: 90% !important;
50
+ }
51
+ }
52
+
53
+ @media (min-width: 1800px) {
54
+ .container {
55
+ max-width: 2400px !important;
56
+ width: 88% !important;
57
+ }
58
+ }
59
+
60
+ @media (min-width: 2000px) {
61
+ .container {
62
+ max-width: 2600px !important;
63
+ width: 85% !important;
64
+ }
65
+ }
66
+
67
+ .header {
68
+ background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
69
+ color: white;
70
+ padding: 2.5rem 0;
71
+ margin-bottom: 3rem;
72
+ border-radius: 0 0 20px 20px;
73
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
74
+ }
75
+
76
+ .stats-card {
77
+ border-radius: 12px;
78
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
79
+ transition: transform 0.3s, box-shadow 0.3s;
80
+ height: 100%;
81
+ overflow: hidden;
82
+ padding: 1rem;
83
+ }
84
+
85
+ .stats-card:hover {
86
+ transform: translateY(-5px);
87
+ box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
88
+ }
89
+
90
+ .card-header {
91
+ font-weight: 600;
92
+ padding: 1.25rem 1.5rem;
93
+ }
94
+
95
+ .card-body {
96
+ padding: 1.5rem;
97
+ }
98
+
99
+ .table-custom {
100
+ border-radius: 10px;
101
+ overflow: hidden;
102
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
103
+ width: 100%;
104
+ table-layout: auto;
105
+ }
106
+
107
+ .crash-analysis-panel {
108
+ background-color: #ffffff;
109
+ border-radius: 14px;
110
+ padding: 1.75rem;
111
+ box-shadow: 0 6px 15px rgba(44, 62, 80, 0.08);
112
+ border: 1px solid rgba(0, 0, 0, 0.05);
113
+ }
114
+
115
+ .crash-analysis-panel .btn-group .btn {
116
+ font-weight: 600;
117
+ }
118
+
119
+ .table-custom thead {
120
+ background-color: #495057;
121
+ color: white;
122
+ }
123
+
124
+ .table-custom th {
125
+ font-weight: 600;
126
+ padding: 15px 12px;
127
+ white-space: nowrap;
128
+ text-align: center;
129
+ }
130
+
131
+ .table-custom td {
132
+ padding: 15px 12px;
133
+ vertical-align: middle;
134
+ text-align: center;
135
+ }
136
+
137
+ /* Specific column widths for property statistics table */
138
+ .table-custom th:nth-child(1), .table-custom td:nth-child(1) { /* Index */
139
+ width: 8%;
140
+ min-width: 55px;
141
+ }
142
+
143
+ .table-custom th:nth-child(2), .table-custom td:nth-child(2) { /* Property Name */
144
+ width: 30%;
145
+ min-width: 200px;
146
+ text-align: left;
147
+ }
148
+
149
+ .table-custom th:nth-child(3), .table-custom td:nth-child(3) { /* Precondition Satisfied */
150
+ width: 15%;
151
+ min-width: 95px;
152
+ }
153
+
154
+ .table-custom th:nth-child(4), .table-custom td:nth-child(4) { /* Executed */
155
+ width: 12%;
156
+ min-width: 75px;
157
+ }
158
+
159
+ .table-custom th:nth-child(5), .table-custom td:nth-child(5) { /* Fails */
160
+ width: 12%;
161
+ min-width: 75px;
162
+ }
163
+
164
+ .table-custom th:nth-child(6), .table-custom td:nth-child(6) { /* Errors */
165
+ width: 12%;
166
+ min-width: 75px;
167
+ }
168
+
169
+ .table-custom tbody tr:nth-of-type(odd) {
170
+ background-color: rgba(0, 0, 0, 0.02);
171
+ }
172
+
173
+ .table-custom tbody tr:hover {
174
+ background-color: rgba(0, 0, 0, 0.05);
175
+ }
176
+
177
+ /* Specific column widths for property source mapping table */
178
+ #property-source-container tr th:nth-child(1),
179
+ #property-source-container tr td:nth-child(1) { /* Index */
180
+ width: 8%;
181
+ min-width: 55px;
182
+ }
183
+
184
+ #property-source-container tr th:nth-child(2),
185
+ #property-source-container tr td:nth-child(2) { /* Property Name */
186
+ width: 35%;
187
+ min-width: 200px;
188
+ text-align: left;
189
+ }
190
+
191
+ #property-source-container tr th:nth-child(3),
192
+ #property-source-container tr td:nth-child(3) { /* Source Directories */
193
+ width: 57%;
194
+ min-width: 300px;
195
+ text-align: center;
196
+ }
197
+
198
+ /* Property Source Mapping specific styles */
199
+ .property-source-row .badge-custom {
200
+ max-width: 100%;
201
+ word-break: break-word;
202
+ white-space: normal;
203
+ }
204
+
205
+ .property-source-row td:last-child {
206
+ line-height: 1.8;
207
+ }
208
+
209
+ .property-source-row .badge.bg-info {
210
+ transition: all 0.2s ease;
211
+ }
212
+
213
+ .property-source-row .badge.bg-info:hover {
214
+ background-color: #0d6efd !important;
215
+ transform: translateY(-1px);
216
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
217
+ }
218
+
219
+ /* Source directories toggle button styles */
220
+ .source-dirs-toggle {
221
+ border-radius: 12px;
222
+ transition: all 0.2s ease;
223
+ vertical-align: middle;
224
+ }
225
+
226
+ .source-dirs-toggle:hover {
227
+ transform: translateY(-1px);
228
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
229
+ }
230
+
231
+ .source-dirs-toggle .bi {
232
+ transition: transform 0.2s ease;
233
+ }
234
+
235
+ .source-dirs-hidden {
236
+ display: inline;
237
+ }
238
+
239
+ .source-dirs-container {
240
+ line-height: 1.8;
241
+ }
242
+
243
+ .stat-value {
244
+ font-size: 2.2rem;
245
+ font-weight: 700;
246
+ display: block;
247
+ margin-bottom: 0.8rem;
248
+ line-height: 1.2;
249
+ }
250
+
251
+ .stat-label {
252
+ font-size: 1rem;
253
+ color: #666;
254
+ display: block;
255
+ margin-top: 5px;
256
+ }
257
+
258
+ .section-title {
259
+ position: relative;
260
+ padding-bottom: 15px;
261
+ margin-bottom: 30px;
262
+ font-weight: 600;
263
+ color: var(--dark-color);
264
+ }
265
+
266
+ .section-title::after {
267
+ content: '';
268
+ position: absolute;
269
+ bottom: 0;
270
+ left: 0;
271
+ height: 3px;
272
+ width: 50px;
273
+ background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
274
+ border-radius: 3px;
275
+ }
276
+
277
+ .section-block {
278
+ margin-bottom: 70px;
279
+ }
280
+
281
+ .value-highlight {
282
+ color: var(--primary-color);
283
+ }
284
+
285
+ .value-danger {
286
+ color: var(--danger-color);
287
+ }
288
+
289
+ .value-warning {
290
+ color: var(--warning-color);
291
+ }
292
+
293
+ .value-success {
294
+ color: var(--secondary-color);
295
+ }
296
+
297
+ .summary-card {
298
+ border-radius: 12px;
299
+ background-color: white;
300
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
301
+ padding: 30px;
302
+ margin-bottom: 40px;
303
+ }
304
+
305
+ .badge-custom {
306
+ padding: 6px 12px;
307
+ border-radius: 50px;
308
+ font-weight: 500;
309
+ font-size: 0.9rem;
310
+ margin: 0 2px;
311
+ }
312
+
313
+
314
+
315
+ .activities-container {
316
+ display: flex;
317
+ flex-direction: column;
318
+ height: 650px;
319
+ }
320
+
321
+ .pagination-container {
322
+ padding: 10px 0;
323
+ background-color: white;
324
+ border-radius: 0 0 8px 8px;
325
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
326
+ }
327
+
328
+ /* Modern Activity Item Styling */
329
+ .activity-item {
330
+ background: #ffffff;
331
+ border: 1px solid #f3f4f6;
332
+ border-radius: 12px;
333
+ padding: 16px 20px;
334
+ margin-bottom: 8px;
335
+ transition: all 0.2s ease;
336
+ display: flex;
337
+ align-items: center;
338
+ justify-content: space-between;
339
+ }
340
+
341
+ .activity-item:hover {
342
+ border-color: #e5e7eb;
343
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
344
+ transform: translateY(-1px);
345
+ }
346
+
347
+ .activity-content {
348
+ display: flex;
349
+ align-items: center;
350
+ gap: 12px;
351
+ }
352
+
353
+ .activity-name {
354
+ font-weight: 500;
355
+ color: #374151;
356
+ font-size: 14px;
357
+ }
358
+
359
+ .traversal-badge {
360
+ background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
361
+ border: none;
362
+ border-radius: 20px;
363
+ padding: 6px 12px;
364
+ font-size: 12px;
365
+ font-weight: 500;
366
+ box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
367
+ }
368
+
369
+ /* Modern Activity List Container */
370
+ .activity-list {
371
+ background: #ffffff;
372
+ border: 1px solid #e5e7eb;
373
+ border-radius: 12px;
374
+ padding: 16px;
375
+ height: 550px;
376
+ overflow-y: auto;
377
+ scrollbar-width: thin;
378
+ scrollbar-color: var(--primary-color) #eee;
379
+ margin-bottom: 15px;
380
+ }
381
+
382
+ .activity-list::-webkit-scrollbar {
383
+ width: 8px;
384
+ }
385
+
386
+ .activity-list::-webkit-scrollbar-track {
387
+ background: #f1f1f1;
388
+ border-radius: 10px;
389
+ }
390
+
391
+ .activity-list::-webkit-scrollbar-thumb {
392
+ background-color: var(--primary-color);
393
+ border-radius: 10px;
394
+ }
395
+
396
+ .activity-list::-webkit-scrollbar-thumb:hover {
397
+ background-color: #2980b9;
398
+ }
399
+
400
+ .nav-tabs .nav-link {
401
+ color: #666;
402
+ border: 1px solid transparent;
403
+ border-radius: 6px 6px 0 0;
404
+ font-weight: 500;
405
+ transition: all 0.3s ease;
406
+ }
407
+
408
+ .nav-tabs .nav-link:hover {
409
+ color: var(--primary-color);
410
+ border-color: rgba(52, 152, 219, 0.2);
411
+ background-color: rgba(52, 152, 219, 0.05);
412
+ }
413
+
414
+ .nav-tabs .nav-link.active {
415
+ color: var(--primary-color);
416
+ background-color: white;
417
+ border-color: #dee2e6 #dee2e6 #fff;
418
+ font-weight: 600;
419
+ }
420
+
421
+ .tab-content {
422
+ border: 1px solid #dee2e6;
423
+ border-top: none;
424
+ border-radius: 0 0 8px 8px;
425
+ padding: 20px;
426
+ background-color: #fafafa;
427
+ }
428
+
429
+ .sorting-controls {
430
+ background-color: #f8f9fa;
431
+ border: 1px solid #e9ecef;
432
+ border-radius: 8px;
433
+ padding: 15px;
434
+ margin-bottom: 20px;
435
+ }
436
+
437
+ .sorting-controls .form-select {
438
+ min-width: 140px;
439
+ }
440
+
441
+ .sorting-controls .btn {
442
+ transition: all 0.3s ease;
443
+ }
444
+
445
+ .sorting-controls .btn:hover {
446
+ transform: translateY(-1px);
447
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
448
+ }
449
+
450
+ .sort-icon {
451
+ margin-left: 8px;
452
+ transition: all 0.3s ease;
453
+ font-size: 1.4rem;
454
+ color: #ffffff !important;
455
+ opacity: 0.6;
456
+ text-shadow: 0 0 3px rgba(0,0,0,0.3);
457
+ }
458
+
459
+ .sort-icon:hover {
460
+ opacity: 1;
461
+ transform: scale(1.2);
462
+ text-shadow: 0 0 5px rgba(0,0,0,0.5);
463
+ }
464
+
465
+ .sort-icon.active {
466
+ opacity: 1;
467
+ font-weight: bold;
468
+ text-shadow: 0 0 5px rgba(0,0,0,0.5);
469
+ }
470
+
471
+ .sort-icon.asc.active {
472
+ color: #40e0d0 !important;
473
+ }
474
+
475
+ .sort-icon.desc.active {
476
+ color: #ff6b6b !important;
477
+ }
478
+
479
+ /* Modern Sorting Controls Styling */
480
+ .sorting-controls-modern {
481
+ background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
482
+ border: 1px solid #e3e6ea;
483
+ border-radius: 12px;
484
+ padding: 20px 24px;
485
+ margin-bottom: 24px;
486
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
487
+ transition: all 0.3s ease;
488
+ position: relative;
489
+ overflow: hidden;
490
+ }
491
+
492
+ .sorting-controls-modern::before {
493
+ content: '';
494
+ position: absolute;
495
+ top: 0;
496
+ left: 0;
497
+ right: 0;
498
+ height: 3px;
499
+ background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
500
+ border-radius: 12px 12px 0 0;
501
+ }
502
+
503
+ .sorting-controls-modern:hover {
504
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
505
+ transform: translateY(-1px);
506
+ }
507
+
508
+ .sort-label-section {
509
+ display: flex;
510
+ align-items: center;
511
+ gap: 16px;
512
+ }
513
+
514
+ .sort-icon-wrapper {
515
+ width: 48px;
516
+ height: 48px;
517
+ background: linear-gradient(135deg, #3498db, #2980b9);
518
+ border-radius: 12px;
519
+ display: flex;
520
+ align-items: center;
521
+ justify-content: center;
522
+ box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
523
+ }
524
+
525
+ .sort-icon-wrapper i {
526
+ color: white;
527
+ font-size: 20px;
528
+ }
529
+
530
+ .sort-text {
531
+ display: flex;
532
+ flex-direction: column;
533
+ gap: 4px;
534
+ }
535
+
536
+ .sort-title {
537
+ font-size: 16px;
538
+ font-weight: 600;
539
+ color: #2c3e50;
540
+ line-height: 1.2;
541
+ }
542
+
543
+ .sort-subtitle {
544
+ font-size: 13px;
545
+ color: #7f8c8d;
546
+ font-weight: 400;
547
+ line-height: 1.2;
548
+ }
549
+
550
+ .sort-button-section {
551
+ display: flex;
552
+ align-items: center;
553
+ }
554
+
555
+ .btn-sort-modern {
556
+ background: linear-gradient(135deg, #27ae60, #2ecc71);
557
+ border: none;
558
+ border-radius: 10px;
559
+ padding: 12px 20px;
560
+ color: white;
561
+ font-weight: 500;
562
+ font-size: 14px;
563
+ cursor: pointer;
564
+ transition: all 0.3s ease;
565
+ box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
566
+ position: relative;
567
+ overflow: hidden;
568
+ }
569
+
570
+ .btn-sort-modern::before {
571
+ content: '';
572
+ position: absolute;
573
+ top: 0;
574
+ left: -100%;
575
+ width: 100%;
576
+ height: 100%;
577
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
578
+ transition: left 0.5s ease;
579
+ }
580
+
581
+ .btn-sort-modern:hover {
582
+ transform: translateY(-2px);
583
+ box-shadow: 0 4px 16px rgba(46, 204, 113, 0.4);
584
+ }
585
+
586
+ .btn-sort-modern:hover::before {
587
+ left: 100%;
588
+ }
589
+
590
+ .btn-sort-modern:active {
591
+ transform: translateY(0px);
592
+ box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
593
+ }
594
+
595
+ .btn-content {
596
+ display: flex;
597
+ align-items: center;
598
+ gap: 8px;
599
+ position: relative;
600
+ z-index: 1;
601
+ }
602
+
603
+ .btn-icon {
604
+ font-size: 16px;
605
+ opacity: 0.9;
606
+ }
607
+
608
+ .btn-text {
609
+ font-size: 14px;
610
+ font-weight: 500;
611
+ white-space: nowrap;
612
+ }
613
+
614
+ .btn-arrow {
615
+ font-size: 14px;
616
+ transition: transform 0.3s ease;
617
+ opacity: 0.8;
618
+ }
619
+
620
+ .btn-sort-modern:hover .btn-arrow {
621
+ transform: scale(1.1);
622
+ opacity: 1;
623
+ }
624
+
625
+ /* Search Controls Styling */
626
+ .search-controls-modern {
627
+ background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
628
+ border: 1px solid #e3e6ea;
629
+ border-radius: 12px;
630
+ padding: 20px 24px;
631
+ margin-bottom: 24px;
632
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
633
+ transition: all 0.3s ease;
634
+ position: relative;
635
+ overflow: hidden;
636
+ }
637
+
638
+ .search-controls-modern::before {
639
+ content: '';
640
+ position: absolute;
641
+ top: 0;
642
+ left: 0;
643
+ right: 0;
644
+ height: 3px;
645
+ background: linear-gradient(90deg, #17a2b8, #20c997);
646
+ border-radius: 12px 12px 0 0;
647
+ }
648
+
649
+ .search-controls-modern:hover {
650
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
651
+ transform: translateY(-1px);
652
+ }
653
+
654
+ .search-icon-wrapper {
655
+ width: 48px;
656
+ height: 48px;
657
+ background: linear-gradient(135deg, #17a2b8, #138496);
658
+ border-radius: 12px;
659
+ display: flex;
660
+ align-items: center;
661
+ justify-content: center;
662
+ box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
663
+ }
664
+
665
+ .search-icon-wrapper i {
666
+ color: white;
667
+ font-size: 20px;
668
+ }
669
+
670
+ /* Combined Search and Sort Controls */
671
+ .search-sort-controls-modern {
672
+ background: #ffffff;
673
+ border: 1px solid #e5e7eb;
674
+ border-radius: 16px;
675
+ padding: 20px 24px;
676
+ margin-bottom: 20px;
677
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
678
+ transition: all 0.2s ease;
679
+ position: relative;
680
+ }
681
+
682
+ .search-sort-controls-modern:hover {
683
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
684
+ border-color: #d1d5db;
685
+ }
686
+
687
+ .search-section {
688
+ min-width: 0; /* Allow flex item to shrink */
689
+ }
690
+
691
+ .sort-section {
692
+ flex-shrink: 0; /* Prevent sort section from shrinking */
693
+ }
694
+
695
+ .sort-label {
696
+ white-space: nowrap;
697
+ font-size: 14px;
698
+ }
699
+
700
+ /* Responsive design for combined controls */
701
+ @media (max-width: 768px) {
702
+ .search-sort-controls-modern .d-flex {
703
+ flex-direction: column;
704
+ gap: 16px !important;
705
+ }
706
+
707
+ .search-section {
708
+ width: 100% !important;
709
+ max-width: none !important;
710
+ flex-shrink: 1 !important;
711
+ }
712
+
713
+ .sort-section {
714
+ justify-content: center;
715
+ width: 100%;
716
+ margin-left: 0 !important;
717
+ }
718
+ }
719
+
720
+ @media (max-width: 576px) {
721
+ .search-section {
722
+ max-width: none !important;
723
+ }
724
+
725
+ .search-icon-wrapper {
726
+ width: 40px;
727
+ height: 40px;
728
+ }
729
+
730
+ .search-icon-wrapper i {
731
+ font-size: 18px;
732
+ }
733
+ }
734
+
735
+ /* Modern Search Input */
736
+ .activity-search-input {
737
+ border: 1px solid #e5e7eb;
738
+ border-radius: 12px;
739
+ padding: 12px 16px;
740
+ font-size: 14px;
741
+ transition: all 0.2s ease;
742
+ background: #f9fafb;
743
+ }
744
+
745
+ .activity-search-input:focus {
746
+ border-color: #3b82f6;
747
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
748
+ background: #ffffff;
749
+ outline: none;
750
+ }
751
+
752
+ .search-btn {
753
+ border-radius: 12px;
754
+ padding: 12px 16px;
755
+ background: linear-gradient(135deg, #3b82f6, #1d4ed8);
756
+ border: none;
757
+ color: white;
758
+ transition: all 0.2s ease;
759
+ }
760
+
761
+ .search-btn:hover {
762
+ background: linear-gradient(135deg, #2563eb, #1e40af);
763
+ transform: translateY(-1px);
764
+ box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
765
+ color: white;
766
+ }
767
+
768
+ .search-btn:focus {
769
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
770
+ color: white;
771
+ }
772
+
773
+ .search-clear-btn {
774
+ border-radius: 0 8px 8px 0;
775
+ border-left: none;
776
+ padding: 12px 16px;
777
+ transition: all 0.3s ease;
778
+ }
779
+
780
+ .search-clear-btn:hover {
781
+ background-color: #dc3545;
782
+ border-color: #dc3545;
783
+ color: white;
784
+ }
785
+
786
+ .search-results-count {
787
+ display: block;
788
+ margin-top: 8px;
789
+ font-size: 12px;
790
+ font-style: italic;
791
+ }
792
+
793
+ @media (max-width: 768px) {
794
+ .container {
795
+ max-width: 98% !important;
796
+ width: 98% !important;
797
+ padding-left: 10px !important;
798
+ padding-right: 10px !important;
799
+ }
800
+
801
+ .stat-value {
802
+ font-size: 1.5rem;
803
+ }
804
+
805
+ .table-custom {
806
+ font-size: 0.9rem;
807
+ }
808
+
809
+ .table-custom th, .table-custom td {
810
+ padding: 10px 6px;
811
+ }
812
+
813
+ .badge-custom {
814
+ font-size: 0.8rem;
815
+ padding: 4px 8px;
816
+ }
817
+ }
818
+
819
+ @media (max-width: 576px) {
820
+ .container {
821
+ max-width: 100% !important;
822
+ width: 100% !important;
823
+ padding-left: 5px !important;
824
+ padding-right: 5px !important;
825
+ }
826
+
827
+ .table-custom {
828
+ font-size: 0.8rem;
829
+ }
830
+
831
+ .table-custom th, .table-custom td {
832
+ padding: 8px 4px;
833
+ white-space: normal;
834
+ }
835
+ }
836
+
837
+ /* Merge Information Styles */
838
+ .merge-info-section {
839
+ margin-bottom: 1.5rem;
840
+ }
841
+
842
+ .merge-info-card {
843
+ background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
844
+ border: 1px solid #e3f2fd;
845
+ border-radius: 12px;
846
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
847
+ overflow: hidden;
848
+ transition: all 0.3s ease;
849
+ }
850
+
851
+ .merge-info-card:hover {
852
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
853
+ transform: translateY(-1px);
854
+ }
855
+
856
+ .merge-info-header {
857
+ padding: 16px 20px;
858
+ background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
859
+ border-bottom: 1px solid rgba(23, 162, 184, 0.2);
860
+ cursor: pointer;
861
+ transition: all 0.3s ease;
862
+ user-select: none;
863
+ }
864
+
865
+ .merge-info-header:hover {
866
+ background: linear-gradient(135deg, #d1ecf1 0%, #e8f4f8 100%);
867
+ }
868
+
869
+ .merge-icon-wrapper {
870
+ width: 40px;
871
+ height: 40px;
872
+ background: linear-gradient(135deg, #17a2b8, #138496);
873
+ border-radius: 10px;
874
+ display: flex;
875
+ align-items: center;
876
+ justify-content: center;
877
+ box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
878
+ }
879
+
880
+ .merge-icon-wrapper i {
881
+ color: white;
882
+ font-size: 18px;
883
+ }
884
+
885
+ .merge-title {
886
+ font-size: 16px;
887
+ font-weight: 600;
888
+ color: #2c3e50;
889
+ margin-bottom: 2px;
890
+ }
891
+
892
+ .merge-subtitle {
893
+ font-size: 13px;
894
+ color: #6c757d;
895
+ }
896
+
897
+ .merge-count-badge {
898
+ font-size: 13px;
899
+ font-weight: 500;
900
+ padding: 6px 12px;
901
+ border-radius: 20px;
902
+ background: linear-gradient(135deg, #007bff, #0056b3) !important;
903
+ box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
904
+ }
905
+
906
+ .collapse-icon {
907
+ font-size: 16px;
908
+ color: #6c757d;
909
+ transition: transform 0.3s ease;
910
+ }
911
+
912
+ .merge-info-header[aria-expanded="true"] .collapse-icon {
913
+ transform: rotate(180deg);
914
+ }
915
+
916
+ .merge-info-body {
917
+ padding: 20px;
918
+ background: #ffffff;
919
+ }
920
+
921
+ .merge-directories-header h6 {
922
+ color: #495057;
923
+ font-weight: 600;
924
+ font-size: 15px;
925
+ }
926
+
927
+ .merged-directories-list {
928
+ max-height: 200px;
929
+ overflow-y: auto;
930
+ overflow-x: hidden;
931
+ padding: 12px;
932
+ padding-right: 8px; /* Make room for scrollbar */
933
+ background: #f8f9fa;
934
+ border-radius: 8px;
935
+ border: 1px solid #e9ecef;
936
+ font-family: 'Courier New', monospace;
937
+ line-height: 1.6;
938
+ /* Force scrollbar to always be visible when content overflows */
939
+ scrollbar-width: thin;
940
+ scrollbar-color: #c1c1c1 #f1f1f1;
941
+ }
942
+
943
+ .directory-list-item {
944
+ display: flex;
945
+ align-items: center;
946
+ padding: 6px 8px;
947
+ margin-bottom: 4px;
948
+ background: white;
949
+ border-radius: 4px;
950
+ border: 1px solid #e9ecef;
951
+ transition: all 0.2s ease;
952
+ }
953
+
954
+ .directory-list-item:hover {
955
+ background: #e3f2fd;
956
+ border-color: #17a2b8;
957
+ transform: translateX(4px);
958
+ }
959
+
960
+ .directory-list-item:last-child {
961
+ margin-bottom: 0;
962
+ }
963
+
964
+ /* Property Search Container Styles */
965
+ .property-search-container {
966
+ position: relative;
967
+ display: flex;
968
+ align-items: center;
969
+ width: 100%;
970
+ }
971
+
972
+ .property-search-input {
973
+ border-radius: 25px !important;
974
+ border: 1px solid #dee2e6 !important;
975
+ padding: 8px 45px 8px 16px !important;
976
+ font-size: 14px;
977
+ transition: all 0.3s ease;
978
+ background-color: #ffffff;
979
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
980
+ }
981
+
982
+ .property-search-input:focus {
983
+ border-color: #007bff !important;
984
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
985
+ outline: none;
986
+ }
987
+
988
+ .property-search-input::placeholder {
989
+ color: #6c757d;
990
+ font-style: italic;
991
+ }
992
+
993
+ .property-search-icon-btn {
994
+ position: absolute;
995
+ right: 8px;
996
+ top: 50%;
997
+ transform: translateY(-50%);
998
+ background: none;
999
+ border: none;
1000
+ color: #6c757d;
1001
+ font-size: 16px;
1002
+ padding: 4px 8px;
1003
+ cursor: pointer;
1004
+ transition: color 0.3s ease;
1005
+ z-index: 10;
1006
+ }
1007
+
1008
+ .property-search-icon-btn.search-btn:hover {
1009
+ color: #495057 !important;
1010
+ background: rgba(0, 0, 0, 0.04) !important;
1011
+ border-radius: 4px !important;
1012
+ transform: translateY(-50%) !important;
1013
+ box-shadow: none !important;
1014
+ }
1015
+
1016
+ .property-search-icon-btn.search-btn:focus {
1017
+ outline: none;
1018
+ color: #495057 !important;
1019
+ background: rgba(0, 0, 0, 0.04) !important;
1020
+ border-radius: 4px !important;
1021
+ transform: translateY(-50%) !important;
1022
+ box-shadow: none !important;
1023
+ }
1024
+
1025
+ .directory-list-item .directory-index {
1026
+ font-weight: 600;
1027
+ color: #17a2b8;
1028
+ margin-right: 8px;
1029
+ min-width: 25px;
1030
+ font-size: 14px;
1031
+ }
1032
+
1033
+ /* Activities Coverage table styling */
1034
+ .table-activities thead {
1035
+ background-color: #007bff !important;
1036
+ color: white;
1037
+ }
1038
+
1039
+ .table-activities .sort-icon {
1040
+ color: #ffffff !important;
1041
+ text-shadow: 0 0 3px rgba(0,0,0,0.4);
1042
+ }
1043
+
1044
+ .activities-sort-icon {
1045
+ cursor: pointer;
1046
+ transition: all 0.3s ease;
1047
+ }
1048
+
1049
+ .activities-sort-icon:hover {
1050
+ transform: scale(1.1);
1051
+ }
1052
+
1053
+ .table-activities .sort-icon:hover {
1054
+ opacity: 1;
1055
+ transform: scale(1.2);
1056
+ text-shadow: 0 0 5px rgba(0,0,0,0.6);
1057
+ }
1058
+
1059
+ .table-activities .activities-sort-icon:hover {
1060
+ opacity: 1;
1061
+ transform: scale(1.2);
1062
+ text-shadow: 0 0 5px rgba(0,0,0,0.6);
1063
+ }
1064
+
1065
+ /* Column widths for activities table */
1066
+ .table-activities th:nth-child(1), .table-activities td:nth-child(1) { /* Activity Name */
1067
+ width: 70%;
1068
+ min-width: 300px;
1069
+ text-align: left;
1070
+ padding-left: 180px;
1071
+ }
1072
+
1073
+ .table-activities th:nth-child(2), .table-activities td:nth-child(2) { /* Visit Count */
1074
+ width: 30%;
1075
+ min-width: 150px;
1076
+ text-align: center;
1077
+ }
1078
+
1079
+ .activity-name {
1080
+ font-weight: 500;
1081
+ color: #374151;
1082
+ font-size: 14px;
1083
+ }
1084
+
1085
+ /* Activities Coverage table styling */
1086
+ .table-activities thead {
1087
+ background-color: #007bff !important;
1088
+ color: white;
1089
+ }
1090
+
1091
+ .table-activities .sort-icon {
1092
+ color: #ffffff !important;
1093
+ text-shadow: 0 0 3px rgba(0,0,0,0.4);
1094
+ }
1095
+
1096
+ .directory-list-item .directory-name {
1097
+ font-size: 14px;
1098
+ color: #2c3e50;
1099
+ word-break: break-all;
1100
+ flex: 1;
1101
+ }
1102
+
1103
+ .merged-directories-list::-webkit-scrollbar {
1104
+ width: 8px;
1105
+ }
1106
+
1107
+ .merged-directories-list::-webkit-scrollbar-track {
1108
+ background: #f1f1f1;
1109
+ border-radius: 4px;
1110
+ margin: 2px;
1111
+ }
1112
+
1113
+ .merged-directories-list::-webkit-scrollbar-thumb {
1114
+ background: #17a2b8;
1115
+ border-radius: 4px;
1116
+ border: 1px solid #f1f1f1;
1117
+ min-height: 20px;
1118
+ }
1119
+
1120
+ .merged-directories-list::-webkit-scrollbar-thumb:hover {
1121
+ background: #138496;
1122
+ border-color: #e9ecef;
1123
+ }
1124
+
1125
+ .merged-directories-list::-webkit-scrollbar-thumb:active {
1126
+ background: #0f6674;
1127
+ }
1128
+
1129
+ /* Scroll indicator for merged directories */
1130
+ .merged-directories-container {
1131
+ position: relative;
1132
+ }
1133
+
1134
+ .merged-directories-container::after {
1135
+ content: "";
1136
+ position: absolute;
1137
+ top: 0;
1138
+ right: 0;
1139
+ width: 2px;
1140
+ height: 100%;
1141
+ background: linear-gradient(to bottom, transparent 0%, rgba(23, 162, 184, 0.3) 50%, transparent 100%);
1142
+ pointer-events: none;
1143
+ opacity: 0;
1144
+ transition: opacity 0.3s ease;
1145
+ }
1146
+
1147
+ .merged-directories-container:hover::after {
1148
+ opacity: 1;
1149
+ }
1150
+
1151
+ /* Animation for collapse */
1152
+ .collapse {
1153
+ transition: height 0.35s ease;
1154
+ }
1155
+
1156
+ /* Responsive adjustments */
1157
+ @media (max-width: 768px) {
1158
+ .merged-directories-list {
1159
+ font-size: 13px;
1160
+ }
1161
+
1162
+ .directory-list-item .directory-name {
1163
+ font-size: 13px;
1164
+ }
1165
+
1166
+ .merge-info-header {
1167
+ padding: 12px 16px;
1168
+ }
1169
+
1170
+ .merge-info-body {
1171
+ padding: 16px;
1172
+ }
1173
+
1174
+ .merge-icon-wrapper {
1175
+ width: 36px;
1176
+ height: 36px;
1177
+ }
1178
+
1179
+ .merge-title {
1180
+ font-size: 14px;
1181
+ }
1182
+
1183
+ .merge-subtitle {
1184
+ font-size: 12px;
1185
+ }
1186
+
1187
+ .directory-name {
1188
+ font-size: 14px;
1189
+ }
1190
+
1191
+ .directory-index {
1192
+ font-size: 12px;
1193
+ }
1194
+
1195
+ .directory-icon {
1196
+ width: 32px;
1197
+ height: 32px;
1198
+ }
1199
+
1200
+ .directory-icon i {
1201
+ font-size: 14px;
1202
+ }
1203
+ }
1204
+ </style>
1205
+ </head>
1206
+
1207
+ <body>
1208
+ <!-- Header -->
1209
+ <header class="header text-center">
1210
+ <div class="container">
1211
+ <h1><i class="bi bi-bug"></i> Kea2 Merged Test Report</h1>
1212
+ <p class="lead">Test Time: {{ timestamp }}</p>
1213
+ </div>
1214
+ </header>
1215
+
1216
+ <div class="container mb-5">
1217
+ <!-- Test Summary -->
1218
+ <div class="row mb-4">
1219
+ <div class="col-12">
1220
+ <div class="summary-card">
1221
+ <h2 class="section-title">Test Summary</h2>
1222
+
1223
+ <!-- Statistics Cards -->
1224
+ <div class="row g-4">
1225
+ <div class="col-lg-2 col-md-4 col-sm-6">
1226
+ <div class="text-center">
1227
+ <i class="bi bi-bug text-danger" style="font-size: 2rem;"></i>
1228
+ <span class="stat-value value-danger">{{ bugs_found }}</span>
1229
+ <span class="stat-label">Property Violations</span>
1230
+ </div>
1231
+ </div>
1232
+ <div class="col-lg-2 col-md-4 col-sm-6">
1233
+ <div class="text-center">
1234
+ <i class="bi bi-x-circle text-danger" style="font-size: 2rem;"></i>
1235
+ <span class="stat-value value-danger">{{ total_crash_count|default(0) }}</span>
1236
+ <span class="stat-label">Crashes</span>
1237
+ </div>
1238
+ </div>
1239
+ <div class="col-lg-2 col-md-4 col-sm-6">
1240
+ <div class="text-center">
1241
+ <i class="bi bi-clock text-warning" style="font-size: 2rem;"></i>
1242
+ <span class="stat-value value-warning">{{ total_anr_count|default(0) }}</span>
1243
+ <span class="stat-label">ANRs</span>
1244
+ </div>
1245
+ </div>
1246
+ <div class="col-lg-2 col-md-4 col-sm-6">
1247
+ <div class="text-center">
1248
+ <i class="bi bi-pie-chart text-info" style="font-size: 2rem;"></i>
1249
+ <span class="stat-value value-highlight">{{ "%.2f"|format(coverage_percent) }}%</span>
1250
+ <span class="stat-label">Activity Coverage</span>
1251
+ </div>
1252
+ </div>
1253
+ <div class="col-lg-2 col-md-4 col-sm-6">
1254
+ <div class="text-center">
1255
+ <i class="bi bi-list-check text-primary" style="font-size: 2rem;"></i>
1256
+ <span class="stat-value value-highlight">{{ all_properties_count }}</span>
1257
+ <span class="stat-label">All Properties</span>
1258
+ </div>
1259
+ </div>
1260
+ <div class="col-lg-2 col-md-4 col-sm-6">
1261
+ <div class="text-center">
1262
+ <i class="bi bi-check-square text-success" style="font-size: 2rem;"></i>
1263
+ <span class="stat-value value-success">{{ executed_properties_count }}</span>
1264
+ <span class="stat-label">Executed Properties</span>
1265
+ </div>
1266
+ </div>
1267
+ </div>
1268
+
1269
+ <!-- Merge Information Section -->
1270
+ {% if merge_info %}
1271
+ <div class="merge-info-section mt-4">
1272
+ <div class="merge-info-card">
1273
+ <!-- Collapsible Header -->
1274
+ <div class="merge-info-header" data-bs-toggle="collapse" data-bs-target="#mergeInfoCollapse" aria-expanded="false" aria-controls="mergeInfoCollapse">
1275
+ <div class="d-flex align-items-center justify-content-between">
1276
+ <div class="d-flex align-items-center">
1277
+ <div class="merge-icon-wrapper me-3">
1278
+ <i class="bi bi-layers"></i>
1279
+ </div>
1280
+ <div>
1281
+ <h6 class="mb-0 merge-title">Merged Report</h6>
1282
+ <small class="text-muted merge-subtitle">
1283
+ <i class="bi bi-clock me-1"></i>
1284
+ Generated at {{ merge_info.merge_timestamp }}
1285
+ </small>
1286
+ </div>
1287
+ </div>
1288
+ <div class="d-flex align-items-center">
1289
+ <span class="badge bg-primary me-3 merge-count-badge">
1290
+ <i class="bi bi-folder2-open me-1"></i>
1291
+ {{ merge_info.source_count }} directories
1292
+ </span>
1293
+ <i class="bi bi-chevron-down collapse-icon"></i>
1294
+ </div>
1295
+ </div>
1296
+ </div>
1297
+
1298
+ <!-- Collapsible Content -->
1299
+ <div class="collapse" id="mergeInfoCollapse">
1300
+ <div class="merge-info-body">
1301
+ <div class="merge-directories-header">
1302
+ <h6 class="mb-3">
1303
+ <i class="bi bi-list-ul me-2"></i>
1304
+ Merged Directories
1305
+ </h6>
1306
+ </div>
1307
+ <div class="merged-directories-container">
1308
+ <div class="merged-directories-list">
1309
+ {% for dir_name in merge_info.source_directories %}
1310
+ <div class="directory-list-item">
1311
+ <span class="directory-index">{{ loop.index }}.</span>
1312
+ <span class="directory-name">{{ dir_name }}</span>
1313
+ </div>
1314
+ {% endfor %}
1315
+ </div>
1316
+ </div>
1317
+ </div>
1318
+ </div>
1319
+ </div>
1320
+ </div>
1321
+ {% endif %}
1322
+ </div>
1323
+ </div>
1324
+ </div>
1325
+
1326
+ <!-- Activities Coverage -->
1327
+ <div class="section-block">
1328
+ <h2 class="section-title">Activities Coverage</h2>
1329
+
1330
+ <!-- Search Controls for Activities -->
1331
+ <div class="mb-4">
1332
+ <div class="d-flex align-items-center">
1333
+ <div style="width: 33%;">
1334
+ <div class="property-search-container">
1335
+ <input type="text" class="form-control property-search-input property-stats-search-simple"
1336
+ id="activities-search"
1337
+ placeholder="Search activities by name..."
1338
+ data-target="activities-container"
1339
+ data-item-class="activity-row"
1340
+ data-pagination="activities-pagination"
1341
+ data-page-size="activities-page-size">
1342
+ <button class="property-search-icon-btn search-btn" type="button" id="activities-search-btn">
1343
+ <i class="bi bi-search"></i>
1344
+ </button>
1345
+ </div>
1346
+ </div>
1347
+ <div class="ms-3">
1348
+ <small class="text-muted search-results-count" id="activities-search-results"></small>
1349
+ </div>
1350
+ </div>
1351
+ </div>
1352
+
1353
+ <div class="table-responsive">
1354
+ <table class="table table-custom table-activities">
1355
+ <thead>
1356
+ <tr>
1357
+ <th>Activity Name <span class="badge bg-primary ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ tested_activities_count }}/{{ total_activities_count }}</span></th>
1358
+ <th>Visit Count <i class="bi bi-arrow-down-up text-muted sort-icon activities-sort-icon" id="visit-count-sort" data-column="visit-count" data-order="none" style="cursor: pointer;"></i></th>
1359
+ </tr>
1360
+ </thead>
1361
+ <tbody id="activities-container">
1362
+ {% if total_activities|length > 0 %}
1363
+ {% for activity in total_activities %}
1364
+ <tr class="activity-row" data-page="1"
1365
+ data-activity-name="{{ activity }}"
1366
+ data-visit-count="{{ activity_count_history[activity] if activity in activity_count_history else 0 }}">
1367
+ <td>
1368
+ {% if activity in tested_activities %}
1369
+ <i class="bi bi-check-circle-fill text-success me-2"></i>
1370
+ {% else %}
1371
+ <i class="bi bi-dash-circle text-secondary me-2"></i>
1372
+ {% endif %}
1373
+ <span class="activity-name">{{ activity }}</span>
1374
+ </td>
1375
+ <td>
1376
+ {% if activity in activity_count_history %}
1377
+ <span class="badge bg-info text-white">
1378
+ <i class="bi bi-eye"></i> {{ activity_count_history[activity] }} times
1379
+ </span>
1380
+ {% else %}
1381
+ <span class="badge bg-secondary text-white">
1382
+ <i class="bi bi-dash"></i> 0 times
1383
+ </span>
1384
+ {% endif %}
1385
+ </td>
1386
+ </tr>
1387
+ {% endfor %}
1388
+ {% else %}
1389
+ <tr>
1390
+ <td colspan="2" class="text-center text-muted">No activities found</td>
1391
+ </tr>
1392
+ {% endif %}
1393
+ </tbody>
1394
+ </table>
1395
+ </div>
1396
+
1397
+ <!-- Pagination for Activities -->
1398
+ <div class="d-flex justify-content-between align-items-center mt-3">
1399
+ <div class="d-flex align-items-center">
1400
+ <label for="activities-page-size" class="form-label me-2 mb-0">Show:</label>
1401
+ <select class="form-select form-select-sm" id="activities-page-size" style="width: auto;">
1402
+ <option value="5">5</option>
1403
+ <option value="10" selected>10</option>
1404
+ <option value="20">20</option>
1405
+ <option value="50">50</option>
1406
+ <option value="100">100</option>
1407
+ </select>
1408
+ </div>
1409
+ <nav aria-label="Activities pagination">
1410
+ <ul class="pagination pagination-sm mb-0" id="activities-pagination">
1411
+ <!-- Pagination will be generated by JavaScript -->
1412
+ </ul>
1413
+ </nav>
1414
+ </div>
1415
+ </div>
1416
+
1417
+ <!-- Crash Analysis Section -->
1418
+ {% if crash_events or anr_events %}
1419
+ <div class="section-block">
1420
+ <h2 class="section-title">
1421
+ <i class="bi bi-exclamation-triangle text-danger"></i> Crash and ANR Events
1422
+ </h2>
1423
+
1424
+ <!-- Detailed Crash Information -->
1425
+ <div class="crash-analysis-panel">
1426
+ <!-- Event Filter -->
1427
+ <div class="mb-3">
1428
+ <div class="btn-group" role="group" aria-label="Event filter">
1429
+ <input type="radio" class="btn-check" name="event-filter" id="all-events" autocomplete="off" checked>
1430
+ <label class="btn btn-outline-primary" for="all-events">All Events ({{ (crash_events|length) + (anr_events|length) }})</label>
1431
+
1432
+ <input type="radio" class="btn-check" name="event-filter" id="crashes-only" autocomplete="off">
1433
+ <label class="btn btn-outline-danger" for="crashes-only">Crashes Only ({{ crash_events|length }})</label>
1434
+
1435
+ <input type="radio" class="btn-check" name="event-filter" id="anr-only" autocomplete="off">
1436
+ <label class="btn btn-outline-warning" for="anr-only">ANR Only ({{ anr_events|length }})</label>
1437
+ </div>
1438
+ </div>
1439
+
1440
+
1441
+ <!-- Events Table -->
1442
+ <div class="table-responsive">
1443
+ <table class="table table-custom">
1444
+ <thead>
1445
+ <tr>
1446
+ <th>Type</th>
1447
+ <th>Time</th>
1448
+ <th>Exception</th>
1449
+ <th>Process</th>
1450
+ <th>Report Source</th>
1451
+ <th>Details</th>
1452
+ </tr>
1453
+ </thead>
1454
+ <tbody id="crash-events-container">
1455
+ {% for crash in crash_events %}
1456
+ <tr class="event-row" data-type="crash" data-page="1">
1457
+ <td><span class="badge bg-danger">CRASH</span></td>
1458
+ <td>{{ crash.time }}</td>
1459
+ <td>{{ crash.exception_type }}</td>
1460
+ <td>{{ crash.process }}</td>
1461
+ <td>
1462
+ {% if crash.report_path %}
1463
+ <a href="{{ crash.report_path }}" target="_blank" class="text-decoration-none">
1464
+ <span class="badge bg-info text-white me-2 mb-1"
1465
+ style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em; cursor: pointer;"
1466
+ title="Click to open original report"
1467
+ onmouseover="this.style.backgroundColor='#0056b3'" onmouseout="this.style.backgroundColor='#0dcaf0'">
1468
+ <i class="bi bi-folder me-1"></i>{{ crash.source_directory or 'Unknown' }}
1469
+ <i class="bi bi-box-arrow-up-right ms-1" style="font-size: 0.7em;"></i>
1470
+ </span>
1471
+ </a>
1472
+ {% elif crash.source_directory %}
1473
+ <span class="badge bg-info text-white me-2 mb-1"
1474
+ style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em;">
1475
+ <i class="bi bi-folder me-1"></i>{{ crash.source_directory }}
1476
+ </span>
1477
+ {% else %}
1478
+ <span class="text-muted">N/A</span>
1479
+ {% endif %}
1480
+ </td>
1481
+ <td>
1482
+ <button class="btn btn-sm btn-outline-primary" type="button"
1483
+ data-bs-toggle="collapse" data-bs-target="#crash-detail-{{ loop.index }}"
1484
+ aria-expanded="false" aria-controls="crash-detail-{{ loop.index }}">
1485
+ <i class="bi bi-eye"></i> Details
1486
+ </button>
1487
+ <button class="btn btn-sm btn-outline-secondary copy-stack-btn"
1488
+ data-stack-index="{{ loop.index }}">
1489
+ <i class="bi bi-clipboard"></i> Copy
1490
+ </button>
1491
+ </td>
1492
+ </tr>
1493
+ <tr class="collapse" id="crash-detail-{{ loop.index }}">
1494
+ <td colspan="6">
1495
+ <div class="bg-light p-3 rounded">
1496
+ <h6 class="text-danger">Stack Trace:</h6>
1497
+ <pre class="text-danger mb-0 text-start" id="stack-trace-{{ loop.index }}" style="font-size: 0.9em; white-space: pre-wrap; text-align: left;">{{ crash.stack_trace }}</pre>
1498
+ </div>
1499
+ </td>
1500
+ </tr>
1501
+ {% endfor %}
1502
+
1503
+
1504
+ {% for anr in anr_events %}
1505
+ <tr class="event-row" data-type="anr" data-page="1">
1506
+ <td><span class="badge bg-warning text-dark">ANR</span></td>
1507
+ <td>{{ anr.time }}</td>
1508
+ <td>{{ anr.reason }}</td>
1509
+ <td>{{ anr.process }}</td>
1510
+ <td>
1511
+ {% if anr.report_path %}
1512
+ <a href="{{ anr.report_path }}" target="_blank" class="text-decoration-none">
1513
+ <span class="badge bg-info text-white me-2 mb-1"
1514
+ style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em; cursor: pointer;"
1515
+ title="Click to open original report"
1516
+ onmouseover="this.style.backgroundColor='#0056b3'" onmouseout="this.style.backgroundColor='#0dcaf0'">
1517
+ <i class="bi bi-folder me-1"></i>{{ anr.source_directory or 'Unknown' }}
1518
+ <i class="bi bi-box-arrow-up-right ms-1" style="font-size: 0.7em;"></i>
1519
+ </span>
1520
+ </a>
1521
+ {% elif anr.source_directory %}
1522
+ <span class="badge bg-info text-white me-2 mb-1"
1523
+ style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em;">
1524
+ <i class="bi bi-folder me-1"></i>{{ anr.source_directory }}
1525
+ </span>
1526
+ {% else %}
1527
+ <span class="text-muted">N/A</span>
1528
+ {% endif %}
1529
+ </td>
1530
+ <td>
1531
+ <button class="btn btn-sm btn-outline-primary" type="button"
1532
+ data-bs-toggle="collapse" data-bs-target="#anr-detail-{{ loop.index }}"
1533
+ aria-expanded="false" aria-controls="anr-detail-{{ loop.index }}">
1534
+ <i class="bi bi-eye"></i> Details
1535
+ </button>
1536
+ <button class="btn btn-sm btn-outline-secondary copy-stack-btn"
1537
+ data-stack-index="anr-{{ loop.index }}">
1538
+ <i class="bi bi-clipboard"></i> Copy
1539
+ </button>
1540
+ </td>
1541
+ </tr>
1542
+ <tr class="collapse" id="anr-detail-{{ loop.index }}">
1543
+ <td colspan="6">
1544
+ <div class="bg-light p-3 rounded">
1545
+ <h6 class="text-dark">ANR Details:</h6>
1546
+ <pre class="text-dark mb-0 text-start" id="stack-trace-anr-{{ loop.index }}" style="font-size: 0.9em; white-space: pre-wrap; text-align: left;">{{ anr.trace }}</pre>
1547
+ </div>
1548
+ </td>
1549
+ </tr>
1550
+ {% endfor %}
1551
+ </tbody>
1552
+ </table>
1553
+ </div>
1554
+
1555
+ <!-- Pagination for Crash Events -->
1556
+ <div class="pagination-container d-flex justify-content-between align-items-center mt-3">
1557
+ <div class="d-flex align-items-center">
1558
+ <label for="events-page-size" class="form-label me-2 mb-0">Show:</label>
1559
+ <select class="form-select form-select-sm" id="events-page-size" style="width: auto;">
1560
+ <option value="5">5</option>
1561
+ <option value="10" selected>10</option>
1562
+ <option value="20">20</option>
1563
+ <option value="50">50</option>
1564
+ <option value="100">100</option>
1565
+ </select>
1566
+ </div>
1567
+ <nav aria-label="Crash Events Pagination">
1568
+ <ul class="pagination pagination-sm mb-0" id="events-pagination">
1569
+ <!-- Pagination will be generated by JavaScript -->
1570
+ </ul>
1571
+ </nav>
1572
+ </div>
1573
+ </div>
1574
+ </div>
1575
+ {% else %}
1576
+ <div class="section-block">
1577
+ <h2 class="section-title">
1578
+ <i class="bi bi-exclamation-triangle text-danger"></i> Crash and ANR Events
1579
+ </h2>
1580
+ <div class="alert alert-info text-center">
1581
+ <i class="bi bi-info-circle"></i> No crash or ANR events detected in this test session.
1582
+ </div>
1583
+ </div>
1584
+ {% endif %}
1585
+
1586
+ <!-- Property Checking Statistics -->
1587
+ <div class="section-block">
1588
+ <h2 class="section-title">Property Checking Statistics</h2>
1589
+
1590
+ <!-- Search Controls for Property Statistics -->
1591
+ <div class="mb-4">
1592
+ <div style="width: 33%;">
1593
+ <div class="property-search-container">
1594
+ <input type="text" class="form-control property-search-input property-stats-search-simple"
1595
+ id="property-stats-search"
1596
+ placeholder="Search properties by name..."
1597
+ data-target="property-stats-container"
1598
+ data-item-class="property-stat-row"
1599
+ data-pagination="stats-pagination"
1600
+ data-page-size="stats-page-size">
1601
+ <button class="property-search-icon-btn search-btn" type="button"
1602
+ data-target="property-stats-search">
1603
+ <i class="bi bi-search"></i>
1604
+ </button>
1605
+ </div>
1606
+ </div>
1607
+ <small class="text-muted search-results-count" id="property-search-results"></small>
1608
+ </div>
1609
+
1610
+ <div class="table-responsive">
1611
+ <table class="table table-custom">
1612
+ <thead>
1613
+ <tr>
1614
+ <th>Index</th>
1615
+ <th>Property Name <span class="badge bg-primary ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_properties if property_stats_summary is defined else property_stats|length }}</span></th>
1616
+ <th>Precondition Satisfied <span class="badge bg-success ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_precond_satisfied if property_stats_summary is defined else 0 }}</span></th>
1617
+ <th>Total Executions <span class="badge bg-info ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_executed if property_stats_summary is defined else 0 }}</span></th>
1618
+ <th>Passes <span class="badge bg-secondary ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_passes if property_stats_summary is defined else 0 }}</span></th>
1619
+ <th>Fails <span class="badge bg-danger ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_fails if property_stats_summary is defined else 0 }}</span> <i class="bi bi-arrow-down-up text-muted sort-icon" id="fails-sort" data-column="fails" data-order="none" style="cursor: pointer;"></i></th>
1620
+ <th>Errors <span class="badge bg-warning ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_errors if property_stats_summary is defined else 0 }}</span> <i class="bi bi-arrow-down-up text-muted sort-icon" id="errors-sort" data-column="errors" data-order="none" style="cursor: pointer;"></i></th>
1621
+ <th>Skipped <span class="badge bg-light text-dark ms-2" style="font-size: 0.9rem; font-weight: 600;">{{ property_stats_summary.total_not_executed if property_stats_summary is defined else 0 }}</span></th>
1622
+ </tr>
1623
+ </thead>
1624
+ <tbody id="property-stats-container">
1625
+ {% for property_name, test_result in property_stats.items() %}
1626
+ <tr class="property-stat-row" data-page="1"
1627
+ data-index="{{ loop.index }}"
1628
+ data-property-name="{{ property_name }}"
1629
+ data-precond-satisfied="{{ test_result.precond_satisfied|default(0) }}"
1630
+ data-executed="{{ test_result.executed_total|default(test_result.executed|default(0)) }}"
1631
+ data-pass="{{ test_result.pass_count|default(0) }}"
1632
+ data-fails="{{ test_result.fail|default(0) }}"
1633
+ data-errors="{{ test_result.error|default(0) }}"
1634
+ data-not-executed="{{ test_result.not_executed|default(0) }}">
1635
+ <td>{{ loop.index }}</td>
1636
+ <td><span class="badge bg-light text-dark badge-custom">{{ property_name }}</span></td>
1637
+ <td>{{ test_result.precond_satisfied|default(0) }}</td>
1638
+ <td>{{ test_result.executed_total|default(test_result.executed|default(0)) }}</td>
1639
+ <td>{{ test_result.pass_count|default(0) }}</td>
1640
+ <td><span class="badge bg-danger text-white">{{ test_result.fail|default(0) }}</span></td>
1641
+ <td><span class="badge bg-warning text-dark">{{ test_result.error|default(0) }}</span></td>
1642
+ <td>{{ test_result.not_executed|default(0) }}</td>
1643
+ </tr>
1644
+ {% endfor %}
1645
+ </tbody>
1646
+ </table>
1647
+
1648
+ <!-- Pagination for Property Checking Statistics -->
1649
+ <div class="d-flex justify-content-between align-items-center mt-3">
1650
+ <div class="d-flex align-items-center">
1651
+ <label for="stats-page-size" class="form-label me-2 mb-0">Show:</label>
1652
+ <select class="form-select form-select-sm" id="stats-page-size" style="width: auto;">
1653
+ <option value="5">5</option>
1654
+ <option value="10" selected>10</option>
1655
+ <option value="20">20</option>
1656
+ <option value="50">50</option>
1657
+ <option value="100">100</option>
1658
+ </select>
1659
+ </div>
1660
+ <nav aria-label="Property Stats Pagination">
1661
+ <ul class="pagination pagination-sm mb-0" id="stats-pagination">
1662
+ <!-- Pagination will be generated by JavaScript -->
1663
+ </ul>
1664
+ </nav>
1665
+ </div>
1666
+ </div>
1667
+ </div>
1668
+
1669
+ <!-- Property Source Mapping -->
1670
+ {% if property_source_mapping %}
1671
+ <div class="section-block">
1672
+ <h2 class="section-title">
1673
+ <i class="bi bi-folder2-open text-info"></i> Property Source Mapping
1674
+ </h2>
1675
+
1676
+ <div class="alert alert-info mb-4" style="border-left: 4px solid #17a2b8; background-color: #f8f9fa;">
1677
+ <div class="d-flex align-items-start">
1678
+ <i class="bi bi-info-circle me-2 mt-1"></i>
1679
+ <div>
1680
+ <strong>Source Directory Information:</strong>
1681
+ <p class="mb-0 mt-1">This section shows which test directories contain properties with failures or errors.
1682
+ Use this information to locate the original test reports for detailed error analysis.</p>
1683
+ </div>
1684
+ </div>
1685
+ </div>
1686
+
1687
+ <!-- Search Controls for Property Source Mapping -->
1688
+ <div class="mb-4">
1689
+ <div style="width: 33%;">
1690
+ <div class="property-search-container">
1691
+ <input type="text" class="form-control property-search-input property-stats-search-simple"
1692
+ id="property-source-search"
1693
+ placeholder="Search properties by name..."
1694
+ data-target="property-source-container"
1695
+ data-item-class="property-source-row"
1696
+ data-pagination="source-pagination"
1697
+ data-page-size="source-page-size">
1698
+ <button class="property-search-icon-btn search-btn" type="button"
1699
+ data-target="property-source-search">
1700
+ <i class="bi bi-search"></i>
1701
+ </button>
1702
+ </div>
1703
+ </div>
1704
+ <small class="text-muted search-results-count" id="property-source-search-results"></small>
1705
+ </div>
1706
+
1707
+ <div class="table-responsive">
1708
+ <table class="table table-custom">
1709
+ <thead>
1710
+ <tr>
1711
+ <th>Index</th>
1712
+ <th>Property Name</th>
1713
+ <th>Source Directories</th>
1714
+ </tr>
1715
+ </thead>
1716
+ <tbody id="property-source-container">
1717
+ {% for property_name, source_dirs in property_source_mapping.items() %}
1718
+ <tr class="property-source-row" data-page="1"
1719
+ data-index="{{ loop.index }}"
1720
+ data-property-name="{{ property_name }}">
1721
+ <td>{{ loop.index }}</td>
1722
+ <td>
1723
+ <span class="badge bg-light text-dark badge-custom">{{ property_name }}</span>
1724
+ </td>
1725
+ <td>
1726
+ {% set max_visible = 3 %}
1727
+ {% if source_dirs|length <= max_visible %}
1728
+ <!-- Show all directories if count is small -->
1729
+ {% for dir_info in source_dirs %}
1730
+ {% if dir_info.report_path %}
1731
+ <a href="{{ dir_info.report_path }}" target="_blank" class="text-decoration-none">
1732
+ <span class="badge bg-info text-white me-2 mb-1" style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em; cursor: pointer;"
1733
+ title="Click to open original report"
1734
+ onmouseover="this.style.backgroundColor='#0056b3'" onmouseout="this.style.backgroundColor='#0dcaf0'">
1735
+ <i class="bi bi-folder me-1"></i>{{ dir_info.dir_name }}
1736
+ <i class="bi bi-box-arrow-up-right ms-1" style="font-size: 0.7em;"></i>
1737
+ </span>
1738
+ </a>
1739
+ {% else %}
1740
+ <span class="badge bg-info text-white me-2 mb-1" style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em;">
1741
+ <i class="bi bi-folder me-1"></i>{{ dir_info.dir_name }}
1742
+ </span>
1743
+ {% endif %}
1744
+ {% endfor %}
1745
+ {% else %}
1746
+ <!-- Show limited directories with expand/collapse -->
1747
+ <div class="source-dirs-container" data-property="{{ property_name }}">
1748
+ <!-- Always visible directories -->
1749
+ {% for dir_info in source_dirs[:max_visible] %}
1750
+ {% if dir_info.report_path %}
1751
+ <a href="{{ dir_info.report_path }}" target="_blank" class="text-decoration-none">
1752
+ <span class="badge bg-info text-white me-2 mb-1" style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em; cursor: pointer;"
1753
+ title="Click to open original report"
1754
+ onmouseover="this.style.backgroundColor='#0056b3'" onmouseout="this.style.backgroundColor='#0dcaf0'">
1755
+ <i class="bi bi-folder me-1"></i>{{ dir_info.dir_name }}
1756
+ <i class="bi bi-box-arrow-up-right ms-1" style="font-size: 0.7em;"></i>
1757
+ </span>
1758
+ </a>
1759
+ {% else %}
1760
+ <span class="badge bg-info text-white me-2 mb-1" style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em;">
1761
+ <i class="bi bi-folder me-1"></i>{{ dir_info.dir_name }}
1762
+ </span>
1763
+ {% endif %}
1764
+ {% endfor %}
1765
+
1766
+ <!-- Hidden directories -->
1767
+ <div class="source-dirs-hidden" id="hidden-dirs-{{ loop.index }}" style="display: none;">
1768
+ {% for dir_info in source_dirs[max_visible:] %}
1769
+ {% if dir_info.report_path %}
1770
+ <a href="{{ dir_info.report_path }}" target="_blank" class="text-decoration-none">
1771
+ <span class="badge bg-info text-white me-2 mb-1" style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em; cursor: pointer;"
1772
+ title="Click to open original report"
1773
+ onmouseover="this.style.backgroundColor='#0056b3'" onmouseout="this.style.backgroundColor='#0dcaf0'">
1774
+ <i class="bi bi-folder me-1"></i>{{ dir_info.dir_name }}
1775
+ <i class="bi bi-box-arrow-up-right ms-1" style="font-size: 0.7em;"></i>
1776
+ </span>
1777
+ </a>
1778
+ {% else %}
1779
+ <span class="badge bg-info text-white me-2 mb-1" style="font-family: 'Courier New', monospace; font-size: 0.8em; padding: 0.4em 0.6em;">
1780
+ <i class="bi bi-folder me-1"></i>{{ dir_info.dir_name }}
1781
+ </span>
1782
+ {% endif %}
1783
+ {% endfor %}
1784
+ </div>
1785
+
1786
+ <!-- Toggle button -->
1787
+ <button class="btn btn-sm btn-outline-info source-dirs-toggle"
1788
+ data-target="hidden-dirs-{{ loop.index }}"
1789
+ data-total="{{ source_dirs|length }}"
1790
+ data-visible="{{ max_visible }}"
1791
+ style="font-size: 0.75em; padding: 0.2em 0.5em; margin-left: 0.25em;">
1792
+ <i class="bi bi-chevron-down"></i>
1793
+ <span class="toggle-text">+{{ source_dirs|length - max_visible }} more</span>
1794
+ </button>
1795
+ </div>
1796
+ {% endif %}
1797
+ </td>
1798
+ </tr>
1799
+ {% endfor %}
1800
+ </tbody>
1801
+ </table>
1802
+
1803
+ <!-- Pagination for Property Source Mapping -->
1804
+ <div class="d-flex justify-content-between align-items-center mt-3">
1805
+ <div class="d-flex align-items-center">
1806
+ <label for="source-page-size" class="form-label me-2 mb-0">Show:</label>
1807
+ <select class="form-select form-select-sm" id="source-page-size" style="width: auto;">
1808
+ <option value="5">5</option>
1809
+ <option value="10" selected>10</option>
1810
+ <option value="20">20</option>
1811
+ <option value="50">50</option>
1812
+ <option value="100">100</option>
1813
+ </select>
1814
+ </div>
1815
+ <nav aria-label="Property Source Pagination">
1816
+ <ul class="pagination pagination-sm mb-0" id="source-pagination">
1817
+ <!-- Pagination will be generated by JavaScript -->
1818
+ </ul>
1819
+ </nav>
1820
+ </div>
1821
+ </div>
1822
+ </div>
1823
+ {% endif %}
1824
+ </div>
1825
+
1826
+ <!-- Footer -->
1827
+ <footer class="bg-dark text-white text-center py-4">
1828
+ <div class="container">
1829
+ <p class="mb-0">Kea2 Merged Test Report | Generated at: {{ timestamp }}</p>
1830
+ </div>
1831
+ </footer>
1832
+
1833
+ <!-- JavaScript -->
1834
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
1835
+ <script>
1836
+ document.addEventListener('DOMContentLoaded', function() {
1837
+ // Initialize merge info collapse functionality
1838
+ initMergeInfoCollapse();
1839
+
1840
+ // Initialize merged directories scrollbar enhancement
1841
+ initMergedDirectoriesScrollbar();
1842
+
1843
+ // Initialize pagination for Activities
1844
+ initPagination('activities-container', 'activity-row', 'activities-pagination', 'activities-page-size');
1845
+
1846
+ // Initialize activity sorting
1847
+ initActivitiesSorting();
1848
+
1849
+ // Initialize activity searching
1850
+ initActivitiesSearching();
1851
+
1852
+ // Initialize activities page size selector
1853
+ initActivitiesPageSize();
1854
+
1855
+ // Initialize property statistics searching
1856
+ initPropertySearching();
1857
+
1858
+ // Initialize pagination for Property tables
1859
+ initPagination('property-stats-container', 'property-stat-row', 'stats-pagination', 'stats-page-size');
1860
+
1861
+ // Initialize sorting for Property Checking Statistics
1862
+ initSorting();
1863
+
1864
+ // Initialize property source mapping searching and pagination
1865
+ initPropertySourceSearching();
1866
+ initPagination('property-source-container', 'property-source-row', 'source-pagination', 'source-page-size');
1867
+
1868
+ // Initialize source directories expand/collapse functionality
1869
+ initSourceDirsToggle();
1870
+
1871
+ // Initialize crash events functionality (only if crash analysis section exists)
1872
+ setTimeout(function() {
1873
+ const crashContainer = document.getElementById('crash-events-container');
1874
+ if (crashContainer) {
1875
+ initCrashAnalysis();
1876
+ // Pagination will be set up automatically by initEventFiltering
1877
+ }
1878
+ }, 100);
1879
+
1880
+ function setupCrashEventsPagination() {
1881
+ const container = document.getElementById('crash-events-container');
1882
+ const paginationElement = document.getElementById('events-pagination');
1883
+ const pageSizeSelect = document.getElementById('events-page-size');
1884
+
1885
+ if (!container || !paginationElement || !pageSizeSelect) {
1886
+ return;
1887
+ }
1888
+
1889
+ const allEventRows = Array.from(container.querySelectorAll('.event-row'));
1890
+
1891
+ // Get currently filtered visible rows (those not hidden by filter)
1892
+ const filteredRows = allEventRows.filter(row => {
1893
+ // Check if row should be visible based on current filter
1894
+ const eventType = row.dataset.type;
1895
+ const currentFilter = getCurrentFilter();
1896
+
1897
+ switch(currentFilter) {
1898
+ case 'all-events':
1899
+ return true;
1900
+ case 'crashes-only':
1901
+ return eventType === 'crash';
1902
+ case 'anr-only':
1903
+ return eventType === 'anr';
1904
+ default:
1905
+ return true;
1906
+ }
1907
+ });
1908
+
1909
+ const pageSize = parseInt(pageSizeSelect.value) || 10;
1910
+ const totalPages = Math.ceil(filteredRows.length / pageSize);
1911
+
1912
+ // Clear pagination first
1913
+ paginationElement.innerHTML = '';
1914
+
1915
+ // Show/hide pagination container based on whether pagination is needed
1916
+ const paginationContainer = paginationElement.closest('.pagination-container');
1917
+ if (paginationContainer) {
1918
+ if (totalPages > 1) {
1919
+ paginationContainer.style.display = '';
1920
+ } else {
1921
+ paginationContainer.style.display = 'none';
1922
+ }
1923
+ }
1924
+
1925
+ // Hide all rows first
1926
+ allEventRows.forEach(row => {
1927
+ row.style.display = 'none';
1928
+ const detailRow = row.nextElementSibling;
1929
+ if (detailRow && detailRow.classList.contains('collapse')) {
1930
+ detailRow.style.display = 'none';
1931
+ }
1932
+ });
1933
+
1934
+ // Show only the first page of filtered rows
1935
+ for (let i = 0; i < Math.min(pageSize, filteredRows.length); i++) {
1936
+ const row = filteredRows[i];
1937
+ row.style.display = '';
1938
+ const detailRow = row.nextElementSibling;
1939
+ if (detailRow && detailRow.classList.contains('collapse')) {
1940
+ detailRow.style.display = '';
1941
+ }
1942
+ }
1943
+
1944
+ // Create pagination if needed
1945
+ if (totalPages > 1) {
1946
+ createPaginationControls(totalPages, 1);
1947
+ }
1948
+
1949
+ function getCurrentFilter() {
1950
+ const filterButtons = document.querySelectorAll('input[name="event-filter"]');
1951
+ for (let button of filterButtons) {
1952
+ if (button.checked) {
1953
+ return button.id;
1954
+ }
1955
+ }
1956
+ return 'all-events'; // default
1957
+ }
1958
+
1959
+ function createPaginationControls(totalPages, currentPage) {
1960
+ paginationElement.innerHTML = '';
1961
+
1962
+ // Previous button
1963
+ const prevLi = document.createElement('li');
1964
+ prevLi.className = 'page-item' + (currentPage === 1 ? ' disabled' : '');
1965
+ prevLi.innerHTML = '<a class="page-link" href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>';
1966
+ prevLi.addEventListener('click', function(e) {
1967
+ e.preventDefault();
1968
+ if (currentPage > 1) {
1969
+ showCrashEventsPage(currentPage - 1, totalPages);
1970
+ }
1971
+ });
1972
+ paginationElement.appendChild(prevLi);
1973
+
1974
+ // Page numbers
1975
+ for (let i = 1; i <= totalPages; i++) {
1976
+ const pageLi = document.createElement('li');
1977
+ pageLi.className = i === currentPage ? 'page-item active' : 'page-item';
1978
+ pageLi.innerHTML = `<a class="page-link" href="#">${i}</a>`;
1979
+ pageLi.addEventListener('click', function(e) {
1980
+ e.preventDefault();
1981
+ showCrashEventsPage(i, totalPages);
1982
+ });
1983
+ paginationElement.appendChild(pageLi);
1984
+ }
1985
+
1986
+ // Next button
1987
+ const nextLi = document.createElement('li');
1988
+ nextLi.className = 'page-item' + (currentPage === totalPages ? ' disabled' : '');
1989
+ nextLi.innerHTML = '<a class="page-link" href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>';
1990
+ nextLi.addEventListener('click', function(e) {
1991
+ e.preventDefault();
1992
+ if (currentPage < totalPages) {
1993
+ showCrashEventsPage(currentPage + 1, totalPages);
1994
+ }
1995
+ });
1996
+ paginationElement.appendChild(nextLi);
1997
+ }
1998
+
1999
+ function showCrashEventsPage(pageNum, totalPages) {
2000
+ // Get current page size
2001
+ const currentPageSize = parseInt(pageSizeSelect.value) || 10;
2002
+
2003
+ // Recalculate filtered rows based on current filter
2004
+ const currentFilteredRows = allEventRows.filter(row => {
2005
+ const eventType = row.dataset.type;
2006
+ const currentFilter = getCurrentFilter();
2007
+
2008
+ switch(currentFilter) {
2009
+ case 'all-events':
2010
+ return true;
2011
+ case 'crashes-only':
2012
+ return eventType === 'crash';
2013
+ case 'anr-only':
2014
+ return eventType === 'anr';
2015
+ default:
2016
+ return true;
2017
+ }
2018
+ });
2019
+
2020
+ const startIndex = (pageNum - 1) * currentPageSize;
2021
+ const endIndex = startIndex + currentPageSize;
2022
+
2023
+ // Hide all rows first
2024
+ allEventRows.forEach(row => {
2025
+ row.style.display = 'none';
2026
+ const detailRow = row.nextElementSibling;
2027
+ if (detailRow && detailRow.classList.contains('collapse')) {
2028
+ detailRow.style.display = 'none';
2029
+ }
2030
+ });
2031
+
2032
+ // Show only the rows for current page
2033
+ for (let i = startIndex; i < endIndex && i < currentFilteredRows.length; i++) {
2034
+ const row = currentFilteredRows[i];
2035
+ row.style.display = '';
2036
+ const detailRow = row.nextElementSibling;
2037
+ if (detailRow && detailRow.classList.contains('collapse')) {
2038
+ detailRow.style.display = '';
2039
+ }
2040
+ }
2041
+
2042
+ // Update pagination controls and container visibility
2043
+ const paginationContainer = paginationElement.closest('.pagination-container');
2044
+ if (paginationContainer) {
2045
+ if (totalPages > 1) {
2046
+ paginationContainer.style.display = '';
2047
+ createPaginationControls(totalPages, pageNum);
2048
+ } else {
2049
+ paginationContainer.style.display = 'none';
2050
+ paginationElement.innerHTML = '';
2051
+ }
2052
+ }
2053
+ }
2054
+ }
2055
+
2056
+ // Activity sorting function
2057
+ function initActivitySorting() {
2058
+ const sortButtons = document.querySelectorAll('.activity-sort-btn');
2059
+
2060
+ sortButtons.forEach(function(button) {
2061
+ button.addEventListener('click', function() {
2062
+ const sortType = this.dataset.sort;
2063
+ const currentOrder = this.dataset.order;
2064
+ const parentTab = this.closest('.tab-pane');
2065
+ const isTestedTab = parentTab.id === 'tested-activities';
2066
+
2067
+ // Toggle sort order
2068
+ const newOrder = currentOrder === 'asc' ? 'desc' : 'asc';
2069
+
2070
+ this.dataset.order = newOrder;
2071
+ const icon = this.querySelector('.sort-icon');
2072
+
2073
+ if (newOrder === 'asc') {
2074
+ icon.className = 'bi bi-arrow-up sort-icon btn-arrow';
2075
+ } else {
2076
+ icon.className = 'bi bi-arrow-down sort-icon btn-arrow';
2077
+ }
2078
+
2079
+ // Sort activities
2080
+ sortActivities(sortType, newOrder, isTestedTab);
2081
+ });
2082
+ });
2083
+
2084
+ function sortActivities(sortType, order, isTestedTab) {
2085
+ const containerId = isTestedTab ? 'tested-activities-container' : 'all-activities-container';
2086
+ const itemClass = isTestedTab ? 'tested-activity' : 'all-activity';
2087
+ const paginationId = isTestedTab ? 'tested-pagination' : 'all-pagination';
2088
+ const pageSizeSelectId = isTestedTab ? 'tested-page-size' : 'all-page-size';
2089
+
2090
+ const container = document.getElementById(containerId);
2091
+ const items = Array.from(container.getElementsByClassName(itemClass));
2092
+
2093
+ // Check if there's an active search
2094
+ const searchInputId = isTestedTab ? 'tested-activity-search' : 'all-activity-search';
2095
+ const searchInput = document.getElementById(searchInputId);
2096
+ const hasActiveSearch = searchInput && searchInput.value.trim() !== '';
2097
+ const searchTerm = hasActiveSearch ? searchInput.value.toLowerCase().trim() : '';
2098
+
2099
+ // Store current search visibility state before sorting
2100
+ const searchStates = new Map();
2101
+ if (hasActiveSearch) {
2102
+ items.forEach(function(item) {
2103
+ const searchVisible = item.getAttribute('data-search-visible');
2104
+ searchStates.set(item, searchVisible);
2105
+ });
2106
+ }
2107
+
2108
+ // Sort all items
2109
+ items.sort(function(a, b) {
2110
+ const badgeA = a.querySelector('.traversal-badge');
2111
+ const badgeB = b.querySelector('.traversal-badge');
2112
+
2113
+ // Extract traversal count from badge text like " 5 times"
2114
+ const valueA = badgeA ? parseInt(badgeA.textContent.match(/\d+/)[0]) || 0 : 0;
2115
+ const valueB = badgeB ? parseInt(badgeB.textContent.match(/\d+/)[0]) || 0 : 0;
2116
+
2117
+ if (order === 'asc') {
2118
+ return valueA - valueB;
2119
+ } else {
2120
+ return valueB - valueA;
2121
+ }
2122
+ });
2123
+
2124
+ // Clear container and append sorted items
2125
+ container.innerHTML = '';
2126
+ items.forEach(function(item) {
2127
+ container.appendChild(item);
2128
+ });
2129
+
2130
+ // Restore search state and apply filtering
2131
+ if (hasActiveSearch) {
2132
+ let visibleCount = 0;
2133
+ items.forEach(function(item) {
2134
+ const activityNameElement = item.querySelector('.activity-name');
2135
+ if (activityNameElement) {
2136
+ const activityName = activityNameElement.textContent.toLowerCase();
2137
+
2138
+ if (activityName.includes(searchTerm)) {
2139
+ item.setAttribute('data-search-visible', 'true');
2140
+ visibleCount++;
2141
+ } else {
2142
+ item.setAttribute('data-search-visible', 'false');
2143
+ }
2144
+ }
2145
+ });
2146
+
2147
+ // Update search results count
2148
+ const resultsElement = document.getElementById(searchInput.id.replace('-search', '-search-results'));
2149
+ if (resultsElement) {
2150
+ resultsElement.textContent = `Found ${visibleCount} of ${items.length} activities`;
2151
+ }
2152
+
2153
+ // Re-initialize pagination with filtered results
2154
+ initPagination(containerId, itemClass, paginationId, pageSizeSelectId);
2155
+ } else {
2156
+ // No active search, just re-initialize pagination
2157
+ initPagination(containerId, itemClass, paginationId, pageSizeSelectId);
2158
+ }
2159
+ }
2160
+ }
2161
+
2162
+ // Simplified sorting function for Fails and Errors columns
2163
+ function initSorting() {
2164
+ // Exclude activities sort icons to avoid conflicts
2165
+ const sortIcons = document.querySelectorAll('.sort-icon:not(.activities-sort-icon)');
2166
+
2167
+ console.log('initSorting: Found', sortIcons.length, 'sort icons (excluding activities)');
2168
+
2169
+ sortIcons.forEach(function(icon) {
2170
+ icon.addEventListener('click', function() {
2171
+ const column = this.dataset.column;
2172
+ const currentOrder = this.dataset.order;
2173
+
2174
+ // Reset all other sort icons
2175
+ sortIcons.forEach(function(otherIcon) {
2176
+ if (otherIcon !== icon) {
2177
+ otherIcon.dataset.order = 'none';
2178
+ otherIcon.className = 'bi bi-arrow-down-up sort-icon';
2179
+ otherIcon.style.color = '#6c757d';
2180
+ }
2181
+ });
2182
+
2183
+ // Toggle current sort order
2184
+ let newOrder;
2185
+ if (currentOrder === 'none' || currentOrder === 'desc') {
2186
+ newOrder = 'asc';
2187
+ this.className = 'bi bi-arrow-up sort-icon active asc';
2188
+ this.style.color = '#28a745';
2189
+ } else {
2190
+ newOrder = 'desc';
2191
+ this.className = 'bi bi-arrow-down sort-icon active desc';
2192
+ this.style.color = '#dc3545';
2193
+ }
2194
+
2195
+ this.dataset.order = newOrder;
2196
+ sortTable(column, newOrder);
2197
+ });
2198
+ });
2199
+
2200
+ function sortTable(column, order) {
2201
+ const container = document.getElementById('property-stats-container');
2202
+ const rows = Array.from(container.getElementsByClassName('property-stat-row'));
2203
+
2204
+ rows.sort(function(a, b) {
2205
+ let valueA, valueB;
2206
+
2207
+ if (column === 'fails') {
2208
+ valueA = parseInt(a.dataset.fails);
2209
+ valueB = parseInt(b.dataset.fails);
2210
+ } else if (column === 'errors') {
2211
+ valueA = parseInt(a.dataset.errors);
2212
+ valueB = parseInt(b.dataset.errors);
2213
+ }
2214
+
2215
+ if (order === 'asc') {
2216
+ return valueA - valueB;
2217
+ } else {
2218
+ return valueB - valueA;
2219
+ }
2220
+ });
2221
+
2222
+ // Clear container and append sorted rows
2223
+ container.innerHTML = '';
2224
+ rows.forEach(function(row) {
2225
+ container.appendChild(row);
2226
+ });
2227
+
2228
+ // Re-initialize pagination after sorting
2229
+ initPagination('property-stats-container', 'property-stat-row', 'stats-pagination', 'stats-page-size');
2230
+ }
2231
+ }
2232
+
2233
+ // Function to handle page navigation
2234
+ function goToPage(pageNumber, containerId, itemClass, itemsPerPage, paginationId) {
2235
+ const container = document.getElementById(containerId);
2236
+ const allItems = Array.from(container.getElementsByClassName(itemClass));
2237
+ const paginationElement = document.getElementById(paginationId);
2238
+
2239
+ // Get items that should be visible based on search filter
2240
+ const filteredItems = allItems.filter(item => {
2241
+ const searchVisible = item.getAttribute('data-search-visible');
2242
+ const shouldShow = searchVisible === null || searchVisible === 'true';
2243
+ return shouldShow;
2244
+ });
2245
+
2246
+ // Update pagination active state
2247
+ if (paginationElement) {
2248
+ const pageItems = paginationElement.getElementsByClassName('page-item');
2249
+ const totalPages = Math.max(1, Math.ceil(filteredItems.length / itemsPerPage));
2250
+
2251
+ for (let i = 0; i < pageItems.length; i++) {
2252
+ const pageText = pageItems[i].textContent.trim();
2253
+ if (pageText === pageNumber.toString()) {
2254
+ pageItems[i].className = 'page-item active';
2255
+ } else if (pageText !== '«' && pageText !== '»') {
2256
+ pageItems[i].className = 'page-item';
2257
+ } else if (pageText === '«') {
2258
+ // Previous button
2259
+ pageItems[i].className = pageNumber <= 1 ? 'page-item disabled' : 'page-item';
2260
+ } else if (pageText === '»') {
2261
+ // Next button
2262
+ pageItems[i].className = pageNumber >= totalPages ? 'page-item disabled' : 'page-item';
2263
+ }
2264
+ }
2265
+ }
2266
+
2267
+ // Hide all items first
2268
+ allItems.forEach((item, index) => {
2269
+ item.style.display = 'none';
2270
+ });
2271
+
2272
+ // Show items for current page (only from filtered items)
2273
+ const startIndex = (pageNumber - 1) * itemsPerPage;
2274
+ const endIndex = Math.min(startIndex + itemsPerPage, filteredItems.length);
2275
+
2276
+ for (let i = startIndex; i < endIndex; i++) {
2277
+ if (filteredItems[i]) {
2278
+ filteredItems[i].style.display = '';
2279
+ }
2280
+ }
2281
+ }
2282
+
2283
+ // Pagination initialization function
2284
+ function initPagination(containerId, itemClass, paginationId, pageSizeSelectId) {
2285
+ const container = document.getElementById(containerId);
2286
+ const pageSizeSelect = document.getElementById(pageSizeSelectId);
2287
+ if (!container) return;
2288
+
2289
+ // Remove existing event listener to prevent duplicate bindings
2290
+ if (pageSizeSelect && !pageSizeSelect.hasAttribute('data-listener-bound')) {
2291
+ pageSizeSelect.addEventListener('change', function() {
2292
+ const newItemsPerPage = parseInt(this.value);
2293
+ renderPagination();
2294
+ goToPage(1, containerId, itemClass, newItemsPerPage, paginationId);
2295
+ });
2296
+ // Mark as having listener bound
2297
+ pageSizeSelect.setAttribute('data-listener-bound', 'true');
2298
+ }
2299
+
2300
+ function renderPagination() {
2301
+ const allItems = Array.from(container.getElementsByClassName(itemClass));
2302
+
2303
+ // Always get current page size from select element
2304
+ const currentPageSizeSelect = document.getElementById(pageSizeSelectId);
2305
+ const currentItemsPerPage = currentPageSizeSelect ? parseInt(currentPageSizeSelect.value) : 10;
2306
+
2307
+ // Use same filtering logic as goToPage function
2308
+ const filteredItems = allItems.filter(item => {
2309
+ const searchVisible = item.getAttribute('data-search-visible');
2310
+ // If no search filter is applied, show all items
2311
+ return searchVisible === null || searchVisible === 'true';
2312
+ });
2313
+
2314
+ const totalItems = filteredItems.length;
2315
+ const totalPages = Math.max(1, Math.ceil(totalItems / currentItemsPerPage));
2316
+
2317
+ // Create pagination
2318
+ const paginationElement = document.getElementById(paginationId);
2319
+ if (!paginationElement) return;
2320
+
2321
+ // Clear pagination
2322
+ paginationElement.innerHTML = '';
2323
+
2324
+ // Don't show pagination if there's only one page or no items
2325
+ if (totalPages <= 1) {
2326
+ // Hide the entire pagination container when not needed
2327
+ const paginationContainer = paginationElement.closest('.pagination-container');
2328
+ if (paginationContainer) {
2329
+ paginationContainer.style.display = 'none';
2330
+ }
2331
+ return;
2332
+ }
2333
+
2334
+ // Show the pagination container when needed
2335
+ const paginationContainer = paginationElement.closest('.pagination-container');
2336
+ if (paginationContainer) {
2337
+ paginationContainer.style.display = '';
2338
+ }
2339
+
2340
+ // Previous button
2341
+ const prevLi = document.createElement('li');
2342
+ prevLi.className = 'page-item disabled';
2343
+ prevLi.innerHTML = '<a class="page-link" href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>';
2344
+ prevLi.addEventListener('click', function(e) {
2345
+ e.preventDefault();
2346
+ const activePage = paginationElement.querySelector('.page-item.active');
2347
+ if (activePage) {
2348
+ const currentPageNum = parseInt(activePage.textContent.trim());
2349
+ if (currentPageNum > 1) {
2350
+ goToPage(currentPageNum - 1, containerId, itemClass, currentItemsPerPage, paginationId);
2351
+ }
2352
+ }
2353
+ });
2354
+ paginationElement.appendChild(prevLi);
2355
+
2356
+ // Add page numbers
2357
+ for (let i = 1; i <= totalPages; i++) {
2358
+ const pageLi = document.createElement('li');
2359
+ pageLi.className = i === 1 ? 'page-item active' : 'page-item';
2360
+ pageLi.innerHTML = `<a class="page-link" href="#">${i}</a>`;
2361
+ pageLi.addEventListener('click', function(e) {
2362
+ e.preventDefault();
2363
+ goToPage(i, containerId, itemClass, currentItemsPerPage, paginationId);
2364
+ });
2365
+ paginationElement.appendChild(pageLi);
2366
+ }
2367
+
2368
+ // Next button
2369
+ const nextLi = document.createElement('li');
2370
+ nextLi.className = totalPages <= 1 ? 'page-item disabled' : 'page-item';
2371
+ nextLi.innerHTML = '<a class="page-link" href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>';
2372
+ nextLi.addEventListener('click', function(e) {
2373
+ e.preventDefault();
2374
+ const activePage = paginationElement.querySelector('.page-item.active');
2375
+ if (activePage) {
2376
+ const currentPageNum = parseInt(activePage.textContent.trim());
2377
+ if (currentPageNum < totalPages) {
2378
+ goToPage(currentPageNum + 1, containerId, itemClass, currentItemsPerPage, paginationId);
2379
+ }
2380
+ }
2381
+ });
2382
+ paginationElement.appendChild(nextLi);
2383
+ }
2384
+
2385
+ // Initial render
2386
+ renderPagination();
2387
+ // Always call goToPage to ensure items are displayed correctly, even if no pagination is shown
2388
+ const currentItemsPerPage = pageSizeSelect ? parseInt(pageSizeSelect.value) : 10;
2389
+ goToPage(1, containerId, itemClass, currentItemsPerPage, paginationId);
2390
+ }
2391
+
2392
+ // Activity searching function
2393
+ function initActivitySearching() {
2394
+ const searchInputs = document.querySelectorAll('.activity-search-input');
2395
+
2396
+ searchInputs.forEach(function(searchInput) {
2397
+ const searchButton = document.querySelector('.search-btn[data-target="' + searchInput.id + '"]');
2398
+ const clearButton = document.querySelector('[data-target="' + searchInput.id + '"].search-clear-btn');
2399
+
2400
+ // Search on Enter key
2401
+ searchInput.addEventListener('keydown', function(e) {
2402
+ if (e.key === 'Enter') {
2403
+ e.preventDefault();
2404
+ performActivitySearch(this);
2405
+ } else if (e.key === 'Escape') {
2406
+ clearActivitySearch(this);
2407
+ }
2408
+ });
2409
+
2410
+ // Search button functionality
2411
+ if (searchButton) {
2412
+ searchButton.addEventListener('click', function() {
2413
+ performActivitySearch(searchInput);
2414
+ });
2415
+ }
2416
+
2417
+ // Clear button functionality
2418
+ if (clearButton) {
2419
+ clearButton.addEventListener('click', function() {
2420
+ clearActivitySearch(searchInput);
2421
+ });
2422
+ }
2423
+ });
2424
+
2425
+ function performActivitySearch(searchInput) {
2426
+ const searchTerm = searchInput.value.toLowerCase().trim();
2427
+ const containerId = searchInput.dataset.target;
2428
+ const itemClass = searchInput.dataset.itemClass;
2429
+ const paginationId = searchInput.dataset.pagination;
2430
+ const pageSizeSelectId = searchInput.dataset.pageSize;
2431
+
2432
+ const container = document.getElementById(containerId);
2433
+ const items = Array.from(container.getElementsByClassName(itemClass));
2434
+
2435
+ let visibleCount = 0;
2436
+ let totalCount = items.length;
2437
+
2438
+ // Filter items based on search term
2439
+ items.forEach(function(item) {
2440
+ const activityNameElement = item.querySelector('.activity-name');
2441
+ if (activityNameElement) {
2442
+ const activityName = activityNameElement.textContent.toLowerCase();
2443
+
2444
+ if (searchTerm === '' || activityName.includes(searchTerm)) {
2445
+ item.setAttribute('data-search-visible', 'true');
2446
+ visibleCount++;
2447
+ } else {
2448
+ item.setAttribute('data-search-visible', 'false');
2449
+ }
2450
+ }
2451
+ });
2452
+
2453
+ // Update search results count
2454
+ const resultsElement = document.getElementById(searchInput.id.replace('-search', '-search-results'));
2455
+ if (resultsElement) {
2456
+ if (searchTerm === '') {
2457
+ resultsElement.textContent = '';
2458
+ } else {
2459
+ resultsElement.textContent = `Found ${visibleCount} of ${totalCount} activities`;
2460
+ }
2461
+ }
2462
+
2463
+ // Re-initialize pagination with filtered results
2464
+ initPagination(containerId, itemClass, paginationId, pageSizeSelectId);
2465
+ }
2466
+
2467
+ function clearActivitySearch(searchInput) {
2468
+ searchInput.value = '';
2469
+ performActivitySearch(searchInput);
2470
+ }
2471
+ }
2472
+
2473
+ // Property statistics searching function
2474
+ function initPropertySearching() {
2475
+ const searchInput = document.getElementById('property-stats-search');
2476
+ const searchButton = document.querySelector('.search-btn[data-target="property-stats-search"]');
2477
+ const clearButton = document.querySelector('[data-target="property-stats-search"].search-clear-btn');
2478
+
2479
+ if (!searchInput) return;
2480
+
2481
+ // Search on Enter key
2482
+ searchInput.addEventListener('keydown', function(e) {
2483
+ if (e.key === 'Enter') {
2484
+ e.preventDefault();
2485
+ performPropertySearch(this);
2486
+ } else if (e.key === 'Escape') {
2487
+ clearPropertySearch(this);
2488
+ }
2489
+ });
2490
+
2491
+ // Search button functionality
2492
+ if (searchButton) {
2493
+ searchButton.addEventListener('click', function() {
2494
+ performPropertySearch(searchInput);
2495
+ });
2496
+ }
2497
+
2498
+ // Clear button functionality
2499
+ if (clearButton) {
2500
+ clearButton.addEventListener('click', function() {
2501
+ clearPropertySearch(searchInput);
2502
+ });
2503
+ }
2504
+
2505
+ function performPropertySearch(searchInput) {
2506
+ const searchTerm = searchInput.value.toLowerCase().trim();
2507
+ const container = document.getElementById('property-stats-container');
2508
+ const items = Array.from(container.getElementsByClassName('property-stat-row'));
2509
+
2510
+ let visibleCount = 0;
2511
+ let totalCount = items.length;
2512
+
2513
+ // Filter items based on search term
2514
+ items.forEach(function(item) {
2515
+ const propertyNameElement = item.querySelector('.badge-custom');
2516
+ if (propertyNameElement) {
2517
+ const propertyName = propertyNameElement.textContent.toLowerCase();
2518
+
2519
+ if (searchTerm === '' || propertyName.includes(searchTerm)) {
2520
+ item.setAttribute('data-search-visible', 'true');
2521
+ visibleCount++;
2522
+ } else {
2523
+ item.setAttribute('data-search-visible', 'false');
2524
+ }
2525
+ }
2526
+ });
2527
+
2528
+ // Update search results count
2529
+ const resultsElement = document.getElementById('property-search-results');
2530
+ if (resultsElement) {
2531
+ if (searchTerm === '') {
2532
+ resultsElement.textContent = '';
2533
+ } else {
2534
+ resultsElement.textContent = `Found ${visibleCount} of ${totalCount} properties`;
2535
+ }
2536
+ }
2537
+
2538
+ // Re-initialize pagination with filtered results
2539
+ initPagination('property-stats-container', 'property-stat-row', 'stats-pagination', 'stats-page-size');
2540
+ }
2541
+
2542
+ function clearPropertySearch(searchInput) {
2543
+ searchInput.value = '';
2544
+ performPropertySearch(searchInput);
2545
+ }
2546
+ }
2547
+
2548
+ // Property source mapping searching function
2549
+ function initPropertySourceSearching() {
2550
+ const searchInput = document.getElementById('property-source-search');
2551
+ const searchButton = document.querySelector('.search-btn[data-target="property-source-search"]');
2552
+ const clearButton = document.querySelector('[data-target="property-source-search"].search-clear-btn');
2553
+
2554
+ if (!searchInput) return;
2555
+
2556
+ // Search on Enter key
2557
+ searchInput.addEventListener('keydown', function(e) {
2558
+ if (e.key === 'Enter') {
2559
+ e.preventDefault();
2560
+ performPropertySourceSearch(this);
2561
+ } else if (e.key === 'Escape') {
2562
+ clearPropertySourceSearch(this);
2563
+ }
2564
+ });
2565
+
2566
+ // Search button functionality
2567
+ if (searchButton) {
2568
+ searchButton.addEventListener('click', function() {
2569
+ performPropertySourceSearch(searchInput);
2570
+ });
2571
+ }
2572
+
2573
+ // Clear button functionality
2574
+ if (clearButton) {
2575
+ clearButton.addEventListener('click', function() {
2576
+ clearPropertySourceSearch(searchInput);
2577
+ });
2578
+ }
2579
+
2580
+ function performPropertySourceSearch(searchInput) {
2581
+ const searchTerm = searchInput.value.toLowerCase().trim();
2582
+ const container = document.getElementById('property-source-container');
2583
+ const items = Array.from(container.getElementsByClassName('property-source-row'));
2584
+
2585
+ let visibleCount = 0;
2586
+ let totalCount = items.length;
2587
+
2588
+ // Filter items based on search term
2589
+ items.forEach(function(item) {
2590
+ const propertyNameElement = item.querySelector('.badge-custom');
2591
+ if (propertyNameElement) {
2592
+ const propertyName = propertyNameElement.textContent.toLowerCase();
2593
+
2594
+ if (searchTerm === '' || propertyName.includes(searchTerm)) {
2595
+ item.setAttribute('data-search-visible', 'true');
2596
+ visibleCount++;
2597
+ } else {
2598
+ item.setAttribute('data-search-visible', 'false');
2599
+ }
2600
+ }
2601
+ });
2602
+
2603
+ // Update search results count
2604
+ const resultsElement = document.getElementById('property-source-search-results');
2605
+ if (resultsElement) {
2606
+ if (searchTerm === '') {
2607
+ resultsElement.textContent = '';
2608
+ } else {
2609
+ resultsElement.textContent = `Found ${visibleCount} of ${totalCount} properties`;
2610
+ }
2611
+ }
2612
+
2613
+ // Re-initialize pagination with filtered results
2614
+ initPagination('property-source-container', 'property-source-row', 'source-pagination', 'source-page-size');
2615
+ }
2616
+
2617
+ function clearPropertySourceSearch(searchInput) {
2618
+ searchInput.value = '';
2619
+ performPropertySourceSearch(searchInput);
2620
+ }
2621
+ }
2622
+
2623
+ // Activities table searching function
2624
+ function initActivitiesSearching() {
2625
+ const searchInput = document.getElementById('activities-search');
2626
+ const searchButton = document.getElementById('activities-search-btn');
2627
+
2628
+ if (!searchInput) return;
2629
+
2630
+ // Search on Enter key and clear on Escape
2631
+ searchInput.addEventListener('keydown', function(e) {
2632
+ if (e.key === 'Enter') {
2633
+ e.preventDefault();
2634
+ performActivitiesSearch(this);
2635
+ } else if (e.key === 'Escape') {
2636
+ clearActivitiesSearch(this);
2637
+ }
2638
+ });
2639
+
2640
+ // Search button functionality
2641
+ if (searchButton) {
2642
+ searchButton.addEventListener('click', function() {
2643
+ performActivitiesSearch(searchInput);
2644
+ });
2645
+ }
2646
+
2647
+ function performActivitiesSearch(searchInput) {
2648
+ const searchTerm = searchInput.value.toLowerCase().trim();
2649
+ const container = document.getElementById('activities-container');
2650
+ const rows = container.querySelectorAll('.activity-row');
2651
+ const resultsCount = document.getElementById('activities-search-results');
2652
+
2653
+ let visibleCount = 0;
2654
+
2655
+ rows.forEach(function(row) {
2656
+ const activityName = row.querySelector('.activity-name').textContent.toLowerCase();
2657
+
2658
+ // If no search term, show all rows
2659
+ if (!searchTerm) {
2660
+ row.removeAttribute('data-search-visible');
2661
+ visibleCount++;
2662
+ } else {
2663
+ const matches = activityName.includes(searchTerm);
2664
+ if (matches) {
2665
+ row.setAttribute('data-search-visible', 'true');
2666
+ visibleCount++;
2667
+ } else {
2668
+ row.setAttribute('data-search-visible', 'false');
2669
+ }
2670
+ }
2671
+ });
2672
+
2673
+ console.log('Search performed:', {searchTerm, visibleCount, totalRows: rows.length});
2674
+
2675
+ // Update results count
2676
+ if (resultsCount) {
2677
+ if (searchTerm) {
2678
+ resultsCount.textContent = `Found ${visibleCount} of ${rows.length} activities`;
2679
+ } else {
2680
+ resultsCount.textContent = '';
2681
+ }
2682
+ }
2683
+
2684
+ // Immediately show/hide rows based on search before pagination update
2685
+ rows.forEach(function(row) {
2686
+ const searchVisible = row.getAttribute('data-search-visible');
2687
+ if (searchVisible === null || searchVisible === 'true') {
2688
+ row.style.display = '';
2689
+ } else {
2690
+ row.style.display = 'none';
2691
+ }
2692
+ });
2693
+
2694
+ console.log('Rows visibility updated, calling pagination update...');
2695
+
2696
+ // Update pagination after search
2697
+ updateActivitiesPagination();
2698
+ }
2699
+
2700
+ function clearActivitiesSearch(searchInput) {
2701
+ searchInput.value = '';
2702
+ performActivitiesSearch(searchInput);
2703
+ searchInput.focus();
2704
+ }
2705
+ }
2706
+
2707
+ // Activities table sorting function - Simplified version
2708
+ function initActivitiesSorting() {
2709
+ console.log('Initializing activities sorting...');
2710
+
2711
+ // Use event delegation to avoid losing event listeners
2712
+ document.addEventListener('click', function(e) {
2713
+ // Check if clicked element is the sort icon
2714
+ if (e.target && e.target.id === 'visit-count-sort') {
2715
+ e.preventDefault();
2716
+ e.stopPropagation();
2717
+
2718
+ console.log('=== SORT CLICK EVENT START ===');
2719
+ console.log('Sort icon clicked via delegation');
2720
+
2721
+ const sortIcon = e.target;
2722
+ const currentOrder = sortIcon.dataset.order || 'none';
2723
+
2724
+ console.log('Current order:', currentOrder);
2725
+
2726
+ // Determine new order
2727
+ let newOrder;
2728
+ if (currentOrder === 'none' || currentOrder === 'desc') {
2729
+ newOrder = 'asc';
2730
+ } else {
2731
+ newOrder = 'desc';
2732
+ }
2733
+
2734
+ console.log('New order:', newOrder);
2735
+
2736
+ // Update icon appearance
2737
+ sortIcon.classList.remove('bi-arrow-down-up', 'bi-arrow-up', 'bi-arrow-down');
2738
+ sortIcon.classList.add('text-primary');
2739
+ if (newOrder === 'asc') {
2740
+ sortIcon.classList.add('bi-arrow-up');
2741
+ } else {
2742
+ sortIcon.classList.add('bi-arrow-down');
2743
+ }
2744
+
2745
+ // Store new order
2746
+ sortIcon.dataset.order = newOrder;
2747
+
2748
+ // Get container and rows
2749
+ const container = document.getElementById('activities-container');
2750
+ const rows = Array.from(container.querySelectorAll('.activity-row'));
2751
+
2752
+ console.log('Found rows for sorting:', rows.length);
2753
+
2754
+ // Sort rows
2755
+ rows.sort((a, b) => {
2756
+ const aCount = parseInt(a.dataset.visitCount) || 0;
2757
+ const bCount = parseInt(b.dataset.visitCount) || 0;
2758
+
2759
+ if (newOrder === 'asc') {
2760
+ return aCount - bCount;
2761
+ } else {
2762
+ return bCount - aCount;
2763
+ }
2764
+ });
2765
+
2766
+ console.log('Rows sorted, reordering DOM');
2767
+
2768
+ // Clear container and re-append sorted rows
2769
+ container.innerHTML = '';
2770
+ rows.forEach(function(row) {
2771
+ container.appendChild(row);
2772
+ });
2773
+
2774
+ console.log('DOM reordered, updating pagination');
2775
+
2776
+ // Update pagination after sorting
2777
+ updateActivitiesPagination();
2778
+
2779
+ console.log('=== SORT CLICK EVENT END ===');
2780
+ }
2781
+ });
2782
+
2783
+ console.log('Activities sorting initialized with event delegation');
2784
+ }
2785
+
2786
+ // Function to update Activities pagination after sorting
2787
+ function updateActivitiesPagination() {
2788
+ const container = document.getElementById('activities-container');
2789
+ const pageSizeSelect = document.getElementById('activities-page-size');
2790
+ const paginationElement = document.getElementById('activities-pagination');
2791
+
2792
+ if (!container || !paginationElement) return;
2793
+
2794
+ const allRows = Array.from(container.querySelectorAll('.activity-row'));
2795
+ const itemsPerPage = pageSizeSelect ? parseInt(pageSizeSelect.value) : 10;
2796
+
2797
+ // Filter visible rows (considering search)
2798
+ const visibleRows = allRows.filter(row => {
2799
+ const searchVisible = row.getAttribute('data-search-visible');
2800
+ return searchVisible === null || searchVisible === 'true';
2801
+ });
2802
+
2803
+ const totalItems = visibleRows.length;
2804
+ const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
2805
+
2806
+ console.log('Updating pagination:', {totalItems, itemsPerPage, totalPages});
2807
+
2808
+ // Get pagination container
2809
+ const paginationContainer = paginationElement.closest('.d-flex');
2810
+
2811
+ // Don't show pagination if there's only one page or no items
2812
+ if (totalPages <= 1) {
2813
+ if (paginationContainer) {
2814
+ paginationContainer.style.display = 'none';
2815
+ }
2816
+ // Show visible rows and hide invisible rows
2817
+ allRows.forEach(row => {
2818
+ const searchVisible = row.getAttribute('data-search-visible');
2819
+ if (searchVisible === null || searchVisible === 'true') {
2820
+ row.style.display = '';
2821
+ } else {
2822
+ row.style.display = 'none';
2823
+ }
2824
+ });
2825
+ return;
2826
+ }
2827
+
2828
+ // Show pagination container
2829
+ if (paginationContainer) {
2830
+ paginationContainer.style.display = '';
2831
+ }
2832
+
2833
+ // Clear existing pagination
2834
+ paginationElement.innerHTML = '';
2835
+
2836
+ // Previous button
2837
+ const prevLi = document.createElement('li');
2838
+ prevLi.className = 'page-item disabled';
2839
+ prevLi.innerHTML = '<a class="page-link" href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>';
2840
+ paginationElement.appendChild(prevLi);
2841
+
2842
+ // Create pagination buttons
2843
+ for (let i = 1; i <= totalPages; i++) {
2844
+ const li = document.createElement('li');
2845
+ li.className = `page-item ${i === 1 ? 'active' : ''}`;
2846
+
2847
+ const a = document.createElement('a');
2848
+ a.className = 'page-link';
2849
+ a.href = '#';
2850
+ a.textContent = i;
2851
+ a.addEventListener('click', function(e) {
2852
+ e.preventDefault();
2853
+ goToActivitiesPage(i, totalPages, itemsPerPage);
2854
+ });
2855
+
2856
+ li.appendChild(a);
2857
+ paginationElement.appendChild(li);
2858
+ }
2859
+
2860
+ // Next button
2861
+ const nextLi = document.createElement('li');
2862
+ nextLi.className = totalPages <= 1 ? 'page-item disabled' : 'page-item';
2863
+ nextLi.innerHTML = '<a class="page-link" href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>';
2864
+ paginationElement.appendChild(nextLi);
2865
+
2866
+ // Add event listeners to prev/next buttons
2867
+ const prevButton = paginationElement.firstChild;
2868
+ const nextButton = paginationElement.lastChild;
2869
+
2870
+ prevButton.addEventListener('click', function(e) {
2871
+ e.preventDefault();
2872
+ const activePage = paginationElement.querySelector('.page-item.active');
2873
+ if (activePage && activePage.previousElementSibling && activePage.previousElementSibling !== prevButton) {
2874
+ const pageNum = parseInt(activePage.textContent) - 1;
2875
+ if (pageNum >= 1) {
2876
+ goToActivitiesPage(pageNum, totalPages, itemsPerPage);
2877
+ }
2878
+ }
2879
+ });
2880
+
2881
+ nextButton.addEventListener('click', function(e) {
2882
+ e.preventDefault();
2883
+ const activePage = paginationElement.querySelector('.page-item.active');
2884
+ if (activePage && activePage.nextElementSibling && activePage.nextElementSibling !== nextButton) {
2885
+ const pageNum = parseInt(activePage.textContent) + 1;
2886
+ if (pageNum <= totalPages) {
2887
+ goToActivitiesPage(pageNum, totalPages, itemsPerPage);
2888
+ }
2889
+ }
2890
+ });
2891
+
2892
+ // Show first page
2893
+ goToActivitiesPage(1, totalPages, itemsPerPage);
2894
+ }
2895
+
2896
+ // Function to navigate to specific page
2897
+ function goToActivitiesPage(pageNumber, totalPages, itemsPerPage) {
2898
+ const container = document.getElementById('activities-container');
2899
+ const allRows = Array.from(container.querySelectorAll('.activity-row'));
2900
+
2901
+ // Filter visible rows (considering search)
2902
+ const visibleRows = allRows.filter(row => {
2903
+ const searchVisible = row.getAttribute('data-search-visible');
2904
+ return searchVisible === null || searchVisible === 'true';
2905
+ });
2906
+
2907
+ const startIndex = (pageNumber - 1) * itemsPerPage;
2908
+ const endIndex = startIndex + itemsPerPage;
2909
+
2910
+ console.log('Going to page:', {pageNumber, startIndex, endIndex, totalVisible: visibleRows.length});
2911
+
2912
+ // Hide all rows first
2913
+ allRows.forEach(row => {
2914
+ row.style.display = 'none';
2915
+ });
2916
+
2917
+ // Show only rows for current page
2918
+ visibleRows.slice(startIndex, endIndex).forEach(row => {
2919
+ row.style.display = '';
2920
+ });
2921
+
2922
+ // Update pagination active state
2923
+ const paginationElement = document.getElementById('activities-pagination');
2924
+ if (paginationElement) {
2925
+ const pageItems = paginationElement.querySelectorAll('.page-item');
2926
+ const prevButton = pageItems[0]; // First item is previous button
2927
+ const nextButton = pageItems[pageItems.length - 1]; // Last item is next button
2928
+
2929
+ // Update page number buttons (skip first and last which are prev/next)
2930
+ pageItems.forEach((item, index) => {
2931
+ // Skip prev/next buttons
2932
+ if (index === 0 || index === pageItems.length - 1) return;
2933
+
2934
+ const pageNum = index; // Adjusted for prev button at index 0
2935
+ if (pageNum === pageNumber) {
2936
+ item.classList.add('active');
2937
+ } else {
2938
+ item.classList.remove('active');
2939
+ }
2940
+ });
2941
+
2942
+ // Update prev/next button states
2943
+ if (prevButton) {
2944
+ if (pageNumber <= 1) {
2945
+ prevButton.classList.add('disabled');
2946
+ } else {
2947
+ prevButton.classList.remove('disabled');
2948
+ }
2949
+ }
2950
+
2951
+ if (nextButton) {
2952
+ if (pageNumber >= totalPages) {
2953
+ nextButton.classList.add('disabled');
2954
+ } else {
2955
+ nextButton.classList.remove('disabled');
2956
+ }
2957
+ }
2958
+ }
2959
+ }
2960
+
2961
+ // Initialize Activities page size selector
2962
+ function initActivitiesPageSize() {
2963
+ const pageSizeSelect = document.getElementById('activities-page-size');
2964
+
2965
+ if (!pageSizeSelect) return;
2966
+
2967
+ // Remove existing event listener to prevent duplicate bindings
2968
+ if (!pageSizeSelect.hasAttribute('data-activities-listener-bound')) {
2969
+ pageSizeSelect.addEventListener('change', function() {
2970
+ console.log('Activities page size changed to:', this.value);
2971
+ updateActivitiesPagination();
2972
+ });
2973
+ // Mark as having listener bound
2974
+ pageSizeSelect.setAttribute('data-activities-listener-bound', 'true');
2975
+ }
2976
+ }
2977
+
2978
+ // Source directories expand/collapse functionality
2979
+ function initSourceDirsToggle() {
2980
+ const toggleButtons = document.querySelectorAll('.source-dirs-toggle');
2981
+
2982
+ toggleButtons.forEach(function(button) {
2983
+ button.addEventListener('click', function() {
2984
+ const targetId = this.getAttribute('data-target');
2985
+ const hiddenDirs = document.getElementById(targetId);
2986
+ const icon = this.querySelector('.bi');
2987
+ const toggleText = this.querySelector('.toggle-text');
2988
+ const total = parseInt(this.getAttribute('data-total'));
2989
+ const visible = parseInt(this.getAttribute('data-visible'));
2990
+
2991
+ if (hiddenDirs.style.display === 'none') {
2992
+ // Show hidden directories
2993
+ hiddenDirs.style.display = 'inline';
2994
+ icon.className = 'bi bi-chevron-up';
2995
+ toggleText.textContent = 'Show less';
2996
+ this.classList.remove('btn-outline-info');
2997
+ this.classList.add('btn-outline-secondary');
2998
+ } else {
2999
+ // Hide directories
3000
+ hiddenDirs.style.display = 'none';
3001
+ icon.className = 'bi bi-chevron-down';
3002
+ toggleText.textContent = `+${total - visible} more`;
3003
+ this.classList.remove('btn-outline-secondary');
3004
+ this.classList.add('btn-outline-info');
3005
+ }
3006
+ });
3007
+ });
3008
+ }
3009
+
3010
+ function updatePaginationControls(paginationId, currentPage, totalPages, onPageClick) {
3011
+ var pagination = document.getElementById(paginationId);
3012
+ if (!pagination) return;
3013
+
3014
+ pagination.innerHTML = '';
3015
+
3016
+ if (totalPages <= 1) {
3017
+ // Hide the entire pagination container when not needed
3018
+ var paginationContainer = pagination.closest('.pagination-container');
3019
+ if (paginationContainer) {
3020
+ paginationContainer.style.display = 'none';
3021
+ }
3022
+ return;
3023
+ }
3024
+
3025
+ // Show the pagination container when needed
3026
+ var paginationContainer = pagination.closest('.pagination-container');
3027
+ if (paginationContainer) {
3028
+ paginationContainer.style.display = '';
3029
+ }
3030
+
3031
+ // Previous button
3032
+ var prevLi = document.createElement('li');
3033
+ prevLi.className = 'page-item' + (currentPage === 1 ? ' disabled' : '');
3034
+ var prevLink = document.createElement('a');
3035
+ prevLink.className = 'page-link';
3036
+ prevLink.href = '#';
3037
+ prevLink.setAttribute('aria-label', 'Previous');
3038
+ prevLink.innerHTML = '<span aria-hidden="true">&laquo;</span>';
3039
+
3040
+ prevLink.addEventListener('click', function(e) {
3041
+ e.preventDefault();
3042
+ e.stopPropagation();
3043
+ // Get current page dynamically to avoid stale closure values
3044
+ var currentActivePage = getCurrentPageNumber(paginationId);
3045
+ if (currentActivePage > 1 && !prevLi.classList.contains('disabled')) {
3046
+ onPageClick(currentActivePage - 1);
3047
+ }
3048
+ });
3049
+
3050
+ prevLi.appendChild(prevLink);
3051
+ pagination.appendChild(prevLi);
3052
+
3053
+ // Page numbers
3054
+ for (var i = 1; i <= totalPages; i++) {
3055
+ var li = document.createElement('li');
3056
+ li.className = 'page-item' + (i === currentPage ? ' active' : '');
3057
+ var link = document.createElement('a');
3058
+ link.className = 'page-link';
3059
+ link.href = '#';
3060
+ link.textContent = i;
3061
+ link.addEventListener('click', (function(page) {
3062
+ return function(e) {
3063
+ e.preventDefault();
3064
+ e.stopPropagation();
3065
+ onPageClick(page);
3066
+ };
3067
+ })(i));
3068
+ li.appendChild(link);
3069
+ pagination.appendChild(li);
3070
+ }
3071
+
3072
+ // Next button
3073
+ var nextLi = document.createElement('li');
3074
+ nextLi.className = 'page-item' + (currentPage === totalPages ? ' disabled' : '');
3075
+ var nextLink = document.createElement('a');
3076
+ nextLink.className = 'page-link';
3077
+ nextLink.href = '#';
3078
+ nextLink.setAttribute('aria-label', 'Next');
3079
+ nextLink.innerHTML = '<span aria-hidden="true">&raquo;</span>';
3080
+
3081
+ nextLink.addEventListener('click', function(e) {
3082
+ e.preventDefault();
3083
+ e.stopPropagation();
3084
+ // Get current page dynamically to avoid stale closure values
3085
+ var currentActivePage = getCurrentPageNumber(paginationId);
3086
+ if (currentActivePage < totalPages && !nextLi.classList.contains('disabled')) {
3087
+ onPageClick(currentActivePage + 1);
3088
+ }
3089
+ });
3090
+
3091
+ nextLi.appendChild(nextLink);
3092
+ pagination.appendChild(nextLi);
3093
+ }
3094
+
3095
+ function getCurrentPageNumber(paginationId) {
3096
+ var pagination = document.getElementById(paginationId);
3097
+ if (!pagination) return 1;
3098
+
3099
+ var activeItem = pagination.querySelector('.page-item.active');
3100
+ if (activeItem) {
3101
+ var pageText = activeItem.textContent.trim();
3102
+ var pageNum = parseInt(pageText);
3103
+ return isNaN(pageNum) ? 1 : pageNum;
3104
+ }
3105
+ return 1;
3106
+ }
3107
+
3108
+ function initMergeInfoCollapse() {
3109
+ // Initialize merge info collapse functionality if needed
3110
+ // This function can be expanded based on specific merge info requirements
3111
+ console.log('Merge info collapse initialized');
3112
+ }
3113
+
3114
+ function initMergedDirectoriesScrollbar() {
3115
+ const directoriesList = document.querySelector('.merged-directories-list');
3116
+ const directoriesContainer = document.querySelector('.merged-directories-container');
3117
+
3118
+ if (!directoriesList || !directoriesContainer) return;
3119
+
3120
+ // Function to check if scrollbar is needed
3121
+ function checkScrollbar() {
3122
+ const hasScrollbar = directoriesList.scrollHeight > directoriesList.clientHeight;
3123
+
3124
+ if (hasScrollbar) {
3125
+ directoriesContainer.classList.add('has-scrollbar');
3126
+ // Add scroll indicator
3127
+ if (!directoriesContainer.querySelector('.scroll-indicator')) {
3128
+ const indicator = document.createElement('div');
3129
+ indicator.className = 'scroll-indicator';
3130
+ indicator.innerHTML = '<i class="bi bi-chevron-down"></i>';
3131
+ indicator.style.cssText = `
3132
+ position: absolute;
3133
+ bottom: 5px;
3134
+ right: 5px;
3135
+ background: rgba(23, 162, 184, 0.8);
3136
+ color: white;
3137
+ border-radius: 50%;
3138
+ width: 20px;
3139
+ height: 20px;
3140
+ display: flex;
3141
+ align-items: center;
3142
+ justify-content: center;
3143
+ font-size: 10px;
3144
+ pointer-events: none;
3145
+ opacity: 0.7;
3146
+ transition: opacity 0.3s ease;
3147
+ `;
3148
+ directoriesContainer.appendChild(indicator);
3149
+ }
3150
+ } else {
3151
+ directoriesContainer.classList.remove('has-scrollbar');
3152
+ const indicator = directoriesContainer.querySelector('.scroll-indicator');
3153
+ if (indicator) {
3154
+ indicator.remove();
3155
+ }
3156
+ }
3157
+ }
3158
+
3159
+ // Check on load
3160
+ checkScrollbar();
3161
+
3162
+ // Check on window resize
3163
+ window.addEventListener('resize', checkScrollbar);
3164
+
3165
+ // Add scroll event listener to hide indicator when scrolled to bottom
3166
+ directoriesList.addEventListener('scroll', function() {
3167
+ const indicator = directoriesContainer.querySelector('.scroll-indicator');
3168
+ if (indicator) {
3169
+ const isAtBottom = this.scrollTop + this.clientHeight >= this.scrollHeight - 5;
3170
+ indicator.style.opacity = isAtBottom ? '0' : '0.7';
3171
+ }
3172
+ });
3173
+
3174
+ // Enhance scrollbar visibility on hover
3175
+ directoriesContainer.addEventListener('mouseenter', function() {
3176
+ directoriesList.style.scrollbarWidth = 'auto';
3177
+ });
3178
+
3179
+ directoriesContainer.addEventListener('mouseleave', function() {
3180
+ directoriesList.style.scrollbarWidth = 'thin';
3181
+ });
3182
+ }
3183
+
3184
+ // Crash Analysis Functions
3185
+ function initCrashAnalysis() {
3186
+ // Initialize event filtering first (this will set initial visibility)
3187
+ initEventFiltering();
3188
+
3189
+ // Initialize pagination for crash events (using specialized function)
3190
+ initCrashEventsPagination();
3191
+
3192
+ // Initialize copy stack trace functionality
3193
+ initCopyStackTrace();
3194
+ }
3195
+
3196
+ function initEventFiltering() {
3197
+ const filterButtons = document.querySelectorAll('input[name="event-filter"]');
3198
+
3199
+ filterButtons.forEach(button => {
3200
+ button.addEventListener('change', function() {
3201
+ const filterType = this.id;
3202
+ filterEvents(filterType);
3203
+ });
3204
+ });
3205
+
3206
+ // Initialize with default filter (all-events)
3207
+ filterEvents('all-events');
3208
+ }
3209
+
3210
+ function filterEvents(filterType) {
3211
+ const eventRows = document.querySelectorAll('.event-row');
3212
+
3213
+ eventRows.forEach(row => {
3214
+ const eventType = row.dataset.type;
3215
+ let shouldShow = false;
3216
+
3217
+ switch(filterType) {
3218
+ case 'all-events':
3219
+ shouldShow = true;
3220
+ break;
3221
+ case 'crashes-only':
3222
+ shouldShow = eventType === 'crash';
3223
+ break;
3224
+ case 'anr-only':
3225
+ shouldShow = eventType === 'anr';
3226
+ break;
3227
+ }
3228
+
3229
+ // Set the display style to control visibility
3230
+ row.style.display = shouldShow ? '' : 'none';
3231
+
3232
+ // Also control the corresponding detail row
3233
+ const detailRow = row.nextElementSibling;
3234
+ if (detailRow && detailRow.classList.contains('collapse')) {
3235
+ detailRow.style.display = shouldShow ? '' : 'none';
3236
+ }
3237
+ });
3238
+
3239
+ // Re-setup pagination after filtering
3240
+ setTimeout(function() {
3241
+ setupCrashEventsPagination();
3242
+ }, 10);
3243
+ }
3244
+
3245
+
3246
+
3247
+ function initCrashEventsPagination() {
3248
+ const pageSizeSelect = document.getElementById('events-page-size');
3249
+
3250
+ if (pageSizeSelect) {
3251
+ // Add event listener for page size change
3252
+ pageSizeSelect.addEventListener('change', function() {
3253
+ setupCrashEventsPagination();
3254
+ });
3255
+ }
3256
+ }
3257
+
3258
+
3259
+
3260
+
3261
+
3262
+
3263
+ function initCopyStackTrace() {
3264
+ const copyButtons = document.querySelectorAll('.copy-stack-btn');
3265
+
3266
+ copyButtons.forEach(button => {
3267
+ button.addEventListener('click', function() {
3268
+ const stackIndex = this.dataset.stackIndex;
3269
+ copyStackTrace(stackIndex);
3270
+ });
3271
+ });
3272
+ }
3273
+
3274
+ function copyStackTrace(stackIndex) {
3275
+ const stackElement = document.getElementById(`stack-trace-${stackIndex}`);
3276
+ if (!stackElement) return;
3277
+
3278
+ const stackText = stackElement.textContent;
3279
+
3280
+ if (navigator.clipboard && navigator.clipboard.writeText) {
3281
+ navigator.clipboard.writeText(stackText).then(() => {
3282
+ showCopyNotification('Stack trace copied to clipboard!');
3283
+ }).catch(err => {
3284
+ console.error('Failed to copy stack trace: ', err);
3285
+ showCopyNotification('Failed to copy stack trace', 'error');
3286
+ });
3287
+ } else {
3288
+ // Fallback for older browsers
3289
+ const textArea = document.createElement('textarea');
3290
+ textArea.value = stackText;
3291
+ document.body.appendChild(textArea);
3292
+ textArea.select();
3293
+ try {
3294
+ document.execCommand('copy');
3295
+ showCopyNotification('Stack trace copied to clipboard!');
3296
+ } catch (err) {
3297
+ console.error('Fallback copy failed: ', err);
3298
+ showCopyNotification('Failed to copy stack trace', 'error');
3299
+ }
3300
+ document.body.removeChild(textArea);
3301
+ }
3302
+ }
3303
+
3304
+ function showCopyNotification(message, type) {
3305
+ type = type || 'success';
3306
+
3307
+ // Create notification element
3308
+ const notification = document.createElement('div');
3309
+ notification.className = 'alert alert-' + (type === 'error' ? 'danger' : 'success') + ' position-fixed';
3310
+ notification.style.cssText = 'top: 20px; right: 20px; z-index: 9999; min-width: 300px; opacity: 0; transition: opacity 0.3s ease-in-out;';
3311
+ notification.innerHTML = '<i class="bi bi-' + (type === 'error' ? 'exclamation-triangle' : 'check-circle') + '"></i> ' + message;
3312
+
3313
+ document.body.appendChild(notification);
3314
+
3315
+ // Fade in animation
3316
+ setTimeout(function() {
3317
+ notification.style.opacity = '1';
3318
+ }, 10);
3319
+
3320
+ // Auto remove after 3 seconds with fade out
3321
+ setTimeout(function() {
3322
+ notification.style.opacity = '0';
3323
+ setTimeout(function() {
3324
+ if (notification.parentNode) {
3325
+ notification.parentNode.removeChild(notification);
3326
+ }
3327
+ }, 300);
3328
+ }, 3000);
3329
+ }
3330
+ });
3331
+ </script>
3332
+ </body>
3333
+ </html>