-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdashboard-enterprise.html
More file actions
911 lines (804 loc) · 32.9 KB
/
Copy pathdashboard-enterprise.html
File metadata and controls
911 lines (804 loc) · 32.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitForge Enterprise Dashboard</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
color: #e2e8f0;
min-height: 100vh;
}
.container {
max-width: 1600px;
margin: 0 auto;
padding: 20px;
}
/* Header */
.header {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
padding: 40px 20px;
border-radius: 12px;
margin-bottom: 40px;
box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}
.header h1 {
font-size: 2.5em;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 10px;
}
.header p {
font-size: 1.1em;
opacity: 0.9;
}
/* Tabs */
.tabs {
display: flex;
gap: 10px;
margin-bottom: 30px;
border-bottom: 2px solid #334155;
flex-wrap: wrap;
}
.tab-btn {
padding: 12px 24px;
background: transparent;
border: none;
color: #94a3b8;
cursor: pointer;
font-size: 1em;
border-bottom: 3px solid transparent;
transition: all 0.3s;
}
.tab-btn:hover {
color: #e2e8f0;
}
.tab-btn.active {
color: #6366f1;
border-bottom-color: #6366f1;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Cards Grid */
.cards-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.card {
background: #1e293b;
border: 1px solid #334155;
border-radius: 8px;
padding: 20px;
transition: all 0.3s;
}
.card:hover {
border-color: #6366f1;
box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}
.card-title {
font-size: 0.9em;
color: #94a3b8;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.card-value {
font-size: 2em;
font-weight: bold;
color: #6366f1;
margin-bottom: 5px;
}
.card-subtitle {
font-size: 0.85em;
color: #64748b;
}
.card-change {
font-size: 0.85em;
margin-top: 10px;
padding: 5px 10px;
border-radius: 4px;
display: inline-block;
}
.card-change.positive {
background: rgba(34, 197, 94, 0.1);
color: #22c55e;
}
.card-change.negative {
background: rgba(239, 68, 68, 0.1);
color: #ef4444;
}
/* Section */
.section {
background: #1e293b;
border: 1px solid #334155;
border-radius: 8px;
padding: 30px;
margin-bottom: 30px;
}
.section-title {
font-size: 1.5em;
margin-bottom: 20px;
color: #e2e8f0;
display: flex;
align-items: center;
gap: 10px;
}
/* Tables */
.table-container {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
}
th {
background: #0f172a;
padding: 12px;
text-align: left;
font-weight: 600;
color: #94a3b8;
border-bottom: 2px solid #334155;
}
td {
padding: 12px;
border-bottom: 1px solid #334155;
}
tr:hover {
background: #0f172a;
}
/* Status Badges */
.badge {
display: inline-block;
padding: 4px 12px;
border-radius: 20px;
font-size: 0.85em;
font-weight: 600;
}
.badge-success {
background: rgba(34, 197, 94, 0.1);
color: #22c55e;
}
.badge-warning {
background: rgba(245, 158, 11, 0.1);
color: #f59e0b;
}
.badge-danger {
background: rgba(239, 68, 68, 0.1);
color: #ef4444;
}
.badge-info {
background: rgba(59, 130, 246, 0.1);
color: #3b82f6;
}
/* Charts */
.chart-container {
background: #0f172a;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
}
.chart-title {
font-size: 1.1em;
margin-bottom: 15px;
color: #e2e8f0;
}
.bar-chart {
display: flex;
align-items: flex-end;
gap: 10px;
height: 200px;
}
.bar {
flex: 1;
background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
border-radius: 4px 4px 0 0;
position: relative;
min-height: 20px;
}
.bar-label {
position: absolute;
bottom: -25px;
left: 0;
right: 0;
text-align: center;
font-size: 0.85em;
color: #94a3b8;
}
.bar-value {
position: absolute;
top: -25px;
left: 0;
right: 0;
text-align: center;
font-size: 0.9em;
font-weight: bold;
color: #6366f1;
}
/* Phase Sections */
.phase-section {
border-left: 4px solid #6366f1;
padding-left: 20px;
margin-bottom: 30px;
}
.phase-title {
font-size: 1.3em;
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 10px;
}
/* Footer */
.footer {
text-align: center;
padding: 20px;
color: #64748b;
border-top: 1px solid #334155;
margin-top: 40px;
}
/* Responsive */
@media (max-width: 768px) {
.header h1 {
font-size: 1.8em;
}
.cards-grid {
grid-template-columns: 1fr;
}
.section {
padding: 20px;
}
.tabs {
flex-direction: column;
}
.tab-btn {
width: 100%;
text-align: left;
}
}
/* Loading State */
.loading {
text-align: center;
padding: 40px;
color: #94a3b8;
}
.spinner {
display: inline-block;
width: 40px;
height: 40px;
border: 4px solid #334155;
border-top-color: #6366f1;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Alerts */
.alert {
padding: 15px 20px;
border-radius: 8px;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}
.alert-info {
background: rgba(59, 130, 246, 0.1);
border-left: 4px solid #3b82f6;
color: #3b82f6;
}
.alert-success {
background: rgba(34, 197, 94, 0.1);
border-left: 4px solid #22c55e;
color: #22c55e;
}
.alert-warning {
background: rgba(245, 158, 11, 0.1);
border-left: 4px solid #f59e0b;
color: #f59e0b;
}
</style>
</head>
<body>
<div class="container">
<!-- Header -->
<div class="header">
<h1>🚀 GitForge Enterprise Dashboard</h1>
<p>Real-time analytics for bounties, governance, and talent management</p>
</div>
<!-- Tabs -->
<div class="tabs">
<button class="tab-btn active" onclick="switchTab('overview')">📊 Overview</button>
<button class="tab-btn" onclick="switchTab('payouts')">💳 Payouts (Phase 1)</button>
<button class="tab-btn" onclick="switchTab('governance')">🏛️ Governance (Phase 2)</button>
<button class="tab-btn" onclick="switchTab('talent')">👥 Talent Pipeline (Phase 3)</button>
<button class="tab-btn" onclick="switchTab('analytics')">📈 Advanced Analytics</button>
</div>
<!-- OVERVIEW TAB -->
<div id="overview" class="tab-content active">
<div class="cards-grid">
<div class="card">
<div class="card-title">Total Bounties</div>
<div class="card-value" id="total-bounties">0</div>
<div class="card-subtitle">Completed this month</div>
<div class="card-change positive">↑ 12% from last month</div>
</div>
<div class="card">
<div class="card-title">Total Payouts</div>
<div class="card-value" id="total-payouts">$0</div>
<div class="card-subtitle">Distributed to contributors</div>
<div class="card-change positive">↑ 8% from last month</div>
</div>
<div class="card">
<div class="card-title">GitForge Revenue</div>
<div class="card-value" id="gitforge-revenue">$0</div>
<div class="card-subtitle">From transaction fees</div>
<div class="card-change positive">↑ 15% from last month</div>
</div>
<div class="card">
<div class="card-title">Active Contributors</div>
<div class="card-value" id="active-contributors">0</div>
<div class="card-subtitle">With verified profiles</div>
<div class="card-change positive">↑ 5 new this month</div>
</div>
<div class="card">
<div class="card-title">Avg Reputation Score</div>
<div class="card-value" id="avg-reputation">0</div>
<div class="card-subtitle">Out of 100</div>
<div class="card-change positive">↑ 2.5 points</div>
</div>
<div class="card">
<div class="card-title">Governance Votes</div>
<div class="card-value" id="governance-votes">0</div>
<div class="card-subtitle">This month</div>
<div class="card-change positive">↑ 3 new votes</div>
</div>
</div>
<div class="section">
<div class="section-title">📊 System Health</div>
<div class="cards-grid">
<div class="card">
<div class="card-title">Data Integrity</div>
<div class="card-value" style="color: #22c55e;">✓ 100%</div>
<div class="card-subtitle">All audit logs verified</div>
</div>
<div class="card">
<div class="card-title">Payment Success Rate</div>
<div class="card-value" style="color: #22c55e;">✓ 99.8%</div>
<div class="card-subtitle">Via Paymentor</div>
</div>
<div class="card">
<div class="card-title">Governance Compliance</div>
<div class="card-value" style="color: #22c55e;">✓ 100%</div>
<div class="card-subtitle">All votes recorded</div>
</div>
<div class="card">
<div class="card-title">System Uptime</div>
<div class="card-value" style="color: #22c55e;">✓ 99.99%</div>
<div class="card-subtitle">Last 30 days</div>
</div>
</div>
</div>
</div>
<!-- PAYOUTS TAB (Phase 1) -->
<div id="payouts" class="tab-content">
<div class="alert alert-info">
<span>💳</span>
<span>Powered by Paymentor - Decentralized payment processor with crypto & fiat support</span>
</div>
<div class="cards-grid">
<div class="card">
<div class="card-title">Total Payouts (USD)</div>
<div class="card-value" id="payout-total-usd">$0</div>
<div class="card-subtitle">All time</div>
</div>
<div class="card">
<div class="card-title">Total Fees Collected</div>
<div class="card-value" id="payout-fees">$0</div>
<div class="card-subtitle">GitForge revenue</div>
</div>
<div class="card">
<div class="card-title">Crypto Payments</div>
<div class="card-value" id="crypto-count">0</div>
<div class="card-subtitle">USDC, USDT, ETH, etc.</div>
</div>
<div class="card">
<div class="card-title">Fiat Payments</div>
<div class="card-value" id="fiat-count">0</div>
<div class="card-subtitle">Bank transfers</div>
</div>
</div>
<div class="section">
<div class="section-title">💰 Payment Methods Distribution</div>
<div class="chart-container">
<div class="chart-title">Payouts by Currency</div>
<div class="bar-chart" id="payment-methods-chart">
<div class="bar" style="height: 75%;">
<div class="bar-value">USDC</div>
<div class="bar-label">45%</div>
</div>
<div class="bar" style="height: 55%;">
<div class="bar-value">USD</div>
<div class="bar-label">30%</div>
</div>
<div class="bar" style="height: 35%;">
<div class="bar-value">ETH</div>
<div class="bar-label">15%</div>
</div>
<div class="bar" style="height: 20%;">
<div class="bar-value">Other</div>
<div class="bar-label">10%</div>
</div>
</div>
</div>
</div>
<div class="section">
<div class="section-title">📋 Recent Payouts</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Contributor</th>
<th>Amount</th>
<th>Currency</th>
<th>Status</th>
<th>Date</th>
</tr>
</thead>
<tbody id="recent-payouts">
<tr>
<td>@john-developer</td>
<td>$250.00</td>
<td>USDC (Polygon)</td>
<td><span class="badge badge-success">Confirmed</span></td>
<td>2025-11-10</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- GOVERNANCE TAB (Phase 2) -->
<div id="governance" class="tab-content">
<div class="alert alert-info">
<span>🏛️</span>
<span>Weighted voting system with immutable governance audit log</span>
</div>
<div class="cards-grid">
<div class="card">
<div class="card-title">Total Votes</div>
<div class="card-value" id="total-votes">0</div>
<div class="card-subtitle">All time</div>
</div>
<div class="card">
<div class="card-title">Approved PRs</div>
<div class="card-value" id="approved-prs">0</div>
<div class="card-subtitle">Via weighted voting</div>
</div>
<div class="card">
<div class="card-title">Vetoed PRs</div>
<div class="card-value" id="vetoed-prs">0</div>
<div class="card-subtitle">Blocked by veto</div>
</div>
<div class="card">
<div class="card-title">Avg Approval Time</div>
<div class="card-value" id="avg-approval-time">2.5h</div>
<div class="card-subtitle">From PR to merge</div>
</div>
</div>
<div class="section">
<div class="section-title">👥 Governance Roles</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Role</th>
<th>Members</th>
<th>Vote Weight</th>
<th>Permissions</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="badge badge-info">Founder</span></td>
<td>1</td>
<td>100</td>
<td>Full control, veto power</td>
</tr>
<tr>
<td><span class="badge badge-info">Lead Maintainer</span></td>
<td>2</td>
<td>50</td>
<td>Approve PRs, veto power</td>
</tr>
<tr>
<td><span class="badge badge-info">Reviewer</span></td>
<td>5</td>
<td>25</td>
<td>Review and vote</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<div class="section-title">📊 Voting Threshold</div>
<div class="chart-container">
<div class="chart-title">Approval Threshold: 50% of total weight</div>
<div style="background: #0f172a; padding: 20px; border-radius: 8px;">
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px;">
<div style="flex: 1; height: 30px; background: linear-gradient(90deg, #6366f1 0%, #6366f1 50%, #334155 50%, #334155 100%); border-radius: 4px;"></div>
</div>
<div style="display: flex; justify-content: space-between; font-size: 0.9em; color: #94a3b8;">
<span>0%</span>
<span style="color: #6366f1; font-weight: bold;">50% Required</span>
<span>100%</span>
</div>
</div>
</div>
</div>
</div>
<!-- TALENT PIPELINE TAB (Phase 3) -->
<div id="talent" class="tab-content">
<div class="alert alert-info">
<span>👥</span>
<span>Verifiable contributor profiles with skill extraction and talent marketplace</span>
</div>
<div class="cards-grid">
<div class="card">
<div class="card-title">Total Profiles</div>
<div class="card-value" id="total-profiles">0</div>
<div class="card-subtitle">Verified contributors</div>
</div>
<div class="card">
<div class="card-title">Skills Tracked</div>
<div class="card-value" id="skills-tracked">0</div>
<div class="card-subtitle">Unique skills</div>
</div>
<div class="card">
<div class="card-title">Avg Reputation</div>
<div class="card-value" id="talent-avg-reputation">0</div>
<div class="card-subtitle">Out of 100</div>
</div>
<div class="card">
<div class="card-title">Available for Hire</div>
<div class="card-value" id="available-for-hire">0</div>
<div class="card-subtitle">Contributors</div>
</div>
</div>
<div class="section">
<div class="section-title">⭐ Contributor Tiers</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Tier</th>
<th>Count</th>
<th>Requirements</th>
<th>Benefits</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="badge badge-success">💎 Core Team</span></td>
<td id="tier-core">0</td>
<td>10%+ equity or $5K+</td>
<td>Priority hiring, premium rates</td>
</tr>
<tr>
<td><span class="badge badge-success">👑 Founding</span></td>
<td id="tier-founding">0</td>
<td>5%+ equity or $2.5K+</td>
<td>Featured profile, high visibility</td>
</tr>
<tr>
<td><span class="badge badge-success">🎖️ Veteran</span></td>
<td id="tier-veteran">0</td>
<td>10+ bounties or $1K+</td>
<td>Verified badge, priority support</td>
</tr>
<tr>
<td><span class="badge badge-warning">⭐ Rising Star</span></td>
<td id="tier-rising">0</td>
<td>5+ bounties or $500+</td>
<td>Visible profile, growth support</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<div class="section-title">🔍 Top Skills</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Skill</th>
<th>Contributors</th>
<th>Avg Proficiency</th>
<th>Demand</th>
</tr>
</thead>
<tbody id="top-skills">
<tr>
<td>Frontend Development</td>
<td>15</td>
<td>Intermediate</td>
<td><span class="badge badge-success">High</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- ANALYTICS TAB -->
<div id="analytics" class="tab-content">
<div class="section">
<div class="section-title">📈 Revenue Breakdown</div>
<div class="cards-grid">
<div class="card">
<div class="card-title">Transaction Fees</div>
<div class="card-value" style="color: #22c55e;">$0</div>
<div class="card-subtitle">From bounty payouts (1-2%)</div>
</div>
<div class="card">
<div class="card-title">Subscription Revenue</div>
<div class="card-value" style="color: #22c55e;">$0</div>
<div class="card-subtitle">Pro & Enterprise tiers</div>
</div>
<div class="card">
<div class="card-title">Talent Marketplace</div>
<div class="card-value" style="color: #22c55e;">$0</div>
<div class="card-subtitle">From hiring fees (15%)</div>
</div>
<div class="card">
<div class="card-title">Total Monthly Revenue</div>
<div class="card-value" style="color: #6366f1;">$0</div>
<div class="card-subtitle">All streams combined</div>
</div>
</div>
</div>
<div class="section">
<div class="section-title">📊 Contributor Activity</div>
<div class="chart-container">
<div class="chart-title">Bounties Completed by Month</div>
<div class="bar-chart">
<div class="bar" style="height: 40%;"><div class="bar-label">Jan</div></div>
<div class="bar" style="height: 55%;"><div class="bar-label">Feb</div></div>
<div class="bar" style="height: 70%;"><div class="bar-label">Mar</div></div>
<div class="bar" style="height: 85%;"><div class="bar-label">Apr</div></div>
<div class="bar" style="height: 100%;"><div class="bar-label">May</div></div>
</div>
</div>
</div>
<div class="section">
<div class="section-title">🌍 Geographic Distribution</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Region</th>
<th>Contributors</th>
<th>Total Earned</th>
<th>Avg Reputation</th>
</tr>
</thead>
<tbody>
<tr>
<td>🌍 Africa</td>
<td>25</td>
<td>$12,500</td>
<td>62.3</td>
</tr>
<tr>
<td>🌎 Americas</td>
<td>18</td>
<td>$18,750</td>
<td>68.5</td>
</tr>
<tr>
<td>🌏 Asia-Pacific</td>
<td>32</td>
<td>$22,400</td>
<td>65.8</td>
</tr>
<tr>
<td>🇪🇺 Europe</td>
<td>15</td>
<td>$15,200</td>
<td>71.2</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Footer -->
<div class="footer">
<p>GitForge Enterprise Dashboard • Last updated: <span id="last-updated">just now</span></p>
<p style="margin-top: 10px; font-size: 0.9em;">Powered by GitHub Actions, Paymentor, and open-source technology</p>
</div>
</div>
<script>
// Tab switching
function switchTab(tabName) {
// Hide all tabs
document.querySelectorAll('.tab-content').forEach(tab => {
tab.classList.remove('active');
});
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.classList.remove('active');
});
// Show selected tab
document.getElementById(tabName).classList.add('active');
event.target.classList.add('active');
}
// Load data from JSON files
async function loadData() {
try {
// Load equity data
const equityResponse = await fetch('../github/EQUITY_TRACKING.json');
const equityData = await equityResponse.json();
// Load payout audit
const payoutResponse = await fetch('../github/PAYOUT_AUDIT.json');
const payoutData = await payoutResponse.json();
// Load profiles
const profilesResponse = await fetch('../github/CONTRIBUTOR_PROFILES.json');
const profilesData = await profilesResponse.json();
// Load skills
const skillsResponse = await fetch('../github/SKILLS_INDEX.json');
const skillsData = await skillsResponse.json();
// Update dashboard
updateDashboard(equityData, payoutData, profilesData, skillsData);
} catch (error) {
console.error('Error loading data:', error);
}
}
function updateDashboard(equity, payouts, profiles, skills) {
// Overview metrics
document.getElementById('total-bounties').textContent = equity.contributors?.length || 0;
document.getElementById('total-payouts').textContent = '$' + (payouts.total_amount_usd || 0).toLocaleString();
document.getElementById('gitforge-revenue').textContent = '$' + (payouts.total_fees_collected || 0).toLocaleString();
document.getElementById('active-contributors').textContent = profiles.total_profiles || 0;
// Calculate average reputation
const avgRep = profiles.profiles?.length > 0
? (profiles.profiles.reduce((sum, p) => sum + p.reputation_score, 0) / profiles.profiles.length).toFixed(1)
: 0;
document.getElementById('avg-reputation').textContent = avgRep;
// Payout metrics
document.getElementById('payout-total-usd').textContent = '$' + (payouts.total_amount_usd || 0).toLocaleString();
document.getElementById('payout-fees').textContent = '$' + (payouts.total_fees_collected || 0).toLocaleString();
// Talent metrics
document.getElementById('total-profiles').textContent = profiles.total_profiles || 0;
document.getElementById('skills-tracked').textContent = Object.keys(skills.skills_by_category || {}).length;
document.getElementById('talent-avg-reputation').textContent = avgRep;
// Contributor tiers
if (profiles.statistics?.tiers) {
document.getElementById('tier-core').textContent = profiles.statistics.tiers['Core Team Member'] || 0;
document.getElementById('tier-founding').textContent = profiles.statistics.tiers['Founding Contributor'] || 0;
document.getElementById('tier-veteran').textContent = profiles.statistics.tiers['Veteran Contributor'] || 0;
document.getElementById('tier-rising').textContent = profiles.statistics.tiers['Rising Star'] || 0;
}
// Update timestamp
document.getElementById('last-updated').textContent = new Date().toLocaleTimeString();
}
// Load data on page load
window.addEventListener('load', loadData);
// Auto-refresh every 5 minutes
setInterval(loadData, 300000);
</script>
</body>
</html>