noice
This commit is contained in:
@@ -455,6 +455,7 @@ function populateDemoShell() {
|
|||||||
<span class="agent-tab-dot agent-tab-dot--red"></span>
|
<span class="agent-tab-dot agent-tab-dot--red"></span>
|
||||||
<span>bell</span>
|
<span>bell</span>
|
||||||
<span class="agent-tab-expires">expires 2026-07-10</span>
|
<span class="agent-tab-expires">expires 2026-07-10</span>
|
||||||
|
<a class="agent-tab-resub" href="#" onclick="event.stopPropagation();openBillingPortal()" title="Resubscribe via Stripe portal">Resubscribe →</a>
|
||||||
<span class="agent-tab-badge">EU</span>
|
<span class="agent-tab-badge">EU</span>
|
||||||
</button>
|
</button>
|
||||||
<a class="agent-tab-add" href="https://derez.ai/add.html?email=${encodeURIComponent(currentEmail || "")}" target="_blank" title="Add agent">+ Add Agent</a>`;
|
<a class="agent-tab-add" href="https://derez.ai/add.html?email=${encodeURIComponent(currentEmail || "")}" target="_blank" title="Add agent">+ Add Agent</a>`;
|
||||||
@@ -591,12 +592,16 @@ function renderAgentTabs() {
|
|||||||
const expiredText = hasExpiry
|
const expiredText = hasExpiry
|
||||||
? `<span class="agent-tab-expires">expires ${escHtml(expires)}</span>`
|
? `<span class="agent-tab-expires">expires ${escHtml(expires)}</span>`
|
||||||
: "";
|
: "";
|
||||||
|
const portalLink = hasExpiry
|
||||||
|
? `<a class="agent-tab-resub" href="#" onclick="event.stopPropagation();openBillingPortal()" title="Resubscribe via Stripe portal">Resubscribe →</a>`
|
||||||
|
: "";
|
||||||
return `
|
return `
|
||||||
<button class="agent-tab${uuid === activeUUID ? " active" : ""}"
|
<button class="agent-tab${uuid === activeUUID ? " active" : ""}"
|
||||||
onclick="selectAgent('${escAttr(uuid)}')">
|
onclick="selectAgent('${escAttr(uuid)}')">
|
||||||
<span class="${dotClass}"></span>
|
<span class="${dotClass}"></span>
|
||||||
<span>${escHtml(uuid)}</span>
|
<span>${escHtml(uuid)}</span>
|
||||||
${expiredText}
|
${expiredText}
|
||||||
|
${portalLink}
|
||||||
<span class="agent-tab-badge">${escHtml(server.toUpperCase())}</span>
|
<span class="agent-tab-badge">${escHtml(server.toUpperCase())}</span>
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
@@ -1194,12 +1199,11 @@ async function saveInvoiceEmail() {
|
|||||||
|
|
||||||
async function openBillingPortal() {
|
async function openBillingPortal() {
|
||||||
const btn = document.getElementById("portal-btn");
|
const btn = document.getElementById("portal-btn");
|
||||||
if (!btn) return;
|
|
||||||
if (!currentEmail) {
|
if (!currentEmail) {
|
||||||
toast("No email found. Please sign in again.", "warning");
|
toast("No email found. Please sign in again.", "warning");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btnLoad(btn, "");
|
if (btn) btnLoad(btn, "");
|
||||||
try {
|
try {
|
||||||
const res = await apiFetch(
|
const res = await apiFetch(
|
||||||
`${PORTAL_URL}?email=${encodeURIComponent(currentEmail)}`,
|
`${PORTAL_URL}?email=${encodeURIComponent(currentEmail)}`,
|
||||||
@@ -1221,7 +1225,7 @@ async function openBillingPortal() {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast(err.message, "error");
|
toast(err.message, "error");
|
||||||
} finally {
|
} finally {
|
||||||
btnReset(btn);
|
if (btn) btnReset(btn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
@@ -721,6 +721,23 @@ body::after {
|
|||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.agent-tab-resub {
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--accent);
|
||||||
|
text-decoration: none;
|
||||||
|
margin-left: 4px;
|
||||||
|
padding: 1px 6px;
|
||||||
|
border: 1px solid var(--accent);
|
||||||
|
border-radius: 4px;
|
||||||
|
line-height: normal;
|
||||||
|
transition: background 0.15s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agent-tab-resub:hover {
|
||||||
|
background: var(--accent-dim);
|
||||||
|
}
|
||||||
|
|
||||||
.agent-tab-badge {
|
.agent-tab-badge {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|||||||
Reference in New Issue
Block a user