Racks: the pen that edits or removes a racked asset is always shown on the rack drawing instead of only on hover, in a holder slot too when wide enough, with the U position kept clear of it; an asset page has Edit or remove under Rack; the elevation hint mentions the pen; 26.12.2 changelog bug fix entry

This commit is contained in:
johnnyq
2026-11-26 00:50:40 -05:00
parent bfc91512c9
commit 26f82b0a82
5 changed files with 28 additions and 9 deletions

View File

@@ -21,6 +21,7 @@ If you manage other ITFlow installs, the manager and its instances can be update
### Bug Fixes
- Managed Instances: a manager behind a web application firewall - ModSecurity with the OWASP Core Rule Set, say - could answer an instance's check-ins with 403, as the cron command and error text in its report looked like an attack, and the instance's Managed By page said "The manager answered 403". Check-ins are now sent encoded, so nothing needs excluding. An instance sends them that way once its manager says it reads them, and a manager still reads a plain check-in, so either side can be updated first.
- Racks: on a rack's drawing, clicking an asset opens its page, and the pen for editing it there - to move it or take it out of the rack - only showed while you pointed at it, at the far right. It was easy to miss, and on a touch screen it never showed. The pen is now always on each asset, in a holder's slot too when the slot is wide enough, and an asset's own page has Edit or remove under Rack, in Where & who.
### Developer Updates

View File

@@ -734,7 +734,13 @@ if (mysqli_num_rows($sql) == 0) {
</dd>
<?php if ($asset_rack) { ?>
<dt>Rack</dt>
<dd><a href="rack.php?client_id=<?= $client_id ?>&rack_id=<?= $asset_rack_id ?>"><?= $asset_rack_name ?></a><div class="small text-body-secondary"><?= $asset_rack_position ?></div></dd>
<dd>
<a href="rack.php?client_id=<?= $client_id ?>&rack_id=<?= $asset_rack_id ?>"><?= $asset_rack_name ?></a><div class="small text-body-secondary"><?= $asset_rack_position ?></div>
<?php if ($can_edit) { ?>
<!-- Clicking it on the rack comes here, so moving it or taking it out of the rack is here too -->
<a href="#" class="small ajax-modal" data-modal-url="modals/rack/rack_device_edit.php?id=<?= intval($asset_rack['unit_id']) ?>"><i class="fas fa-fw fa-pen me-1"></i>Edit or remove</a>
<?php } ?>
</dd>
<?php } ?>
<?php if ($asset_has_contact || $asset_contact_id) { ?>
<dt>Assigned</dt>

View File

@@ -86,6 +86,10 @@ $elevation_rail = $elevation_descending ? range(1, $elevation_rack_units) : rang
if ($block['asset_archived']) {
$block_classes .= ' is-archived';
}
// An asset opens its page, so its pen is the way to edit or remove it - always shown, with room kept for it
if ($elevation_can_edit && $block['asset_id'] && !$block['ghost'] && !$block['slots']) {
$block_classes .= ' has-edit';
}
$block_title = $block['name'] . ' - ' . html_entity_decode($block['position']) . ($block['meta'] ? " - {$block['meta']}" : '');
$block_drags = $elevation_can_edit && !$block['ghost'];
if ($block_drags) {
@@ -140,7 +144,7 @@ $elevation_rail = $elevation_descending ? range(1, $elevation_rack_units) : rang
$child_close = '</div>';
}
?>
<div class="itflow-rack-cell itflow-rack-tone-<?= $child['tone'] ?><?= $child['asset_archived'] ? ' is-archived' : '' ?>" style="<?= $cell_place ?>"
<div class="itflow-rack-cell itflow-rack-tone-<?= $child['tone'] ?><?= $child['asset_archived'] ? ' is-archived' : '' ?><?= $elevation_can_edit && $child['asset_id'] ? ' has-edit' : '' ?>" style="<?= $cell_place ?>"
<?php if ($elevation_can_edit) { ?>draggable="true" data-rack-drag="unit" data-rack-child="1" data-rack-id="<?= $child['id'] ?>" data-rack-holder="<?= $block['id'] ?>" data-rack-slot="<?= $cell['slot'] ?>" data-rack-height="<?= $block['height'] ?>" data-rack-full="<?= $block['full_depth'] ? 1 : 0 ?>" data-rack-from="<?= $block['face'] ?>" data-rack-start="<?= $block['start'] ?>"<?php } ?>>
<?= $child_open ?>
<span class="itflow-rack-cell-name"><?= $child['name'] ?></span>

View File

@@ -179,7 +179,7 @@ if (mysqli_num_rows($sql) == 0) {
<h3 class="card-title mb-0 me-auto"><i class="fas fa-fw fa-columns me-2 text-secondary"></i>Elevation</h3>
<span class="small text-body-secondary d-print-none">
<?php if ($can_edit && !$rack_archived_at) { ?>
Click an empty U to add something there, or drag an item to move it
Click an empty U to add something there, drag an item to move it, or use an asset's pen to edit or remove it
<?php } ?>
</span>
</div>

View File

@@ -3983,15 +3983,16 @@ button.itflow-rack-item-body:hover {
background-color: rgba(0, 0, 0, .35);
font-size: .6rem;
color: #fff;
opacity: 0;
opacity: .75;
transition: opacity .12s ease-in-out;
}
.itflow-rack-item:hover .itflow-rack-item-edit,
.itflow-rack-item:focus-within .itflow-rack-item-edit {
opacity: 1;
}
.itflow-rack-item:has(.itflow-rack-item-edit):hover .itflow-rack-item-pos {
visibility: hidden;
/* An asset's pen is always there - clicking the asset opens its page - so its position sits clear of it */
.itflow-rack-item.has-edit .itflow-rack-item-body {
padding-right: 2rem;
}
.itflow-rack-item-edit:hover {
background-color: rgba(0, 0, 0, .55);
@@ -4142,16 +4143,23 @@ button.itflow-rack-cell-body:hover {
background-color: rgba(0, 0, 0, .4);
font-size: .55rem;
color: #fff;
opacity: .75;
}
.itflow-rack-cell:hover .itflow-rack-cell-edit,
.itflow-rack-cell:focus-within .itflow-rack-cell-edit {
opacity: 1;
}
.itflow-rack-cell-edit:hover {
background-color: rgba(0, 0, 0, .6);
}
/* The pen only where the slot is wide enough for it and the name */
/* The pen, always there, where the slot is wide enough for it and the name - the name kept clear of it */
@container (min-width: 4.5rem) {
.itflow-rack-cell:hover .itflow-rack-cell-edit,
.itflow-rack-cell:focus-within .itflow-rack-cell-edit {
.itflow-rack-cell-edit {
display: flex;
}
.itflow-rack-cell.has-edit .itflow-rack-cell-body {
padding-right: 1.45rem;
}
}
.itflow-rack-cell.is-archived {
opacity: .55;