-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.html
More file actions
1399 lines (1241 loc) · 74.8 KB
/
index.html
File metadata and controls
1399 lines (1241 loc) · 74.8 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="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SEO & Meta Tags -->
<title>Redc - 红队基础设施多云自动化部署工具 | Red Team Infrastructure Multi-Cloud Automated Deployment Tool</title>
<meta name="description" content="Redc 是一款基于 Terraform 的红队基础设施自动化工具。支持 MCP 协议与 AI 助手集成,提供 Compose 服务编排,一键自动化部署多云(阿里云、AWS、腾讯云等)攻防环境。">
<meta name="keywords" content="Red Team, IaC, Terraform, MCP, Model Context Protocol, Compose, 自动化部署, 红队设施, 基础设施即代码, Aliyun, AWS, TencentCloud">
<meta name="author" content="wgpsec">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://redc.wgpsec.org/">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://redc.wgpsec.org/">
<meta property="og:title" content="Redc - 红队基础设施多云自动化部署工具">
<meta property="og:description" content="不仅仅是开机工具,更是对云资源的自动化调度器。支持 MCP 协议、多服务编排与多云部署。">
<meta property="og:image" content="https://redc.wgpsec.org/assets/og-image.png">
<meta property="og:locale" content="zh_CN">
<meta property="og:locale:alternate" content="en_US">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://redc.wgpsec.org/">
<meta property="twitter:title" content="Redc - 红队基础设施多云自动化部署工具">
<meta property="twitter:description" content="支持 MCP 协议与 AI 助手集成,一键构建、管理和销毁攻防环境。">
<meta property="twitter:image" content="https://redc.wgpsec.org/assets/og-image.png">
<!-- Preconnect for Performance -->
<link rel="preconnect" href="https://cdn.tailwindcss.com">
<link rel="preconnect" href="https://unpkg.com">
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
<!-- Dependencies -->
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/lucide@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.6/purify.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown-light.min.css" id="markdown-css">
<!-- Structured Data (JSON-LD) -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Redc",
"operatingSystem": "Linux, macOS, Windows",
"applicationCategory": "DeveloperApplication",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"description": "红队基础设施多云自动化部署工具,支持 MCP 协议与 Compose 编排。",
"author": {
"@type": "Organization",
"name": "WGPSec"
}
}
</script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['Inter', 'system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'],
mono: ['JetBrains Mono', 'Fira Code', 'Menlo', 'Monaco', 'Consolas', 'monospace']
},
colors: {
primary: {
50: '#E8F3FF',
100: '#BEDAFF',
200: '#94BFFF',
300: '#6AA1FF',
400: '#4080FF',
500: '#165DFF', // Arco Blue
600: '#0E42D2',
700: '#002596',
900: '#001A66'
},
neutral: {
50: '#F7F8FA',
100: '#F2F3F5',
200: '#E5E6EB',
300: '#C9CDD4',
400: '#86909C',
500: '#4E5969',
600: '#1D2129',
800: '#27272a',
900: '#17171A' // Arco Dark Bg
}
},
animation: {
'fade-in': 'fadeIn 0.4s ease-out',
'slide-up': 'slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1)',
},
keyframes: {
fadeIn: { '0%': { opacity: '0' }, '100%': { opacity: '1' } },
slideUp: { '0%': { transform: 'translateY(20px)', opacity: '0' }, '100%': { transform: 'translateY(0)', opacity: '1' } }
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
/* CSS Variables for Theming */
:root {
--bg-body: #FFFFFF;
--bg-nav: rgba(255, 255, 255, 0.8);
--bg-card: #FFFFFF;
--bg-section: #FFFFFF;
--bg-secondary: #F7F8FA; /* Gray background for lists/tables */
--text-primary: #1D2129;
--text-secondary: #4E5969;
--text-tertiary: #86909C;
--border-color: #E5E6EB;
--border-hover: #165DFF;
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
--shadow-hover: 0 4px 20px rgba(22, 93, 255, 0.08);
--dot-color: #E5E6EB;
--btn-outline-bg: #FFFFFF;
--btn-outline-border: #E5E6EB;
--btn-outline-text: #1D2129;
--btn-outline-hover-bg: #F7F8FA;
}
html.dark {
--bg-body: #17171A;
--bg-nav: rgba(23, 23, 26, 0.8);
--bg-card: #232324;
--bg-section: #17171A;
--bg-secondary: #2A2A2B;
--text-primary: #F2F3F5;
--text-secondary: #C9CDD4;
--text-tertiary: #86909C;
--border-color: #373739;
/* --border-hover: #4080FF; */
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
--shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4);
--dot-color: #2E2E30;
--btn-outline-bg: #232324;
--btn-outline-border: #373739;
--btn-outline-text: #F2F3F5;
--btn-outline-hover-bg: #2A2A2B;
}
/* Global */
body {
background-color: var(--bg-body);
color: var(--text-secondary);
-webkit-font-smoothing: antialiased;
transition: background-color 0.3s, color 0.3s;
}
/* Dot Pattern Background */
.bg-dot-pattern {
background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
background-size: 24px 24px;
mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
-webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}
/* Components */
.pd-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 8px;
transition: all 0.2s ease-in-out;
}
.pd-card:hover {
border-color: #165DFF;
box-shadow: var(--shadow-hover);
transform: translateY(-2px);
}
/* Terminal Window - Always Dark Theme */
.terminal-window {
background: #1D2129;
border-radius: 8px;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
border: 1px solid #2E323D;
overflow: hidden;
display: flex;
flex-direction: column;
}
html.dark .terminal-window {
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
border: 1px solid #373739;
}
.terminal-header {
background: #272B36;
padding: 12px 16px;
display: flex;
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid #2E323D;
flex-shrink: 0;
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-body {
padding: 24px;
font-family: 'JetBrains Mono', monospace;
font-size: 13px;
color: #C9CDD4;
line-height: 1.6;
min-height: 240px; /* Ensure enough height */
flex-grow: 1;
}
.prompt { color: #165DFF; margin-right: 8px; font-weight: 700; }
.cmd { color: #FFFFFF; }
.output { color: #86909C; }
/* Buttons */
.btn-primary {
background: #165DFF;
color: white;
border-radius: 6px;
font-weight: 500;
transition: all 0.2s;
box-shadow: 0 2px 4px rgba(22, 93, 255, 0.2);
}
.btn-primary:hover {
background: #4080FF;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}
.btn-outline {
background: var(--btn-outline-bg);
border: 1px solid var(--btn-outline-border);
color: var(--btn-outline-text);
border-radius: 6px;
font-weight: 500;
transition: all 0.2s;
}
.btn-outline:hover {
border-color: #C9CDD4;
background: var(--btn-outline-hover-bg);
color: #165DFF;
}
html.dark .btn-outline:hover {
border-color: #4E5969;
}
/* Badges */
.badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: 500;
border: 1px solid;
}
/* Table */
.custom-table th {
font-weight: 600;
font-size: 12px;
color: var(--text-tertiary);
text-transform: uppercase;
letter-spacing: 0.05em;
padding: 12px 16px;
background-color: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
}
.custom-table td {
padding: 12px 16px;
border-bottom: 1px solid var(--bg-secondary);
color: var(--text-primary);
font-size: 14px;
}
.custom-table tr:hover td { background-color: var(--bg-secondary); }
/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E5E6EB; border-radius: 3px; }
html.dark ::-webkit-scrollbar-thumb { background: #373739; }
::-webkit-scrollbar-thumb:hover { background: #C9CDD4; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #4E5969; }
/* Selection */
::selection { background: #E8F3FF; color: #165DFF; }
html.dark ::selection { background: #165DFF; color: #FFFFFF; }
/* Helper for hiding/showing */
.hidden-tab { display: none !important; }
</style>
</head>
<body class="min-h-screen font-sans flex flex-col relative transition-colors duration-300">
<!-- Background Pattern -->
<div class="fixed inset-0 z-[-1] bg-dot-pattern h-[600px] pointer-events-none"></div>
<!-- Nav -->
<nav class="sticky top-0 z-40" style="background-color: var(--bg-nav); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color);">
<div class="max-w-7xl mx-auto px-6 h-16 flex items-center justify-between">
<div class="flex items-center gap-3">
<!-- Updated Logo: Terminal Icon -->
<div class="w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shadow-md shadow-primary-500/20">
<i data-lucide="terminal" class="w-5 h-5 text-white"></i>
</div>
<span class="font-bold text-lg tracking-tight" style="color: var(--text-primary);">Redc</span>
<!-- Updated Version Badge -->
<span class="hidden sm:inline-block text-xs px-2.5 py-0.5 rounded-full border font-mono font-medium" style="background-color: var(--bg-secondary); color: var(--text-tertiary); border-color: var(--border-color);">__REDC_VERSION__</span>
</div>
<div class="flex items-center gap-3">
<button id="theme-switcher" onclick="toggleTheme()"
class="p-2 rounded-md transition" style="color: var(--text-secondary);">
<i data-lucide="moon" class="w-4 h-4 block dark:hidden"></i>
<i data-lucide="sun" class="w-4 h-4 hidden dark:block text-yellow-400"></i>
</button>
<button id="lang-switcher" onclick="toggleLanguage()"
class="p-2 rounded-md transition hover:bg-primary-50 hover:text-primary-500 dark:hover:bg-primary-900/30" style="color: var(--text-secondary);">
<i data-lucide="languages" class="w-4 h-4"></i>
</button>
<a href="https://github.com/wgpsec/redc" target="_blank" rel="noopener noreferrer"
class="btn-outline px-4 py-2 text-sm flex items-center gap-2">
<i data-lucide="github" class="w-4 h-4"></i>
<span>Star on GitHub</span>
</a>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="flex-grow">
<!-- Hero Section -->
<section class="pt-20 pb-16 px-6 border-b" style="border-color: var(--border-color);">
<div class="max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
<!-- Left: Copy -->
<div class="animate-slide-up">
<div class="inline-flex items-center gap-2 px-3 py-1 bg-primary-50 dark:bg-primary-900/30 border border-primary-100 dark:border-primary-800 text-primary-600 dark:text-primary-400 text-xs font-semibold rounded-full mb-6">
<span class="w-2 h-2 rounded-full bg-primary-500 animate-pulse"></span>
<span data-i18n="hero_badge">Infrastructure Automation for Red Teams</span>
</div>
<h1 class="text-4xl sm:text-5xl lg:text-6xl font-extrabold mb-6 leading-[1.1] tracking-tight" style="color: var(--text-primary);">
<span data-i18n="hero_title_prefix">Red Team Infrastructure</span> <br/>
<span class="text-primary-500" data-i18n="hero_title_suffix">Multi-Cloud Automation</span>
</h1>
<p class="text-lg mb-8 leading-relaxed max-w-lg" style="color: var(--text-secondary);" data-i18n="hero_description">
基于 Terraform 的红队基础设施自动化工具。支持 MCP 协议、Compose 编排,一条命令交付攻防环境。
</p>
<div class="flex flex-wrap gap-4">
<a href="https://github.com/wgpsec/redc/releases" class="btn-primary px-6 py-3 flex items-center gap-2 text-sm">
<i data-lucide="download" class="w-4 h-4"></i>
Download
</a>
<button onclick="document.getElementById('registry-section').scrollIntoView({behavior: 'smooth'})" class="btn-outline px-6 py-3 flex items-center gap-2 text-sm">
<i data-lucide="search" class="w-4 h-4"></i>
Explore Registry
</button>
</div>
<!-- Quick Install Snippet -->
<div class="mt-8 flex items-center gap-2 text-sm" style="color: var(--text-secondary);">
<span>Install via Homebrew:</span>
<div class="group flex items-center gap-2 border rounded px-3 py-1 cursor-pointer hover:border-primary-300 transition"
style="background-color: var(--bg-card); border-color: var(--border-color);"
onclick="copyCommand('brew install wgpsec/tap/redc')">
<code class="font-mono text-primary-600 dark:text-primary-400">brew install wgpsec/tap/redc</code>
<i data-lucide="copy" class="w-3 h-3 opacity-0 group-hover:opacity-100 transition"></i>
</div>
</div>
</div>
<!-- Right: Terminal Visual (Simplified) -->
<div class="animate-slide-up" style="animation-delay: 0.1s;">
<div class="terminal-window">
<div class="terminal-header">
<div class="terminal-dots">
<div class="terminal-dot bg-[#FF5F56]"></div>
<div class="terminal-dot bg-[#FFBD2E]"></div>
<div class="terminal-dot bg-[#27C93F]"></div>
</div>
</div>
<div class="terminal-body">
<!-- Standard Demo -->
<div class="flex items-center mb-2">
<span class="prompt">➜</span>
<span class="prompt text-neutral-400">~</span>
<span class="cmd">redc pull aliyun/ecs</span>
</div>
<div class="output mb-4">
<span class="text-green-400">✔</span> Template 'aliyun/ecs' pulled successfully.<br/>
<span class="text-neutral-500"> Location: ./redc/aliyun/ecs</span>
</div>
<div class="flex items-center mb-2">
<span class="prompt">➜</span>
<span class="prompt text-neutral-400">~</span>
<span class="cmd">redc run aliyun/ecs</span>
</div>
<div class="output">
<span class="text-blue-400">ℹ</span> Initializing provider plugins...<br/>
<span class="text-blue-400">ℹ</span> Plan: 2 to add, 0 to change, 0 to destroy.<br/>
<span class="text-neutral-500">...</span><br/>
<span class="text-green-400">✔</span> Apply complete! Resources: 2 added.<br/>
<span class="text-neutral-300"> IP: 47.101.xx.xx</span>
</div>
<div class="flex items-center mt-2 animate-pulse">
<span class="prompt">➜</span>
<span class="prompt text-neutral-400">~</span>
<span class="cmd border-r-2 border-neutral-500 pr-1"> </span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Grid (Bento Style) -->
<section class="py-16 px-6 border-b" style="border-color: var(--border-color); background-color: var(--bg-section);">
<div class="max-w-7xl mx-auto">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- Feature 1 -->
<div class="pd-card p-6">
<div class="w-10 h-10 rounded bg-primary-50 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400 flex items-center justify-center mb-4">
<i data-lucide="cloud" class="w-5 h-5"></i>
</div>
<h3 class="font-bold mb-2" style="color: var(--text-primary);" data-i18n="feat_cloud_title">Multi-Cloud</h3>
<p class="text-sm leading-relaxed" style="color: var(--text-secondary);" data-i18n="feat_cloud_desc">Support AWS, Aliyun, Tencent, Azure, GCP and more.</p>
</div>
<!-- Feature 2 -->
<div class="pd-card p-6">
<div class="w-10 h-10 rounded bg-indigo-50 dark:bg-indigo-900/30 text-indigo-600 dark:text-indigo-400 flex items-center justify-center mb-4">
<i data-lucide="database" class="w-5 h-5"></i>
</div>
<h3 class="font-bold mb-2" style="color: var(--text-primary);" data-i18n="feat_iac_title">State Mgmt</h3>
<p class="text-sm leading-relaxed" style="color: var(--text-secondary);" data-i18n="feat_iac_desc">Local state management, one-click destroy to prevent waste.</p>
</div>
<!-- Feature 3 -->
<div class="pd-card p-6 relative overflow-hidden">
<div class="absolute top-4 right-4"><span class="badge bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800">New</span></div>
<div class="w-10 h-10 rounded bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 flex items-center justify-center mb-4">
<i data-lucide="bot" class="w-5 h-5"></i>
</div>
<h3 class="font-bold mb-2" style="color: var(--text-primary);" data-i18n="feat_mcp_title">MCP Support</h3>
<p class="text-sm leading-relaxed" style="color: var(--text-secondary);" data-i18n="feat_mcp_desc">Model Context Protocol for AI integration.</p>
</div>
<!-- Feature 4 -->
<div class="pd-card p-6 relative overflow-hidden">
<div class="absolute top-4 right-4"><span class="badge bg-orange-50 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800">New</span></div>
<div class="w-10 h-10 rounded bg-orange-50 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400 flex items-center justify-center mb-4">
<i data-lucide="workflow" class="w-5 h-5"></i>
</div>
<h3 class="font-bold mb-2" style="color: var(--text-primary);" data-i18n="feat_compose_title">Compose</h3>
<p class="text-sm leading-relaxed" style="color: var(--text-secondary);" data-i18n="feat_compose_desc">Orchestrate multiple services via YAML.</p>
</div>
</div>
</div>
</section>
<!-- GUI Desktop App Section -->
<section class="py-16 px-6 border-b" style="border-color: var(--border-color);">
<div class="max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
<!-- Left: Copy -->
<div>
<div class="inline-flex items-center gap-2 px-3 py-1 bg-indigo-50 dark:bg-indigo-900/30 border border-indigo-100 dark:border-indigo-800 text-indigo-600 dark:text-indigo-400 text-xs font-semibold rounded-full mb-6">
<i data-lucide="monitor" class="w-3 h-3"></i>
<span data-i18n="gui_badge">Desktop App</span>
</div>
<h2 class="text-3xl sm:text-4xl font-extrabold mb-4 leading-tight" style="color: var(--text-primary);">
<span data-i18n="gui_title">Redc GUI</span>
</h2>
<p class="text-base mb-6 leading-relaxed" style="color: var(--text-secondary);" data-i18n="gui_description">
不只是命令行。Redc GUI 提供可视化仪表盘、AI 聊天助手、一键部署管理,让红队基础设施管理更加直观高效。
</p>
<ul class="space-y-3 mb-8">
<li class="flex items-center gap-3 text-sm" style="color: var(--text-secondary);">
<div class="w-6 h-6 rounded-full bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 flex items-center justify-center flex-shrink-0">
<i data-lucide="check" class="w-3.5 h-3.5"></i>
</div>
<span data-i18n="gui_feat_1">Visual dashboard with real-time resource overview</span>
</li>
<li class="flex items-center gap-3 text-sm" style="color: var(--text-secondary);">
<div class="w-6 h-6 rounded-full bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 flex items-center justify-center flex-shrink-0">
<i data-lucide="check" class="w-3.5 h-3.5"></i>
</div>
<span data-i18n="gui_feat_2">Built-in AI Chat for intelligent deployment assistance</span>
</li>
<li class="flex items-center gap-3 text-sm" style="color: var(--text-secondary);">
<div class="w-6 h-6 rounded-full bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 flex items-center justify-center flex-shrink-0">
<i data-lucide="check" class="w-3.5 h-3.5"></i>
</div>
<span data-i18n="gui_feat_3">One-click deploy, SSH terminal, and file management</span>
</li>
<li class="flex items-center gap-3 text-sm" style="color: var(--text-secondary);">
<div class="w-6 h-6 rounded-full bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 flex items-center justify-center flex-shrink-0">
<i data-lucide="check" class="w-3.5 h-3.5"></i>
</div>
<span data-i18n="gui_feat_4">Cross-platform: macOS, Windows, Linux</span>
</li>
</ul>
<a href="https://github.com/wgpsec/redc/releases" class="btn-primary px-6 py-3 inline-flex items-center gap-2 text-sm">
<i data-lucide="download" class="w-4 h-4"></i>
<span data-i18n="gui_download">Download GUI</span>
</a>
</div>
<!-- Right: Screenshot Showcase -->
<div>
<!-- Tab Buttons -->
<div class="flex gap-2 mb-4">
<button onclick="switchGuiTab('dashboard')" id="gui-tab-dashboard" class="gui-tab px-3 py-1.5 text-xs font-medium rounded-md transition-all border" style="background-color: var(--bg-card); color: var(--text-primary); border-color: var(--primary-color); box-shadow: 0 0 0 1px var(--primary-color);">
<i data-lucide="layout-dashboard" class="w-3 h-3 inline-block mr-1"></i>Dashboard
</button>
<button onclick="switchGuiTab('ai-chat')" id="gui-tab-ai-chat" class="gui-tab px-3 py-1.5 text-xs font-medium rounded-md transition-all border" style="color: var(--text-tertiary); border-color: var(--border-color);">
<i data-lucide="message-square" class="w-3 h-3 inline-block mr-1"></i>AI Chat
</button>
<button onclick="switchGuiTab('deploy')" id="gui-tab-deploy" class="gui-tab px-3 py-1.5 text-xs font-medium rounded-md transition-all border" style="color: var(--text-tertiary); border-color: var(--border-color);">
<i data-lucide="rocket" class="w-3 h-3 inline-block mr-1"></i>Deploy
</button>
</div>
<!-- Screenshot Container -->
<div class="relative rounded-xl overflow-hidden border shadow-lg" style="border-color: var(--border-color); background-color: var(--bg-secondary);">
<img id="gui-screenshot-dashboard" src="assets/screenshots/gui-dashboard.png" alt="Redc GUI Dashboard" class="w-full h-auto gui-screenshot" loading="lazy" />
<img id="gui-screenshot-ai-chat" src="assets/screenshots/gui-ai-chat.png" alt="Redc GUI AI Chat" class="w-full h-auto gui-screenshot hidden" loading="lazy" />
<img id="gui-screenshot-deploy" src="assets/screenshots/gui-deploy.png" alt="Redc GUI Deploy" class="w-full h-auto gui-screenshot hidden" loading="lazy" />
</div>
</div>
</div>
</section>
<!-- NEW SECTION: Quick Reference (Config & Cheatsheet - Swapped Order) -->
<section class="py-12 px-6 border-b" style="border-color: var(--border-color);">
<div class="max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Config Card (Placed First/Left) -->
<div class="pd-card p-6">
<div class="flex justify-between items-center mb-5">
<h4 class="font-bold text-sm flex items-center gap-2" style="color: var(--text-primary);">
<div class="w-6 h-6 rounded bg-primary-50 dark:bg-primary-900/30 flex items-center justify-center text-primary-500">
<i data-lucide="settings" class="w-4 h-4"></i>
</div>
<span data-i18n="step2_title">Configuration</span>
</h4>
<!-- Tabs -->
<div class="flex p-0.5 rounded-md border" style="background-color: var(--bg-secondary); border-color: var(--border-color);">
<button onclick="switchConfigTab('file')" id="tab-file" class="px-3 py-1 text-xs font-medium rounded-sm transition-all" style="background-color: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card);">File</button>
<button onclick="switchConfigTab('env')" id="tab-env" class="px-3 py-1 text-xs font-medium rounded-sm transition-all" style="color: var(--text-tertiary);">Env</button>
</div>
</div>
<!-- Content: File -->
<div id="content-file">
<div class="bg-[#1e1e1e] rounded-md p-4 border border-neutral-800 shadow-inner h-[220px] flex flex-col">
<div class="flex justify-between items-center mb-3 pb-3 border-b border-white/10">
<span class="text-xs font-mono text-neutral-500">~/.redc/config.yaml</span>
<div class="flex gap-2">
<button onclick="copyCommand('mkdir -p ~/.redc && touch ~/.redc/config.yaml')" class="text-neutral-500 hover:text-white transition" title="Create File">
<i data-lucide="plus" class="w-4 h-4"></i>
</button>
<button onclick="copyCommand('providers:\n aws:\n AWS_ACCESS_KEY_ID: \'AKIDXXXXXXXXXXXXXXXX\'\n AWS_SECRET_ACCESS_KEY: \'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW\'\n region: \'us-east-1\'\n aliyun:\n ALICLOUD_ACCESS_KEY: \'AKIDXXXXXXXXXXXXXXXX\'\n ALICLOUD_SECRET_KEY: \'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW\'\n region: \'cn-hangzhou\'\n tencentcloud:\n TENCENTCLOUD_SECRET_ID: \'AKIDXXXXXXXXXXXXXXXX\'\n TENCENTCLOUD_SECRET_KEY: \'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW\'\n region: \'ap-guangzhou\'')" class="text-neutral-500 hover:text-white transition" title="Copy Content">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
</div>
<pre class="text-xs font-mono text-[#C9CDD4] leading-relaxed overflow-x-auto whitespace-pre flex-grow custom-scrollbar"><span class="text-purple-400">providers:</span>
<span class="text-green-400">aws:</span>
<span class="text-blue-300">AWS_ACCESS_KEY_ID:</span> "AKID..."
<span class="text-blue-300">AWS_SECRET_ACCESS_KEY:</span> "WWWW..."
<span class="text-blue-300">region:</span> "us-east-1"
<span class="text-green-400">aliyun:</span>
<span class="text-blue-300">ALICLOUD_ACCESS_KEY:</span> "AKID..."
<span class="text-blue-300">ALICLOUD_SECRET_KEY:</span> "WWWW..."
<span class="text-blue-300">region:</span> "cn-hangzhou"
<span class="text-green-400">tencentcloud:</span>
<span class="text-blue-300">TENCENTCLOUD_SECRET_ID:</span> "AKID..."
<span class="text-blue-300">TENCENTCLOUD_SECRET_KEY:</span> "WWWW..."
<span class="text-blue-300">region:</span> "ap-guangzhou"</pre>
</div>
</div>
<!-- Content: Env -->
<div id="content-env" class="hidden-tab">
<div class="bg-[#1e1e1e] rounded-md p-4 border border-neutral-800 shadow-inner h-[220px] flex flex-col">
<div class="flex justify-between items-center mb-3 pb-3 border-b border-white/10">
<span class="text-xs font-mono text-neutral-500">Bash / Zsh</span>
<button onclick="copyCommand('export ALICLOUD_ACCESS_KEY=\'...\'\nexport ALICLOUD_SECRET_KEY=\'...\'')" class="text-neutral-500 hover:text-white transition" title="Copy Commands">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
<pre class="text-xs font-mono text-[#C9CDD4] leading-relaxed overflow-x-auto whitespace-pre flex-grow"><span class="text-purple-400">export</span> ALICLOUD_ACCESS_KEY="..."
<span class="text-purple-400">export</span> ALICLOUD_SECRET_KEY="..."
<span class="text-neutral-500"># Verify</span>
redc config check</pre>
</div>
</div>
</div>
<!-- Cheatsheet Card (Placed Second/Right) -->
<div class="pd-card p-6">
<h4 class="font-bold text-sm mb-5 flex items-center gap-2" style="color: var(--text-primary);">
<div class="w-6 h-6 rounded bg-primary-50 dark:bg-primary-900/30 flex items-center justify-center text-primary-500">
<i data-lucide="terminal" class="w-4 h-4"></i>
</div>
<span data-i18n="cheatsheet_title">Cheatsheet</span>
</h4>
<div class="space-y-3">
<div class="group flex items-center justify-between p-3 rounded border transition cursor-pointer"
style="background-color: var(--bg-secondary); border-color: var(--border-color);"
onmouseover="this.style.borderColor='#165DFF'"
onmouseout="this.style.borderColor=getComputedStyle(document.documentElement).getPropertyValue('--border-color')"
onclick="copyCommand('redc ps')">
<div>
<div class="text-xs font-semibold mb-1" style="color: var(--text-tertiary);" data-i18n="cmd_status_title">Check Status</div>
<code class="font-mono text-sm" style="color: var(--text-primary);">redc ps</code>
</div>
<i data-lucide="copy" class="w-4 h-4 opacity-50 group-hover:opacity-100 transition" style="color: var(--text-secondary);"></i>
</div>
<div class="group flex items-center justify-between p-3 rounded border transition cursor-pointer"
style="background-color: var(--bg-secondary); border-color: var(--border-color);"
onmouseover="this.style.borderColor='#165DFF'"
onmouseout="this.style.borderColor=getComputedStyle(document.documentElement).getPropertyValue('--border-color')"
onclick="copyCommand('redc exec <id> cmd')">
<div>
<div class="text-xs font-semibold mb-1" style="color: var(--text-tertiary);" data-i18n="cmd_exec_title">Execute Command</div>
<code class="font-mono text-sm" style="color: var(--text-primary);">redc exec <id> cmd</code>
</div>
<i data-lucide="copy" class="w-4 h-4 opacity-50 group-hover:opacity-100 transition" style="color: var(--text-secondary);"></i>
</div>
<div class="group flex items-center justify-between p-3 rounded border transition cursor-pointer"
style="background-color: var(--bg-secondary); border-color: var(--border-color);"
onmouseover="this.style.borderColor='#165DFF'"
onmouseout="this.style.borderColor=getComputedStyle(document.documentElement).getPropertyValue('--border-color')"
onclick="copyCommand('redc cp src dst')">
<div>
<div class="text-xs font-semibold mb-1" style="color: var(--text-tertiary);" data-i18n="cmd_cp_title">Transfer Files</div>
<code class="font-mono text-sm" style="color: var(--text-primary);">redc cp src dst</code>
</div>
<i data-lucide="copy" class="w-4 h-4 opacity-50 group-hover:opacity-100 transition" style="color: var(--text-secondary);"></i>
</div>
</div>
</div>
</div>
</section>
<!-- Registry Section (Full Width) -->
<section id="registry-section" class="py-16 px-6" style="background-color: var(--bg-secondary);">
<div class="max-w-7xl mx-auto">
<div class="flex flex-col sm:flex-row justify-between items-center mb-6 gap-4">
<div>
<h2 class="text-xl font-bold" style="color: var(--text-primary);" data-i18n="registry_title">Template Registry</h2>
<p class="text-sm mt-1" style="color: var(--text-tertiary);">Explore community driven infrastructure templates.</p>
</div>
<div class="flex gap-3 w-full sm:w-auto">
<div class="relative flex-1 sm:w-64">
<i data-lucide="search" class="w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2" style="color: var(--text-tertiary);"></i>
<input type="text" id="search-input"
class="w-full pl-9 pr-4 py-2 border rounded-md text-sm focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500 transition"
style="background-color: var(--bg-card); border-color: var(--border-color); color: var(--text-primary);"
data-i18n-placeholder="search_placeholder"
placeholder="Search templates...">
</div>
<div class="flex border rounded-md p-1" style="background-color: var(--bg-card); border-color: var(--border-color);">
<button onclick="switchView('grid')" id="btn-grid" class="view-btn p-1.5 rounded active transition" style="color: var(--text-primary);"><i data-lucide="layout-grid" class="w-4 h-4"></i></button>
<button onclick="switchView('table')" id="btn-table" class="view-btn p-1.5 rounded transition" style="color: var(--text-tertiary);"><i data-lucide="list" class="w-4 h-4"></i></button>
</div>
</div>
</div>
<div class="flex flex-wrap gap-2 mb-6" id="filter-container">
<button class="filter-btn active px-3 py-1.5 transition text-sm" onclick="filterByProvider('all')">All</button>
<!-- Dynamic Filters -->
</div>
<div id="content-area" class="min-h-[300px]">
<!-- Content -->
<div class="flex flex-col items-center justify-center py-20" style="color: var(--text-tertiary);">
<i data-lucide="loader-2" class="w-8 h-8 animate-spin text-primary-500 mb-3"></i>
<p class="text-sm">Loading templates...</p>
</div>
</div>
<div class="mt-4 text-right text-xs font-mono" style="color: var(--text-tertiary);" id="build-info"></div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="border-t py-12" style="background-color: var(--bg-card); border-color: var(--border-color);">
<div class="max-w-7xl mx-auto px-6 flex flex-col md:flex-row justify-between items-center gap-6">
<div class="flex items-center gap-2" style="color: var(--text-secondary);">
<span class="font-bold text-lg">Redc</span>
<span style="color: var(--text-tertiary);">|</span>
<span class="text-sm" style="color: var(--text-tertiary);">© 2026 WGPSec</span>
</div>
<div class="flex gap-6 text-sm" style="color: var(--text-tertiary);">
<a href="https://github.com/wgpsec/redc" class="hover:text-primary-500 transition">GitHub</a>
<a href="#" class="hover:text-primary-500 transition">Docs</a>
<a href="#" class="hover:text-primary-500 transition">Templates</a>
</div>
</div>
</footer>
<!-- Modal -->
<div id="modal" class="fixed inset-0 z-50 hidden" aria-labelledby="modal-title" role="dialog" aria-modal="true">
<div class="fixed inset-0 bg-neutral-900/60 backdrop-blur-sm transition-opacity opacity-0" id="modal-backdrop"></div>
<div class="fixed inset-0 z-10 overflow-y-auto">
<div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0">
<div class="relative transform overflow-hidden rounded-lg text-left shadow-2xl transition-all sm:my-8 sm:w-full sm:max-w-4xl opacity-0 translate-y-4" id="modal-panel" style="background-color: var(--bg-card);">
<!-- Header -->
<div class="px-6 py-5 border-b flex justify-between items-start sticky top-0 z-20" style="background-color: var(--bg-card); border-color: var(--border-color);">
<div>
<h3 class="text-xl font-bold flex items-center gap-3" style="color: var(--text-primary);" id="modal-title">
<!-- JS Populated -->
</h3>
<div class="flex items-center gap-4 mt-2 text-xs" style="color: var(--text-tertiary);">
<span class="flex items-center gap-1.5 px-2 py-1 rounded" style="background-color: var(--bg-secondary); color: var(--text-secondary);"><i data-lucide="user" class="w-3 h-3"></i> <span id="modal-author"></span></span>
<span class="flex items-center gap-1.5 px-2 py-1 rounded" style="background-color: var(--bg-secondary); color: var(--text-secondary);"><i data-lucide="tag" class="w-3 h-3"></i> <span id="modal-version"></span></span>
<span class="font-mono text-neutral-400" id="modal-footer-info"></span>
</div>
</div>
<button type="button" class="p-2 rounded transition hover:bg-neutral-100 dark:hover:bg-neutral-800" style="color: var(--text-tertiary);" onclick="closeModal()">
<i data-lucide="x" class="w-5 h-5"></i>
</button>
</div>
<!-- Command Bar -->
<div class="px-6 py-4 border-b flex items-center justify-between" style="background-color: var(--bg-secondary); border-color: var(--border-color);">
<div class="flex items-center gap-3 text-sm">
<span class="font-bold" style="color: var(--text-secondary);">Run:</span>
<code class="font-mono text-primary-600 bg-white dark:bg-neutral-800 px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 shadow-sm" id="modal-cmd"></code>
</div>
<button id="modal-pull-cmd-container" class="btn-outline px-3 py-1.5 text-xs flex items-center gap-2 shadow-sm">
<i data-lucide="copy" class="w-3 h-3"></i> Copy
</button>
</div>
<div class="px-8 py-8 min-h-[300px] max-h-[60vh] overflow-y-auto custom-scrollbar" style="background-color: var(--bg-card);">
<p class="text-sm mb-8 pb-4 border-b leading-relaxed" style="color: var(--text-secondary); border-color: var(--border-color);" id="modal-desc"></p>
<div id="markdown-content" class="markdown-body" style="background-color: transparent;"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Toast -->
<div id="toast" class="fixed top-6 left-1/2 -translate-x-1/2 z-50 pointer-events-none">
<div class="bg-neutral-800 text-white px-4 py-2.5 rounded-lg shadow-xl flex items-center gap-3 transform -translate-y-20 transition-all duration-300 opacity-0" id="toast-body">
<i data-lucide="check-circle" class="w-4 h-4 text-green-400"></i>
<span class="font-medium text-sm" data-i18n="copied">Command copied to clipboard</span>
</div>
</div>
<script>
// --- State ---
let currentLang = localStorage.getItem('redc-lang') || (navigator.language && navigator.language.startsWith('zh') ? 'zh-CN' : 'en');
let currentTheme = localStorage.getItem('redc-theme') || 'light';
let currentView = 'grid';
let currentFilter = 'all';
let allTemplates = [];
let filteredTemplates = [];
// --- I18N ---
const translations = {
'zh-CN': {
hero_badge: '红队基础设施多云自动化部署工具',
hero_title_prefix: '红队基础设施',
hero_title_suffix: '多云自动化部署工具',
hero_description: '不仅仅是 IaC,更是攻防环境的自动化调度器。提供 CLI 和 GUI 双模式,一键编排、部署与销毁多云资源。',
feat_cloud_title: '多云支持',
feat_cloud_desc: '适配阿里云、腾讯云、AWS、Azure、GCP 等主流厂商,环境一键拉起。',
feat_iac_title: '状态管理',
feat_iac_desc: '本地保存资源状态,一条命令销毁环境,杜绝资源浪费。',
feat_mcp_title: 'MCP 支持',
feat_mcp_desc: '支持模型上下文协议,与 AI 助手无缝集成,自然语言管理设施。',
feat_compose_title: '服务编排',
feat_compose_desc: '支持 Compose 编排,通过 YAML 同时管理多个云服务实例。',
gui_badge: '桌面客户端',
gui_title: 'Redc GUI',
gui_description: '不只是命令行。Redc GUI 提供可视化仪表盘、AI 聊天助手、一键部署管理,让红队基础设施管理更加直观高效。',
gui_feat_1: '可视化仪表盘,实时资源概览',
gui_feat_2: '内置 AI Chat,智能辅助部署',
gui_feat_3: '一键部署、SSH 终端、文件管理',
gui_feat_4: '跨平台:macOS、Windows、Linux',
gui_download: '下载 GUI 客户端',
guide_title: '快速开始',
step1_title: '安装',
step2_title: '配置',
step3_title: '拉取',
step4_title: '运行',
cheatsheet_title: '常用命令',
cmd_status_title: '查看状态',
cmd_exec_title: '执行命令',
cmd_cp_title: '文件传输',
registry_title: '武器库模版',
search_placeholder: '搜索模版、云厂商...',
loading: '正在加载武器库...',
no_results: '未找到相关模版',
no_results_hint: '尝试更换关键词或分类。',
clear_search: '清除搜索',
copied: '已复制到剪贴板',
table_provider: '云厂商',
table_name: '名称',
table_desc: '描述',
table_author: '作者',
table_version: '版本',
table_action: '操作'
},
'en': {
hero_badge: 'Red Team Infrastructure Automation',
hero_title_prefix: 'Red Team Infrastructure',
hero_title_suffix: 'Multi-Cloud Automation',
hero_description: 'More than just IaC, it is an automated scheduler for offensive environments. Available as both CLI and GUI, orchestrate, deploy, and destroy multi-cloud resources with ease.',
feat_cloud_title: 'Multi-Cloud',
feat_cloud_desc: 'Support AWS, Aliyun, Tencent, Azure, GCP and more.',
feat_iac_title: 'State Management',
feat_iac_desc: 'Local state management, one-click destroy to prevent resource waste.',
feat_mcp_title: 'MCP Support',
feat_mcp_desc: 'Model Context Protocol support for seamless AI assistant integration.',
feat_compose_title: 'Compose',
feat_compose_desc: 'Orchestrate multiple cloud services via simple YAML configuration.',
gui_badge: 'Desktop App',
gui_title: 'Redc GUI',
gui_description: 'More than just CLI. Redc GUI provides a visual dashboard, AI chat assistant, and one-click deployment management for intuitive red team infrastructure operations.',
gui_feat_1: 'Visual dashboard with real-time resource overview',
gui_feat_2: 'Built-in AI Chat for intelligent deployment assistance',
gui_feat_3: 'One-click deploy, SSH terminal, and file management',
gui_feat_4: 'Cross-platform: macOS, Windows, Linux',
gui_download: 'Download GUI',
guide_title: 'Quick Start',
step1_title: 'Install',
step2_title: 'Configure',
step3_title: 'Pull',
step4_title: 'Run',
cheatsheet_title: 'Cheatsheet',
cmd_status_title: 'Check Status',
cmd_exec_title: 'Execute Command',
cmd_cp_title: 'Transfer Files',
registry_title: 'Template Registry',
search_placeholder: 'Search templates...',
loading: 'Loading arsenal...',
no_results: 'No templates found',
no_results_hint: 'Try different keywords or filters.',
clear_search: 'Clear Search',
copied: 'Copied to clipboard',
table_provider: 'Provider',
table_name: 'Name',
table_desc: 'Description',
table_author: 'Author',
table_version: 'Version',
table_action: 'Action'
}
};
// --- Core Logic ---
document.addEventListener('DOMContentLoaded', () => {
initTheme();
setLanguage(currentLang);
fetchData();
setupSearch();
lucide.createIcons();
});
async function fetchData() {
try {
const response = await fetch(`index.json?t=${new Date().getTime()}`);
if (!response.ok) throw new Error('Failed to load data');
const data = await response.json();
if (Array.isArray(data.templates)) {
allTemplates = data.templates;
} else if (typeof data.templates === 'object') {
allTemplates = Object.values(data.templates);
} else {
allTemplates = [];
}
allTemplates.sort((a, b) => {
const dateA = new Date(a.versions?.[a.latest]?.updated_at || a.updated_at || 0);
const dateB = new Date(b.versions?.[b.latest]?.updated_at || b.updated_at || 0);
return dateB - dateA;
});
const buildDate = new Date(data.updated_at || Date.now());
document.getElementById('build-info').innerHTML =
`Updated: ${buildDate.toLocaleDateString()}`;
renderFilters(allTemplates);
filterTemplates();
} catch (error) {
console.error(error);
document.getElementById('content-area').innerHTML = `
<div class="text-center py-20 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded mx-auto max-w-lg">
<i data-lucide="alert-triangle" class="w-8 h-8 text-red-500 mx-auto mb-2"></i>
<h3 class="text-sm font-bold text-red-600 dark:text-red-400">Failed to load registry</h3>
<p class="text-red-500 dark:text-red-300 text-xs mt-1">${error.message}</p>
</div>`;
lucide.createIcons();
}
}
// --- Filters ---
function renderFilters(templates) {
const providers = new Set();
templates.forEach(t => {
const provider = t.provider || t.id.split('/')[0];
providers.add(provider.toLowerCase());
});
const container = document.getElementById('filter-container');
const sortedProviders = Array.from(providers).sort();
sortedProviders.forEach(p => {
const btn = document.createElement('button');
btn.className = 'filter-btn px-3 py-1.5 transition capitalize';
btn.textContent = p;
btn.onclick = () => filterByProvider(p);
container.appendChild(btn);
});
}
function filterByProvider(provider) {
currentFilter = provider;
document.querySelectorAll('.filter-btn').forEach(btn => {
const isActive = btn.textContent.toLowerCase() === provider;
if (isActive) {
btn.classList.add('active');
btn.style.backgroundColor = '#165DFF';
btn.style.color = '#FFFFFF';
} else {
btn.classList.remove('active');
btn.style.backgroundColor = 'var(--bg-card)';
btn.style.color = 'var(--text-secondary)';
}
});
filterTemplates();
}
function filterTemplates() {
const searchTerm = document.getElementById('search-input').value.toLowerCase().trim();
filteredTemplates = allTemplates.filter(t => {
const provider = (t.provider || t.id.split('/')[0]).toLowerCase();
const meta = t.metadata || {};
const matchesFilter = currentFilter === 'all' || provider === currentFilter;
const matchesSearch = !searchTerm ||
(t.id || '').toLowerCase().includes(searchTerm) ||
(meta.name || '').toLowerCase().includes(searchTerm) ||
(meta.description || '').toLowerCase().includes(searchTerm) ||
(meta.description_en || '').toLowerCase().includes(searchTerm) ||
(meta.author || '').toLowerCase().includes(searchTerm) ||
provider.includes(searchTerm);
return matchesFilter && matchesSearch;
});
renderContent(filteredTemplates);
}
// --- Render Content ---
function switchView(view) {