From bd63c72fd4a9575de9bb2b9230a404136e439654 Mon Sep 17 00:00:00 2001 From: stellarshenson Date: Tue, 6 Jan 2026 21:30:07 +0100 Subject: [PATCH] feat: add per-row copy icon in credentials modal --- .../jupyterhub/templates_enhanced/admin.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/services/jupyterhub/templates_enhanced/admin.html b/services/jupyterhub/templates_enhanced/admin.html index bbde9d7..a7a8297 100644 --- a/services/jupyterhub/templates_enhanced/admin.html +++ b/services/jupyterhub/templates_enhanced/admin.html @@ -37,6 +37,7 @@ Username Password + @@ -223,7 +224,22 @@ row.innerHTML = ` ${escapeHtml(cred.username)} ${escapeHtml(cred.password)} + `; + // Add click handler for row copy + row.querySelector('.copy-row-btn').addEventListener('click', function() { + const text = 'Username: ' + cred.username + '\nPassword: ' + cred.password; + navigator.clipboard.writeText(text).then(() => { + this.classList.remove('fa-copy'); + this.classList.add('fa-check'); + this.style.opacity = '1'; + setTimeout(() => { + this.classList.remove('fa-check'); + this.classList.add('fa-copy'); + this.style.opacity = '0.4'; + }, 1500); + }); + }); tbody.appendChild(row); });