-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
2025 lines (1897 loc) · 152 KB
/
Copy pathindex.html
File metadata and controls
2025 lines (1897 loc) · 152 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" />
<title>FlashShell · 多会话 SSH / SFTP 桌面终端</title>
<style>
/* ==========================================================================
FlashShell — UI 重设计 · 设计系统 (tech-utility)
语义: 数据密集的运维工作台。单一绿色强调色 + 深色终端 + 系统无衬线 + 等宽。
========================================================================== */
:root {
--bg: oklch(98% 0.005 250);
--surface: oklch(100% 0 0);
--surface-2: oklch(96.5% 0.006 250);
--fg: oklch(22% 0.02 240);
--fg-2: oklch(42% 0.018 240);
--muted: oklch(52% 0.018 240);
--border: oklch(90% 0.008 240);
--border-strong: oklch(83% 0.008 240);
--accent: oklch(55% 0.16 150);
--accent-strong: oklch(48% 0.16 150);
--accent-soft: oklch(94% 0.055 150);
--on-accent: oklch(99% 0.01 150);
--danger: oklch(55% 0.21 25);
--danger-soft: oklch(94% 0.06 25);
--warning: oklch(64% 0.15 80);
--warning-soft: oklch(95% 0.05 80);
--info: oklch(56% 0.15 250);
--info-soft: oklch(94% 0.04 250);
--term-bg: oklch(20% 0.02 240);
--term-fg: oklch(88% 0.02 240);
--term-dim: oklch(64% 0.02 240);
--term-green:oklch(75% 0.16 150);
--term-red: oklch(70% 0.19 25);
--term-amber:oklch(80% 0.15 85);
--term-blue: oklch(75% 0.13 250);
--term-cyan: oklch(78% 0.11 195);
--term-bg2: var(--term-bg2);
--term-border: var(--term-border);
--term-hover: oklch(27% 0.015 240);
--shadow-sm: 0 1px 2px oklch(20% 0.02 240 / 0.06);
--shadow-md: 0 4px 14px oklch(20% 0.02 240 / 0.09);
--shadow-lg: 0 18px 50px oklch(20% 0.02 240 / 0.22);
--r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px;
--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
--font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
html.dark {
--bg: oklch(15% 0.012 240);
--surface: oklch(19% 0.014 240);
--surface-2: oklch(21.5% 0.014 240);
--fg: oklch(92% 0.01 240);
--fg-2: oklch(74% 0.012 240);
--muted: oklch(60% 0.015 240);
--border: oklch(28% 0.014 240);
--border-strong: oklch(35% 0.014 240);
--accent: oklch(73% 0.15 150);
--accent-strong: oklch(79% 0.15 150);
--accent-soft: oklch(30% 0.05 150);
--on-accent: oklch(16% 0.03 150);
--danger: oklch(68% 0.18 25);
--danger-soft: oklch(30% 0.06 25);
--warning: oklch(76% 0.14 85);
--warning-soft: oklch(30% 0.05 85);
--info: oklch(70% 0.12 250);
--info-soft: oklch(30% 0.04 250);
--term-bg: oklch(14% 0.015 240);
--term-fg: oklch(88% 0.02 240);
--term-dim: oklch(63% 0.02 240);
--term-bg2: oklch(20% 0.015 240);
--term-border: oklch(26% 0.014 240);
--term-hover: var(--term-hover);
--shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.4);
--shadow-md: 0 4px 14px oklch(0% 0 0 / 0.45);
--shadow-lg: 0 18px 50px oklch(0% 0 0 / 0.6);
}
/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
margin: 0;
font-family: var(--font-ui);
font-size: 14px;
line-height: 1.45;
color: var(--fg);
background: var(--bg);
-webkit-font-smoothing: antialiased;
overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: oklch(55% 0.01 240 / 0.28); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: oklch(55% 0.01 240 / 0.5); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.app { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }
/* ---------- top bar ---------- */
.topbar {
position: relative;
height: 42px; flex: 0 0 42px;
display: flex; align-items: center; gap: 10px;
padding: 0 12px 0 14px;
background: var(--surface);
border-bottom: 1px solid var(--border);
-webkit-app-region: drag;
}
.topbar button, .topbar .tb-input, .topbar .seg { -webkit-app-region: no-drag; }
.traffic { display: flex; gap: 8px; align-items: center; margin-right: 2px; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.traffic i.r { background: oklch(66% 0.19 25); }
.traffic i.y { background: oklch(80% 0.15 85); }
.traffic i.g { background: oklch(68% 0.15 150); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--on-accent); display: grid; place-items: center; box-shadow: inset 0 0 0 1px oklch(99% 0 0 / 0.18); }
.brand-mark svg { width: 12px; height: 12px; }
.tb-context { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tb-context b { color: var(--fg-2); font-weight: 500; }
.tb-sep { width: 1px; height: 18px; background: var(--border); }
.tb-spacer { flex: 1; }
.tb-right { display: flex; align-items: center; gap: 6px; }
/* mode segmented */
.seg { display: inline-flex; padding: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); transition: all .13s ease; }
.seg button:hover { color: var(--fg); }
.seg button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); font-weight: 500; }
.seg button.active .seg-dot { background: var(--accent); }
/* ---------- icon buttons ---------- */
.icon-btn {
width: 28px; height: 28px; border-radius: 7px;
display: inline-flex; align-items: center; justify-content: center;
color: var(--fg-2); position: relative;
transition: background .13s ease, color .13s ease;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn:focus-visible, .btn:focus-visible, .chip:focus-visible, .nav-item:focus-visible, .machine:focus-visible, .project-card:focus-visible, .tab:focus-visible, .row-main:focus-visible, .tree-item:focus-visible, .dd-item:focus-visible, .mn-item:focus-visible, .sk-key:focus-visible, .tab-add:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.switch:focus-visible, .color-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab .t-close:focus-visible { opacity: 1; }
.icon-btn.badge::after { content: attr(data-count); position: absolute; top: -3px; right: -4px; min-width: 14px; height: 14px; padding: 0 4px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; line-height: 14px; text-align: center; font-family: var(--font-mono); }
/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500; border: 1px solid var(--border); color: var(--fg-2); background: var(--surface); transition: all .13s ease; white-space: nowrap; }
.btn svg { width: 14px; height: 14px; }
.btn:hover { border-color: var(--border-strong); color: var(--fg); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-danger { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 30%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-soft:hover { background: color-mix(in oklch, var(--accent) 22%, transparent); color: var(--accent-strong); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 24px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--border); color: var(--fg-2); transform: none; }
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
/* ---------- status / chips ---------- */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.dot.on { background: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 25%, transparent); }
.dot.off { background: var(--muted); }
.dot.warn { background: var(--warning); }
.dot.err { background: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); color: var(--fg-2); background: var(--surface); transition: all .13s ease; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { border-color: color-mix(in oklch, var(--accent) 50%, var(--border)); color: var(--accent); background: var(--accent-soft); }
.chip .dot { width: 6px; height: 6px; }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-family: var(--font-mono); font-weight: 600; letter-spacing: .02em; }
.tag-batch { background: var(--accent-soft); color: var(--accent-strong); }
.tag-remote { background: var(--warning-soft); color: color-mix(in oklch, var(--warning) 70%, oklch(30% 0.05 80)); }
.tag-info { background: var(--info-soft); color: var(--info); }
/* ---------- rail ---------- */
.app-body { flex: 1; min-height: 0; display: flex; }
.rail {
flex: 0 0 52px; display: flex; flex-direction: column; align-items: center;
gap: 4px; padding: 10px 0; background: var(--surface-2);
border-right: 1px solid var(--border);
}
.rail .nav-item { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--muted); position: relative; transition: all .14s ease; }
.rail .nav-item svg { width: 17px; height: 17px; }
.rail .nav-item:hover { color: var(--fg); background: color-mix(in oklch, var(--fg) 7%, transparent); }
.rail .nav-item.active { color: var(--accent); background: var(--accent-soft); }
.rail .nav-item.active::before { content: ""; position: absolute; left: -9px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail .nav-item .ncount { position: absolute; top: -2px; right: -2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; line-height: 15px; text-align: center; font-family: var(--font-mono); }
.rail .rail-gap { flex: 1; }
.rail .rail-tip { font-size: 12px; color: var(--muted); writing-mode: vertical-rl; letter-spacing: .06em; margin: 4px 0; }
.rail .rail-sep { width: 30px; height: 1px; background: var(--border); margin: 2px 0 6px; flex: 0 0 auto; }
/* 界面模式切换:带边框的亮/暗双图标开关,区别于普通设置按钮 */
.rail-mode {
display: flex; flex-direction: column; align-items: center; gap: 3px;
width: 38px; padding: 5px 0 6px; border-radius: 10px;
border: 1px solid var(--border); background: var(--surface);
color: var(--muted); transition: all .14s ease;
}
.rail-mode svg { width: 15px; height: 15px; }
.rail-mode .i-sun { color: var(--accent); }
.rail-mode .i-moon { color: var(--muted); opacity: .5; }
html.dark .rail-mode .i-sun { color: var(--muted); opacity: .5; }
html.dark .rail-mode .i-moon { color: var(--accent); opacity: 1; }
.rail-mode:hover { border-color: var(--border-strong); }
.rail-mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* ---------- views ---------- */
.view { flex: 1; min-width: 0; min-height: 0; display: none; }
.view.active { display: flex; }
/* ---------- home ---------- */
.home { flex-direction: column; background: var(--bg); }
.home-header { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; transition: border-color .13s ease, box-shadow .13s ease; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 15%, transparent); }
.search svg { width: 14px; height: 14px; color: var(--muted); flex: 0 0 auto; }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; }
.home-header .kbd { font-family: var(--font-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--surface-2); }
.home-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 24px; }
.home-section-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin: 20px 2px 10px; }
.home-section-title:first-child { margin-top: 2px; }
.home-section-title svg { width: 13px; height: 13px; }
.home-section-title .count { font-weight: 500; color: var(--muted); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.project-card {
display: flex; flex-direction: column; gap: 10px; padding: 13px 14px;
background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
text-align: left; transition: all .14s ease; position: relative;
}
.project-card:hover { border-color: color-mix(in oklch, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-card .pc-top { display: flex; align-items: flex-start; gap: 10px; }
.pc-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.pc-icon svg { width: 16px; height: 16px; }
.pc-name { font-weight: 600; font-size: 14px; color: var(--fg); }
.pc-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.project-card .pc-foot { display: flex; align-items: center; gap: 6px; }
.pc-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.project-card .pc-run { margin-left: auto; opacity: 0; transform: translateX(4px); transition: all .14s ease; }
.project-card:hover .pc-run { opacity: 1; transform: none; }
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.machine {
display: flex; align-items: center; gap: 10px; padding: 10px 12px;
background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
text-align: left; transition: all .14s ease;
}
.machine:hover { border-color: color-mix(in oklch, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-sm); }
.machine .m-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--fg-2); display: grid; place-items: center; flex: 0 0 auto; }
.machine .m-icon svg { width: 15px; height: 15px; }
.machine .m-main { min-width: 0; flex: 1; }
.m-name { font-weight: 500; font-size: 13.5px; color: var(--fg); display: flex; align-items: center; gap: 6px; }
.m-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.machine .m-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .13s ease; }
.machine:hover .m-actions { opacity: 1; }
.machine .m-actions .icon-btn { width: 24px; height: 24px; }
.machine .m-actions .icon-btn svg { width: 13px; height: 13px; }
.home-empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.home-empty svg { width: 30px; height: 30px; margin: 0 auto 10px; opacity: .5; }
/* ---------- task ---------- */
.task { flex-direction: row; background: var(--bg); }
.task-left { flex: 0 0 296px; display: flex; flex-direction: column; background: var(--surface-2); border-right: 1px solid var(--border); min-width: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; }
.tl-head .back { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--fg-2); }
.tl-head .back:hover { background: color-mix(in oklch, var(--fg) 8%, transparent); color: var(--fg); }
.tl-head .back svg { width: 15px; height: 15px; }
.tl-head .tt { min-width: 0; flex: 1; }
.tl-head .tt b { display: block; font-size: 14px; font-weight: 600; }
.tl-head .tt span { display: block; font-size: 12px; color: var(--muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-toolbar { display: flex; align-items: center; gap: 6px; padding: 0 14px 10px; }
.tl-toolbar .spacer { flex: 1; }
.tree { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 14px; }
.tree-item { width: 100%; border-radius: 8px; text-align: left; }
.sp-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 8px; transition: background .12s ease; }
.sp-row:hover { background: color-mix(in oklch, var(--fg) 6%, transparent); }
.sp-row .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .13s ease; flex: 0 0 auto; }
.sp-row .chev.open { transform: rotate(90deg); }
.sp-row .sp-main { flex: 1; min-width: 0; }
.sp-name { font-size: 13.5px; font-weight: 500; color: var(--fg); }
.sp-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-meta { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.sp-actions { display: flex; gap: 3px; opacity: 0; transition: opacity .12s ease; }
.sp-row:hover .sp-actions { opacity: 1; }
.sp-actions .icon-btn { width: 24px; height: 24px; }
.sp-actions .icon-btn svg { width: 13px; height: 13px; }
.sp-actions .run { color: var(--accent); background: var(--accent-soft); }
.sp-actions .run:hover { background: color-mix(in oklch, var(--accent) 22%, transparent); color: var(--accent-strong); }
.sp-actions .stop { color: var(--danger); background: var(--danger-soft); }
.sp-actions .stop:hover { background: color-mix(in oklch, var(--danger) 20%, transparent); }
.cmd-list { margin: 2px 0 2px 22px; border-left: 1px solid var(--border); padding-left: 8px; }
.cmd-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; transition: background .12s ease; }
.cmd-row:hover { background: color-mix(in oklch, var(--fg) 6%, transparent); }
.cmd-row .cmd-main { flex: 1; min-width: 0; }
.cmd-name { font-size: 13px; color: var(--fg-2); display: flex; align-items: center; gap: 6px; }
.cmd-meta { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.step-list { margin: 2px 0 2px 20px; border-left: 1px solid var(--border); padding-left: 8px; }
.step-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.step-item:hover { background: color-mix(in oklch, var(--fg) 5%, transparent); color: var(--fg-2); }
.step-item .s-num { color: var(--muted); font-size: 12px; min-width: 14px; text-align: right; }
.step-item .s-cmd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-item.running { color: var(--accent); }
.step-item.running::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; animation: pulse 1s ease infinite; }
.step-item.done { color: var(--muted); }
.step-item.done .s-cmd::after { content: " ✓"; color: var(--accent); }
.step-item.fail { color: var(--danger); }
/* terminal output */
.task-right { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--term-bg); }
.term-toolbar { flex: 0 0 auto; height: 38px; display: flex; align-items: center; gap: 4px; padding: 0 10px; background: color-mix(in oklch, var(--term-bg) 96%, white); border-bottom: 1px solid var(--term-border); color: var(--term-dim); }
.term-toolbar .icon-btn { color: var(--term-dim); width: 26px; height: 26px; }
.term-toolbar .icon-btn:hover { background: var(--term-hover); color: var(--term-fg); }
.term-toolbar .t-title { font-family: var(--font-mono); font-size: 12.5px; color: var(--term-fg); display: flex; align-items: center; gap: 7px; margin-left: 4px; }
.term-toolbar .t-title .dot { width: 7px; height: 7px; }
.term-toolbar .spacer { flex: 1; }
.term-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; color: var(--term-fg); }
.term-body .line { white-space: pre-wrap; word-break: break-all; min-height: 1.6em; }
.t-prompt { color: var(--term-green); }
.t-path { color: var(--term-blue); }
.t-ok { color: var(--term-green); }
.t-err { color: var(--term-red); }
.t-warn { color: var(--term-amber); }
.t-dim { color: var(--term-dim); }
.t-info { color: var(--term-cyan); }
.cursor { display: inline-block; width: 7px; height: 14px; background: var(--term-fg); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
/* status bar (task) */
.task-status { flex: 0 0 auto; height: 34px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--surface); border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.task-status .progress { flex: 1; max-width: 320px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.task-status .progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.task-status .st-label { display: flex; align-items: center; gap: 6px; }
/* ---------- shell ---------- */
.shell { flex-direction: row; background: var(--term-bg); }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-tabs { flex: 0 0 auto; display: flex; align-items: stretch; background: var(--term-bg); border-bottom: 1px solid var(--term-border); }
.tabs-scroll { display: flex; align-items: stretch; overflow-x: auto; flex: 1; min-width: 0; }
.tab { display: flex; align-items: center; gap: 7px; padding: 0 12px; height: 38px; font-size: 13px; color: var(--term-dim); border-right: 1px solid var(--term-border); position: relative; white-space: nowrap; transition: background .12s ease; }
.tab:hover { background: var(--term-hover); color: var(--term-fg); }
.tab.active { background: var(--term-bg); color: var(--term-fg); }
.tab.active::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.tab .dot { width: 6px; height: 6px; }
.tab .t-close { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: var(--term-dim); opacity: 0; }
.tab:hover .t-close, .tab .t-close:focus-visible { opacity: 1; }
.tab .t-close:hover { background: var(--term-hover); color: var(--term-fg); }
.tab .t-close svg { width: 11px; height: 11px; }
.tab-add { width: 34px; height: 38px; display: grid; place-items: center; color: var(--term-dim); flex: 0 0 auto; }
.tab-add:hover { color: var(--term-fg); background: var(--term-hover); }
.tab-add svg { width: 15px; height: 15px; }
.shell-toolbar { flex: 0 0 auto; height: 36px; display: flex; align-items: center; gap: 3px; padding: 0 10px; background: var(--term-bg); border-bottom: 1px solid var(--term-border); color: var(--term-dim); }
.shell-toolbar .icon-btn { color: var(--term-dim); width: 26px; height: 26px; }
.shell-toolbar .icon-btn:hover { background: var(--term-hover); color: var(--term-fg); }
.shell-toolbar .icon-btn.active { color: var(--accent); background: oklch(30% 0.04 150); }
.shell-toolbar .spacer { flex: 1; }
.shell-toolbar .bc-bar { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-family: var(--font-mono); padding: 3px 10px; border-radius: 6px; background: oklch(30% 0.04 150); color: var(--term-green); border: 1px solid oklch(38% 0.06 150); }
.shell-body { flex: 1; min-height: 0; display: flex; }
.shell-monitor { flex: 0 0 240px; background: var(--term-bg2); border-right: 1px solid var(--term-border); display: none; flex-direction: column; min-width: 0; }
.shell-monitor.open { display: flex; }
.mon-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; color: var(--term-fg); font-size: 13px; font-weight: 500; }
.mon-header .mon-host { font-family: var(--font-mono); font-size: 12px; color: var(--term-dim); }
.mon-body { flex: 1; overflow-y: auto; padding: 0 12px 14px; }
.metric { margin-bottom: 12px; }
.metric .m-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--term-dim); font-family: var(--font-mono); margin-bottom: 5px; }
.metric .m-val { color: var(--term-fg); }
.metric .m-bar { height: 6px; border-radius: 3px; background: var(--term-border); overflow: hidden; }
.metric .m-bar i { display: block; height: 100%; border-radius: 3px; }
.m-bar i.g { background: var(--term-green); }
.m-bar i.b { background: var(--term-blue); }
.m-bar i.a { background: var(--term-amber); }
.m-bar i.r { background: var(--term-red); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.spark i { flex: 1; background: var(--term-green); border-radius: 1px; opacity: .8; }
.shell-terminal { flex: 1; min-width: 0; min-height: 0; overflow: hidden; display: flex; }
.split { display: flex; flex: 1; min-width: 0; min-height: 0; }
.split > .pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--term-border); }
.split > .pane:last-child { border-right: none; }
.pane .term-body { flex: 1; }
.pane.active { box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--accent) 60%, transparent); }
.shell-sftp { flex: 0 0 auto; height: 0; background: var(--term-bg2); border-top: 1px solid var(--term-border); display: flex; flex-direction: column; transition: height .18s ease; overflow: hidden; }
.shell-sftp.open { height: 200px; }
.sftp-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--term-border); font-family: var(--font-mono); font-size: 12px; color: var(--term-dim); }
.sftp-head .path { color: var(--term-fg); }
.sftp-head .spacer { flex: 1; }
.sftp-body { flex: 1; min-height: 0; display: flex; }
.sftp-files { flex: 1; overflow-y: auto; padding: 6px 8px; }
.sftp-row { display: grid; grid-template-columns: 1fr 88px 112px 88px; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 12.5px; color: var(--term-fg); }
.sftp-row:hover { background: var(--term-hover); }
.sftp-row .f-name { display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sftp-row .f-name svg { width: 13px; height: 13px; color: var(--term-dim); flex: 0 0 auto; }
.sftp-row .f-size { color: var(--term-dim); text-align: right; }
.sftp-row .f-time { color: var(--term-dim); }
.sftp-row .f-perm { color: var(--term-cyan); }
.sftp-row.is-dir .f-name { color: var(--term-blue); }
/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: oklch(12% 0.01 240 / 0.4); backdrop-filter: blur(2px); display: none; z-index: 100; }
.modal-backdrop.open { display: block; }
.modal { position: fixed; z-index: 110; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 1040px; max-width: calc(100vw - 40px); height: 680px; max-height: calc(100vh - 60px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); display: none; flex-direction: row; overflow: hidden; }
.modal.open { display: flex; }
.modal-nav { flex: 0 0 200px; background: var(--surface-2); border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; }
.mn-group { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; padding: 10px 10px 6px; }
.mn-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--fg-2); transition: all .12s ease; width: 100%; text-align: left; }
.mn-item:hover { background: color-mix(in oklch, var(--fg) 6%, transparent); color: var(--fg); }
.mn-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.mn-item svg { width: 15px; height: 15px; }
.modal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head .m-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.modal-head .spacer { flex: 1; }
.modal-content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
/* settings content */
.set-panel { max-width: 720px; }
.set-section { margin-bottom: 26px; }
.set-section h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.set-section .set-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row .sr-label { flex: 1; min-width: 0; }
.set-row .sr-label b { display: block; font-size: 13.5px; font-weight: 500; }
.set-row .sr-label span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.set-row .sr-ctrl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.input, select.input, textarea.input { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 13.5px; outline: none; transition: border-color .13s ease, box-shadow .13s ease; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 15%, transparent); }
select.input { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.switch { position: relative; width: 36px; height: 20px; padding: 0; border-radius: 10px; background: var(--border-strong); transition: background .15s ease; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: left .15s ease; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 18px; }
.color-row { display: flex; gap: 8px; }
.color-dot { width: 26px; height: 26px; padding: 0; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform .1s ease, border-color .1s ease; }
.color-dot:hover { transform: scale(1.08); }
.color-dot.active { border-color: var(--fg); }
.machine-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.machine-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.machine-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.machine-table tr:last-child td { border-bottom: none; }
.machine-table tbody tr:hover { background: var(--surface-2); }
.machine-table .mono { font-family: var(--font-mono); font-size: 12.5px; }
.machine-table .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.machine-table .row-actions .icon-btn { width: 24px; height: 24px; }
.machine-table .row-actions .icon-btn svg { width: 13px; height: 13px; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table td { padding: 7px 0; border-bottom: 1px solid var(--border); }
.kv-table .mono { font-family: var(--font-mono); }
.shortcut-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.shortcut-row .sk-name { flex: 1; font-size: 13.5px; }
.shortcut-row .sk-key { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 5px; }
.about-hero { display: flex; align-items: center; gap: 16px; padding: 6px 0 20px; }
.about-logo { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--on-accent); display: grid; place-items: center; }
.about-logo svg { width: 28px; height: 28px; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes typing { from { width: 0; } }
@media (prefers-reduced-motion: reduce) {
.cursor, .step-item.running::before { animation: none !important; }
* { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (max-width: 920px) {
.rail { flex: 0 0 44px; }
.proj-grid, .machine-grid { grid-template-columns: 1fr 1fr; }
.task-left { flex-basis: 240px; }
.shell-monitor { flex-basis: 180px; }
}
@media (max-width: 720px) {
.proj-grid, .machine-grid { grid-template-columns: 1fr; }
.task-left { flex-basis: 200px; }
}
/* ===== 终端主题(功能化预设) ===== */
.term-nord { --term-bg: oklch(20% 0.03 250); --term-fg: oklch(91% 0.02 230); --term-dim: oklch(63% 0.02 240); --term-green: oklch(80% 0.12 190); --term-red: oklch(72% 0.16 20); --term-amber: oklch(83% 0.12 85); --term-blue: oklch(76% 0.12 250); --term-cyan: oklch(81% 0.11 200); --term-bg2: oklch(24% 0.03 250); --term-border: oklch(31% 0.02 250); --term-hover: oklch(28% 0.025 250); }
.term-dracula { --term-bg: oklch(18% 0.03 300); --term-fg: oklch(91% 0.01 300); --term-dim: oklch(62% 0.02 300); --term-green: oklch(76% 0.14 150); --term-red: oklch(70% 0.18 20); --term-amber: oklch(82% 0.14 90); --term-blue: oklch(70% 0.14 285); --term-cyan: oklch(78% 0.12 200); --term-bg2: oklch(22% 0.03 300); --term-border: oklch(29% 0.02 300); --term-hover: oklch(26% 0.025 300); }
.term-monokai { --term-bg: oklch(21% 0.02 90); --term-fg: oklch(93% 0.02 90); --term-dim: oklch(65% 0.02 90); --term-green: oklch(80% 0.15 140); --term-red: oklch(72% 0.18 30); --term-amber: oklch(83% 0.15 85); --term-blue: oklch(74% 0.13 250); --term-cyan: oklch(79% 0.11 190); --term-bg2: oklch(25% 0.02 90); --term-border: oklch(31% 0.015 90); --term-hover: oklch(28% 0.02 90); }
.term-solarized { --term-bg: oklch(25% 0.03 220); --term-fg: oklch(87% 0.02 210); --term-dim: oklch(65% 0.02 220); --term-green: oklch(72% 0.13 160); --term-red: oklch(68% 0.16 25); --term-amber: oklch(80% 0.13 85); --term-blue: oklch(74% 0.12 250); --term-cyan: oklch(76% 0.1 200); --term-bg2: oklch(28% 0.03 220); --term-border: oklch(33% 0.02 220); --term-hover: oklch(30% 0.025 220); }
.t-chev { color: var(--term-green); font-weight: 700; }
/* 终端搜索 */
.term-body mark.search { background: var(--term-amber); color: oklch(18% 0.02 240); border-radius: 2px; padding: 0 1px; }
.term-body mark.search.cur { background: var(--term-cyan); color: oklch(15% 0.02 240); }
.term-searchbar { position: fixed; top: 50px; right: 16px; z-index: 60; display: none; align-items: center; gap: 6px; height: 34px; padding: 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); }
.term-searchbar.open { display: inline-flex; }
.term-searchbar input { width: 150px; border: none; outline: none; background: transparent; font-size: 13.5px; font-family: var(--font-mono); color: var(--fg); }
.term-searchbar .scount { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-width: 36px; text-align: center; }
.term-searchbar .icon-btn { width: 24px; height: 24px; color: var(--fg-2); }
.term-searchbar .icon-btn:hover { background: var(--surface-2); }
.term-searchbar .icon-btn svg { width: 13px; height: 13px; }
.task-right, .shell-terminal { position: relative; }
/* 连接中态 */
.connecting { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; color: var(--term-dim); font-family: var(--font-mono); font-size: 13.5px; }
.connecting .spinner { width: 22px; height: 22px; border: 2px solid var(--term-border); border-top-color: var(--term-green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 命令面板 */
.palette-backdrop { position: fixed; inset: 0; background: oklch(12% 0.01 240 / 0.35); z-index: 300; display: none; }
.palette-backdrop.open { display: block; }
.palette { position: fixed; top: 13vh; left: 50%; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 310; display: none; overflow: hidden; }
.palette.open { display: block; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.palette-input svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.palette-input input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; color: var(--fg); }
.palette-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.pal-group { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; padding: 8px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--fg-2); }
.pal-item:hover, .pal-item.active { background: var(--accent-soft); color: var(--accent); }
.pal-item svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.pal-item.active svg { color: var(--accent); }
.pal-item .pal-key { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
/* Host Key 信任弹窗 */
.hk-modal { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; }
.hk-modal.open { display: flex; }
.hk-backdrop { position: absolute; inset: 0; background: oklch(12% 0.01 240 / 0.45); }
.hk-card { position: relative; width: 460px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 22px; }
.hk-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.hk-card .hk-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.hk-fp { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-family: var(--font-mono); font-size: 13px; margin-bottom: 18px; word-break: break-all; }
.hk-fp .hk-warn { color: var(--warning); flex: 0 0 auto; }
.hk-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* 首页空态 */
.home-empty { display: none; text-align: center; color: var(--muted); padding: 48px 16px; }
.home-empty.show { display: block; }
.home-empty svg { width: 32px; height: 32px; margin: 0 auto 10px; opacity: .5; }
/* SFTP 上传进度 */
.sftp-progress { display: none; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--term-border); font-family: var(--font-mono); font-size: 12px; color: var(--term-dim); }
.sftp-progress.show { display: flex; }
.sftp-progress .sp-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--term-border); overflow: hidden; }
.sftp-progress .sp-bar i { display: block; height: 100%; width: 0; background: var(--term-green); border-radius: 2px; transition: width .2s ease; }
</style>
</head>
<body>
<h1 class="sr-only">FlashShell · 多会话 SSH / SFTP 桌面终端</h1>
<div class="app">
<!-- ══════════ 顶栏 ══════════ -->
<header class="topbar" data-od-id="topbar">
<div class="traffic" aria-hidden="true"><i class="r"></i><i class="y"></i><i class="g"></i></div>
<div class="brand">
<span class="brand-mark"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M13.2 2 3 14h6.5l-1 8L20 10h-6.5l-.3-8z"/></svg></span>
FlashShell
</div>
<span class="tb-sep"></span>
<div class="tb-context" id="tb-context">同港出海 · 任务与 Shell 并行</div>
<div class="tb-spacer"></div>
<div class="tb-right">
<div class="seg" id="mode-seg" data-od-id="mode-switcher">
<button data-view="task" aria-label="任务模式">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:13px;height:13px"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M3 9h18M8 4v5"/></svg>
任务
</button>
<button data-view="shell" aria-label="Shell 模式">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:13px;height:13px"><path d="M5 7l4 5-4 5M11 17h6"/></svg>
终端
<span class="seg-dot dot on" style="width:6px;height:6px"></span>
</button>
</div>
<span class="tb-sep"></span>
<button class="icon-btn" title="新建窗口" aria-label="新建窗口"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><rect x="5" y="4" width="14" height="16" rx="2"/><path d="M3 9h2M3 15h2M19 9h2M19 15h2"/></svg></button>
<button class="icon-btn" title="配置文件" aria-label="配置文件" onclick="toggleDropdown('config-dd', event)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M6 3h9l4 4v14H6z"/><path d="M14 3v5h5"/></svg></button>
<button class="icon-btn" title="系统设置" aria-label="系统设置" onclick="openSettings('app')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9L17 7M7 17l-2.1 2.1"/></svg></button>
<button class="icon-btn" title="关于 FlashShell" aria-label="关于" onclick="openSettings('about')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg></button>
</div>
<!-- 配置文件下拉 -->
<div class="dropdown" id="config-dd" style="display:none">
<div class="dd-label">业务配置文件</div>
<button class="dd-item active" onclick="closeDropdown('config-dd')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" style="width:12px;height:12px"><path d="M5 13l4 4L19 7"/></svg>config.yaml</button>
<button class="dd-item" onclick="closeDropdown('config-dd')">staging.yaml</button>
<button class="dd-item" onclick="closeDropdown('config-dd')">production.yaml</button>
<div class="dd-sep"></div>
<button class="dd-item" onclick="closeDropdown('config-dd')">编辑任务流水线</button>
<button class="dd-item" onclick="closeDropdown('config-dd')">刷新配置列表</button>
<div class="dd-sep"></div>
<button class="dd-item" onclick="closeDropdown('config-dd')">打开全局配置</button>
<button class="dd-item" onclick="closeDropdown('config-dd')">打开当前配置</button>
</div>
</header>
<div class="app-body">
<!-- ══════════ 侧栏 ══════════ -->
<nav class="rail" data-od-id="rail" aria-label="主导航">
<button class="nav-item active" data-view="home" title="首页" aria-label="首页"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10.5L12 3l9 7.5"/><path d="M5 9.5V21h14V9.5"/></svg></button>
<button class="nav-item" data-view="task" title="任务" aria-label="任务"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="3" width="16" height="18" rx="2"/><path d="M8 8h8M8 12h8M8 16h5"/></svg></button>
<button class="nav-item" data-view="shell" title="终端" aria-label="终端"><span class="ncount">3</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l6-6-6-6M12 19h8"/></svg></button>
<div class="rail-gap"></div>
<span class="rail-tip">FlashShell</span>
<div class="rail-sep" aria-hidden="true"></div>
<button class="nav-item" title="系统设置" aria-label="系统设置" onclick="openSettings('app')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9L17 7M7 17l-2.1 2.1"/></svg></button>
<button class="rail-mode" id="theme-toggle" title="切换界面模式" aria-label="切换界面模式" aria-pressed="false">
<svg class="i-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
<svg class="i-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1111.2 3a7 7 0 009.8 9.8z"/></svg>
</button>
</nav>
<!-- ══════════ 首页 ══════════ -->
<main class="view home active" id="view-home" data-od-id="home">
<div class="home-header">
<div class="search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
<input id="home-search" type="text" aria-label="搜索主机或项目" placeholder="查找主机或输入 SSH 地址快速连接…" oninput="filterHome(this.value)" />
<span class="kbd">⌘K</span>
</div>
<div style="flex:1"></div>
<button class="btn btn-primary" onclick="switchView('shell')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l6-6-6-6M12 19h8"/></svg>打开终端</button>
</div>
<div class="home-scroll">
<div class="home-section-title" style="margin-top:2px">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="3" width="16" height="18" rx="2"/><path d="M8 8h8M8 12h8M8 16h5"/></svg>
任务项目 <span class="count">4</span>
</div>
<div class="proj-grid" id="proj-grid">
<button class="project-card" data-od-id="project-sample-platform" onclick="enterTask('sample-platform')">
<div class="pc-top">
<span class="pc-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l9-4 9 4v10l-9 4-9-4z"/><path d="M3 7l9 4 9-4M12 11v10"/></svg></span>
<div><div class="pc-name">sample-platform</div><div class="pc-desc">Maven 构建 + Docker 部署</div></div>
</div>
<div class="pc-foot"><span class="pc-meta">1 子项目 · 5 命令</span><span class="pc-run btn btn-sm btn-soft">进入<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" style="width:11px;height:11px"><path d="M9 6l6 6-6 6"/></svg></span></div>
</button>
<button class="project-card" data-od-id="project-demo-api" onclick="enterTask('demo-api')">
<div class="pc-top">
<span class="pc-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M3 9h18M8 4v5"/></svg></span>
<div><div class="pc-name">demo-api</div><div class="pc-desc">Spring Boot 服务 · 构建并发布</div></div>
</div>
<div class="pc-foot"><span class="pc-meta">1 子项目 · 2 命令</span><span class="pc-run btn btn-sm btn-soft">进入<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" style="width:11px;height:11px"><path d="M9 6l6 6-6 6"/></svg></span></div>
</button>
<button class="project-card" data-od-id="project-resilient-deploy" onclick="enterTask('resilient-deploy')">
<div class="pc-top">
<span class="pc-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2L4 14h6l-1 8 9-12h-6z"/></svg></span>
<div><div class="pc-name">resilient-deploy</div><div class="pc-desc">滚动发布 · 重试与容错</div></div>
</div>
<div class="pc-foot"><span class="pc-meta">1 子项目 · 1 命令</span><span class="pc-run btn btn-sm btn-soft">进入<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" style="width:11px;height:11px"><path d="M9 6l6 6-6 6"/></svg></span></div>
</button>
<button class="project-card" data-od-id="project-dev-tools" onclick="enterTask('dev-tools')">
<div class="pc-top">
<span class="pc-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 007.5.5l3-3a5 5 0 00-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 00-7.5-.5l-3 3a5 5 0 007 7l1.7-1.7"/></svg></span>
<div><div class="pc-name">dev-tools</div><div class="pc-desc">本地脚本 · 环境开关</div></div>
</div>
<div class="pc-foot"><span class="pc-meta">1 子项目 · 1 命令</span><span class="pc-run btn btn-sm btn-soft">进入<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" style="width:11px;height:11px"><path d="M9 6l6 6-6 6"/></svg></span></div>
</button>
</div>
<div class="home-section-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="7" rx="2"/><rect x="2" y="13" width="20" height="7" rx="2"/><path d="M6 7.5h.01M6 16.5h.01"/></svg>
置顶主机 <span class="count">2</span>
</div>
<div class="machine-grid" id="pinned-grid">
<div class="machine" data-od-id="machine-staging">
<span class="m-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="7" rx="2"/><rect x="2" y="13" width="20" height="7" rx="2"/><path d="M6 7.5h.01M6 16.5h.01"/></svg></span>
<div class="m-main"><div class="m-name"><span class="dot on"></span>staging-server</div><div class="m-sub">ubuntu@10.0.0.15:22 · dev</div></div>
<div class="m-actions">
<button class="icon-btn" title="连接" onclick="connectShell('staging-server')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M7 4l12 8-12 8z"/></svg></button>
</div>
</div>
<div class="machine" data-od-id="machine-prod">
<span class="m-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="7" rx="2"/><rect x="2" y="13" width="20" height="7" rx="2"/><path d="M6 7.5h.01M6 16.5h.01"/></svg></span>
<div class="m-main"><div class="m-name"><span class="dot on"></span>prod-server</div><div class="m-sub">root@10.0.1.8:22 · prod</div></div>
<div class="m-actions">
<button class="icon-btn" title="连接" onclick="connectShell('prod-server')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M7 4l12 8-12 8z"/></svg></button>
</div>
</div>
</div>
<div class="home-section-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>
全部主机 <span class="count">3</span>
<span style="flex:1"></span>
<span class="chip active" onclick="this.classList.toggle('active')">全部</span>
<span class="chip" onclick="this.classList.toggle('active')">dev</span>
<span class="chip" onclick="this.classList.toggle('active')">prod</span>
<span class="chip" onclick="this.classList.toggle('active')">db</span>
</div>
<div class="machine-grid" id="machine-grid">
<div class="machine" data-od-id="machine-app01">
<span class="m-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="7" rx="2"/><rect x="2" y="13" width="20" height="7" rx="2"/><path d="M6 7.5h.01M6 16.5h.01"/></svg></span>
<div class="m-main"><div class="m-name"><span class="dot on"></span>app-server-01</div><div class="m-sub">ubuntu@10.0.1.21:22 · prod</div></div>
<div class="m-actions">
<button class="icon-btn" title="连接" onclick="connectShell('app-server-01')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M7 4l12 8-12 8z"/></svg></button>
<button class="icon-btn" title="编辑" onclick="openSettings('machines')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M4 20h4l10-10-4-4L4 16zM13.5 6.5l4 4"/></svg></button>
</div>
</div>
<div class="machine" data-od-id="machine-dbmaster">
<span class="m-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="6" rx="8" ry="3"/><path d="M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6"/><path d="M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"/></svg></span>
<div class="m-main"><div class="m-name"><span class="dot off"></span>db-master</div><div class="m-sub">debian@10.0.2.3:22 · db</div></div>
<div class="m-actions">
<button class="icon-btn" title="连接" onclick="connectShell('db-master')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M7 4l12 8-12 8z"/></svg></button>
<button class="icon-btn" title="编辑" onclick="openSettings('machines')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M4 20h4l10-10-4-4L4 16zM13.5 6.5l4 4"/></svg></button>
</div>
</div>
<div class="machine" data-od-id="machine-build">
<span class="m-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="7" rx="2"/><rect x="2" y="13" width="20" height="7" rx="2"/><path d="M6 7.5h.01M6 16.5h.01"/></svg></span>
<div class="m-main"><div class="m-name"><span class="dot on"></span>build-node</div><div class="m-sub">macos@10.0.0.50:22 · ci</div></div>
<div class="m-actions">
<button class="icon-btn" title="连接" onclick="connectShell('build-node')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M7 4l12 8-12 8z"/></svg></button>
<button class="icon-btn" title="编辑" onclick="openSettings('machines')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M4 20h4l10-10-4-4L4 16zM13.5 6.5l4 4"/></svg></button>
</div>
</div>
<button class="machine" style="border-style:dashed;justify-content:center;color:var(--muted)" onclick="openSettings('machines')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" style="width:15px;height:15px"><path d="M12 5v14M5 12h14"/></svg> 新建主机
</button>
</div>
<div class="home-empty" id="home-empty">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
<p>没有匹配的结果</p>
<p style="font-size: 13px;margin:4px 0 0">试试其它关键词,或清空搜索框</p>
</div>
</div>
</main>
<!-- ══════════ 任务模式 ══════════ -->
<main class="view task" id="view-task" data-od-id="task">
<aside class="task-left" data-od-id="task-pipeline">
<div class="tl-head">
<button class="back" onclick="switchView('home')" title="返回首页" aria-label="返回首页"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5M11 18l-6-6 6-6"/></svg></button>
<div class="tt"><b id="task-proj-name">sample-platform</b><span>config.yaml · 可执行项目</span></div>
</div>
<div class="tl-toolbar">
<button class="btn btn-sm" onclick="openConfigEditor()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M4 20h4l10-10-4-4L4 16zM13.5 6.5l4 4"/></svg>编辑流水线</button>
<div class="spacer"></div>
<button class="btn btn-sm" onclick="refreshTree()" title="刷新"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M20 11A8 8 0 104 11a8 8 0 0012 5.3M20 4v7h-7"/></svg></button>
</div>
<div class="tree" id="task-tree">
<!-- 动态生成 -->
</div>
</aside>
<div class="task-right">
<div class="term-toolbar" data-od-id="task-terminal-toolbar">
<div class="t-title"><span class="dot on"></span>任务输出 · <span id="task-output-title">构建用户服务</span></div>
<div class="spacer"></div>
<button class="icon-btn" title="查找" onclick="taskSearch()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg></button>
<button class="icon-btn" title="清空输出" onclick="clearTerm()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13"/></svg></button>
<button class="icon-btn" title="粘底跟随"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v13M6 11l6 6 6-6"/></svg></button>
</div>
<div class="term-body" id="task-term" data-od-id="task-terminal-output"></div>
<div class="task-status" data-od-id="task-status">
<span class="st-label" id="task-status-label"><span class="dot"></span>就绪</span>
<div class="progress"><i id="task-progress" style="width:0%"></i></div>
<span class="st-label" id="task-step-label">0 / 0 步</span>
<div class="spacer" style="flex:1"></div>
<button class="btn btn-sm btn-danger" id="task-stop-btn" onclick="stopTask()" disabled><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><rect x="6" y="6" width="12" height="12" rx="1.5"/></svg>停止</button>
</div>
</div>
</main>
<!-- ══════════ Shell 模式 ══════════ -->
<main class="view shell" id="view-shell" data-od-id="shell">
<!-- 监控侧栏 -->
<aside class="shell-monitor" id="shell-monitor" data-od-id="shell-monitor">
<div class="mon-header">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" style="width:15px;height:15px"><path d="M3 3v18h18"/><path d="M7 15l4-4 3 3 5-6"/></svg>
机器监控
<span class="mon-host" id="mon-host">staging-server</span>
</div>
<div class="mon-body">
<div class="metric"><div class="m-head"><span>CPU</span><span class="m-val">23%</span></div><div class="m-bar"><i class="g" style="width:23%"></i></div></div>
<div class="metric"><div class="m-head"><span>内存</span><span class="m-val">4.2 / 8.0 GB</span></div><div class="m-bar"><i class="b" style="width:52%"></i></div></div>
<div class="metric"><div class="m-head"><span>磁盘 /</span><span class="m-val">61%</span></div><div class="m-bar"><i class="a" style="width:61%"></i></div></div>
<div class="metric"><div class="m-head"><span>负载</span><span class="m-val">0.42 · 0.51 · 0.48</span></div></div>
<div class="metric"><div class="m-head"><span>网络吞吐</span><span class="m-val">1.2 MB/s</span></div><div class="spark"><i style="height:30%"></i><i style="height:45%"></i><i style="height:38%"></i><i style="height:62%"></i><i style="height:55%"></i><i style="height:70%"></i><i style="height:50%"></i><i style="height:78%"></i><i style="height:60%"></i><i style="height:72%"></i><i style="height:48%"></i><i style="height:66%"></i></div></div>
</div>
</aside>
<div class="shell-main">
<div class="shell-tabs" data-od-id="shell-tabs">
<div class="tabs-scroll" id="shell-tabs-scroll">
<div class="tab active" data-tab="staging"><span class="dot on"></span><span>staging-server</span><button class="t-close" onclick="closeTab('staging')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button></div>
<div class="tab" data-tab="prod"><span class="dot on"></span><span>prod-server</span><button class="t-close" onclick="closeTab('prod')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button></div>
<div class="tab" data-tab="local"><span class="dot on"></span><span>本机</span><button class="t-close" onclick="closeTab('local')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button></div>
</div>
<button class="tab-add" title="连接 / 快速切换" onclick="openPicker()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg></button>
</div>
<div class="shell-toolbar" data-od-id="shell-toolbar">
<button class="icon-btn" id="btn-broadcast" title="广播输入" onclick="toggleBroadcast()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="6" cy="12" r="2"/><circle cx="18" cy="6" r="2"/><circle cx="18" cy="18" r="2"/><path d="M8 11l8-4M8 13l8 4"/></svg></button>
<button class="icon-btn" id="btn-split" title="分屏" onclick="toggleSplit()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M12 4v16"/></svg></button>
<button class="icon-btn" id="btn-sftp" title="SFTP 文件面板" onclick="toggleSftp()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l9-4 9 4v10l-9 4-9-4z"/><path d="M3 7l9 4 9-4M12 11v10"/></svg></button>
<button class="icon-btn" id="btn-monitor" title="机器监控" onclick="toggleMonitor()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"/><path d="M7 15l4-4 3 3 5-6"/></svg></button>
<button class="icon-btn" title="SSH 隧道" onclick="openTunnelDialog()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20c8-4 8-12 16-16"/><path d="M20 4a6 6 0 00-6 6 6 6 0 00-6 6"/></svg></button>
<button class="icon-btn" id="btn-compose" title="撰写栏(多行命令)" onclick="toggleCompose()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20h4L18 10l-4-4L4 16v4z"/><path d="M13.5 6.5l4 4"/></svg></button>
<span class="spacer"></span>
<button class="icon-btn" title="查找" onclick="shellSearch()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg></button>
<button class="icon-btn" title="命令面板" onclick="openPalette()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M7 9h.01M11 9h6M7 13h.01M11 13h6"/></svg></button>
</div>
<!-- 广播栏(浮层) -->
<div class="aux-bar" id="broadcast-bar" data-od-id="broadcast-bar">
<span class="aux-meta"><span class="dot on"></span>广播</span>
<div class="aux-targets" id="broadcast-targets"></div>
<button class="aux-chip" onclick="selectAllBroadcast()">全选</button>
<div class="aux-input"><span class="prompt">></span><input id="broadcast-input" type="text" placeholder="输入命令,Enter 发送到全部选中会话" onkeydown="if(event.key==='Enter'){sendBroadcast()}" /></div>
<button class="aux-btn send" title="发送" onclick="sendBroadcast()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l14-7-4 7 4 7-14-7z"/></svg></button>
<button class="aux-btn" title="关闭广播" onclick="toggleBroadcast()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button>
</div>
<!-- 撰写栏(浮层) -->
<div class="aux-bar" id="compose-bar" data-od-id="compose-bar">
<span class="aux-meta">撰写</span>
<div class="aux-input" style="flex:1"><textarea id="compose-input" rows="1" placeholder="多行命令,Enter 执行 / Shift+Enter 换行" onkeydown="if(event.key==='Enter' && !event.shiftKey){event.preventDefault();sendCompose()}"></textarea></div>
<button class="aux-btn send" title="执行" onclick="sendCompose()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M7 4l12 8-12 8z"/></svg></button>
<button class="aux-btn" title="关闭撰写" onclick="toggleCompose()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button>
</div>
<div class="shell-body">
<div class="shell-terminal" id="shell-terminal">
<div class="split" id="split-root">
<div class="pane active" id="pane-0">
<div class="term-body" id="shell-term"></div>
</div>
</div>
</div>
</div>
<!-- SFTP 面板 -->
<div class="shell-sftp" id="shell-sftp" data-od-id="shell-sftp">
<div class="sftp-head">
<span>sftp</span><span class="path">/opt/app</span>
<span class="spacer"></span>
<button class="icon-btn" style="color:var(--term-dim)" title="上传" onclick="startUpload()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19V5M6 11l6-6 6 6"/></svg></button>
<button class="icon-btn" style="color:var(--term-dim)" title="下载"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button>
<button class="icon-btn" style="color:var(--term-dim)" title="刷新"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M20 11A8 8 0 104 11a8 8 0 0012 5.3M20 4v7h-7"/></svg></button>
</div>
<div class="sftp-progress" id="sftp-progress">
<span id="sp-label">上传 app.jar</span>
<span class="sp-bar"><i id="sp-fill"></i></span>
<span id="sp-pct">0%</span>
</div>
<div class="sftp-body">
<div class="sftp-files">
<div class="sftp-row is-dir"><span class="f-name"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l9-4 9 4v10l-9 4-9-4z"/><path d="M3 7l9 4 9-4M12 11v10"/></svg>..</span><span class="f-size">—</span><span class="f-time">—</span><span class="f-perm">drwxr-xr-x</span></div>
<div class="sftp-row is-dir"><span class="f-name"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l9-4 9 4v10l-9 4-9-4z"/><path d="M3 7l9 4 9-4M12 11v10"/></svg>logs</span><span class="f-size">—</span><span class="f-time">08-22 09:14</span><span class="f-perm">drwxr-xr-x</span></div>
<div class="sftp-row"><span class="f-name"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/></svg>app.jar</span><span class="f-size">48.2 MB</span><span class="f-time">08-22 08:57</span><span class="f-perm">-rw-r--r--</span></div>
<div class="sftp-row"><span class="f-name"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/></svg>docker-compose.yml</span><span class="f-size">1.8 KB</span><span class="f-time">08-20 17:02</span><span class="f-perm">-rw-r--r--</span></div>
<div class="sftp-row"><span class="f-name"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/></svg>app.yml</span><span class="f-size">3.4 KB</span><span class="f-time">08-20 16:58</span><span class="f-perm">-rw-r--r--</span></div>
</div>
</div>
</div>
<!-- 状态栏 -->
<div class="shell-status" data-od-id="shell-status">
<div class="st-left">
<span class="st-tag" id="st-active-tab">staging-server</span>
<span class="tunnel-chip active" title="隧道运行中" onclick="openTunnelDialog()">web 8080→80</span>
<span class="tunnel-chip" title="隧道未建立" onclick="openTunnelDialog()">socks 1080</span>
</div>
<div class="st-right">
<button class="icon-btn" title="文件" onclick="toggleSftp()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l9-4 9 4v10l-9 4-9-4z"/><path d="M3 7l9 4 9-4M12 11v10"/></svg></button>
<button class="icon-btn" title="搜索" onclick="shellSearch()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg></button>
<button class="icon-btn" title="清空" onclick="clearShell()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13"/></svg></button>
<span class="st-info">FlashShell · Shell</span>
</div>
</div>
</div>
</main>
</div>
<!-- ══════════ 命令面板 ══════════ -->
<div class="term-searchbar" id="term-searchbar" role="search">
<input id="term-search-input" type="text" aria-label="在终端中查找" placeholder="查找…" oninput="runTermSearch(this.value)" onkeydown="if(event.key==='Enter'){searchNext()}" />
<span class="scount" id="term-search-count">0/0</span>
<button class="icon-btn" title="上一个" aria-label="上一个匹配" onclick="searchPrev()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg></button>
<button class="icon-btn" title="下一个" aria-label="下一个匹配" onclick="searchNext()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 15l6-6 6 6"/></svg></button>
<button class="icon-btn" title="关闭" aria-label="关闭查找" onclick="closeTermSearch()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button>
</div>
<div class="palette-backdrop" id="palette-backdrop" onclick="closePalette()"></div>
<div class="palette" id="palette" role="dialog" aria-modal="true" aria-label="命令面板">
<div class="palette-input">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
<input id="palette-input" type="text" aria-label="搜索命令" placeholder="输入命令或搜索…" onkeydown="if(event.key==='Enter'){var f=document.querySelector('#palette-list .pal-item');if(f)f.click();}" />
</div>
<div class="palette-list" id="palette-list"></div>
</div>
<!-- ══════════ Host Key 信任弹窗 ══════════ -->
<div class="hk-modal" id="hk-modal" role="dialog" aria-modal="true" aria-label="主机密钥确认">
<div class="hk-backdrop" onclick="closeHostKey()"></div>
<div class="hk-card">
<h3>确认主机密钥指纹</h3>
<p class="hk-sub">首次连接该主机,请核对指纹后再信任(写入 known_hosts.json)</p>
<div class="hk-fp"><svg class="hk-warn" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" style="width:18px;height:18px"><path d="M12 3l9 16H3z"/><path d="M12 10v4M12 17h.01"/></svg><span id="hk-fp">SHA256:7b2f4c8e9a1d</span></div>
<div class="hk-actions">
<button class="btn" onclick="closeHostKey()">取消</button>
<button class="btn btn-primary" onclick="trustHostKey()">信任并连接</button>
</div>
</div>
</div>
<!-- ══════════ 设置中心 ══════════ -->
<div class="modal-backdrop" id="modal-backdrop" onclick="closeSettings()"></div>
<div class="modal" id="settings-modal" data-od-id="settings" role="dialog" aria-modal="true" aria-label="设置">
<nav class="modal-nav" data-od-id="settings-nav">
<div class="mn-group">偏好设置</div>
<button class="mn-item" data-sec="app" onclick="setSettingsSection('app')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="3"/><path d="M6 9h.01M6 13h.01M10 9h8M10 13h8"/></svg>应用</button>
<button class="mn-item" data-sec="appearance" onclick="setSettingsSection('appearance')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 100 18c1.4 0 2.1-1 1.6-2.1-.4-.9.1-1.9 1.1-1.9H17a4 4 0 004-4c0-5-4-9-9-9z"/><circle cx="7.5" cy="10.5" r="1"/><circle cx="10" cy="7" r="1"/><circle cx="14" cy="7" r="1"/></svg>外观</button>
<button class="mn-item" data-sec="terminal" onclick="setSettingsSection('terminal')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l6-6-6-6M12 19h8"/></svg>终端</button>
<button class="mn-item" data-sec="sftp" onclick="setSettingsSection('sftp')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l9-4 9 4v10l-9 4-9-4z"/><path d="M3 7l9 4 9-4M12 11v10"/></svg>SFTP</button>
<button class="mn-item" data-sec="keys" onclick="setSettingsSection('keys')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="15" r="4"/><path d="M10.8 12.2L20 3M15 8l3 3M13 10l2 2"/></svg>密钥库</button>
<button class="mn-item" data-sec="security" onclick="setSettingsSection('security')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 018 0v4"/></svg>主机密钥</button>
<div class="mn-group">运维资源</div>
<button class="mn-item" data-sec="machines" onclick="setSettingsSection('machines')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="7" rx="2"/><rect x="2" y="13" width="20" height="7" rx="2"/><path d="M6 7.5h.01M6 16.5h.01"/></svg>机器配置</button>
<button class="mn-item" data-sec="env" onclick="setSettingsSection('env')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7V5a1 1 0 011-1h14a1 1 0 011 1v2"/><path d="M4 7h16M4 7v10a2 2 0 002 2h12a2 2 0 002-2V7"/><path d="M8 12h8"/></svg>环境变量</button>
<button class="mn-item" data-sec="portforwards" onclick="setSettingsSection('portforwards')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20c8-4 8-12 16-16"/><path d="M20 4a6 6 0 00-6 6 6 6 0 00-6 6"/></svg>端口转发</button>
<button class="mn-item" data-sec="proxy" onclick="setSettingsSection('proxy')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a15 15 0 010 18M12 3a15 15 0 000 18"/></svg>HTTP 代理</button>
<button class="mn-item" data-sec="shortcuts" onclick="setSettingsSection('shortcuts')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h.01M10 14h.01M14 14h.01M18 14h.01"/></svg>快捷键</button>
<div class="mn-group">其它</div>
<button class="mn-item" data-sec="about" onclick="setSettingsSection('about')"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg>关于</button>
</nav>
<div class="modal-body">
<div class="modal-head">
<div><h2 id="settings-title">应用</h2><div class="m-sub" id="settings-sub">通用偏好与窗口行为</div></div>
<div class="spacer"></div>
<button class="btn" onclick="closeSettings()">完成</button>
</div>
<div class="modal-content" id="settings-content">
<!-- 动态生成 -->
</div>
</div>
</div>
</div>
<script>
/* ================================================================
FlashShell UI 原型 — 交互逻辑
================================================================ */
(function () {
var ACTIVE_VIEW = 'home';
var SHELL_TABS = [
{ id: 'staging', name: 'staging-server', host: 'ubuntu@10.0.0.15', connected: true },
{ id: 'prod', name: 'prod-server', host: 'root@10.0.1.8', connected: true },
{ id: 'local', name: '本机', host: 'local', connected: true },
];
/* ---------- 视图切换 ---------- */
window.switchView = function (view) {
if (view === 'shell' && !document.querySelector('#view-shell').classList.contains('active')) {
renderShellTerminal('staging');
}
ACTIVE_VIEW = view;
['home', 'task', 'shell'].forEach(function (v) {
var el = document.getElementById('view-' + v);
el.classList.toggle('active', v === view);
});
document.querySelectorAll('.rail .nav-item[data-view]').forEach(function (b) {
b.classList.toggle('active', b.dataset.view === view);
});
document.querySelectorAll('#mode-seg button').forEach(function (b) {
b.classList.toggle('active', b.dataset.view === view);
});
var ctx = { home: '同港出海 · 任务与 Shell 并行', task: '任务模式 · ' + document.getElementById('task-proj-name').textContent, shell: 'Shell 模式 · 3 个会话已连接' }[view];
document.getElementById('tb-context').textContent = ctx;
};
/* ---------- 首页过滤 ---------- */
window.filterHome = function (kw) {
kw = (kw || '').trim().toLowerCase();
var visible = 0;
document.querySelectorAll('#proj-grid .project-card').forEach(function (c) {
var hit = c.textContent.toLowerCase().indexOf(kw) >= 0;
c.style.display = hit ? '' : 'none';
if (hit) visible++;
});
document.querySelectorAll('#machine-grid .machine, #pinned-grid .machine').forEach(function (m) {
var hit = m.textContent.toLowerCase().indexOf(kw) >= 0;
m.style.display = hit ? '' : 'none';
if (hit) visible++;