-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathconfig-generator.html
More file actions
1990 lines (1774 loc) · 115 KB
/
config-generator.html
File metadata and controls
1990 lines (1774 loc) · 115 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">
<title>WeRead Bot 配置生成器 Beta</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.js"></script>
<script src="https://unpkg.com/js-yaml@4.1.0/dist/js-yaml.js"></script>
<style>
.tab-content { display: none; }
.tab-content.active { display: block; }
.step-indicator { transition: all 0.3s ease; }
.step-indicator.active { background-color: rgb(99 102 241); color: white; }
.step-indicator.completed { background-color: rgb(34 197 94); color: white; }
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Header -->
<header class="bg-white shadow-sm border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center py-6">
<div class="flex items-center">
<i data-lucide="book-open" class="w-8 h-8 text-indigo-600 mr-3"></i>
<div>
<h1 class="text-2xl font-bold text-gray-900">WeRead Bot 配置生成器 Beta</h1>
<p class="text-sm text-gray-600">轻松生成微信读书机器人配置文件</p>
</div>
</div>
<div class="flex items-center space-x-4">
<button onclick="resetConfig()" class="px-4 py-2 text-gray-600 hover:text-gray-900 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
<i data-lucide="refresh-cw" class="w-4 h-4 mr-2 inline"></i>
重置
</button>
<button onclick="loadExample()" class="px-4 py-2 text-gray-600 hover:text-gray-900 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
<i data-lucide="file-text" class="w-4 h-4 mr-2 inline"></i>
加载示例
</button>
</div>
</div>
</div>
</header>
<!-- Progress Steps -->
<div class="bg-white border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-4">
<div class="step-indicator active rounded-full w-10 h-10 flex items-center justify-center text-sm font-medium border-2 border-indigo-600" data-step="1">
1
</div>
<div class="flex-1 h-1 bg-gray-200">
<div class="h-1 bg-indigo-600 transition-all duration-300" id="progress-1" style="width: 0%"></div>
</div>
<div class="step-indicator rounded-full w-10 h-10 flex items-center justify-center text-sm font-medium border-2 border-gray-300" data-step="2">
2
</div>
<div class="flex-1 h-1 bg-gray-200">
<div class="h-1 bg-indigo-600 transition-all duration-300" id="progress-2" style="width: 0%"></div>
</div>
<div class="step-indicator rounded-full w-10 h-10 flex items-center justify-center text-sm font-medium border-2 border-gray-300" data-step="3">
3
</div>
<div class="flex-1 h-1 bg-gray-200">
<div class="h-1 bg-indigo-600 transition-all duration-300" id="progress-3" style="width: 0%"></div>
</div>
<div class="step-indicator rounded-full w-10 h-10 flex items-center justify-center text-sm font-medium border-2 border-gray-300" data-step="4">
4
</div>
</div>
<div class="text-sm text-gray-600">
第 <span id="current-step">1</span> 步,共 4 步
</div>
</div>
<div class="flex items-center justify-between mt-4">
<div class="text-center" style="width: 80px;">
<div class="text-sm font-medium text-gray-900">基础配置</div>
</div>
<div class="text-center" style="width: 80px;">
<div class="text-sm font-medium text-gray-900">阅读配置</div>
</div>
<div class="text-center" style="width: 80px;">
<div class="text-sm font-medium text-gray-900">通知配置</div>
</div>
<div class="text-center" style="width: 80px;">
<div class="text-sm font-medium text-gray-900">多用户配置</div>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<!-- Form Panel -->
<div class="lg:col-span-2">
<div class="bg-white rounded-lg shadow-sm border">
<div class="p-6">
<!-- Step 1: Basic Configuration -->
<div id="step-1" class="tab-content active">
<div class="mb-6">
<h2 class="text-xl font-semibold text-gray-900 mb-2">基础配置</h2>
<p class="text-gray-600">设置应用的基本运行参数</p>
</div>
<div class="space-y-6">
<!-- App Name -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">应用名称</label>
<input type="text" id="appName" value="WeReadBot"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<!-- Startup Mode -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">启动模式</label>
<select id="startupMode" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="immediate">立即执行</option>
<option value="scheduled">定时执行</option>
<option value="daemon">守护进程</option>
</select>
</div>
<!-- Startup Delay -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">启动延迟(秒)</label>
<input type="text" id="startupDelay" value="60-300" placeholder="例如: 60-300"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<p class="text-xs text-gray-500 mt-1">支持范围值,如 60-300 表示60到300秒随机,防止被识别,建议尽量设置大一些</p>
</div>
<!-- Max Concurrent Users -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">最大并发用户数</label>
<input type="number" id="maxConcurrentUsers" value="1" min="1"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<p class="text-xs text-gray-500 mt-1">多用户模式下同时执行的账号数量,推荐 1-3 之间,根据服务器性能和风控策略调优</p>
</div>
<!-- CURL Configuration -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">CURL配置方式</label>
<div class="space-y-3">
<label class="flex items-center">
<input type="radio" name="curlType" value="file" checked class="mr-2">
<span>文件路径</span>
</label>
<label class="flex items-center">
<input type="radio" name="curlType" value="content" class="mr-2">
<span>直接内容</span>
</label>
</div>
</div>
<!-- CURL File Path -->
<div id="curlFileGroup">
<label class="block text-sm font-medium text-gray-700 mb-2">CURL文件路径</label>
<input type="text" id="curlFilePath" value="curl_command.txt" placeholder="例如: curl_command.txt"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<!-- CURL Content -->
<div id="curlContentGroup" class="hidden">
<label class="block text-sm font-medium text-gray-700 mb-2">CURL命令内容</label>
<textarea id="curlContent" rows="4" placeholder="粘贴完整的curl命令..."
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"></textarea>
</div>
<!-- Hack Configuration -->
<div class="border-t pt-6 mt-6">
<div class="mb-4">
<h3 class="text-lg font-medium text-gray-900 flex items-center">
<i data-lucide="settings" class="w-5 h-5 mr-2 text-orange-500"></i>
高级配置
</h3>
<p class="text-sm text-gray-600 mt-1">解决特殊兼容性问题的配置选项</p>
</div>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Cookie刷新QL属性
<span class="ml-1 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-orange-100 text-orange-800">
高级
</span>
</label>
<div class="space-y-2">
<label class="flex items-center">
<input type="radio" name="cookieRefreshQl" value="false" checked class="mr-2">
<span>False (默认)</span>
</label>
<label class="flex items-center">
<input type="radio" name="cookieRefreshQl" value="true" class="mr-2">
<span>True (解决cookie刷新问题时使用)</span>
</label>
</div>
<p class="text-xs text-gray-500 mt-1">
根据不同用户的环境,可能需要设置为True或False来确保cookie刷新正常工作
</p>
</div>
</div>
</div>
</div>
</div>
<!-- Step 2: Reading Configuration -->
<div id="step-2" class="tab-content">
<div class="mb-6">
<h2 class="text-xl font-semibold text-gray-900 mb-2">阅读配置</h2>
<p class="text-gray-600">设置阅读行为和策略参数</p>
</div>
<div class="space-y-6">
<!-- Reading Mode -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">阅读模式</label>
<select id="readingMode" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="smart_random">智能随机</option>
<option value="sequential">顺序阅读</option>
<option value="pure_random">纯随机</option>
</select>
</div>
<!-- Target Duration -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">目标阅读时长(分钟)</label>
<input type="text" id="targetDuration" value="45-90" placeholder="例如: 45-90"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<p class="text-xs text-gray-500 mt-1">建议设置为45-90分钟,过长的阅读不符合人类阅读习惯</p>
</div>
<!-- Reading Interval -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">阅读间隔(秒)</label>
<input type="text" id="readingInterval" value="30-48" placeholder="例如: 30-48"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<!-- CURL Data Priority -->
<div>
<h3 class="text-lg font-medium text-gray-900 mb-4">数据优先级设置</h3>
<div class="space-y-3">
<label class="flex items-center">
<input type="checkbox" id="useCurlDataFirst" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">优先使用CURL数据</span>
</label>
<label class="flex items-center">
<input type="checkbox" id="fallbackToConfig" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">CURL数据无效时回退到配置</span>
</label>
</div>
</div>
<!-- Books Configuration -->
<div>
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">书籍配置</h3>
<button onclick="addBook()" class="px-3 py-1 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
<i data-lucide="plus" class="w-4 h-4 mr-1 inline"></i>
添加书籍
</button>
</div>
<p class="text-sm text-gray-600 mb-4">章节索引优先级:配置的索引值 > CURL提取的值 > 自动计算的索引</p>
<div id="booksContainer" class="space-y-4">
<!-- Books will be added here dynamically -->
</div>
</div>
<!-- Smart Random Settings -->
<div id="smartRandomSettings">
<h3 class="text-lg font-medium text-gray-900 mb-4">智能随机设置</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">书籍连续性</label>
<input type="range" id="bookContinuity" min="0" max="1" step="0.1" value="0.8"
class="w-full" oninput="updateRangeValue('bookContinuity', this.value)">
<div class="flex justify-between text-xs text-gray-500">
<span>0%</span>
<span id="bookContinuityValue">80%</span>
<span>100%</span>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">章节连续性</label>
<input type="range" id="chapterContinuity" min="0" max="1" step="0.1" value="0.7"
class="w-full" oninput="updateRangeValue('chapterContinuity', this.value)">
<div class="flex justify-between text-xs text-gray-500">
<span>0%</span>
<span id="chapterContinuityValue">70%</span>
<span>100%</span>
</div>
</div>
</div>
<div class="mt-4">
<label class="block text-sm font-medium text-gray-700 mb-2">换书冷却时间(秒)</label>
<input type="number" id="bookSwitchCooldown" value="300" min="0"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
<!-- Human Simulation -->
<div>
<h3 class="text-lg font-medium text-gray-900 mb-4">人类行为模拟</h3>
<div class="space-y-4">
<label class="flex items-center">
<input type="checkbox" id="humanSimulationEnabled" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">启用人类行为模拟</span>
</label>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">休息概率</label>
<input type="range" id="breakProbability" min="0" max="1" step="0.05" value="0.1"
class="w-full" oninput="updateRangeValue('breakProbability', this.value)">
<div class="flex justify-between text-xs text-gray-500">
<span>0%</span>
<span id="breakProbabilityValue">10%</span>
<span>100%</span>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">休息时长(秒)</label>
<input type="text" id="breakDuration" value="5-20" placeholder="例如: 5-20"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="flex items-center">
<input type="checkbox" id="readingSpeedVariation" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">阅读速度变化</span>
</label>
</div>
<div>
<label class="flex items-center">
<input type="checkbox" id="rotateUserAgent" class="mr-2">
<span class="text-sm font-medium text-gray-700">User-Agent轮换</span>
</label>
<p class="text-xs text-gray-500 mt-1">建议不轮换,使用 curl 自带的 User-Agent</p>
</div>
</div>
</div>
</div>
<!-- Network Settings -->
<div>
<h3 class="text-lg font-medium text-gray-900 mb-4">网络设置</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">超时时间(秒)</label>
<input type="number" id="networkTimeout" value="30" min="1"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">重试次数</label>
<input type="number" id="retryTimes" value="3" min="0"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">重试延迟(秒)</label>
<input type="text" id="retryDelay" value="5-15" placeholder="例如: 5-15"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">请求频率限制(请求/分钟)</label>
<input type="number" id="rateLimit" value="10" min="1"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
</div>
</div>
</div>
<!-- Step 3: Notification Configuration -->
<div id="step-3" class="tab-content">
<div class="mb-6">
<h2 class="text-xl font-semibold text-gray-900 mb-2">通知配置</h2>
<p class="text-gray-600">配置消息推送服务</p>
</div>
<div class="space-y-6">
<!-- Notification Toggle -->
<div>
<label class="flex items-center">
<input type="checkbox" id="notificationEnabled" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">启用通知功能</span>
</label>
</div>
<!-- Include Statistics -->
<div>
<label class="flex items-center">
<input type="checkbox" id="includeStatistics" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">包含详细统计信息</span>
</label>
</div>
<!-- Notification Channels -->
<div id="notificationChannels">
<h3 class="text-lg font-medium text-gray-900 mb-4">通知通道</h3>
<div class="space-y-4">
<!-- PushPlus -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="pushplus">
<span class="font-medium">PushPlus</span>
</label>
<span class="text-xs text-gray-500">推荐</span>
</div>
<div class="channel-config hidden" data-channel-config="pushplus">
<input type="text" placeholder="请输入 PushPlus Token"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="pushplus-token">
</div>
</div>
<!-- Telegram -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="telegram">
<span class="font-medium">Telegram</span>
</label>
<span class="text-xs text-blue-500">全球推送</span>
</div>
<div class="channel-config hidden" data-channel-config="telegram">
<div class="space-y-3">
<input type="text" placeholder="Bot Token"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="telegram-bot_token">
<input type="text" placeholder="Chat ID"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="telegram-chat_id">
<div class="border-t pt-3">
<label class="block text-sm font-medium text-gray-700 mb-2">代理设置(可选)</label>
<div class="space-y-2">
<input type="text" placeholder="HTTP代理(例如:http://proxy_host:port)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="telegram-proxy_http">
<input type="text" placeholder="HTTPS代理(例如:https://proxy_host:port)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="telegram-proxy_https">
</div>
</div>
</div>
</div>
</div>
<!-- WxPusher -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="wxpusher">
<span class="font-medium">WxPusher</span>
</label>
</div>
<div class="channel-config hidden" data-channel-config="wxpusher">
<input type="text" placeholder="请输入 WxPusher SPT"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="wxpusher-spt">
</div>
</div>
<!-- Bark -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="bark">
<span class="font-medium">Bark (iOS)</span>
</label>
<span class="text-xs text-orange-500">iOS推送</span>
</div>
<div class="channel-config hidden" data-channel-config="bark">
<div class="space-y-3">
<input type="text" placeholder="服务器地址 (默认: https://api.day.app)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="bark-server">
<input type="text" placeholder="设备密钥"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="bark-device_key">
<input type="text" placeholder="通知音效 (可选,默认: default)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="bark-sound">
</div>
</div>
</div>
<!-- Server酱³ -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="serverchan3">
<span class="font-medium">Server酱³</span>
</label>
<span class="text-xs text-blue-500">微信推送</span>
</div>
<div class="channel-config hidden" data-channel-config="serverchan3">
<div class="space-y-3">
<input type="text" placeholder="请输入 Server酱³ UID"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="serverchan3-uid">
<input type="text" placeholder="请输入 Server酱³ SendKey"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="serverchan3-sendkey">
<input type="text" placeholder="标签 (可选,用|分隔多个标签)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="serverchan3-tags">
<input type="text" placeholder="简短描述 (可选)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="serverchan3-short">
</div>
</div>
</div>
<!-- PushDeer -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="pushdeer">
<span class="font-medium">PushDeer</span>
</label>
<span class="text-xs text-green-500">通用推送</span>
</div>
<div class="channel-config hidden" data-channel-config="pushdeer">
<div class="space-y-3">
<input type="text" placeholder="请输入 PushDeer PushKey"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="pushdeer-pushkey">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">消息类型</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="pushdeer-type">
<option value="markdown">Markdown</option>
<option value="text">纯文本</option>
</select>
</div>
</div>
</div>
</div>
<!-- Apprise -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="apprise">
<span class="font-medium">Apprise</span>
</label>
<span class="text-xs text-purple-500">多服务支持</span>
</div>
<div class="channel-config hidden" data-channel-config="apprise">
<div class="space-y-3">
<input type="text" placeholder="Apprise通知URL(支持Discord、Slack、Email等)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="apprise-url">
<p class="text-xs text-gray-500">示例:discord://webhook_id/webhook_token 或 mailto://user:pass@domain.com</p>
</div>
</div>
</div>
<!-- 飞书 -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="feishu">
<span class="font-medium">飞书</span>
</label>
<span class="text-xs text-blue-500">办公协同</span>
</div>
<div class="channel-config hidden" data-channel-config="feishu">
<div class="space-y-3">
<input type="text" placeholder="飞书机器人Webhook URL"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="feishu-webhook_url">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">消息类型</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="feishu-msg_type">
<option value="text">纯文本</option>
<option value="rich_text">富文本</option>
</select>
</div>
</div>
</div>
</div>
<!-- 企业微信 -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="wework">
<span class="font-medium">企业微信</span>
</label>
<span class="text-xs text-green-500">企业推送</span>
</div>
<div class="channel-config hidden" data-channel-config="wework">
<div class="space-y-3">
<input type="text" placeholder="企业微信机器人Webhook URL"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="wework-webhook_url">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">消息类型</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="wework-msg_type">
<option value="text">纯文本</option>
<option value="markdown">Markdown</option>
<option value="news">图文</option>
</select>
</div>
</div>
</div>
</div>
<!-- 钉钉 -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="dingtalk">
<span class="font-medium">钉钉</span>
</label>
<span class="text-xs text-red-500">办公推送</span>
</div>
<div class="channel-config hidden" data-channel-config="dingtalk">
<div class="space-y-3">
<input type="text" placeholder="钉钉机器人Webhook URL"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="dingtalk-webhook_url">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">消息类型</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="dingtalk-msg_type">
<option value="text">纯文本</option>
<option value="markdown">Markdown</option>
<option value="link">链接</option>
</select>
</div>
</div>
</div>
</div>
<!-- Ntfy -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="ntfy">
<span class="font-medium">Ntfy</span>
</label>
<span class="text-xs text-orange-500">开源推送</span>
</div>
<div class="channel-config hidden" data-channel-config="ntfy">
<div class="space-y-3">
<input type="text" placeholder="Ntfy服务器地址(默认:https://ntfy.sh)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="ntfy-server">
<input type="text" placeholder="主题名称"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="ntfy-topic">
<input type="text" placeholder="访问令牌(可选,用于私有主题)"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="ntfy-token">
</div>
</div>
</div>
<!-- Gotify -->
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex items-center justify-between mb-3">
<label class="flex items-center">
<input type="checkbox" class="channel-checkbox mr-2" data-channel="gotify">
<span class="font-medium">Gotify</span>
</label>
<span class="text-xs text-indigo-500">自建推送</span>
</div>
<div class="channel-config hidden" data-channel-config="gotify">
<div class="space-y-3">
<input type="text" placeholder="Gotify服务器地址"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="gotify-server">
<input type="text" placeholder="应用令牌"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="gotify-token">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">消息优先级(1-10)</label>
<input type="number" placeholder="5" min="1" max="10" value="5"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="gotify-priority">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">消息标题(可选)</label>
<input type="text" placeholder="WeRead Bot 通知"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
data-channel-input="gotify-title">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Step 4: Multi-user Configuration -->
<div id="step-4" class="tab-content">
<div class="mb-6">
<h2 class="text-xl font-semibold text-gray-900 mb-2">多用户配置</h2>
<p class="text-gray-600">配置多个微信读书账号</p>
</div>
<div class="space-y-6">
<!-- Multi-user Toggle -->
<div>
<label class="flex items-center">
<input type="checkbox" id="multiUserEnabled" class="mr-2" onchange="toggleMultiUser()">
<span class="text-sm font-medium text-gray-700">启用多用户模式</span>
</label>
</div>
<!-- Users List -->
<div id="usersList" class="hidden">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">用户列表</h3>
<button onclick="addUser()" class="px-3 py-1 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
<i data-lucide="plus" class="w-4 h-4 mr-1 inline"></i>
添加用户
</button>
</div>
<div id="usersContainer" class="space-y-4">
<!-- Users will be added here dynamically -->
</div>
</div>
<!-- Schedule Configuration -->
<div id="scheduleConfig">
<h3 class="text-lg font-medium text-gray-900 mb-4">定时任务配置</h3>
<div class="space-y-4">
<div>
<label class="flex items-center">
<input type="checkbox" id="scheduleEnabled" class="mr-2">
<span class="text-sm font-medium text-gray-700">启用定时任务</span>
</label>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Cron表达式</label>
<select id="cronExpression" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="0 */2 * * *">每2小时执行一次</option>
<option value="0 */4 * * *">每4小时执行一次</option>
<option value="0 */6 * * *">每6小时执行一次</option>
<option value="30 9 * * *">每天9:30执行</option>
<option value="0 9,18 * * *">每天9:00和18:00执行</option>
<option value="30 9,18 * * *">每天9:30和18:30执行(多时间点)</option>
<option value="0 8,12,18 * * *">每天8:00、12:00、18:00执行</option>
<option value="0 * * * *">每小时执行</option>
<option value="0 0 * * *">每天0点执行</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">时区</label>
<select id="timezone" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="Asia/Shanghai">Asia/Shanghai</option>
<option value="Asia/Beijing">Asia/Beijing</option>
<option value="Asia/Chongqing">Asia/Chongqing</option>
<option value="Asia/Hong_Kong">Asia/Hong_Kong</option>
<option value="Asia/Taipei">Asia/Taipei</option>
<option value="UTC">UTC</option>
<option value="America/New_York">America/New_York</option>
<option value="Europe/London">Europe/London</option>
<option value="Europe/Paris">Europe/Paris</option>
<option value="Asia/Tokyo">Asia/Tokyo</option>
</select>
</div>
</div>
</div>
<!-- Daemon Configuration -->
<div id="daemonConfig">
<h3 class="text-lg font-medium text-gray-900 mb-4">守护进程配置</h3>
<p class="text-sm text-gray-600 mb-4">开启此方式后,程序将执行为一个阅读会话后,休眠一段时间再执行下一次,模拟多次长阅读行为</p>
<div class="space-y-4">
<div>
<label class="flex items-center">
<input type="checkbox" id="daemonEnabled" class="mr-2">
<span class="text-sm font-medium text-gray-700">启用守护进程模式</span>
</label>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">会话间隔(分钟)</label>
<input type="text" id="sessionInterval" value="120-180" placeholder="例如: 120-180"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">每日最大会话数</label>
<input type="number" id="maxDailySessions" value="12" min="1"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
</div>
</div>
<!-- Logging Configuration -->
<div id="loggingConfig">
<h3 class="text-lg font-medium text-gray-900 mb-4">日志配置</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">日志级别</label>
<select id="logLevel" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="DEBUG">DEBUG</option>
<option value="INFO" selected>INFO</option>
<option value="WARNING">WARNING</option>
<option value="ERROR">ERROR</option>
<option value="CRITICAL">CRITICAL</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">日志格式</label>
<select id="logFormat" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="simple">Simple</option>
<option value="detailed" selected>Detailed</option>
<option value="json">JSON</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">日志文件</label>
<input type="text" id="logFile" value="logs/weread.log" placeholder="例如: logs/weread.log"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">最大文件大小</label>
<input type="text" id="logMaxSize" value="10MB" placeholder="例如: 10MB"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">备份文件数量</label>
<input type="number" id="logBackupCount" value="5" min="1"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
<div>
<label class="flex items-center">
<input type="checkbox" id="logConsole" checked class="mr-2">
<span class="text-sm font-medium text-gray-700">控制台显示日志</span>
</label>
</div>
</div>
</div>
</div>
</div>
<!-- Navigation Buttons -->
<div class="flex justify-between mt-8 pt-6 border-t">
<button id="prevBtn" onclick="previousStep()" class="px-6 py-2 text-gray-600 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed" disabled>
<i data-lucide="chevron-left" class="w-4 h-4 mr-2 inline"></i>
上一步
</button>
<button id="nextBtn" onclick="nextStep()" class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
下一步
<i data-lucide="chevron-right" class="w-4 h-4 ml-2 inline"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Preview Panel -->
<div class="lg:col-span-1">
<div class="bg-white rounded-lg shadow-sm border sticky top-8">
<div class="p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-gray-900">配置预览</h3>
<div class="flex space-x-2">
<button onclick="copyConfig()" class="p-2 text-gray-600 hover:text-gray-900 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors" title="复制配置">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
<button onclick="downloadConfig()" class="p-2 text-gray-600 hover:text-gray-900 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors" title="下载配置">
<i data-lucide="download" class="w-4 h-4"></i>
</button>
</div>
</div>
<div class="mb-4">
<div class="flex items-center space-x-2 text-sm text-gray-600">
<i data-lucide="info" class="w-4 h-4"></i>
<span>配置文件将实时更新</span>
</div>
</div>
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
<pre id="configPreview" class="text-sm text-gray-700 whitespace-pre-wrap overflow-x-auto"># WeRead Bot 配置文件
# 由配置生成器自动生成
# 生成时间: <生成时间>
app:
name: WeReadBot
startup_mode: immediate
startup_delay: 1-10
max_concurrent_users: 1
curl_config:
file_path: curl_command.txt
reading:
mode: smart_random
target_duration: 60-70
reading_interval: 25-35
smart_random:
book_continuity: 0.8
chapter_continuity: 0.7
book_switch_cooldown: 300
human_simulation:
enabled: true
break_probability: 0.15
break_duration: 30-180
network:
timeout: 30
retry_times: 3
notification:
enabled: true
include_statistics: true</pre>
</div>
<div class="mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg">
<h4 class="text-sm font-medium text-blue-900 mb-2">配置说明</h4>
<ul class="text-xs text-blue-700 space-y-1">
<li>• 支持YAML格式配置文件</li>
<li>• 可通过环境变量覆盖配置</li>
<li>• 配置文件保存为 config.yaml</li>
<li>• 建议定期备份配置文件</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Toast Notification -->
<div id="toast" class="fixed bottom-4 right-4 transform translate-x-full transition-transform duration-300 z-50">
<div class="bg-white border border-gray-200 rounded-lg shadow-lg p-4 flex items-center space-x-3">
<div id="toastIcon"></div>
<div>
<div id="toastTitle" class="font-medium text-gray-900"></div>
<div id="toastMessage" class="text-sm text-gray-600"></div>
</div>
</div>
</div>
<script>
// Global variables
let currentStep = 1;
let userCount = 0;
let bookCount = 0;
// Initialize the application
document.addEventListener('DOMContentLoaded', function() {
lucide.createIcons();
updateConfigPreview();
initializeEventListeners();
// Add example book for demonstration
if (bookCount === 0) {
addBook();
// Update with example data
const firstBook = document.querySelector('[id^="book-"]');
if (firstBook) {
const bookId = firstBook.id.replace('book-', '');
firstBook.querySelector(`[data-book-input="${bookId}-name"]`).value = '明朝那些事';
firstBook.querySelector(`[data-book-input="${bookId}-book_id"]`).value = 'a57325c05c8ed3a57224187';
// Update chapter with example data
const firstChapter = firstBook.querySelector('[data-chapter-input*="-chapter_id"]');