-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathindex.html
More file actions
1954 lines (1868 loc) · 131 KB
/
index.html
File metadata and controls
1954 lines (1868 loc) · 131 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bootimus Admin Panel</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Login Screen -->
<div id="login-screen" style="display: none; position: fixed; inset: 0; z-index: 9999; background: var(--bg-primary); align-items: center; justify-content: center;">
<div style="position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 10px;">
<select id="login-lang-select" data-i18n-aria-label="lang.label" class="lang-select" title="Language"></select>
<button id="login-theme-toggle" class="theme-switch" type="button" role="switch" aria-checked="false" data-i18n-aria-label="ui.toggle_dark_mode" data-i18n-title="ui.toggle_dark_mode" aria-label="Toggle dark mode" title="Toggle dark mode" onclick="toggleTheme()">
<svg class="theme-switch-icon theme-switch-icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
<svg class="theme-switch-icon theme-switch-icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
<span class="theme-switch-thumb" aria-hidden="true"></span>
</button>
</div>
<div style="width: 100%; max-width: 380px; padding: 24px;">
<div style="text-align: center; margin-bottom: 32px;">
<svg viewBox="0 0 108 36" width="220" style="display: block; margin: 0 auto 8px; max-width: 80%; height: auto; color: var(--text-primary);" role="img" aria-label="Bootimus">
<text font-family="ui-monospace, 'SF Mono', Menlo, Consolas, monospace" font-size="15" font-weight="700" letter-spacing="-0.3" y="23" x="10"><tspan fill="#ffb000">[</tspan><tspan fill="currentColor">bootimus</tspan><tspan fill="#ffb000">]</tspan></text>
</svg>
<p data-i18n="app.product_subtitle" style="color: var(--text-secondary); font-size: 14px;">PXE/HTTP Boot Server</p>
</div>
<form id="login-form">
<div id="login-auth-selector" style="display: none; margin-bottom: 16px;">
<label data-i18n="login.auth_method" style="display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary);">Authentication</label>
<select id="login-auth-method" style="width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font-size: 14px;">
</select>
</div>
<div class="form-group" style="margin-bottom: 16px;">
<label data-i18n="login.username" style="display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary);">Username</label>
<input type="text" name="username" id="login-username" required autocomplete="username" autofocus
style="width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font-size: 14px;">
</div>
<div class="form-group" style="margin-bottom: 20px;">
<label data-i18n="login.password" style="display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary);">Password</label>
<input type="password" name="password" id="login-password" required autocomplete="current-password"
style="width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font-size: 14px;">
</div>
<div id="login-error" style="display: none; color: var(--danger); font-size: 13px; margin-bottom: 12px;"></div>
<button type="submit" data-i18n="login.signin" id="login-submit">Sign In</button>
</form>
</div>
</div>
<header id="main-header" style="display: none;">
<div class="header-content" style="display: flex; align-items: center; gap: 14px; flex-wrap: wrap;">
<h1 style="margin: 0;">
<svg viewBox="0 0 108 36" width="160" style="display: block; height: auto; color: var(--text-primary);" role="img" aria-label="Bootimus">
<text font-family="ui-monospace, 'SF Mono', Menlo, Consolas, monospace" font-size="15" font-weight="700" letter-spacing="-0.3" y="23" x="10"><tspan fill="#ffb000">[</tspan><tspan fill="currentColor">bootimus</tspan><tspan fill="#ffb000">]</tspan></text>
</svg>
</h1>
<p style="margin: 0; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--text-secondary); letter-spacing: 0.4px;">
<span style="color: #ffb000;">></span> <span data-i18n="app.subtitle">PXE/HTTP Boot Server Management Interface</span>
</p>
</div>
<div style="display: flex; align-items: center; gap: 10px;">
<select id="lang-select" data-i18n-aria-label="lang.label" class="lang-select" title="Language"></select>
<button id="theme-toggle-btn" class="theme-switch" type="button" role="switch" aria-checked="false" data-i18n-aria-label="ui.toggle_dark_mode" data-i18n-title="ui.toggle_dark_mode" aria-label="Toggle dark mode" title="Toggle dark mode" onclick="toggleTheme()">
<svg class="theme-switch-icon theme-switch-icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
<svg class="theme-switch-icon theme-switch-icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
<span class="theme-switch-thumb" aria-hidden="true"></span>
</button>
<div class="user-profile">
<button class="user-profile-button" onclick="toggleUserProfile()">👤</button>
<div class="user-profile-dropdown" id="user-profile-dropdown">
<div class="user-profile-info">
<div class="username" id="current-username">Loading...</div>
<div class="role" id="current-user-role">User</div>
</div>
<button onclick="logout()">
<span>🚪</span>
<span data-i18n="user.logout">Logout</span>
</button>
</div>
</div>
</div>
</header>
<div class="app-layout" id="main-app" style="display: none;">
<!-- Sidebar Navigation -->
<aside class="sidebar">
<nav class="sidebar-nav">
<div class="nav-group">
<span class="nav-group-label" data-i18n="nav.group.overview">Overview</span>
<button class="nav-item active" data-tab="server" data-i18n="nav.server"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg> Server Info</button>
</div>
<div class="nav-group">
<span class="nav-group-label" data-i18n="nav.group.management">Management</span>
<button class="nav-item" data-tab="images" data-i18n="nav.images"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="3"/></svg> Images</button>
<button class="nav-item" data-tab="public-files" data-i18n="nav.public_files"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg> Public Files</button>
<button class="nav-item" data-tab="autoinstall" data-i18n="nav.autoinstall"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg> Auto-Install</button>
<button class="nav-item" data-tab="profiles" data-i18n="nav.profiles"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg> Distro Profiles</button>
</div>
<div class="nav-group">
<span class="nav-group-label" data-i18n="nav.group.boot">Boot</span>
<button class="nav-item" data-tab="boot-menu"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg> Boot Menu</button>
<button class="nav-item" data-tab="bootloaders" data-i18n="nav.bootloaders"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg> Bootloaders</button>
<button class="nav-item" data-tab="tools" data-i18n="nav.tools"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg> Tools</button>
</div>
<div class="nav-group">
<span class="nav-group-label" data-i18n="nav.group.access">Access</span>
<button class="nav-item" data-tab="clients" data-i18n="nav.clients"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="2" y1="10" x2="22" y2="10"/></svg> Clients</button>
<button class="nav-item" data-tab="users" data-i18n="nav.users"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg> Users</button>
</div>
<div class="nav-group">
<span class="nav-group-label" data-i18n="nav.group.system">System</span>
<button class="nav-item" data-tab="settings" data-i18n="nav.settings"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg> Settings</button>
<button class="nav-item" data-tab="api-reference"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg> API Reference</button>
<button class="nav-item" data-tab="logs" data-i18n="nav.logs"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg> Logs</button>
</div>
</nav>
<div style="padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0;">
<button onclick="showModal('about-modal')" style="background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 6px;">
🚀 Bootimus <span id="sidebar-version" style="color: var(--text-muted);">v...</span>
</button>
</div>
</aside>
<!-- Main Content -->
<main class="main-content">
<div class="content-area">
<div id="stats-container" class="stats">
<div class="stat-card">
<div class="stat-value" id="stat-clients">-</div>
<div class="stat-label" data-i18n="stats.total_clients">Total Clients</div>
</div>
<div class="stat-card">
<div class="stat-value" id="stat-active-clients">-</div>
<div class="stat-label" data-i18n="stats.active_clients">Active Clients</div>
</div>
<div class="stat-card">
<div class="stat-value" id="stat-images">-</div>
<div class="stat-label" data-i18n="stats.total_images">Total Images</div>
</div>
<div class="stat-card">
<div class="stat-value" id="stat-enabled-images">-</div>
<div class="stat-label" data-i18n="stats.enabled_images">Enabled Images</div>
</div>
<div class="stat-card">
<div class="stat-value" id="stat-boots">-</div>
<div class="stat-label" data-i18n="stats.total_boots">Total Boots</div>
</div>
</div>
<!-- Active Sessions Panel -->
<div id="active-sessions-panel" class="card" style="display: none;">
<h2 data-i18n="sessions.title">Active Sessions</h2>
<div id="active-sessions-content"></div>
</div>
<!-- Hidden tabs for backwards compat -->
<div class="tabs">
<button class="tab active" data-tab="server">Server Info</button>
<button class="tab" data-tab="clients">Clients</button>
<button class="tab" data-tab="images">Images</button>
<button class="tab" data-tab="public-files">Public Files</button>
<button class="tab" data-tab="users">Users</button>
<button class="tab" data-tab="tools">Tools</button>
<button class="tab" data-tab="bootloaders">Bootloaders</button>
<button class="tab" data-tab="settings">Settings</button>
<button class="tab" data-tab="logs">Logs</button>
</div>
<!-- Server Info Tab -->
<div id="server-tab" class="tab-content active">
<div class="card">
<h2 data-i18n="server.info.title">Server Information</h2>
<div id="server-info" class="loading">
<div class="spinner"></div>
<span data-i18n="server.info.loading">Loading server info...</span>
</div>
</div>
</div>
<!-- Clients Tab -->
<div id="clients-tab" class="tab-content">
<div class="card">
<div class="subtabs">
<button class="subtab active" data-subtab="clients" onclick="switchClientsSubtab('clients')">Clients</button>
<button class="subtab" data-subtab="client-groups" onclick="switchClientsSubtab('client-groups')">Client Groups</button>
</div>
<div id="clients-subtab">
<h2 data-i18n="page.clients.title">Client Management</h2>
<p data-i18n="page.clients.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Manage PXE boot clients. Discovered clients appear automatically when they connect.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showAddClientModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add Client
</button>
<button class="btn" type="button" onclick="loadClients()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>
Refresh
</button>
<button id="clients-group-toggle" class="btn btn-toggle" type="button" onclick="toggleClientGrouping()" aria-pressed="false" title="Group clients by their assigned client group">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"/>
<path d="M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"/>
<path d="M3 5a2 2 0 0 0 2 2h3"/>
<path d="M3 3v13a2 2 0 0 0 2 2h3"/>
</svg>
Group
</button>
<button class="btn btn-toggle" type="button" id="clients-autorefresh-btn" onclick="toggleClientsAutoRefresh()" aria-pressed="false" title="Auto-refresh client list every 5 seconds">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
Auto-refresh
</button>
<button class="btn" type="button" onclick="exportClientsCSV()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Export CSV
</button>
<button class="btn" type="button" onclick="showImportClientsModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
Import CSV
</button>
<input type="search" class="toolbar-filter" placeholder="Filter clients…" oninput="applyTableFilter('clients', this.value, renderClientsTable)">
</div>
<div id="clients-bulk-actions" class="toolbar bulk-toolbar" style="display: none;">
<span id="clients-bulk-count" style="color: var(--text-secondary); font-size: 13px;"></span>
<button class="btn" type="button" onclick="bulkSetClientsEnabled(true)" title="Enable selected clients">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
</svg>
Enable
</button>
<button class="btn" type="button" onclick="bulkSetClientsEnabled(false)" title="Disable selected clients">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/>
</svg>
Disable
</button>
<button class="btn" type="button" onclick="bulkWakeClients()" title="Send Wake-on-LAN to selected clients">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M18.36 6.64a9 9 0 1 1-12.73 0"/><line x1="12" y1="2" x2="12" y2="12"/>
</svg>
Wake
</button>
<button class="btn" type="button" onclick="openBulkAssignClientGroupModal()" title="Assign selected clients to a group">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
</svg>
Assign to Group
</button>
<button class="btn" type="button" onclick="bulkDeleteClients()" title="Delete selected clients">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
</svg>
Delete
</button>
<button class="btn" type="button" onclick="clearClientSelection()" title="Clear selection">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
Clear
</button>
</div>
<div id="clients-table" class="loading">
<div class="spinner"></div>
Loading clients...
</div>
</div>
<div id="client-groups-subtab" style="display: none;">
<h2 data-i18n="page.client_groups.title">Client Groups</h2>
<p data-i18n="page.client_groups.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Group clients by location, role, or fleet. Bulk wake all members, set a next-boot image on all, and overlay assigned images.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showAddClientGroupModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add Client Group
</button>
<input type="search" class="toolbar-filter" placeholder="Filter groups…" oninput="applyTableFilter('client-groups', this.value, renderClientGroupsTable)">
</div>
<div id="client-groups-table" class="loading">
<div class="spinner"></div>
Loading client groups...
</div>
</div>
</div>
</div>
<!-- Images Tab -->
<div id="images-tab" class="tab-content">
<div class="card">
<div class="subtabs">
<button class="subtab active" data-subtab="images" onclick="switchImagesSubtab('images')">Images</button>
<button class="subtab" data-subtab="image-groups" onclick="switchImagesSubtab('image-groups')">Image Groups</button>
</div>
<div id="images-subtab">
<h2 data-i18n="page.images.title">Image Management</h2>
<p data-i18n="page.images.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Upload, download, and manage OS images available for PXE booting.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showUploadModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="17 8 12 3 7 8"/>
<line x1="12" y1="3" x2="12" y2="15"/>
</svg>
Upload ISO
</button>
<button class="btn" type="button" onclick="showDownloadModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
Download ISO
</button>
<button class="btn" type="button" onclick="showGetImagesModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10"/>
<line x1="2" y1="12" x2="22" y2="12"/>
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
Get Images
</button>
<button class="btn" type="button" onclick="scanImages()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<polyline points="23 4 23 10 17 10"/>
<polyline points="1 20 1 14 7 14"/>
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/>
</svg>
Scan for ISOs
</button>
<button id="images-group-toggle" class="btn btn-toggle" type="button" onclick="toggleImageGrouping()" aria-pressed="false" title="Group images by their assigned folder">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"/>
<path d="M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"/>
<path d="M3 5a2 2 0 0 0 2 2h3"/>
<path d="M3 3v13a2 2 0 0 0 2 2h3"/>
</svg>
Group
</button>
<input type="search" class="toolbar-filter" placeholder="Filter images…" oninput="applyTableFilter('images', this.value, renderImagesTable)">
</div>
<div id="images-bulk-actions" class="toolbar bulk-toolbar" style="display: none;">
<span id="images-bulk-count" style="color: var(--text-secondary); font-size: 13px;"></span>
<button class="btn" type="button" onclick="bulkSetImagesEnabled(true)" title="Enable selected images">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
</svg>
Enable
</button>
<button class="btn" type="button" onclick="bulkSetImagesEnabled(false)" title="Disable selected images">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/>
</svg>
Disable
</button>
<button class="btn" type="button" onclick="openBulkAssignGroupModal()" title="Assign selected images to a group">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
</svg>
Assign to Group
</button>
<button class="btn" type="button" onclick="bulkDeleteImages()" title="Delete selected images">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
</svg>
Delete
</button>
<button class="btn" type="button" onclick="clearImageSelection()" title="Clear selection">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
Clear
</button>
</div>
<div id="images-table" class="loading">
<div class="spinner"></div>
Loading images...
</div>
</div>
<div id="image-groups-subtab" style="display: none;">
<h2>Image Groups</h2>
<p style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Organise images into groups and subgroups for the PXE boot menu.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showAddGroupModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add Image Group
</button>
<input type="search" class="toolbar-filter" placeholder="Filter groups…" oninput="applyTableFilter('image-groups', this.value, renderGroupsTable)">
</div>
<div id="groups-table" class="loading">
<div class="spinner"></div>
Loading groups...
</div>
</div>
</div>
</div>
<!-- Public Files Tab -->
<div id="public-files-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.public_files.title">Public Files</h2>
<p data-i18n="page.public_files.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Files available to all clients. For image-specific files, manage them from the Images tab.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showUploadPublicFileModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
Upload Public File
</button>
</div>
<div id="public-files-table" class="loading">
<div class="spinner"></div>
<p>Loading files...</p>
</div>
</div>
</div>
<!-- Users Tab -->
<div id="users-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.users.title">User Management</h2>
<p data-i18n="page.users.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Manage admin panel user accounts and permissions.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showAddUserModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add User
</button>
<input type="search" class="toolbar-filter" placeholder="Filter users…" oninput="applyTableFilter('users', this.value, renderUsersTable)">
</div>
<div id="users-table" class="loading">
<div class="spinner"></div>
Loading users...
</div>
</div>
</div>
<!-- Tools Tab -->
<div id="tools-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.tools.title">Boot Tools</h2>
<p data-i18n="page.tools.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Download a tool to make it available, then enable it to show in the boot menu.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showModal('add-custom-tool-modal')">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add Custom Tool
</button>
<button class="btn" type="button" onclick="updateToolsFromRemote()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>
Check for Updates
</button>
</div>
<div id="tools-list" class="loading">
<div class="spinner"></div>
Loading tools...
</div>
</div>
</div>
<!-- Distro Profiles Tab -->
<div id="profiles-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.profiles.title">Distro Profiles</h2>
<p data-i18n="page.profiles.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Distro profiles define how ISOs are detected and booted. Built-in profiles are updated from the central repository. Custom profiles take priority.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showModal('add-profile-modal')">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add Custom Profile
</button>
<button class="btn" type="button" onclick="updateProfilesFromRemote()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>
Check for Updates
</button>
</div>
<div id="profiles-list" class="loading" style="padding: 0 12px 12px;">
<div class="spinner"></div>
Loading profiles...
</div>
</div>
</div>
<!-- Auto-Install Files Tab -->
<div id="autoinstall-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.autoinstall.title">Auto-Install Files</h2>
<p data-i18n="page.autoinstall.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Install operating systems without manual prompts. Windows uses autounattend.xml; Ubuntu uses cloud-init; Red Hat and its family use kickstart; Debian uses preseed. Attach a file to an image for a default config, or override it per client for machine-specific setups.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showAutoInstallFileEditor(null)">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
New File
</button>
<button class="btn" type="button" onclick="document.getElementById('autoinstall-upload-trigger').click()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
Upload File
</button>
<input type="file" id="autoinstall-upload-trigger" style="display: none;" onchange="handleAutoInstallUpload(this)">
<input type="search" class="toolbar-filter" placeholder="Filter files…" oninput="applyTableFilter('autoinstall', this.value, renderAutoInstallFilesTable)">
</div>
<div id="autoinstall-table" class="loading">
<div class="spinner"></div>
Loading files...
</div>
</div>
</div>
<!-- Auto-Install Upload Modal -->
<div id="autoinstall-upload-modal" class="modal">
<div class="modal-content" style="max-width: 500px;">
<div class="modal-header"><h2>Upload Auto-Install File</h2></div>
<div class="modal-body">
<div class="form-group">
<label>File</label>
<div id="autoinstall-upload-filename" style="color: var(--text-secondary); font-size: 13px;"></div>
</div>
<div class="form-group">
<label>Distro Profile</label>
<select id="autoinstall-upload-distro" class="form-control">
<option value="">Select a distro…</option>
</select>
</div>
<div class="form-group">
<label>Save as (optional)</label>
<input type="text" id="autoinstall-upload-rename" class="form-control" placeholder="Leave empty to keep original filename">
</div>
</div>
<div style="margin: 0 20px 20px; display: flex; gap: 8px; align-items: center;">
<div style="flex: 1;"></div>
<button class="btn" onclick="closeModal('autoinstall-upload-modal')">Cancel</button>
<button class="btn btn-primary" onclick="confirmAutoInstallUpload()">Upload</button>
</div>
</div>
</div>
<!-- Auto-Install File Editor Modal -->
<div id="autoinstall-editor-modal" class="modal slide-panel">
<div class="modal-content slide-panel-content" style="max-width: 900px;">
<div class="modal-header">
<h2 id="autoinstall-editor-title">New Auto-Install File</h2>
</div>
<div class="modal-body">
<div class="form-row">
<div class="form-group">
<label>Distro Profile</label>
<select id="autoinstall-editor-distro" class="form-control">
<option value="">Select a distro…</option>
</select>
</div>
<div class="form-group">
<label>Filename</label>
<input type="text" id="autoinstall-editor-filename" class="form-control" placeholder="e.g. kiosk.xml, server.cfg">
</div>
</div>
<div class="form-group">
<label>Content</label>
<textarea id="autoinstall-editor-content" rows="22" style="font-family: monospace; width: 100%; padding: 8px; border: 1px solid var(--text-muted); border-radius: 4px; background: var(--bg-secondary); color: var(--text-primary);"></textarea>
<small style="color: var(--text-secondary); display: block; margin-top: 6px;">
Placeholders substituted per-client at serve time:
<code>{{MAC}}</code>
<code>{{CLIENT_NAME}}</code>
<code>{{HOSTNAME}}</code>
<code>{{IP}}</code>
<code>{{SERVER_ADDR}}</code>
<code>{{IMAGE_NAME}}</code>
<code>{{IMAGE_FILENAME}}</code>
</small>
</div>
</div>
<div style="margin: 0 20px 20px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center;">
<button id="autoinstall-editor-delete-btn" class="btn btn-danger" onclick="deleteAutoInstallFileFromEditor()" style="display: none;">Delete</button>
<button id="autoinstall-editor-download-btn" class="btn" onclick="downloadAutoInstallFileFromEditor()" style="display: none;">Download</button>
<div style="flex: 1;"></div>
<button class="btn" onclick="closeModal('autoinstall-editor-modal')">Cancel</button>
<button class="btn btn-primary" onclick="saveAutoInstallFile()">Save</button>
</div>
</div>
</div>
<!-- Bootloaders Tab -->
<div id="bootloaders-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.bootloaders.title">Bootloader Management</h2>
<p data-i18n="page.bootloaders.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Manage iPXE bootloader sets served to PXE clients. Create custom sets with your own bootloader files.
</p>
<div class="toolbar">
<button class="btn" type="button" onclick="showCreateBootloaderSetModal()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Create Set
</button>
</div>
<div id="bootloaders-table" class="loading">
<div class="spinner"></div>
Loading bootloaders...
</div>
</div>
</div>
<!-- Boot Menu Tab -->
<div id="boot-menu-tab" class="tab-content">
<div class="card">
<h2>Boot Menu</h2>
<p style="color: var(--text-secondary); margin-bottom: 20px;">
Configure the PXE boot menu seen by clients — title, timeout, and default fallback action.
Console resolution may not be supported by all iPXE firmware builds.
</p>
<form id="theme-form">
<div class="form-group">
<label>Menu Title</label>
<input type="text" id="theme-title" placeholder="Bootimus - Boot Menu">
</div>
<div class="form-group">
<label>Menu Timeout (seconds)</label>
<input type="number" id="theme-timeout" min="0" value="30" placeholder="30">
<small style="color: var(--text-secondary);">Time before auto-booting the default entry. Set to 0 to disable (wait forever).</small>
</div>
<div class="form-group">
<label>Default Menu Item</label>
<select id="theme-default-item" class="form-control">
<option value="local">Boot from Local Disk</option>
<option value="shell">Drop to iPXE shell</option>
<option value="reboot">Reboot</option>
<option value="">Auto (next-boot, then first image)</option>
</select>
<small style="color: var(--text-secondary);">Action when the timeout fires. Set to <strong>Boot from Local Disk</strong> to leave clients PXE-booting and have them fall through to local boot. A pending next-boot image always takes priority.</small>
</div>
<div style="display: flex; gap: 10px; margin-top: 10px;">
<button type="submit" class="btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
Save
</button>
</div>
</form>
</div>
</div>
<!-- Settings Tab -->
<div id="settings-tab" class="tab-content">
<div class="card">
<h2>Webhook</h2>
<p style="color: var(--text-secondary); margin: 0 12px 16px; font-size: 13px;">
POST a JSON payload to a URL when PXE events happen. Fire-and-forget, 10s timeout, no retries.
</p>
<form id="webhook-form" style="padding: 0 12px 12px;">
<div class="form-group checkbox-group">
<input type="checkbox" id="webhook-enabled">
<label for="webhook-enabled">Enable outbound webhook</label>
</div>
<div class="form-group">
<label>Webhook URL</label>
<input type="url" id="webhook-url" placeholder="https://example.com/bootimus-hook">
</div>
<div class="form-group">
<label>Events</label>
<div class="form-group checkbox-group" style="margin: 4px 0;">
<input type="checkbox" id="webhook-on-boot-started">
<label for="webhook-on-boot-started"><code>boot.started</code> — a client began booting an image</label>
</div>
<div class="form-group checkbox-group" style="margin: 4px 0;">
<input type="checkbox" id="webhook-on-client-discovered">
<label for="webhook-on-client-discovered"><code>client.discovered</code> — a new MAC connected for the first time</label>
</div>
<div class="form-group checkbox-group" style="margin: 4px 0;">
<input type="checkbox" id="webhook-on-inventory-updated">
<label for="webhook-on-inventory-updated"><code>client.inventory_updated</code> — hardware info refreshed for an existing client</label>
</div>
</div>
<div style="display: flex; gap: 8px;">
<button type="submit" class="btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
Save Webhook
</button>
<button type="button" class="btn" onclick="testWebhook()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
Send Test
</button>
<span id="webhook-test-result" style="align-self: center; font-size: 13px;"></span>
</div>
</form>
</div>
<div class="card" style="margin-top: 20px;">
<h2>Backup</h2>
<p style="color: var(--text-secondary); margin-bottom: 16px;">
Download a <code>.tar.gz</code> of the bootimus data directory: database, bootloader configuration, custom bootloader sets, and settings. ISOs and downloaded tool binaries are excluded (they're reproducible).
</p>
<div style="display: flex; gap: 10px; padding: 0 12px 12px;">
<button class="btn" type="button" onclick="downloadBackup()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Download Backup
</button>
</div>
<p style="color: var(--text-muted); font-size: 12px; padding: 0 12px 12px; margin: 0;">
Restore is manual: stop bootimus, extract the tarball over the data directory, start bootimus.
</p>
</div>
<div class="card" style="margin-top: 20px;">
<h2>USB Boot Images</h2>
<p style="color: var(--text-secondary); margin-bottom: 20px;">
Download bootable USB images for machines that don't support PXE network booting.
Write to a USB stick and boot from it to access the bootimus menu.
</p>
<div id="usb-images-content" style="padding: 0 12px 12px;">
<div class="loading">
<div class="spinner"></div>
Loading...
</div>
</div>
</div>
</div>
<!-- API Reference Tab -->
<div id="api-reference-tab" class="tab-content">
<div class="card">
<h2>API Reference</h2>
<p style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
All endpoints require authentication except where marked <span class="api-method public">PUBLIC</span>. Responses are JSON of the form <code>{success, data, error}</code>. Placeholders are shown as <code>{name}</code>.
</p>
<div class="toolbar">
<label style="display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary);">
Server:
<input type="text" id="api-ref-server" style="height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font-size: 13px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; width: 220px;" placeholder="https://host:port" oninput="onAPIRefServerChange()">
</label>
<label style="display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary);">
Image:
<select id="api-ref-image" style="height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font-size: 13px;" onchange="onAPIRefSelectChange()">
<option value="">(none)</option>
</select>
</label>
<label style="display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary);">
Client:
<select id="api-ref-mac" style="height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font-size: 13px;" onchange="onAPIRefSelectChange()">
<option value="">(none)</option>
</select>
</label>
<input type="search" class="toolbar-filter" id="api-ref-filter" placeholder="Filter endpoints…" oninput="renderAPIReference(this.value)">
</div>
<div id="api-reference-content" style="padding: 0 12px 12px;"></div>
</div>
</div>
<!-- Logs Tab -->
<div id="logs-tab" class="tab-content">
<div class="card">
<h2 data-i18n="page.logs.title">Server Logs</h2>
<p data-i18n="page.logs.intro" style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Live server log output for TFTP, HTTP, and PXE boot activity.
</p>
<div class="toolbar">
<button class="btn" type="button" id="connect-logs-btn" onclick="connectLiveLogs()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polygon points="5 3 19 12 5 21 5 3"/></svg>
Start Auto-Refresh
</button>
<button class="btn" type="button" id="disconnect-logs-btn" onclick="disconnectLiveLogs()" style="display: none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></svg>
Stop Auto-Refresh
</button>
<button class="btn" type="button" onclick="loadServerLogs()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>
Refresh Now
</button>
<button class="btn" type="button" onclick="clearLiveLogs()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>
Clear
</button>
<span id="log-status" style="color: var(--text-secondary); font-size: 12px;"></span>
</div>
<div id="live-logs" style="background: #1a1a1a; padding: 16px; border-radius: var(--radius-sm); max-height: 500px; overflow-y: auto; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; color: #e0e0e0; margin: 0 12px 12px;">
<div style="color: var(--text-secondary);">Click "Refresh Now" to load server logs...</div>
</div>
</div>
<div class="card">
<h2>Boot Attempt History</h2>
<p style="color: var(--text-secondary); margin: 0 12px 8px; font-size: 13px;">
Record of all PXE boot attempts by clients.
</p>
<div id="logs-table" class="loading" style="padding: 0 12px 12px;">
<div class="spinner"></div>
Loading logs...
</div>
</div>
</div>
</main>
</div>
<!-- Upload Bootloader Modal -->
<div id="create-bootloader-set-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Create Bootloader Set</h2>
</div>
<form id="create-bootloader-set-form" onsubmit="createBootloaderSet(event)">
<div class="form-group">
<label>Set Name *</label>
<input type="text" id="bootloader-set-name" placeholder="e.g. ipxe-1.21.1" required>
<small style="color: var(--text-secondary);">Creates a directory in <code>data/bootloaders/</code>. Use a descriptive name.</small>
</div>
<button type="submit" class="btn btn-primary">Create Set</button>
<button type="button" class="btn" onclick="closeModal('create-bootloader-set-modal')">Cancel</button>
</form>
</div>
</div>
<div id="upload-bootloader-files-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Upload Files to <span id="upload-bl-set-name"></span></h2>
</div>
<form id="upload-bootloader-files-form" onsubmit="uploadBootloaderFiles(event)">
<input type="hidden" id="upload-bl-set-value">
<div class="form-group">
<label>Bootloader Files *</label>
<input type="file" id="bootloader-files-upload" multiple required>
<small style="color: var(--text-secondary);">Select one or more iPXE bootloader files (.efi, .kpxe, .usb, etc.).</small>
</div>
<button type="submit" class="btn btn-primary">Upload</button>
<button type="button" class="btn" onclick="closeModal('upload-bootloader-files-modal')">Cancel</button>
</form>
</div>
</div>
<!-- Modals -->
<div id="add-client-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Add Client</h2>
</div>
<form id="add-client-form">
<div class="form-group">
<label>MAC Address *</label>
<input type="text" name="mac_address" placeholder="00:11:22:33:44:55" required>
</div>
<div class="form-group">
<label>Name</label>
<input type="text" name="name" placeholder="Lab Machine 1">
</div>
<div class="form-group">
<label>Description</label>
<textarea name="description" placeholder="Optional description" rows="3"></textarea>
</div>
<div class="form-group checkbox-group">
<input type="checkbox" name="enabled" checked>
<label>Enabled</label>
</div>
<button type="submit" class="btn btn-primary">Create Client</button>
<button type="button" class="btn" onclick="closeModal('add-client-modal')">Cancel</button>
</form>
</div>
</div>
<div id="edit-client-modal" class="modal slide-panel">
<div class="modal-content">
<div class="modal-header">
<h2>Edit Client</h2>
</div>
<form id="edit-client-form">
<div class="form-group">
<label>MAC Address</label>
<input type="text" name="mac_address" readonly>
</div>
<div class="form-group">
<label>Name</label>
<input type="text" name="name">
</div>
<div class="form-group">
<label>Description</label>
<textarea name="description" rows="3"></textarea>
</div>
<div class="form-group checkbox-group">
<input type="checkbox" name="enabled">
<label>Enabled</label>
</div>
<div class="form-group checkbox-group">
<input type="checkbox" name="show_public_images">
<label>Show public images</label>
</div>
<div class="form-group">
<label>Bootloader Set</label>
<select name="bootloader_set" id="edit-bootloader-set-select">
<option value="">Default (global setting)</option>
</select>
<small style="color: var(--text-secondary);">Override the global bootloader set for this client.</small>
</div>
<div class="form-group">
<label>Client Group</label>
<select name="client_group_id" id="edit-client-group-select">
<option value="">(none)</option>
</select>
<small style="color: var(--text-secondary);">Group overlay: inherits allowed images and participates in bulk actions.</small>
</div>
<div class="form-group">
<label>Auto-Install File</label>
<select name="auto_install_file" id="edit-client-autoinstall-select">
<option value="">(inherit from group or image)</option>
</select>
<small style="color: var(--text-secondary);">Override the installation config for this machine specifically. Leave blank to inherit from the client group, or fall back to the image's default.</small>
</div>
<details style="margin-bottom: 12px;">
<summary style="cursor: pointer; font-weight: 500; padding: 6px 0;">BMC / Redfish (Power Control)</summary>
<p style="color: var(--text-muted); font-size: 12px; margin: 4px 0 10px 0;">
Blank username/password/port inherit from the client group. Host is always per-client (each BMC has its own IP).
</p>
<div class="form-group">
<label>BMC Host / IP</label>
<input type="text" name="ipmi_host" placeholder="e.g. 10.0.0.100">
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
<div class="form-group">
<label>Port</label>
<input type="number" name="ipmi_port" min="1" max="65535" placeholder="443">
</div>
<div class="form-group checkbox-group" style="align-self: end; padding: 6px 0;">
<input type="checkbox" name="ipmi_insecure" id="edit-ipmi-insecure">
<label for="edit-ipmi-insecure">Skip TLS verify</label>
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
<div class="form-group">
<label>Username</label>
<input type="text" name="ipmi_username" autocomplete="off">
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="ipmi_password" autocomplete="off">
</div>
</div>
<div style="display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px;">
<button type="button" class="btn btn-sm btn-success" onclick="powerClient('On')">Power On</button>
<button type="button" class="btn btn-sm btn-danger" onclick="powerClient('ForceOff')">Force Off</button>
<button type="button" class="btn btn-sm" onclick="powerClient('GracefulShutdown')">Graceful Off</button>
<button type="button" class="btn btn-sm" onclick="powerClient('ForceRestart')">Restart</button>
<button type="button" class="btn btn-sm" onclick="powerStatusClient()">Status</button>
</div>
<div id="power-client-result" style="font-size: 12px; color: var(--text-secondary);"></div>
</details>
<div class="form-group">
<label>Assigned Images</label>
<select name="images" multiple size="8" id="edit-images-select">
</select>
<small style="color: var(--text-secondary);">Hold Ctrl/Cmd to select multiple. Public images are shown separately if enabled above.</small>
</div>
<div style="margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap;">
<button type="button" class="btn btn-danger" onclick="deleteFromEditClient()">Delete</button>
<div style="flex: 1;"></div>
<button type="button" class="btn" onclick="closeModal('edit-client-modal')">Cancel</button>
<button type="submit" class="btn btn-primary">Update Client</button>
</div>
</form>
<div id="client-hardware-info" style="display:none; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
<h3 style="font-size: 14px; font-weight: 600; color: var(--text-primary);">Hardware Information</h3>
<button type="button" class="btn btn-sm" onclick="showInventoryHistory()">View History</button>
</div>
<div id="client-hw-details"></div>
</div>
<div id="client-boot-history" style="margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px;">
<h3 style="font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px;">Boot History</h3>
<div id="client-boot-history-list" style="font-size: 13px;">
<p style="color: var(--text-secondary); margin: 0;">Loading…</p>
</div>
</div>
</div>
</div>
<div id="next-boot-modal" class="modal">
<div class="modal-content" style="max-width: 480px;">
<div class="modal-header">
<h2>Set Next Boot Action</h2>
</div>
<p style="color: var(--text-secondary); margin-bottom: 16px;">Select an image to boot on the next PXE boot. This is a one-time action that clears after use.</p>
<div class="form-group">
<label>Client</label>
<input type="text" id="next-boot-mac" readonly>
</div>
<div class="form-group">
<label>Boot Image</label>
<select id="next-boot-image-select">
</select>
</div>
<div id="next-boot-current" style="margin-bottom: 16px; display: none;">
<span style="color: var(--text-secondary);">Current next boot: </span>
<span id="next-boot-current-image" class="badge badge-info"></span>