click logo to open instance, #2

This commit is contained in:
simon 2022-05-30 18:32:12 +07:00
parent 91e7345512
commit 62e7469e3d
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 10 additions and 1 deletions

View File

@ -11,7 +11,9 @@
<body>
<div class="container">
<div class="logo">
<img src="/images/logo.png" alt="ta-logo">
<a href="#" id="ta-url" target="_blank">
<img src="/images/logo.png" alt="ta-logo">
</a>
<span>v0.0.1</span>
</div>
<hr>

View File

@ -62,6 +62,12 @@ function pingBackend() {
}
// add url to image
function addUrl(access) {
const url = `${access.url}:${access.port}`;
document.getElementById("ta-url").setAttribute("href", url);
}
// change status icon based on connection status
function setStatusIcon(connected) {
@ -153,6 +159,7 @@ document.addEventListener("DOMContentLoaded", async () => {
document.getElementById("port").value = item.access.port;
document.getElementById("api-key").value = item.access.apiKey;
pingBackend();
addUrl(item.access);
};
function onError(error) {