-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
3865 lines (3328 loc) · 148 KB
/
Copy pathindex.html
File metadata and controls
3865 lines (3328 loc) · 148 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Galaxy Instance Tracker</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
body {
font-family: sans-serif;
padding: 2rem;
background: #f4f4f4;
}
.header-section {
background: #fff;
padding: 1.5rem;
margin-bottom: 1rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.summary-stats {
display: flex;
gap: 1.5rem;
font-size: 1rem;
}
.stat-box {
background: #e3f2fd;
padding: 0.75rem;
border-radius: 6px;
text-align: center;
min-width: 100px;
}
.stat-number {
font-size: 1.2rem;
font-weight: bold;
color: #1976d2;
}
.online-box {
background: #e8f5e8 !important;
}
.offline-box {
background: #fff3e0 !important;
}
.spreadsheet-link {
margin: 1rem 0;
padding: 0.75rem;
background: #f5f5f5;
border-radius: 4px;
}
.search-container {
margin: 1rem 0;
}
.search-input {
width: 100%;
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
box-sizing: border-box;
}
.search-input:focus {
border-color: #2196f3;
outline: none;
box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}
table {
width: 100%;
border-collapse: collapse;
background: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
th, td {
padding: 0.75rem;
border: 1px solid #ccc;
text-align: left;
}
/* Set column widths */
th:nth-child(1), td:nth-child(1) { /* Row number column */
width: 30px;
max-width: 30px;
text-align: center;
}
th:nth-child(2), td:nth-child(2) { /* Status column */
width: 35px;
max-width: 35px;
text-align: center;
}
th:nth-child(3), td:nth-child(3) { /* Tier column */
width: 35px;
max-width: 35px;
text-align: center;
}
th:nth-child(4), td:nth-child(4) { /* Name column */
width: 200px;
max-width: 200px;
word-wrap: break-word;
overflow-wrap: break-word;
white-space: normal;
}
/* Force URL-like strings to break more aggressively in name column */
td:nth-child(4) .server-url {
word-break: break-all;
}
th:nth-child(5), td:nth-child(5) { /* Region column */
width: 100px;
max-width: 100px;
}
th:nth-child(6), td:nth-child(6) { /* Description column - flexible width */
min-width: 300px;
}
th:nth-child(7), td:nth-child(7) { /* Info column */
width: 80px;
max-width: 80px;
text-align: center;
}
th:nth-child(8), td:nth-child(8) { /* Instance column */
width: 120px;
max-width: 120px;
text-align: center;
}
th:nth-child(9), td:nth-child(9) { /* Resources column */
width: 120px;
max-width: 120px;
text-align: center;
}
th {
background: #444;
color: white;
cursor: pointer;
user-select: none;
position: relative;
}
/* Center align the status and tier column headers */
th:nth-child(1), th:nth-child(2) {
text-align: center;
}
/* Center align Info, Instance, and Resources column headers */
th:nth-child(6), th:nth-child(7), th:nth-child(8) {
text-align: center;
}
/* Instance column styling for multi-line content */
td:nth-child(7) {
line-height: 1.3;
vertical-align: top;
}
/* Resources column styling for multi-line content */
td:nth-child(8) {
line-height: 1.3;
vertical-align: top;
}
th:hover {
background: #555;
}
th.sort-asc::after {
content: ' ▲';
position: absolute;
right: 8px;
}
th.sort-desc::after {
content: ' ▼';
position: absolute;
right: 8px;
}
/* Zebra striping for table rows */
tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
tbody tr:hover {
background-color: #e3f2fd;
}
.status-icon {
margin-right: 0.5rem;
font-size: 1.1rem;
display: inline-block;
min-width: 20px;
text-align: center;
}
/* Ensure status column is always visible and properly sized */
.status-column {
width: 50px !important;
max-width: 50px !important;
min-width: 50px !important;
text-align: center !important;
vertical-align: middle !important;
}
/* Progressive loading indicator */
.loading-indicator {
display: inline-block;
width: 12px;
height: 12px;
border: 2px solid #f3f3f3;
border-top: 2px solid #2196f3;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-right: 0.5rem;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Smooth transitions for progressive loading */
tbody tr {
transition: opacity 0.3s ease;
}
.loading-row {
opacity: 0.7;
}
/* Galaxy logo styling in header */
.header-title {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 1rem;
}
.title-section {
display: flex;
align-items: center;
gap: 1rem;
}
.galaxy-logo {
max-width: 150px;
max-height: 60px;
height: auto;
width: auto;
object-fit: contain;
}
.header-title h1 {
margin: 0;
font-size: 2.5rem;
color: #333;
}
/* Server favicon styling */
.server-favicon {
width: 16px;
height: 16px;
margin-right: 0.5rem;
vertical-align: middle;
border-radius: 2px;
}
.server-name-container {
display: flex;
align-items: center;
}
.server-name-info {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.server-url {
font-size: 0.85em;
color: #666;
text-decoration: none;
}
.server-url:hover {
color: #2196f3;
text-decoration: underline;
}
.description-info {
display: flex;
flex-direction: column;
gap: 0.1rem;
}
.description-notes {
font-size: 0.85em;
color: #666;
font-style: italic;
margin-top: 0.1rem;
}
/* Info field styling */
.contact-container {
line-height: 1.4;
}
.contact-name {
font-weight: 500;
margin-bottom: 2px;
}
.contact-email {
font-size: 0.9em;
color: #666;
}
/* Links/Info icons styling */
.contact-icons {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, 1fr);
gap: 0.4rem;
justify-items: center;
align-items: center;
max-width: 60px;
margin: 0 auto;
}
/* Place the 4th, 5th, and 6th icons on the second row, filling all three columns */
.contact-icons .contact-icon:nth-child(4) {
grid-column: 1 / 2;
grid-row: 2;
}
.contact-icons .contact-icon:nth-child(5) {
grid-column: 2 / 3;
grid-row: 2;
}
.contact-icons .contact-icon:nth-child(6) {
grid-column: 3 / 4;
grid-row: 2;
}
.contact-icon {
color: #666;
font-size: 1.1rem;
text-decoration: none;
transition: color 0.2s ease;
}
.contact-icon:hover {
color: #2196f3;
}
.contact-icon.disabled {
color: #ccc;
cursor: not-allowed;
}
/* Refresh button styling */
#refresh-button:hover:not(:disabled) {
background: #1976d2;
transform: translateY(-1px);
}
#refresh-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* Refresh offline button styling */
#refresh-offline-button:hover:not(:disabled) {
background: #f57c00;
transform: translateY(-1px);
}
#refresh-offline-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.no-results {
text-align: center;
font-style: italic;
color: #666;
padding: 2rem !important;
}
/* Tiers filter popup styling */
.tiers-filter-container {
position: relative;
display: inline-block;
}
.tiers-popup {
display: none;
position: absolute;
top: 100%;
left: 0;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
padding: 1rem;
min-width: 250px;
z-index: 1000;
margin-top: 0.25rem;
}
.tiers-popup.show {
display: block;
}
.tiers-popup h4 {
margin: 0 0 0.75rem 0;
font-size: 0.95rem;
color: #333;
font-weight: 600;
}
.tier-checkbox-item {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
padding: 0.25rem 0;
}
.tier-checkbox-item:last-child {
margin-bottom: 0;
}
.tier-checkbox-item input[type="checkbox"] {
margin: 0;
}
.tier-checkbox-item label {
font-size: 0.85rem;
cursor: pointer;
margin: 0;
display: flex;
align-items: center;
gap: 0.25rem;
}
.tier-checkbox-item .tier-icon {
font-size: 0.9rem;
}
.tier-count {
margin-left: auto;
font-size: 0.8rem;
color: #666;
font-weight: normal;
}
.tiers-popup-actions {
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid #eee;
display: flex;
gap: 0.5rem;
justify-content: flex-end;
}
.tiers-popup-actions button {
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
border: 1px solid #ddd;
background: white;
border-radius: 3px;
cursor: pointer;
color: #666;
}
.tiers-popup-actions button:hover {
background: #f5f5f5;
color: #333;
}
/* Status filter popup styling */
.status-filter-container {
position: relative;
display: inline-block;
}
#status-button {
transition: background-color 0.2s ease;
}
#status-button.active {
background: #ad1457 !important;
}
.status-popup {
display: none;
position: absolute;
top: 100%;
left: 0;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
padding: 1rem;
min-width: 250px;
z-index: 1000;
margin-top: 0.25rem;
}
.status-popup.show {
display: block;
}
.status-popup h4 {
margin: 0 0 0.75rem 0;
font-size: 0.95rem;
color: #333;
font-weight: 600;
}
.status-checkbox-item {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
padding: 0.25rem 0;
}
.status-checkbox-item:last-child {
margin-bottom: 0;
}
.status-checkbox-item input[type="checkbox"] {
margin: 0;
}
.status-checkbox-item label {
font-size: 0.85rem;
cursor: pointer;
margin: 0;
display: flex;
align-items: center;
gap: 0.25rem;
}
.status-checkbox-item .status-icon {
font-size: 0.9rem;
}
.status-count {
margin-left: auto;
font-size: 0.8rem;
color: #666;
font-weight: normal;
}
.status-popup-actions {
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid #eee;
display: flex;
gap: 0.5rem;
justify-content: flex-end;
}
.status-popup-actions button {
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
border: 1px solid #ddd;
background: white;
border-radius: 3px;
cursor: pointer;
color: #666;
}
.status-popup-actions button:hover {
background: #f5f5f5;
color: #333;
}
#tiers-button {
position: relative;
}
#tiers-button.active {
background: #1976d2;
}
/* Improved responsive design */
@media (max-width: 768px) {
.header-title {
flex-direction: column;
text-align: center;
gap: 1rem;
}
.title-section {
flex-direction: column;
gap: 0.5rem;
}
.summary-stats {
flex-direction: column;
gap: 1rem;
}
.stat-box {
min-width: auto;
}
table {
font-size: 0.9rem;
}
th, td {
padding: 0.5rem;
}
.header-title {
flex-direction: column;
text-align: center;
gap: 0.5rem;
}
.galaxy-logo {
max-width: 120px;
max-height: 45px;
}
.header-title h1 {
font-size: 1.8rem;
}
}
</style>
</head>
<body>
<div class="header-section">
<div class="header-title">
<div class="title-section">
<img src="https://galaxyproject.org/images/galaxy-logos/galaxy_project_logo_square_no_text_trans.png" alt="Galaxy Project Logo" class="galaxy-logo">
<h1>Galaxy Instance Tracker</h1>
</div>
<div id="summary-stats" class="summary-stats" style="display: none;">
<div class="stat-box">
<div class="stat-number" id="total-servers">0</div>
<div>Total Instances</div>
</div>
<div class="stat-box online-box">
<div class="stat-number" id="online-servers">0</div>
<div>Online Instances</div>
</div>
<div class="stat-box offline-box">
<div class="stat-number" id="offline-servers">0</div>
<div>Offline/Unknown</div>
</div>
</div>
</div>
<div class="search-container">
<input type="text" id="search-input" class="search-input" placeholder="🔍 Search instances by name, URL, region, or any other field...">
<div style="margin-top: 0.75rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;">
<div class="status-filter-container">
<button id="status-button" style="padding: 0.3rem 0.75rem; background: #e91e63; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;">
<i class="fas fa-signal"></i> Status
</button>
<div id="status-popup" class="status-popup">
<h4>Filter by Instance Status</h4>
<div class="status-checkbox-item">
<input type="checkbox" id="status-online-checkbox" checked>
<label for="status-online-checkbox">
<i class="fas fa-circle status-icon" style="color: #4caf50;"></i>
Online Instances <span class="status-count" id="status-online-count">(0)</span>
</label>
</div>
<div class="status-checkbox-item">
<input type="checkbox" id="status-issues-checkbox" checked>
<label for="status-issues-checkbox">
<i class="fas fa-circle status-icon" style="color: #ff9800;"></i>
Instances with Issues <span class="status-count" id="status-issues-count">(0)</span>
</label>
</div>
<div class="status-checkbox-item">
<input type="checkbox" id="status-offline-checkbox" checked>
<label for="status-offline-checkbox">
<i class="fas fa-circle status-icon" style="color: #f44336;"></i>
Offline Instances <span class="status-count" id="status-offline-count">(0)</span>
</label>
</div>
<div class="status-popup-actions">
<button id="status-select-all">Select All</button>
<button id="status-select-none">Select None</button>
</div>
</div>
</div>
<div class="tiers-filter-container">
<button id="tiers-button" style="padding: 0.3rem 0.75rem; background: #673ab7; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;">
<i class="fas fa-layer-group"></i> Tiers
</button>
<div id="tiers-popup" class="tiers-popup">
<h4>Filter by Instance Tier</h4>
<div class="tier-checkbox-item">
<input type="checkbox" id="tier-1-checkbox" checked>
<label for="tier-1-checkbox">
<i class="fas fa-globe tier-icon" style="color: #4caf50;"></i>
Tier 1 - Global Instance <span class="tier-count" id="tier-1-count">(0)</span>
</label>
</div>
<div class="tier-checkbox-item">
<input type="checkbox" id="tier-2-checkbox" checked>
<label for="tier-2-checkbox">
<i class="fas fa-university tier-icon" style="color: #ff9800;"></i>
Tier 2 - National Instance <span class="tier-count" id="tier-2-count">(0)</span>
</label>
</div>
<div class="tier-checkbox-item">
<input type="checkbox" id="tier-3-checkbox" checked>
<label for="tier-3-checkbox">
<i class="fas fa-map-marker-alt tier-icon" style="color: #2196f3;"></i>
Tier 3 - Subdomain <span class="tier-count" id="tier-3-count">(0)</span>
</label>
</div>
<div class="tier-checkbox-item">
<input type="checkbox" id="tier-4-checkbox" checked>
<label for="tier-4-checkbox">
<i class="fas fa-flask tier-icon" style="color: #9c27b0;"></i>
Tier 4 - Institutional <span class="tier-count" id="tier-4-count">(0)</span>
</label>
</div>
<div class="tier-checkbox-item">
<input type="checkbox" id="tier-5-checkbox" checked>
<label for="tier-5-checkbox">
<i class="fas fa-code-branch tier-icon" style="color: #607d8b;"></i>
Tier 5 - Integrated Platform <span class="tier-count" id="tier-5-count">(0)</span>
</label>
</div>
<div class="tier-checkbox-item">
<input type="checkbox" id="tier-6-checkbox" checked>
<label for="tier-6-checkbox">
<i class="fas fa-cogs tier-icon" style="color: #795548;"></i>
Tier 6 - Development Instance <span class="tier-count" id="tier-6-count">(0)</span>
</label>
</div>
<div class="tiers-popup-actions">
<button id="tiers-select-all">Select All</button>
<button id="tiers-select-none">Select None</button>
</div>
</div>
</div>
<button id="refresh-offline-button" style="padding: 0.3rem 0.75rem; background: #ff9800; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;">
<i class="fas fa-redo-alt"></i> Refresh Offline
</button>
<button id="refresh-button" style="padding: 0.3rem 0.75rem; background: #2196f3; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;">
<i class="fas fa-sync-alt"></i> Refresh All
</button>
<button id="export-csv-button" style="padding: 0.3rem 0.75rem; background: #4caf50; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;">
<i class="fas fa-file-csv"></i> Export to CSV
</button>
<button id="show-map-button" style="padding: 0.3rem 0.75rem; background: #009688; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;">
<i class="fas fa-map-marked-alt"></i> Show Map
</button>
</div>
</div>
</div>
<table id="galaxy-table">
<thead>
<tr>
<th style="width: 30px;">#</th>
<th style="width: 35px;"><i class="fas fa-signal" title="Status" style="color: white;"></i></th>
<th style="width: 35px;"><i class="fas fa-layer-group" title="Tier" style="color: white;"></i></th>
<th style="width: 200px;">Name</th>
<th style="width: 100px;">Region</th>
<th>Description</th>
<th style="width: 80px;">Info</th>
<th style="width: 120px;">Instance</th>
<th style="width: 120px;" title="Available tools and genomes">Resources</th>
</tr>
</thead>
<tbody></tbody>
</table>
<div id="status" style="margin-top: 1rem; padding: 0.75rem; background: #e3f2fd; border: 1px solid #2196f3; border-radius: 4px; text-align: center;">
Loading data from spreadsheet...
</div>
<div class="spreadsheet-link" style="margin-top: 1rem; text-align: center; display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;">
<div>📊 <a href="https://docs.google.com/spreadsheets/d/1HSpJ7vOxfnYSjfFm1vs528eydh1gVU40rKR6-1TCeCo/edit#gid=0" target="_blank" style="color: inherit; text-decoration: none;">Source Spreadsheet</a></div>
<div> | </div>
<div>🔗 <a href="https://github.com/mschatz/gxyservers" target="_blank" style="color: inherit; text-decoration: none;">GitHub Repository</a></div>
<div> | </div>
<div>🌌 <a href="https://gxy.io/kui" target="_blank" style="color: inherit; text-decoration: none;">Galaxy KUI</a></div>
</div>
<script>
const sheetId = '1HSpJ7vOxfnYSjfFm1vs528eydh1gVU40rKR6-1TCeCo';
// Using Google Sheets public CSV endpoint - works well with GitHub Pages
const sheetUrl = `https://docs.google.com/spreadsheets/d/${sheetId}/export?format=csv&gid=0`;
// Global variables for sorting and filtering
let currentData = [];
let filteredData = [];
let currentSortColumn = null;
let currentSortDirection = 'asc';
// Cache configuration
const CACHE_DURATION = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
const CACHE_KEY = 'galaxyServerCache';
// Cache management functions
function saveToCache(serverUrl, apiData) {
try {
const cache = getCache();
cache[serverUrl] = {
data: apiData,
timestamp: Date.now()
};
localStorage.setItem(CACHE_KEY, JSON.stringify(cache));
} catch (error) {
console.log('Error saving to cache:', error);
}
}
function getFromCache(serverUrl) {
try {
const cache = getCache();
const cached = cache[serverUrl];
if (cached && (Date.now() - cached.timestamp < CACHE_DURATION)) {
return cached.data;
}
// Remove expired cache entry
if (cached) {
delete cache[serverUrl];
localStorage.setItem(CACHE_KEY, JSON.stringify(cache));
}
return null;
} catch (error) {
console.log('Error reading from cache:', error);
return null;
}
}
function getCache() {
try {
const cache = localStorage.getItem(CACHE_KEY);
return cache ? JSON.parse(cache) : {};
} catch (error) {
return {};
}
}
function clearCache() {
try {
localStorage.removeItem(CACHE_KEY);
console.log('Galaxy server cache cleared');
} catch (error) {
console.log('Error clearing cache:', error);
}
}
function getCacheStats() {
const cache = getCache();
const now = Date.now();
let validEntries = 0;
let expiredEntries = 0;
Object.values(cache).forEach(entry => {
if (now - entry.timestamp < CACHE_DURATION) {
validEntries++;
} else {
expiredEntries++;
}
});
return { validEntries, expiredEntries, totalEntries: Object.keys(cache).length };
}
// Function to parse markdown-style links [text](url) and convert to HTML
function parseMarkdownLinks(text) {
if (!text || typeof text !== 'string') {
return text || '';
}
// Regular expression to match markdown links: [text](url)
const markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
// Replace all markdown links with HTML anchor tags
return text.replace(markdownLinkRegex, (match, linkText, url) => {
// Only add protocol if none is present (preserve existing http:// or https://)
let cleanUrl = url.trim();
if (!cleanUrl.startsWith('http://') && !cleanUrl.startsWith('https://')) {
cleanUrl = 'https://' + cleanUrl;
}
return `<a href="${cleanUrl}" target="_blank" style="color: #2196f3; text-decoration: none;">${linkText.trim()}</a>`;
});
}
// Function to format server start time from configuration data
function formatServerStartTime(serverStartTime) {
if (!serverStartTime) return '';
try {
let date;
// Handle different timestamp formats
if (typeof serverStartTime === 'string') {
// Try to parse as ISO string first
date = new Date(serverStartTime);
// If that fails and it looks like a numeric string, try parsing as number
if (isNaN(date.getTime()) && /^\d+(\.\d+)?$/.test(serverStartTime)) {
const numericTime = parseFloat(serverStartTime);
// If it's a small number, it's likely in seconds (Unix timestamp)
// If it's a large number, it's likely in milliseconds
if (numericTime < 1e10) {
date = new Date(numericTime * 1000); // Convert seconds to milliseconds
} else {
date = new Date(numericTime); // Already in milliseconds
}
}
} else if (typeof serverStartTime === 'number') {
// Handle numeric timestamps
if (serverStartTime < 1e10) {
// Likely in seconds (Unix timestamp)
date = new Date(serverStartTime * 1000);
} else {
// Likely in milliseconds
date = new Date(serverStartTime);
}
} else {
// Try direct conversion
date = new Date(serverStartTime);
}
// Check if the date is valid and reasonable (after 1990, before 2050)
if (isNaN(date.getTime()) || date.getFullYear() < 1990 || date.getFullYear() > 2050) {
console.log('Invalid or unreasonable server start time:', serverStartTime, 'parsed as:', date);
return '';
}
// Format as a readable date
return date.toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric'
});
} catch (error) {
console.log('Error parsing server start time:', serverStartTime, error);
return '';
}
}
function getStatusIcon(version, toolCount, tier = null, serverReachable = null) {
// Handle null, undefined, or empty version
if (!version || version === '' || version === null || version === undefined) {
return { icon: '⏳', tooltip: 'Status unknown - loading or no data available' };
}
// Convert to string and trim for consistent comparison
const versionStr = String(version).trim();
const toolCountStr = String(toolCount || '').trim();
const tierStr = String(tier || '').trim();
// Special handling for Tier 5 (Integrated Deployment) instances
// For Tier 5, if the site is reachable but API doesn't respond, consider it online
if (tierStr === '5') {
// If the instance is reachable (website responds) even with API errors, it's online
if (serverReachable === true) {
// Check if we have API errors but the site itself is reachable
if (versionStr === 'API Error' || versionStr === 'Unknown' || versionStr === 'Error' ||
versionStr === 'CORS Blocked' || toolCountStr === 'API Error') {
return { icon: '🟢', tooltip: 'Integrated platform is online (Galaxy API may not be directly accessible)' };
}
}
// If explicitly marked as unreachable or has DNS/network errors, it's offline
if (versionStr.includes('ERR_NAME_NOT_RESOLVED') || versionStr.includes('ENOTFOUND') ||
versionStr.includes('SERVER_UNREACHABLE') || versionStr === 'DNS Error' ||