Skip to content

Commit

Permalink
added head to alt manager
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Dec 17, 2023
1 parent 7542b20 commit 842ff1f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src-theme/altmanager/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,27 @@
console.log("Account " + i + ": " + accountType + " " + accountUsername);

let row = document.createElement('tr');
let avatar = document.createElement('td');
let type = document.createElement('td');
let name = document.createElement('td');
let button = document.createElement('td');

// If account has UUID, set avatar by UUID
// https://avatar.liquidbounce.net/avatar/<uuid>/32
// Otherwise, set default https://avatar.liquidbounce.net/avatar/MHF_Steve

if (accountProfile.getUuid() !== null) {
avatar.innerHTML = "<img src='https://avatar.liquidbounce.net/avatar/" + accountProfile.getUuid() + "/20' width='20' height='20' alt='head' class='head'/>";
} else {
// fix: when username, it does not take size argument on API
avatar.innerHTML = "<img src='https://avatar.liquidbounce.net/avatar/" + accountUsername + "' width='20' height='20' alt='head' class='head'/>";
}

type.innerText = accountType;
name.innerText = accountUsername;
button.innerHTML = "<button onclick='loginAccount(\"" + i + "\")'>Login</button><button onclick='deleteAccount(\"" + i + "\")'>Delete</button><button onclick='copyAccount(\"" + i + "\")'>Copy</button><button onclick='favoriteAccount(\"" + i + "\")'>Favorite</button>";

row.appendChild(avatar);
row.appendChild(type);
row.appendChild(name);
row.appendChild(button);
Expand Down

0 comments on commit 842ff1f

Please sign in to comment.