-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2516 lines (2450 loc) · 127 KB
/
index.html
File metadata and controls
2516 lines (2450 loc) · 127 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>OpenIPAM - IP Address Management & CMDB</title>
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="app-container">
<!-- Sidebar Navigation -->
<nav class="sidebar">
<div class="logo">
<div class="logo-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"/>
<path d="M12 2v4m0 12v4M2 12h4m12 0h4"/>
<path d="M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83"/>
</svg>
</div>
<div class="logo-text">
<h1>OpenIPAM</h1>
<span class="subtitle">IPAM & CMDB</span>
</div>
</div>
<!-- Global Search -->
<div class="global-search-container">
<div class="global-search-wrapper">
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<path d="M21 21l-4.35-4.35"/>
</svg>
<input type="text" id="globalSearch" placeholder="Search... (Press /)" autocomplete="off">
<kbd class="search-shortcut">/</kbd>
</div>
<div id="globalSearchResults" class="global-search-results"></div>
</div>
<div class="sidebar-nav-scroll">
<div class="nav-section">
<span class="nav-section-title">Overview</span>
<ul class="nav-menu">
<li class="nav-item active" data-page="dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="7" height="7" rx="1"/>
<rect x="14" y="3" width="7" height="7" rx="1"/>
<rect x="3" y="14" width="7" height="7" rx="1"/>
<rect x="14" y="14" width="7" height="7" rx="1"/>
</svg>
<span>Dashboard</span>
</li>
</ul>
</div>
<div class="nav-section">
<span class="nav-section-title">Management</span>
<ul class="nav-menu">
<li class="nav-item" data-page="companies">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 21h18"/>
<path d="M9 8h1m-1 4h1m4-4h1m-1 4h1"/>
<path d="M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16"/>
</svg>
<span>Companies</span>
</li>
<li class="nav-item" data-page="vlans">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 3H5a2 2 0 00-2 2v4m6-6h10a2 2 0 012 2v4M9 3v18m0 0h10a2 2 0 002-2v-4M9 21H5a2 2 0 01-2-2v-4"/>
</svg>
<span>VLANs</span>
</li>
<li class="nav-item" data-page="subnets">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"/>
</svg>
<span>Subnets</span>
</li>
<li class="nav-item" data-page="hosts">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="3" width="20" height="14" rx="2"/>
<path d="M8 21h8m-4-4v4"/>
</svg>
<span>Hosts</span>
</li>
<li class="nav-item" data-page="ipam">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm0 8a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1v-2zm0 8a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1v-2z"/>
</svg>
<span>IP Addresses</span>
</li>
<li class="nav-item" data-page="ip-ranges">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 6h18M3 12h18M3 18h18"/>
<circle cx="6" cy="6" r="2"/>
<circle cx="18" cy="12" r="2"/>
<circle cx="10" cy="18" r="2"/>
</svg>
<span>IP Ranges</span>
</li>
<li class="nav-item" data-page="locations">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="7" width="20" height="14" rx="2"/>
<path d="M16 7V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v3"/>
<path d="M12 11v4"/>
<path d="M8 11h8"/>
</svg>
<span>Locations</span>
</li>
<li class="nav-item" data-page="dhcp">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M5 12h14M12 5l7 7-7 7"/>
<circle cx="5" cy="12" r="2"/>
</svg>
<span>DHCP Scopes</span>
</li>
</ul>
</div>
<div class="nav-section">
<span class="nav-section-title">Tools</span>
<ul class="nav-menu">
<li class="nav-item" data-page="templates">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2"/>
<path d="M3 9h18M9 21V9"/>
</svg>
<span>Subnet Templates</span>
</li>
<li class="nav-item" onclick="showSubnetCalculator()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="4" y="2" width="16" height="20" rx="2"/>
<line x1="8" y1="6" x2="16" y2="6"/>
<line x1="8" y1="10" x2="16" y2="10"/>
<line x1="8" y1="14" x2="12" y2="14"/>
<line x1="8" y1="18" x2="12" y2="18"/>
</svg>
<span>Subnet Calculator</span>
</li>
<li class="nav-item" data-page="maintenance">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
<line x1="16" y1="2" x2="16" y2="6"/>
<line x1="8" y1="2" x2="8" y2="6"/>
<line x1="3" y1="10" x2="21" y2="10"/>
</svg>
<span>Maintenance</span>
</li>
<li class="nav-item" data-page="ip-history">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
<span>IP History</span>
</li>
<li class="nav-item" data-page="lifecycle">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83"/>
</svg>
<span>Lifecycle</span>
</li>
<li class="nav-item" data-page="audit-log">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
</svg>
<span>Activity Log</span>
</li>
<li class="nav-item" data-page="alerts">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/>
<line x1="12" y1="9" x2="12" y2="13"/>
<line x1="12" y1="17" x2="12.01" y2="17"/>
</svg>
<span>Alerts</span>
</li>
<li class="nav-item" data-page="import">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
<polyline points="17 8 12 3 7 8"/>
<line x1="12" y1="3" x2="12" y2="15"/>
</svg>
<span>Import / Export</span>
</li>
<li class="nav-item" data-page="settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"/>
<path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"/>
</svg>
<span>Settings</span>
</li>
</ul>
</div>
</div>
<div class="sidebar-footer">
<div class="sidebar-tools">
<button id="calcBtn" class="btn-icon-text sidebar-tool-btn" onclick="showSubnetCalculator()" title="Subnet Calculator">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="4" y="2" width="16" height="20" rx="2"/>
<line x1="8" y1="6" x2="16" y2="6"/>
<line x1="8" y1="10" x2="10" y2="10"/>
<line x1="12" y1="10" x2="14" y2="10"/>
<line x1="8" y1="14" x2="10" y2="14"/>
<line x1="12" y1="14" x2="14" y2="14"/>
<line x1="8" y1="18" x2="10" y2="18"/>
<line x1="12" y1="18" x2="16" y2="18"/>
</svg>
</button>
<button id="darkModeBtn" class="btn-icon-text sidebar-tool-btn dark-mode-toggle" onclick="toggleDarkMode()" title="Toggle Dark Mode">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/>
</svg>
</button>
<button id="signOutBtn" class="btn-icon-text sidebar-tool-btn" onclick="Auth.logout()" title="Sign Out">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"/>
<polyline points="16 17 21 12 16 7"/>
<line x1="21" y1="12" x2="9" y2="12"/>
</svg>
</button>
</div>
<div class="storage-info">
<div class="storage-label">
<span>Local Storage</span>
<span id="storageUsed">0 KB</span>
</div>
<div class="storage-bar">
<div class="storage-fill" id="storageFill"></div>
</div>
</div>
<button id="clearDataBtn" class="btn-danger-outline">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"/>
<path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"/>
</svg>
Clear All Data
</button>
</div>
</nav>
<!-- Main Content Area -->
<main class="main-content">
<!-- Dashboard Page -->
<div id="dashboard" class="page active">
<div class="page-header">
<div class="page-title">
<h2>Dashboard</h2>
<p class="page-description">Overview of your network infrastructure</p>
</div>
<div class="header-actions">
<button class="btn-primary" onclick="showQuickAddModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Quick Add
</button>
</div>
</div>
<div id="dashboardConflicts"></div>
<div class="stats-grid">
<div class="stat-card gradient-blue">
<div class="stat-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 21h18M9 8h1m-1 4h1m4-4h1m-1 4h1M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16"/>
</svg>
</div>
<div class="stat-info">
<span class="stat-value" id="totalCompanies">0</span>
<span class="stat-label">Companies</span>
</div>
<div class="stat-trend up">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="23 6 13.5 15.5 8.5 10.5 1 18"/>
</svg>
</div>
</div>
<div class="stat-card gradient-purple">
<div class="stat-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<path d="M2 12h20"/>
</svg>
</div>
<div class="stat-info">
<span class="stat-value" id="totalSubnets">0</span>
<span class="stat-label">Subnets</span>
</div>
</div>
<div class="stat-card gradient-green">
<div class="stat-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="3" width="20" height="14" rx="2"/>
<path d="M8 21h8m-4-4v4"/>
</svg>
</div>
<div class="stat-info">
<span class="stat-value" id="totalHosts">0</span>
<span class="stat-label">Total Hosts</span>
</div>
</div>
<div class="stat-card gradient-orange">
<div class="stat-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>
</svg>
</div>
<div class="stat-info">
<span class="stat-value" id="runningHosts">0</span>
<span class="stat-label">Running</span>
</div>
</div>
</div>
<div class="dashboard-grid">
<div class="card">
<div class="card-header">
<h3>IP Utilization</h3>
<div class="card-actions">
<select id="utilizationFilter" class="select-small" onchange="refreshDashboard()">
<option value="">All Companies</option>
</select>
</div>
</div>
<div class="card-body">
<div id="ipUtilization">
<div class="utilization-chart">
<div class="donut-chart" id="utilizationDonut">
<svg viewBox="0 0 36 36">
<path class="donut-ring" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
<path class="donut-segment" stroke-dasharray="0, 100" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
</svg>
<div class="donut-center">
<span class="donut-value" id="overallUsagePercent">0%</span>
<span class="donut-label">Used</span>
</div>
</div>
<div class="utilization-legend">
<div class="legend-item">
<span class="legend-dot assigned"></span>
<span class="legend-label">Assigned</span>
<span class="legend-value" id="assignedIPs">0</span>
</div>
<div class="legend-item">
<span class="legend-dot available"></span>
<span class="legend-label">Available</span>
<span class="legend-value" id="availableIPs">0</span>
</div>
<div class="legend-item">
<span class="legend-dot reserved"></span>
<span class="legend-label">Reserved</span>
<span class="legend-value" id="reservedIPs">0</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Companies Overview</h3>
<a href="#" class="card-link" onclick="navigateTo('companies'); return false;">View All</a>
</div>
<div class="card-body">
<div id="companiesOverview" class="companies-list">
<p class="empty-state">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M3 21h18M9 8h1m-1 4h1m4-4h1m-1 4h1M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16"/>
</svg>
<span>No companies configured</span>
<button class="btn-link" onclick="showAddCompanyModal()">Add your first company</button>
</p>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Recent Activity</h3>
<a href="#" class="card-link" onclick="navigateTo('hosts'); return false;">View All Hosts</a>
</div>
<div class="card-body">
<table class="data-table" id="recentHostsTable">
<thead>
<tr>
<th>VM Name</th>
<th>Company</th>
<th>OS</th>
<th>State</th>
<th>IP Addresses</th>
<th>Node</th>
</tr>
</thead>
<tbody>
<tr><td colspan="6" class="empty-message">No hosts found</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Companies Page -->
<div id="companies" class="page">
<div class="page-header">
<div class="page-title">
<h2>Companies</h2>
<p class="page-description">Manage organizations and their network resources</p>
</div>
<button class="btn-primary" onclick="showAddCompanyModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add Company
</button>
</div>
<div class="companies-grid" id="companiesGrid">
<div class="company-card add-new" onclick="showAddCompanyModal()">
<div class="add-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
</div>
<span>Add New Company</span>
</div>
</div>
</div>
<!-- Subnets Page -->
<div id="subnets" class="page">
<div class="page-header">
<div class="page-title">
<h2>Subnet Management</h2>
<p class="page-description">Configure and monitor network subnets</p>
</div>
<button class="btn-primary" onclick="showAddSubnetModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add Subnet
</button>
</div>
<div class="filters-bar">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<path d="M21 21l-4.35-4.35"/>
</svg>
<input type="text" id="subnetSearchInput" placeholder="Search subnets..." onkeyup="filterSubnets()">
</div>
<select id="subnetCompanyFilter" onchange="filterSubnets()">
<option value="">All Companies</option>
</select>
</div>
<div class="card">
<div class="card-body no-padding">
<table class="data-table" id="subnetsTable">
<thead>
<tr>
<th>Network</th>
<th>Company</th>
<th>Name</th>
<th>VLAN</th>
<th>Gateway</th>
<th>Capacity</th>
<th>Usage</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="8" class="empty-message">No subnets configured</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Hosts Page -->
<div id="hosts" class="page">
<div class="page-header">
<div class="page-title">
<h2>Host Management</h2>
<p class="page-description">Configuration Management Database (CMDB)</p>
</div>
<div class="header-actions">
<button class="btn-icon-text" id="compactViewBtn" onclick="toggleCompactView()" title="Toggle Compact View">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 6h16M4 12h16M4 18h16"/>
</svg>
</button>
<button class="btn-icon-text" onclick="showColumnSettingsModal()" title="Column Settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="7" height="7"/>
<rect x="14" y="3" width="7" height="7"/>
<rect x="14" y="14" width="7" height="7"/>
<rect x="3" y="14" width="7" height="7"/>
</svg>
</button>
<button class="btn-secondary" id="bulkEditHostsBtn" style="display: none;" onclick="showBulkEditHostsModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/>
<path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/>
</svg>
<span id="bulkEditHostsCount">Bulk Edit (0)</span>
</button>
<button class="btn-primary" onclick="showAddHostModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add Host
</button>
</div>
</div>
<div class="filters-bar">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<path d="M21 21l-4.35-4.35"/>
</svg>
<input type="text" id="hostSearchInput" placeholder="Search hosts..." onkeyup="filterHosts()">
</div>
<div class="custom-select-wrapper">
<select id="hostCompanyFilter" onchange="filterHosts()">
<option value="">All Companies</option>
</select>
</div>
<div class="custom-select-wrapper">
<select id="hostTypeFilter" onchange="filterHosts()">
<option value="">All Types</option>
</select>
</div>
<div class="custom-select-wrapper">
<select id="hostStateFilter" onchange="filterHosts()">
<option value="">All States</option>
<option value="running">Running</option>
<option value="stopped">Stopped</option>
</select>
</div>
<div class="custom-select-wrapper">
<select id="hostSubnetFilter" onchange="filterHosts()">
<option value="">All Subnets</option>
</select>
</div>
</div>
<div class="card">
<div class="card-body no-padding table-responsive">
<table class="data-table" id="hostsTable">
<thead>
<tr>
<th class="checkbox-col"><input type="checkbox" id="selectAllHosts" onchange="toggleAllHosts(this)"></th>
<th class="sortable" data-sort="vm_name">VM Name</th>
<th>Company</th>
<th class="sortable" data-sort="operating_system">OS</th>
<th class="sortable" data-sort="state">State</th>
<th class="sortable" data-sort="node">Node</th>
<th>Resources</th>
<th>IP Addresses</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="9" class="empty-message">No hosts found</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- IPAM Page -->
<div id="ipam" class="page">
<div class="page-header">
<div class="page-title">
<h2>IP Address Management</h2>
<p class="page-description">Track and manage IP allocations</p>
</div>
<div class="header-actions">
<button class="btn-secondary" id="bulkEditIPsBtn" style="display: none;" onclick="showBulkEditIPsModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/>
<path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/>
</svg>
<span id="bulkEditIPsCount">Bulk Edit (0)</span>
</button>
<button class="btn-secondary" onclick="showAddReservationModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
<path d="M7 11V7a5 5 0 0110 0v4"/>
</svg>
Reserve IP
</button>
<button class="btn-primary" onclick="showAssignIPModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Assign IP
</button>
</div>
</div>
<div class="filters-bar">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<path d="M21 21l-4.35-4.35"/>
</svg>
<input type="text" id="ipSearchInput" placeholder="Search IP or hostname..." onkeyup="filterIPs()">
</div>
<select id="ipCompanyFilter" onchange="filterIPs()">
<option value="">All Companies</option>
</select>
<select id="ipSubnetFilter" onchange="filterIPs()">
<option value="">All Subnets</option>
</select>
<select id="ipStatusFilter" onchange="filterIPs()">
<option value="">All Status</option>
<option value="assigned">Assigned</option>
<option value="available">Available</option>
<option value="reserved">Reserved</option>
</select>
<button class="btn-icon-text" id="ipamCompactViewBtn" onclick="toggleIPAMCompactView()" title="Toggle Compact View">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
Compact
</button>
</div>
<div id="conflictsPanel" class="conflicts-panel"></div>
<div class="card">
<div class="card-body no-padding">
<table class="data-table" id="ipsTable">
<thead>
<tr>
<th class="checkbox-col"><input type="checkbox" id="selectAllIPs" onchange="toggleAllIPs(this)"></th>
<th class="sortable" data-sort="ip">IP Address</th>
<th>DNS Name</th>
<th>Company</th>
<th>Subnet</th>
<th>Status</th>
<th>Assigned To / Reserved For</th>
<th>Last Updated</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="9" class="empty-message">No IP addresses tracked</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Locations Page -->
<div id="locations" class="page">
<div class="page-header">
<div class="page-title">
<h2>Locations & Racks</h2>
<p class="page-description">Manage datacenters, rooms, and rack positions</p>
</div>
<div class="page-actions">
<button class="btn-primary" onclick="showAddLocationModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add Location
</button>
</div>
</div>
<div class="card">
<div class="table-responsive">
<table class="data-table" id="locationsTable">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Datacenter</th>
<th>Building</th>
<th>Room</th>
<th>Utilization</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="locationsTableBody">
<tr><td colspan="7" class="empty-message">No locations configured</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Import/Export Page -->
<div id="import" class="page">
<div class="page-header">
<div class="page-title">
<h2>Import / Export</h2>
<p class="page-description">Manage your data with CSV and backup files</p>
</div>
</div>
<div class="import-export-grid">
<div class="card">
<div class="card-header">
<h3>Import from CSV</h3>
</div>
<div class="card-body">
<div class="form-group">
<label>Import Type</label>
<select id="importEntity" onchange="updateImportEntityUI()">
<option value="hosts">Hosts</option>
<option value="companies">Companies</option>
<option value="subnets">Subnets</option>
<option value="vlans">VLANs</option>
<option value="locations">Locations</option>
<option value="dhcpScopes">DHCP Scopes</option>
<option value="ipRanges">IP Ranges</option>
</select>
</div>
<p class="help-text" id="importDescription">Import or update hosts and their IP assignments.</p>
<button type="button" class="btn-secondary import-template-btn" onclick="downloadCSVTemplate()">
Download Empty CSV Template
</button>
<p class="help-text">Use this if you do not have a CSV yet. The downloaded file includes the right import columns for the selected import type.</p>
<div class="form-group" id="importCompanyGroup">
<label>Assign to Company</label>
<select id="importCompany">
<option value="">-- No Company --</option>
</select>
<span class="help-text">Used for host imports when the CSV does not specify a company.</span>
</div>
<div class="file-upload-area" id="dropZone">
<input type="file" id="csvFileInput" accept=".csv" onchange="handleFileSelect(event)">
<div class="upload-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
<polyline points="17 8 12 3 7 8"/>
<line x1="12" y1="3" x2="12" y2="15"/>
</svg>
</div>
<p class="upload-text">Drag & drop CSV file here</p>
<p class="upload-subtext">or click to browse</p>
</div>
<div class="checkbox-group">
<label class="checkbox-label">
<input type="checkbox" id="updateExisting" checked>
<span class="checkmark"></span>
Update existing records if found
</label>
</div>
<div id="importStatus" class="import-status"></div>
<div id="importPreview" class="import-preview"></div>
<details class="csv-format-details">
<summary>View expected CSV format</summary>
<code class="csv-format" id="importFormatCode">VM Name, Company, Host Type, Operating System, State, Node, CPU Count, Memory Used (GB), Memory Available (GB), Memory Total (GB), Disk Size (GB), Disk Used (GB), IP Addresses, Fav</code>
</details>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Export Data</h3>
</div>
<div class="card-body">
<p class="help-text">Export your data to CSV or create a full backup.</p>
<div class="export-options">
<div class="export-option" onclick="exportToCSV()">
<div class="export-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
</svg>
</div>
<div class="export-info">
<span class="export-title">Export to CSV</span>
<span class="export-desc">Download hosts as spreadsheet</span>
</div>
</div>
<div class="export-option" onclick="backupDatabase()">
<div class="export-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
</div>
<div class="export-info">
<span class="export-title">Full Backup</span>
<span class="export-desc">Download complete database (JSON)</span>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Restore Backup</h3>
</div>
<div class="card-body">
<p class="help-text">Restore a previous backup. This will replace all current data.</p>
<div class="file-upload-area small" onclick="document.getElementById('restoreInput').click()">
<input type="file" id="restoreInput" accept=".json" style="display:none" onchange="restoreDatabase(event)">
<div class="upload-icon small">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="16 16 12 12 8 16"/>
<line x1="12" y1="12" x2="12" y2="21"/>
<path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/>
</svg>
</div>
<p class="upload-text">Click to select backup file</p>
</div>
</div>
</div>
</div>
</div>
<!-- VLANs Page -->
<div id="vlans" class="page">
<div class="page-header">
<div class="page-title">
<h2>VLAN Management</h2>
<p class="page-description">Configure virtual LANs for network segmentation</p>
</div>
<button class="btn-primary" onclick="showAddVLANModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add VLAN
</button>
</div>
<div class="card">
<div class="card-body no-padding">
<table class="data-table" id="vlansTable">
<thead>
<tr>
<th>VLAN ID</th>
<th>Name</th>
<th>Type</th>
<th>Company</th>
<th>Subnets</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="7" class="empty-message">No VLANs configured</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- DHCP Scopes Page -->
<div id="dhcp" class="page">
<div class="page-header">
<div class="page-title">
<h2>DHCP Scope Management</h2>
<p class="page-description">Track DHCP scopes, leases, reservations, and options</p>
</div>
<button class="btn-primary" onclick="showAddDHCPScopeModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add Scope
</button>
</div>
<div class="dhcp-tabs">
<button class="dhcp-tab active" onclick="switchDHCPTab('scopes')">Scopes</button>
<button class="dhcp-tab" onclick="switchDHCPTab('leases')">Leases</button>
<button class="dhcp-tab" onclick="switchDHCPTab('reservations')">Reservations</button>
</div>
<div class="card">
<div class="card-body no-padding">
<div id="dhcpScopesTab" class="dhcp-tab-content active">
<table class="data-table" id="dhcpScopesTable">
<thead>
<tr>
<th>Name</th>
<th>Subnet</th>
<th>Range</th>
<th>Lease Time</th>
<th>Utilization</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="7" class="empty-message">No DHCP scopes configured</td></tr>
</tbody>
</table>
</div>
<div id="dhcpLeasesTab" class="dhcp-tab-content">
<table class="data-table" id="dhcpLeasesTable">
<thead>
<tr>
<th>IP Address</th>
<th>MAC Address</th>
<th>Hostname</th>
<th>Scope</th>
<th>Status</th>
<th>Start</th>
<th>End</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="8" class="empty-message">No DHCP leases found</td></tr>
</tbody>
</table>
</div>
<div id="dhcpReservationsTab" class="dhcp-tab-content">
<table class="data-table" id="dhcpReservationsTable">
<thead>
<tr>
<th>IP Address</th>
<th>MAC Address</th>
<th>Hostname</th>
<th>Scope</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="6" class="empty-message">No DHCP reservations configured</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- IP Ranges Page -->
<div id="ip-ranges" class="page">
<div class="page-header">
<div class="page-title">
<h2>IP Range Allocation</h2>
<p class="page-description">Organize IP ranges by purpose (servers, printers, IoT, etc.)</p>
</div>
<button class="btn-primary" onclick="showAddIPRangeModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
</svg>
Add IP Range
</button>
</div>
<div class="card">
<div class="card-body no-padding">
<table class="data-table" id="ipRangesTable">
<thead>
<tr>
<th>Purpose</th>
<th>Name</th>
<th>Subnet</th>
<th>Start IP</th>
<th>End IP</th>
<th>Size</th>
<th>Usage</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td colspan="8" class="empty-message">No IP ranges configured</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Subnet Templates Page -->
<div id="templates" class="page">
<div class="page-header">
<div class="page-title">
<h2>Subnet Templates</h2>
<p class="page-description">Pre-defined subnet configurations for quick deployment</p>
</div>
</div>
<div class="templates-grid" id="templatesGrid">
<!-- Templates will be populated by JavaScript -->
</div>