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> <body>
<div class="container"> <div class="container">
<div class="logo"> <div class="logo">
<a href="#" id="ta-url" target="_blank">
<img src="/images/logo.png" alt="ta-logo"> <img src="/images/logo.png" alt="ta-logo">
</a>
<span>v0.0.1</span> <span>v0.0.1</span>
</div> </div>
<hr> <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 // change status icon based on connection status
function setStatusIcon(connected) { function setStatusIcon(connected) {
@ -153,6 +159,7 @@ document.addEventListener("DOMContentLoaded", async () => {
document.getElementById("port").value = item.access.port; document.getElementById("port").value = item.access.port;
document.getElementById("api-key").value = item.access.apiKey; document.getElementById("api-key").value = item.access.apiKey;
pingBackend(); pingBackend();
addUrl(item.access);
}; };
function onError(error) { function onError(error) {