This commit is contained in:
BPower0036 2022-05-16 12:55:33 +00:00 committed by GitHub
parent 925f311d20
commit 4ea6ac064d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -917,6 +917,7 @@ Logic.registerPanel(P_CONTAINER_INFO, {
});
// Populating the panel: name and icon
document.getElementById("container-info-title").textContent = identity.name;
document.getElementById("edit-sites-assigned").setAttribute("data-identity-color", identity.color);
const alwaysOpen = document.querySelector("#always-open-in-info-panel");
Utils.addEnterHandler(alwaysOpen, async () => {
@ -1426,7 +1427,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
});
// Wildcard click-to-toggle subdomains
trElement.querySelectorAll(".subdomain").forEach((subdomainLink) => {
subdomainLink.addEventListener("click", async (e) => {
subdomainLink.addEventListener("click", (e) => {
const wildcardHostname = e.target.getAttribute("data-wildcardHostname");
Utils.setWildcardHostnameForAssignment(assumedUrl, wildcardHostname);
if (wildcardHostname) {
@ -1453,14 +1454,14 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
if (wildcardHostname && wildcardHostname !== hostname) {
if (hostname.endsWith(wildcardHostname)) {
return {
wildcard: hostname.substring(0, hostname.length - wildcardHostname.length),
wildcard: "★",
remaining: wildcardHostname
};
} else {
// In case something got corrupted, allow user to fix error
// by clicking "____" link to clear corrupted wildcard hostname
// by clicking '★' link to clear corrupted wildcard hostname
return {
wildcard: "___",
wildcard: "",
remaining: hostname
};
}
@ -1479,6 +1480,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
// Add wildcard subdomain(s)
if (subdomains.wildcard) {
result.appendChild(this.assignmentSubdomainLink(null, subdomains.wildcard));
result.appendChild(document.createTextNode("."));
}
// Add non-wildcard subdomains
@ -1502,6 +1504,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
result.className = "subdomain";
if (wildcardHostnameOnClick) {
result.setAttribute("data-wildcardHostname", wildcardHostnameOnClick);
result.title = `*.${wildcardHostnameOnClick}`;
} else {
result.classList.add("wildcardSubdomain");
}