Hide API key by default

This commit is contained in:
Connor Yoh 2025-06-10 13:38:44 +01:00
parent 3abf52dff7
commit 62e0b28d0c

View File

@ -79,7 +79,7 @@
</div> </div>
<div class="data-body"> <div class="data-body">
<div style="display: flex; gap: 0.5rem;"> <div style="display: flex; gap: 0.5rem;">
<input type="password" class="data-form-control" id="apiKey" th:placeholder="#{account.yourApiKey}" readonly style="flex: 1;"> <input class="data-form-control" id="apiKey" th:placeholder="#{account.yourApiKey}" readonly style="flex: 1;">
<button class="data-btn data-btn-secondary" id="copyBtn" type="button" onclick="copyToClipboard()" title="Copy to clipboard"> <button class="data-btn data-btn-secondary" id="copyBtn" type="button" onclick="copyToClipboard()" title="Copy to clipboard">
<span class="material-symbols-rounded">content_copy</span> <span class="material-symbols-rounded">content_copy</span>
</button> </button>
@ -321,7 +321,6 @@
} }
document.addEventListener("DOMContentLoaded", async function() { document.addEventListener("DOMContentLoaded", async function() {
showApiKey();
try { try {
/*<![CDATA[*/ /*<![CDATA[*/
const urlGetApiKey = /*[[@{/api/v1/user/get-api-key}]]*/ "/api/v1/user/get-api-key"; const urlGetApiKey = /*[[@{/api/v1/user/get-api-key}]]*/ "/api/v1/user/get-api-key";
@ -336,6 +335,9 @@
} catch (error) { } catch (error) {
console.error('There was an error:', error); console.error('There was an error:', error);
} }
finally {
showApiKey();
}
}); });
async function refreshApiKey() { async function refreshApiKey() {