Add service icon to modal header in openServiceDetailModal and openCredsModal
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/3f26f03c-29fc-4d37-9d53-eebfb8a34c52 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2fc8b64964
commit
739f6a08da
@@ -147,6 +147,17 @@ button.btn-reboot:hover:not(:disabled) {
|
|||||||
font-size: 1.15rem;
|
font-size: 1.15rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.creds-title-icon {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-radius: 6px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.creds-close-btn {
|
.creds-close-btn {
|
||||||
|
|||||||
@@ -55,7 +55,20 @@ function _attachCopyHandlers(container) {
|
|||||||
|
|
||||||
async function openServiceDetailModal(unit, name, icon) {
|
async function openServiceDetailModal(unit, name, icon) {
|
||||||
if (!$credsModal) return;
|
if (!$credsModal) return;
|
||||||
if ($credsTitle) $credsTitle.textContent = name;
|
if ($credsTitle) {
|
||||||
|
$credsTitle.innerHTML = '';
|
||||||
|
if (icon) {
|
||||||
|
var iconImg = document.createElement("img");
|
||||||
|
iconImg.className = "creds-title-icon";
|
||||||
|
iconImg.src = "/static/icons/" + escHtml(icon) + ".svg";
|
||||||
|
iconImg.alt = name;
|
||||||
|
iconImg.onerror = function() { this.style.display = "none"; };
|
||||||
|
$credsTitle.appendChild(iconImg);
|
||||||
|
}
|
||||||
|
var nameSpan = document.createElement("span");
|
||||||
|
nameSpan.textContent = name;
|
||||||
|
$credsTitle.appendChild(nameSpan);
|
||||||
|
}
|
||||||
if ($credsBody) $credsBody.innerHTML = '<p class="creds-loading">Loading…</p>';
|
if ($credsBody) $credsBody.innerHTML = '<p class="creds-loading">Loading…</p>';
|
||||||
$credsModal.classList.add("open");
|
$credsModal.classList.add("open");
|
||||||
|
|
||||||
@@ -370,9 +383,22 @@ async function openServiceDetailModal(unit, name, icon) {
|
|||||||
|
|
||||||
// ── Credentials info modal ────────────────────────────────────────
|
// ── Credentials info modal ────────────────────────────────────────
|
||||||
|
|
||||||
async function openCredsModal(unit, name) {
|
async function openCredsModal(unit, name, icon) {
|
||||||
if (!$credsModal) return;
|
if (!$credsModal) return;
|
||||||
if ($credsTitle) $credsTitle.textContent = name + " — Connection Info";
|
if ($credsTitle) {
|
||||||
|
$credsTitle.innerHTML = '';
|
||||||
|
if (icon) {
|
||||||
|
var iconImg = document.createElement("img");
|
||||||
|
iconImg.className = "creds-title-icon";
|
||||||
|
iconImg.src = "/static/icons/" + escHtml(icon) + ".svg";
|
||||||
|
iconImg.alt = name;
|
||||||
|
iconImg.onerror = function() { this.style.display = "none"; };
|
||||||
|
$credsTitle.appendChild(iconImg);
|
||||||
|
}
|
||||||
|
var nameSpan = document.createElement("span");
|
||||||
|
nameSpan.textContent = name + " — Connection Info";
|
||||||
|
$credsTitle.appendChild(nameSpan);
|
||||||
|
}
|
||||||
if ($credsBody) $credsBody.innerHTML = '<p class="creds-loading">Loading…</p>';
|
if ($credsBody) $credsBody.innerHTML = '<p class="creds-loading">Loading…</p>';
|
||||||
$credsModal.classList.add("open");
|
$credsModal.classList.add("open");
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user