533 lines
31 KiB
PHP
533 lines
31 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
style('chd_admin', 'admin');
|
|
script('chd_admin', 'admin');
|
|
?>
|
|
|
|
<div
|
|
id="chd-admin-root"
|
|
data-overview-url="<?php p((string)($_['overviewUrl'] ?? '')); ?>"
|
|
data-connector-routing-config-url="<?php p((string)($_['connectorRoutingConfigUrl'] ?? '')); ?>"
|
|
data-save-connector-routing-config-url="<?php p((string)($_['saveConnectorRoutingConfigUrl'] ?? '')); ?>"
|
|
data-save-connector-admin-token-url="<?php p((string)($_['saveConnectorAdminTokenUrl'] ?? '')); ?>"
|
|
data-save-billing-auto-fulfillment-url="<?php p((string)($_['saveBillingAutoFulfillmentUrl'] ?? '')); ?>"
|
|
data-run-billing-auto-fulfillment-url="<?php p((string)($_['runBillingAutoFulfillmentUrl'] ?? '')); ?>"
|
|
data-backfill-billing-auto-fulfillment-url="<?php p((string)($_['backfillBillingAutoFulfillmentUrl'] ?? '')); ?>"
|
|
data-connector-summary-url="<?php p((string)($_['connectorSummaryUrl'] ?? '')); ?>"
|
|
data-connector-instances-url="<?php p((string)($_['connectorInstancesUrl'] ?? '')); ?>"
|
|
data-connector-instance-detail-url="<?php p((string)($_['connectorInstanceDetailUrl'] ?? '')); ?>"
|
|
data-paymenter-clients-url="<?php p((string)($_['paymenterClientsUrl'] ?? '')); ?>"
|
|
data-paymenter-orders-url="<?php p((string)($_['paymenterOrdersUrl'] ?? '')); ?>"
|
|
data-paymenter-snapshot-url="<?php p((string)($_['paymenterSnapshotUrl'] ?? '')); ?>"
|
|
data-paymenter-source-sync-url="<?php p((string)($_['paymenterSourceSyncUrl'] ?? '')); ?>"
|
|
data-paymenter-backups-url="<?php p((string)($_['paymenterBackupsUrl'] ?? '')); ?>"
|
|
data-paymenter-invoices-url="<?php p((string)($_['paymenterInvoicesUrl'] ?? '')); ?>"
|
|
data-paymenter-invoice-items-url="<?php p((string)($_['paymenterInvoiceItemsUrl'] ?? '')); ?>"
|
|
data-save-connector-instance-target-url="<?php p((string)($_['saveConnectorInstanceTargetUrl'] ?? '')); ?>"
|
|
data-save-connector-instance-metadata-url="<?php p((string)($_['saveConnectorInstanceMetadataUrl'] ?? '')); ?>"
|
|
data-save-connector-instance-state-url="<?php p((string)($_['saveConnectorInstanceStateUrl'] ?? '')); ?>"
|
|
data-instance-operations-url="<?php p((string)($_['instanceOperationsUrl'] ?? '')); ?>"
|
|
data-save-instance-operation-url="<?php p((string)($_['saveInstanceOperationUrl'] ?? '')); ?>"
|
|
data-update-instance-operation-status-url="<?php p((string)($_['updateInstanceOperationStatusUrl'] ?? '')); ?>"
|
|
data-intro-grant-task-action-url="<?php p((string)($_['introGrantTaskActionUrl'] ?? '')); ?>"
|
|
data-connector-catalog-config-url="<?php p((string)($_['connectorCatalogConfigUrl'] ?? '')); ?>"
|
|
data-save-connector-catalog-config-url="<?php p((string)($_['saveConnectorCatalogConfigUrl'] ?? '')); ?>"
|
|
data-announcements-url="<?php p((string)($_['announcementsUrl'] ?? '')); ?>"
|
|
data-announcement-target-url="<?php p((string)($_['announcementTargetUrl'] ?? '')); ?>"
|
|
data-save-announcements-url="<?php p((string)($_['saveAnnouncementsUrl'] ?? '')); ?>"
|
|
data-publish-announcement-url="<?php p((string)($_['publishAnnouncementUrl'] ?? '')); ?>"
|
|
data-qortal-admin-url="<?php p((string)($_['qortalAdminUrl'] ?? '/settings/admin/qortal_integration')); ?>"
|
|
data-account-dashboard-url="<?php p((string)($_['accountDashboardUrl'] ?? '/apps/qortal_integration/account')); ?>"
|
|
data-qapps-url="<?php p((string)($_['qappsUrl'] ?? '/apps/qortal_integration/qapps')); ?>"
|
|
data-qapps-request-url="<?php p((string)($_['qappsRequestUrl'] ?? '')); ?>"
|
|
data-qapps-approve-url="<?php p((string)($_['qappsApproveUrl'] ?? '')); ?>"
|
|
data-qapps-unlock-url="<?php p((string)($_['qappsUnlockUrl'] ?? '')); ?>"
|
|
data-qapps-unlock-status-url="<?php p((string)($_['qappsUnlockStatusUrl'] ?? '')); ?>"
|
|
data-gateway-proxy-template="<?php p((string)($_['gatewayProxyTemplate'] ?? '/apps/qortal_integration/gateway/__PATH__')); ?>"
|
|
data-chdc-qapp-address="<?php p((string)($_['chdcQappAddress'] ?? 'qortal://CHDC')); ?>"
|
|
>
|
|
<h2><?php p((string)($_['title'] ?? 'CHD Admin')); ?></h2>
|
|
<p class="chd-note">
|
|
Design + control surface for CHD-side operations that benefit from in-cloud visibility and automation.
|
|
</p>
|
|
|
|
<div id="chd-admin-connector-admin-token-card" class="chd-card chd-card--wide chd-hidden">
|
|
<h3>Connector Admin Access</h3>
|
|
<p class="chd-note">
|
|
The shared connector admin token is not configured yet. Add it here so this CHD admin instance can use the connector admin API.
|
|
</p>
|
|
<div class="chd-ops-form-grid">
|
|
<label for="chd-admin-connector-admin-token">Admin Token</label>
|
|
<input id="chd-admin-connector-admin-token" type="password" autocomplete="off" spellcheck="false" placeholder="Enter shared connector admin token" />
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-connector-admin-token-save" class="button button-primary" type="button">Save Admin Token</button>
|
|
</div>
|
|
<div id="chd-admin-connector-admin-token-status" class="chd-note chd-note--status">Loading connector access status...</div>
|
|
</div>
|
|
|
|
<div class="chd-actions">
|
|
<a class="button" href="<?php p((string)($_['qortalAdminUrl'] ?? '/settings/admin/qortal_integration')); ?>">Open Qortal Integration Admin</a>
|
|
<a class="button" href="<?php p((string)($_['accountDashboardUrl'] ?? '/apps/qortal_integration/account')); ?>">Open NuQloud Dashboard</a>
|
|
<button id="chd-admin-refresh" class="button button-primary" type="button">Refresh Overview</button>
|
|
</div>
|
|
|
|
<div class="chd-section-nav">
|
|
<a class="button" href="#chd-admin-section-instances">Instances + Reconciliation</a>
|
|
<a class="button" href="#chd-admin-section-paymenter">Paymenter Data</a>
|
|
<a class="button" href="#chd-admin-section-catalog">Catalog Config</a>
|
|
<a class="button" href="#chd-admin-section-announcements">Announcements</a>
|
|
<a class="button" href="#chd-admin-section-advanced">Advanced</a>
|
|
</div>
|
|
<p class="chd-note">
|
|
Jump between instance reconciliation, Paymenter reads, catalog config, announcements, and advanced diagnostics. Raw payloads stay in the advanced area.
|
|
</p>
|
|
|
|
<div class="chd-grid">
|
|
<section id="chd-admin-section-instances" class="chd-card chd-card--wide">
|
|
<div class="chd-card-head">
|
|
<h3>Instances, Operations, and Reconciliation</h3>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-instances-refresh" class="button" type="button">Refresh Instances</button>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">
|
|
Connector-side instance state, selected-instance reconciliation, and the tasks that still need CHD action live here.
|
|
</p>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h4>Instance Operations Queue</h4>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-operations-refresh" class="button" type="button">Refresh Queue</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-operations-summary" class="chd-snapshot-summary">Select an instance to load operations.</div>
|
|
<div id="chd-admin-operations-list" class="chd-ops-list">Select an instance to load operations.</div>
|
|
<form id="chd-admin-operations-form" class="chd-ops-form">
|
|
<h5>Add Manual Task</h5>
|
|
<div class="chd-ops-form-grid">
|
|
<label for="chd-admin-ops-user">User</label>
|
|
<select id="chd-admin-ops-user"></select>
|
|
<label for="chd-admin-ops-type">Task Type</label>
|
|
<select id="chd-admin-ops-type">
|
|
<option value="publish_credits">Publish Credits</option>
|
|
<option value="storage_upgrade">Storage Upgrade</option>
|
|
<option value="replication_setup">Replication Setup</option>
|
|
<option value="manual">Manual Task</option>
|
|
</select>
|
|
<label for="chd-admin-ops-title">Title</label>
|
|
<input id="chd-admin-ops-title" type="text" placeholder="Example: Fulfill 1,000 publish credits" />
|
|
<label for="chd-admin-ops-code">Order/Product Code</label>
|
|
<input id="chd-admin-ops-code" type="text" placeholder="credits_1000" />
|
|
<label for="chd-admin-ops-notes">Notes</label>
|
|
<textarea id="chd-admin-ops-notes" rows="2" placeholder="Optional fulfillment notes"></textarea>
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-ops-add" class="button button-primary" type="submit">Add Task</button>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="chd-actions">
|
|
<label for="chd-admin-instance-select">Selected Instance:</label>
|
|
<select id="chd-admin-instance-select"></select>
|
|
<button id="chd-admin-instance-load" class="button" type="button">Load Details</button>
|
|
</div>
|
|
<div id="chd-admin-instances-summary" class="chd-snapshot-summary">Loading...</div>
|
|
<div id="chd-admin-instances-compact" class="chd-instance-list">Loading...</div>
|
|
<details class="chd-removed-panel">
|
|
<summary>Removed Instances</summary>
|
|
<p class="chd-note">
|
|
Removed instances are hidden from the active config but kept here so they can be restored. Each remove or restore action writes a backup snapshot automatically.
|
|
</p>
|
|
<div id="chd-admin-removed-instances-summary" class="chd-snapshot-summary">No removed instances.</div>
|
|
<div id="chd-admin-removed-instances-list" class="chd-instance-list">No removed instances.</div>
|
|
</details>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h4>Instances Raw Payload</h4>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-instances-toggle" class="button" type="button">Show Raw</button>
|
|
<button id="chd-admin-instances-all" class="button" type="button">Show All Info</button>
|
|
</div>
|
|
</div>
|
|
<pre id="chd-admin-instances-list" class="chd-hidden">Loading...</pre>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h4>Selected Instance Detail</h4>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-instance-detail-toggle" class="button" type="button">Show Raw</button>
|
|
<button id="chd-admin-instance-detail-all" class="button" type="button">Show All Info</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-instance-detail-summary" class="chd-snapshot-summary">Select an instance to view details.</div>
|
|
<div id="chd-admin-instance-detail-status" class="chd-status-row"></div>
|
|
<div class="chd-ops-form">
|
|
<h5>NuQloud MSP Contact + Future Plugin Admin Fields</h5>
|
|
<p class="chd-note">
|
|
Use the NuQloud MSP contact fields for current hosted-service billing/support matching. The future plugin admin fields are kept separate so plugin-mode installs can have their own explicit admin identity later.
|
|
</p>
|
|
<div class="chd-ops-form-grid">
|
|
<label for="chd-admin-instance-msp-contact-name">NuQloud MSP Contact Name</label>
|
|
<input id="chd-admin-instance-msp-contact-name" type="text" placeholder="Billing or service contact name" />
|
|
<label for="chd-admin-instance-msp-contact-email">NuQloud MSP Contact Email</label>
|
|
<input id="chd-admin-instance-msp-contact-email" type="email" placeholder="billing@example.com" />
|
|
<label for="chd-admin-instance-plugin-admin-email">Future Plugin Admin Email</label>
|
|
<input id="chd-admin-instance-plugin-admin-email" type="email" placeholder="Plugin-mode admin email" />
|
|
<label for="chd-admin-instance-admin-qortal-address">Future Plugin Admin Qortal Address</label>
|
|
<input id="chd-admin-instance-admin-qortal-address" type="text" placeholder="Qortal address for plugin mode" />
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-instance-metadata-save" class="button" type="button">Save Contact Fields</button>
|
|
</div>
|
|
<div id="chd-admin-instance-metadata-status" class="chd-note chd-note--status">Load an instance to manage NuQloud MSP contact fields.</div>
|
|
</div>
|
|
<div class="chd-ops-form">
|
|
<h5>Connector Target</h5>
|
|
<div class="chd-ops-form-grid">
|
|
<label for="chd-admin-instance-connector-profile">Target Profile</label>
|
|
<select id="chd-admin-instance-connector-profile">
|
|
<option value="">No profile target</option>
|
|
</select>
|
|
<label for="chd-admin-instance-connector-url">Target Connector URL Override</label>
|
|
<input id="chd-admin-instance-connector-url" type="text" placeholder="https://connector.crowetic.com" />
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-instance-connector-save" class="button" type="button">Apply Connector Target</button>
|
|
<button id="chd-admin-instance-remove" class="button" type="button">Remove Instance</button>
|
|
</div>
|
|
<div id="chd-admin-instance-connector-status" class="chd-note chd-note--status">Load an instance to manage connector target.</div>
|
|
</div>
|
|
<pre id="chd-admin-instance-detail" class="chd-hidden">Select an instance to view details.</pre>
|
|
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h4>Selected Instance Identity Reconciliation</h4>
|
|
</div>
|
|
<p class="chd-note">
|
|
This block combines the selected instance's known users with the commerce records the connector already knows about, so you can see what is linked, what is missing, and what still needs cleanup.
|
|
</p>
|
|
<div id="chd-admin-user-orders-summary" class="chd-snapshot-summary">Select an instance to load reconciliation data.</div>
|
|
<div id="chd-admin-user-orders-list" class="chd-ops-list">Select an instance to load reconciliation data.</div>
|
|
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h4>Instance Identity Index</h4>
|
|
</div>
|
|
<p class="chd-note">
|
|
Cross-instance view built from the instance details fetched during refresh. It highlights identities that appear on one instance versus multiple instances.
|
|
</p>
|
|
<div id="chd-admin-identity-summary" class="chd-snapshot-summary">Refresh instances to build the identity index.</div>
|
|
<div id="chd-admin-identity-list" class="chd-ops-list">Refresh instances to build the identity index.</div>
|
|
|
|
</section>
|
|
|
|
<section id="chd-admin-section-paymenter" class="chd-card chd-card--wide">
|
|
<div class="chd-card-head">
|
|
<h3>Paymenter Data and Sync</h3>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<label for="chd-admin-paymenter-profile">Backend</label>
|
|
<select id="chd-admin-paymenter-profile"></select>
|
|
<button id="chd-admin-paymenter-clients-refresh" class="button" type="button">Refresh Customers</button>
|
|
<button id="chd-admin-paymenter-snapshot-refresh" class="button" type="button">Refresh Instance Snapshot</button>
|
|
<button id="chd-admin-paymenter-sync-dry-run" class="button" type="button">Dry Run Connector Sync</button>
|
|
<button id="chd-admin-paymenter-sync-run" class="button button-primary" type="button">Run Connector Sync</button>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">
|
|
These are Paymenter reads. Sync actions reconcile the connector against that data, while catalog pricing stays in the catalog config section below. The selected instance snapshot now emphasizes the active service, invoice health, and any suspended or canceled service signals.
|
|
</p>
|
|
<div id="chd-admin-paymenter-status" class="chd-note chd-note--status">Refresh Paymenter customers to load the customer list, selected-instance snapshot, and backup history.</div>
|
|
<div class="chd-ops-form">
|
|
<h5>Automatic Invite Fulfillment</h5>
|
|
<p class="chd-note">
|
|
When enabled, a timed job checks paid orders, creates invite tokens through the broker, and sends the onboarding email from Nextcloud. This keeps fulfillment server-side and removes the manual invite step.
|
|
</p>
|
|
<div class="chd-ops-form-grid">
|
|
<label for="chd-admin-billing-auto-fulfillment-enabled">Enabled</label>
|
|
<input id="chd-admin-billing-auto-fulfillment-enabled" type="checkbox" />
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-billing-auto-fulfillment-save" class="button button-primary" type="button">Save Automation Setting</button>
|
|
<button id="chd-admin-billing-auto-fulfillment-run" class="button" type="button">Run Now</button>
|
|
</div>
|
|
<div class="chd-ops-form-grid">
|
|
<label for="chd-admin-billing-auto-fulfillment-backfill-since">Backfill Since</label>
|
|
<input id="chd-admin-billing-auto-fulfillment-backfill-since" type="datetime-local" />
|
|
<label for="chd-admin-billing-auto-fulfillment-backfill-invoice">Invoice Replay</label>
|
|
<input id="chd-admin-billing-auto-fulfillment-backfill-invoice" type="text" placeholder="Invoice ID" />
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-billing-auto-fulfillment-backfill" class="button" type="button">Run Backfill</button>
|
|
</div>
|
|
<div id="chd-admin-billing-auto-fulfillment-status" class="chd-status-row"></div>
|
|
<div id="chd-admin-billing-auto-fulfillment-summary" class="chd-snapshot-summary">Loading automation status...</div>
|
|
</div>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Paymenter Customers (Read Only)</h5>
|
|
</div>
|
|
<div id="chd-admin-paymenter-clients-summary" class="chd-snapshot-summary">Loading Paymenter customer data...</div>
|
|
<div id="chd-admin-paymenter-clients-list" class="chd-ops-list">Loading Paymenter customer data...</div>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Paymenter Orders (Optional)</h5>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-paymenter-orders-refresh" class="button" type="button">Refresh Orders</button>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">
|
|
This view is only useful if the backend exposes order history. If it is unavailable, invoices and service records are usually the better source of truth for ongoing billing.
|
|
</p>
|
|
<div id="chd-admin-paymenter-orders-summary" class="chd-snapshot-summary">Orders are optional. Click Refresh Orders if your backend exposes order history.</div>
|
|
<div id="chd-admin-paymenter-orders-list" class="chd-ops-list">Orders are optional. Click Refresh Orders if your backend exposes order history.</div>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Paymenter Invoices (Read Only)</h5>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-paymenter-invoices-refresh" class="button" type="button">Refresh Invoices</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-paymenter-invoices-summary" class="chd-snapshot-summary">Loading Paymenter invoices...</div>
|
|
<div id="chd-admin-paymenter-invoices-list" class="chd-ops-list">Loading Paymenter invoices...</div>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Paymenter Invoice Items (Read Only)</h5>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-paymenter-invoice-items-refresh" class="button" type="button">Refresh Invoice Items</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-paymenter-invoice-items-summary" class="chd-snapshot-summary">Loading Paymenter invoice items...</div>
|
|
<div id="chd-admin-paymenter-invoice-items-list" class="chd-ops-list">Loading Paymenter invoice items...</div>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Selected Instance Billing + Service Health</h5>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-paymenter-snapshot-toggle" class="button" type="button">Show Raw</button>
|
|
<button id="chd-admin-paymenter-snapshot-all" class="button" type="button">Show All Info</button>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">
|
|
Use this panel to confirm which package is active for the selected instance, whether any service has been suspended or canceled, and whether any invoices are still outstanding.
|
|
</p>
|
|
<div id="chd-admin-paymenter-snapshot-summary" class="chd-snapshot-summary">Select an instance to load Paymenter snapshot data.</div>
|
|
<div id="chd-admin-paymenter-snapshot-status" class="chd-status-row"></div>
|
|
<pre id="chd-admin-paymenter-snapshot" class="chd-hidden">Select an instance to load Paymenter snapshot data.</pre>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Connector Backups</h5>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-paymenter-backups-refresh" class="button" type="button">Refresh Backups</button>
|
|
<button id="chd-admin-paymenter-backups-toggle" class="button" type="button">Show Raw</button>
|
|
<button id="chd-admin-paymenter-backups-all" class="button" type="button">Show All Info</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-paymenter-backups-summary" class="chd-snapshot-summary">Loading connector backup history...</div>
|
|
<div id="chd-admin-paymenter-backups-list" class="chd-ops-list">Loading connector backup history...</div>
|
|
<pre id="chd-admin-paymenter-backups" class="chd-hidden">Loading connector backup history...</pre>
|
|
</section>
|
|
|
|
<section id="chd-admin-section-catalog" class="chd-card chd-card--wide">
|
|
<div class="chd-card-head">
|
|
<h3>Connector Catalog Config</h3>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-catalog-config-refresh" class="button" type="button">Refresh Config</button>
|
|
<button id="chd-admin-catalog-config-save" class="button button-primary" type="button">Save Config</button>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">
|
|
Configure what products map to your connector tiers, which items each audience sees, and optional cross-sell offers.
|
|
This form writes JSON for you, so admins do not need to edit raw config manually.
|
|
</p>
|
|
<div class="chd-config-grid">
|
|
<section class="chd-config-block">
|
|
<div class="chd-card-head">
|
|
<h4>0) Connector Runtime</h4>
|
|
</div>
|
|
<p class="chd-note">Set which connector CHD Admin talks to, and which Paymenter backend profile that connector should use. Connector URLs are managed here; Paymenter credentials stay on the connector host.</p>
|
|
<div class="chd-field-grid">
|
|
<label for="chd-connector-routing-profile-select">Active Admin Connector Mode</label>
|
|
<select id="chd-connector-routing-profile-select">
|
|
<option value="">Use current connector URL</option>
|
|
<option value="test">test</option>
|
|
<option value="production">production</option>
|
|
</select>
|
|
<label for="chd-connector-routing-test-url">Test Connector URL</label>
|
|
<input id="chd-connector-routing-test-url" type="text" placeholder="https://testconnector.crowetic.com" />
|
|
<label for="chd-connector-routing-production-url">Production Connector URL</label>
|
|
<input id="chd-connector-routing-production-url" type="text" placeholder="https://connector.crowetic.com" />
|
|
</div>
|
|
<div class="chd-actions">
|
|
<button id="chd-connector-routing-save" class="button" type="button">Save Connector Mode</button>
|
|
</div>
|
|
<div id="chd-connector-routing-status" class="chd-note chd-note--status">Refresh config to load connector routing.</div>
|
|
<div class="chd-field-grid">
|
|
<label for="chd-paymenter-profile-select">Active Paymenter Backend</label>
|
|
<select id="chd-paymenter-profile-select"></select>
|
|
<label for="chd-catalog-scope-profile-select">Catalog Config Scope</label>
|
|
<select id="chd-catalog-scope-profile-select"></select>
|
|
</div>
|
|
<div id="chd-paymenter-profile-status" class="chd-note chd-note--status">Refresh config to load connector runtime profiles.</div>
|
|
<div class="chd-card-head chd-card-head--compact">
|
|
<h5>Runtime Diagnostics</h5>
|
|
</div>
|
|
<div id="chd-connector-runtime-diagnostics" class="chd-snapshot-summary">Refresh config to load diagnostics.</div>
|
|
</section>
|
|
|
|
<section class="chd-config-block">
|
|
<div class="chd-card-head">
|
|
<h4>1) Audience Setup</h4>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-audience-add-row" class="button" type="button">Create Audience</button>
|
|
<button id="chd-audience-remove-current" class="button" type="button">Remove Selected</button>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">
|
|
Create or select an audience first, then use the audience editor below to choose which packages, monthly add-ons, one-time products, and extra offers that audience will see.
|
|
</p>
|
|
<div class="chd-field-grid">
|
|
<label for="chd-audience-select">Selected Audience</label>
|
|
<select id="chd-audience-select"></select>
|
|
<label for="chd-audience-create-name">New Audience Name</label>
|
|
<input id="chd-audience-create-name" type="text" placeholder="NuQloud-custom" />
|
|
</div>
|
|
<div id="chd-audience-manage-status" class="chd-note chd-note--status"></div>
|
|
<div id="chd-audience-list" class="chd-audience-pill-list"></div>
|
|
</section>
|
|
|
|
<section class="chd-config-block">
|
|
<div class="chd-card-head">
|
|
<h4>2) Package Product Mapping</h4>
|
|
<button id="chd-package-add-row" class="button" type="button">Add Package</button>
|
|
</div>
|
|
<p class="chd-note">Maps connector package codes to Paymenter product IDs. The connector provides the current recommended NuQloud package seeds, but the actual package-to-product mapping stays manual because Paymenter does not natively know which product fulfills which connector audience/package role. Package summaries use Paymenter details when available, and can be overridden here as a fallback. Live pricing badges below show whether the current runtime is seeing a real Paymenter price, falling back to your saved override, or still unresolved.</p>
|
|
<div id="chd-package-list" class="chd-table-wrap"></div>
|
|
</section>
|
|
|
|
<section class="chd-config-block">
|
|
<div class="chd-card-head">
|
|
<h4>3) Monthly Add-ons</h4>
|
|
<button id="chd-addon-add-row" class="button" type="button">Add Add-on</button>
|
|
</div>
|
|
<p class="chd-note">Recurring monthly add-ons (capacity boosts, etc.). These are global catalog items; audience visibility is chosen in the audience editor.</p>
|
|
<div id="chd-addon-list" class="chd-table-wrap"></div>
|
|
</section>
|
|
|
|
<section class="chd-config-block">
|
|
<div class="chd-card-head">
|
|
<h4>4) One-Time Products</h4>
|
|
<button id="chd-onetime-add-row" class="button" type="button">Add Product</button>
|
|
</div>
|
|
<p class="chd-note">One-time purchases like publish credits. These are global catalog items; audience visibility is chosen in the audience editor.</p>
|
|
<div id="chd-onetime-list" class="chd-table-wrap"></div>
|
|
</section>
|
|
|
|
<section class="chd-config-block">
|
|
<div class="chd-card-head">
|
|
<h4>5) Extra Offers</h4>
|
|
<button id="chd-extra-offers-add-row" class="button" type="button">Add Offer</button>
|
|
</div>
|
|
<p class="chd-note">Optional links to non-core CHD products (dev, web hosting, etc.), with billing type monthly or one-time. Audience visibility is chosen in the audience editor.</p>
|
|
<div id="chd-extra-offers-list" class="chd-table-wrap"></div>
|
|
</section>
|
|
|
|
<section class="chd-config-block chd-card--wide">
|
|
<h4>6) Selected Audience Catalog View</h4>
|
|
<p class="chd-note">
|
|
The selections below apply only to the currently selected audience. If nothing is checked for a configured audience, that section will show nothing for that audience.
|
|
</p>
|
|
<div id="chd-audience-editor"></div>
|
|
</section>
|
|
|
|
<section class="chd-config-block chd-card--wide">
|
|
<h4>7) End-User Preview</h4>
|
|
<p class="chd-note">Preview what users will see for each audience before saving.</p>
|
|
<div class="chd-actions">
|
|
<label for="chd-preview-audience">Preview Audience</label>
|
|
<select id="chd-preview-audience"></select>
|
|
<button id="chd-preview-refresh" class="button" type="button">Refresh Preview</button>
|
|
</div>
|
|
<div id="chd-admin-catalog-preview-render" class="chd-preview-surface">Loading preview...</div>
|
|
<details class="chd-preview-debug">
|
|
<summary>Raw preview payload</summary>
|
|
<pre id="chd-admin-catalog-preview">Loading preview...</pre>
|
|
</details>
|
|
</section>
|
|
</div>
|
|
<pre id="chd-admin-catalog-config-status">Loading...</pre>
|
|
</section>
|
|
|
|
<section id="chd-admin-section-announcements" class="chd-card chd-card--wide">
|
|
<div class="chd-card-head">
|
|
<h3>CHD Announcements Q-App</h3>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<a id="chd-admin-chdc-open" class="button button-primary" href="/apps/qortal_integration/qapps?qapp=qortal%3A%2F%2FCHDC">Open Announcements</a>
|
|
</div>
|
|
</div>
|
|
<p class="chd-note">Use the button to open CHDC announcements in the Q-Apps browser.</p>
|
|
</section>
|
|
|
|
<section id="chd-admin-section-advanced" class="chd-card chd-card--wide">
|
|
<h3>Control Plane Requirements (Paymenter + CHD Connector)</h3>
|
|
<p class="chd-note">
|
|
This is the operational guardrail area. Raw runtime snapshots follow below for debugging and audit checks.
|
|
</p>
|
|
<ul>
|
|
<li>Admin-only service actions with explicit capability checks per endpoint</li>
|
|
<li>Write actions default to dry-run mode before enablement on production clouds</li>
|
|
<li>Per-action audit trail for actor, payload hash, target service, and outcome</li>
|
|
<li>Connector auth via server-side tokens only, never exposed to browser clients</li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section id="chd-admin-section-overview" class="chd-card chd-card--wide">
|
|
<div class="chd-card-head">
|
|
<h3>Current Runtime Snapshot</h3>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-overview-toggle" class="button" type="button">Show Raw</button>
|
|
<button id="chd-admin-overview-all" class="button" type="button">Show All Info</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-overview-summary" class="chd-snapshot-summary">Loading...</div>
|
|
<div id="chd-admin-overview-status" class="chd-status-row"></div>
|
|
<pre id="chd-admin-overview" class="chd-hidden">Loading...</pre>
|
|
</section>
|
|
|
|
<section id="chd-admin-section-connector-snapshot" class="chd-card chd-card--wide">
|
|
<div class="chd-card-head">
|
|
<h3>Connector + Paymenter Snapshot</h3>
|
|
<div class="chd-actions chd-actions--inline">
|
|
<button id="chd-admin-connector-refresh" class="button" type="button">Refresh Snapshot</button>
|
|
<button id="chd-admin-connector-toggle" class="button" type="button">Show Raw</button>
|
|
<button id="chd-admin-connector-all" class="button" type="button">Show All Info</button>
|
|
</div>
|
|
</div>
|
|
<div id="chd-admin-connector-summary-view" class="chd-snapshot-summary">Loading...</div>
|
|
<div id="chd-admin-connector-status" class="chd-status-row"></div>
|
|
<pre id="chd-admin-connector-summary" class="chd-hidden">Loading...</pre>
|
|
</section>
|
|
</div>
|
|
|
|
<div id="chd-admin-qortal-approval" class="chd-modal chd-hidden" role="dialog" aria-modal="true" aria-labelledby="chd-admin-qortal-approval-title">
|
|
<div class="chd-modal__backdrop"></div>
|
|
<div class="chd-modal__panel">
|
|
<h3 id="chd-admin-qortal-approval-title">Approve QORT Send</h3>
|
|
<p class="chd-note">CHD admin grant sends use the same Qortal approval and wallet unlock flow as the NuQloud dashboard.</p>
|
|
<div class="chd-summary-grid">
|
|
<div class="chd-summary-item">
|
|
<span class="chd-summary-label">Request</span>
|
|
<span id="chd-admin-qortal-approval-request" class="chd-summary-value">SEND_COIN</span>
|
|
</div>
|
|
<div class="chd-summary-item">
|
|
<span class="chd-summary-label">Scope</span>
|
|
<span id="chd-admin-qortal-approval-scope" class="chd-summary-value">SEND_COIN</span>
|
|
</div>
|
|
</div>
|
|
<p id="chd-admin-qortal-approval-wallet-status" class="chd-note chd-wallet-status chd-wallet-status-unknown">Wallet lock: checking...</p>
|
|
<div id="chd-admin-qortal-approval-unlock-fields" class="chd-hidden">
|
|
<label for="chd-admin-qortal-approval-password">Wallet password</label>
|
|
<input id="chd-admin-qortal-approval-password" type="password" autocomplete="current-password" placeholder="Required when wallet is locked">
|
|
<label class="chd-checkbox" for="chd-admin-qortal-approval-ttl">
|
|
<input id="chd-admin-qortal-approval-ttl" type="checkbox" checked>
|
|
Keep wallet unlocked for 10 minutes
|
|
</label>
|
|
</div>
|
|
<p id="chd-admin-qortal-approval-error" class="chd-note chd-error chd-hidden"></p>
|
|
<div class="chd-actions">
|
|
<button id="chd-admin-qortal-approval-confirm" class="button button-primary" type="button">Approve and Send</button>
|
|
<button id="chd-admin-qortal-approval-cancel" class="button" type="button">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|