This commit is contained in:
oliver
2026-06-10 19:56:21 -03:00
parent 8c0c5a9df7
commit 24c4421ba7
2 changed files with 16 additions and 6 deletions
+14 -5
View File
@@ -512,8 +512,8 @@ function populateDemoShell() {
<div class="contract-info">
<span class="contract-type">Trainee \u2013 Monthly</span>
<span class="contract-expires">expires 2026-07-10</span>
<a class="contract-extend-link" href="#" onclick="event.preventDefault();openBillingPortal()">Resubscribe &rarr;</a>
</div>
<a class="contract-extend-link" href="#" onclick="event.preventDefault();openBillingPortal()">Resubscribe &rarr;</a>
</div>`;
// Backups
@@ -1549,7 +1549,10 @@ function renderContract(data) {
const product = stripQuotes(item.product || "");
const period = stripQuotes(item.period || "");
const type = stripQuotes(item.type || "");
const expires = stripQuotes(item.expires || "");
// Look up expires from the agent data (new field in agents list API)
const agent = agents.find((a) => (a.UUID || a.uuid) === activeUUID);
const expires = agent ? stripQuotes(agent.expires || "") : "";
const hasExpiry = expires && expires !== "null" && expires !== "";
const label =
@@ -1568,12 +1571,18 @@ function renderContract(data) {
if (hasExpiry) {
html += `
<span class="contract-expires">expires ${escHtml(expires)}</span>
<a class="contract-extend-link" href="#" onclick="event.preventDefault();openBillingPortal()">Resubscribe &rarr;</a>`;
<span class="contract-expires">expires ${escHtml(expires)}</span>`;
}
html += `
</div>`;
if (hasExpiry) {
html += `
<a class="contract-extend-link" href="#" onclick="event.preventDefault();openBillingPortal()">Resubscribe &rarr;</a>`;
}
html += `
</div>
</div>`;
body.innerHTML = html;
+2 -1
View File
@@ -2182,11 +2182,12 @@ body.auth-layout #signin-btn {
.contract-extend-link {
display: inline-block;
margin-top: 5px;
margin-left: auto;
font-size: 12px;
font-weight: 600;
color: var(--danger);
text-decoration: none;
flex-shrink: 0;
}
.contract-extend-link:hover {