Enhanced the add/edit interface Modal UI into tabs

This commit is contained in:
johnnyq
2025-02-14 13:42:15 -05:00
parent 7452e8f08e
commit 117861034a
2 changed files with 427 additions and 367 deletions
+32 -4
View File
@@ -14,6 +14,24 @@
<div class="modal-body bg-white"> <div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#pills-interface-details">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-interface-network">Network</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-interface-notes">Notes</a>
</li>
</ul>
<hr>
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-interface-details">
<!-- Interface Name --> <!-- Interface Name -->
<div class="form-group"> <div class="form-group">
<label>Interface Name or Port / <span class="text-secondary">Primary</span></label> <label>Interface Name or Port / <span class="text-secondary">Primary</span></label>
@@ -63,6 +81,10 @@
</div> </div>
</div> </div>
</div>
<div class="tab-pane fade" id="pills-interface-network">
<!-- MAC Address --> <!-- MAC Address -->
<div class="form-group"> <div class="form-group">
<label>MAC Address</label> <label>MAC Address</label>
@@ -178,17 +200,23 @@
</div> </div>
</div> </div>
</div>
<div class="tab-pane fade" id="pills-interface-notes">
<!-- Notes --> <!-- Notes -->
<div class="form-group"> <div class="form-group">
<textarea class="form-control" rows="5" placeholder="Enter some notes" name="notes"></textarea> <textarea class="form-control" rows="8" placeholder="Enter some notes" name="notes"></textarea>
</div>
</div>
</div> </div>
</div> </div>
<div class="modal-footer bg-white"> <div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="add_asset_interface" class="btn btn-primary text-bold">
<button type="submit" name="add_asset_interface" class="btn btn-primary"> <i class="fas fa-check mr-2"></i>Create
<i class="fa fa-check"></i> Create
</button> </button>
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Close</button>
</div> </div>
</form> </form>
</div> </div>
+39 -7
View File
@@ -25,7 +25,7 @@ if ($link_row = mysqli_fetch_assoc($sql_link)) {
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title"> <h5 class="modal-title">
<i class="fa fa-fw fa-ethernet mr-2"></i> <i class="fa fa-fw fa-ethernet mr-2"></i>
Editing: <?php echo $interface_name; ?> Editing Interface: <strong><?php echo $interface_name; ?></strong>
</h5> </h5>
<button type="button" class="close text-white" data-dismiss="modal"> <button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span> <span>&times;</span>
@@ -38,6 +38,24 @@ if ($link_row = mysqli_fetch_assoc($sql_link)) {
<div class="modal-body bg-white" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>> <div class="modal-body bg-white" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#pills-interface-details<?php echo $interface_id; ?>">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-interface-network<?php echo $interface_id; ?>">Network</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-interface-notes<?php echo $interface_id; ?>">Notes</a>
</li>
</ul>
<hr>
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-interface-details<?php echo $interface_id; ?>">
<!-- Interface Name --> <!-- Interface Name -->
<div class="form-group"> <div class="form-group">
<label>Interface Name or Port / <span class="text-secondary">Primary</span></label> <label>Interface Name or Port / <span class="text-secondary">Primary</span></label>
@@ -98,6 +116,11 @@ if ($link_row = mysqli_fetch_assoc($sql_link)) {
</div> </div>
</div> </div>
</div> <!-- End Details -->
<!-- Network Section -->
<div class="tab-pane fade" id="pills-interface-network<?php echo $interface_id; ?>">
<!-- MAC Address --> <!-- MAC Address -->
<div class="form-group"> <div class="form-group">
<label>MAC Address</label> <label>MAC Address</label>
@@ -217,8 +240,6 @@ if ($link_row = mysqli_fetch_assoc($sql_link)) {
</div> </div>
</div> </div>
<!-- Connected to (One-to-One) --> <!-- Connected to (One-to-One) -->
<div class="form-group"> <div class="form-group">
<label>Connected to</label> <label>Connected to</label>
@@ -261,16 +282,27 @@ if ($link_row = mysqli_fetch_assoc($sql_link)) {
</div> </div>
</div> </div>
</div> <!-- End Network Section -->
<!-- Notes Section -->
<div class="tab-pane fade" id="pills-interface-notes<?php echo $interface_id; ?>">
<!-- Notes --> <!-- Notes -->
<div class="form-group"> <div class="form-group">
<textarea class="form-control" rows="5" placeholder="Enter some notes" name="notes"><?php echo $interface_notes; ?></textarea> <textarea class="form-control" rows="8" placeholder="Enter some notes" name="notes"><?php echo $interface_notes; ?></textarea>
</div>
</div>
<!-- End Notes Section -->
</div> </div>
</div> </div>
<!-- End Footer Section -->
<div class="modal-footer bg-white"> <div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="edit_asset_interface" class="btn btn-primary text-bold">
<button type="submit" name="edit_asset_interface" class="btn btn-primary"> <i class="fas fa-check mr-2"></i>Save
<i class="fa fa-check mr-2"></i>Save </button>
<button type="button" class="btn btn-light" data-dismiss="modal">
<i class="fas fa-times mr-2"></i>Close
</button> </button>
</div> </div>
</form> </form>