fix: deep audit — wire TDS v1.2 components, fix kanban/tabs/bulk/avatar
- ticket.js: fix showTab() early return preventing attachments/deps from loading - ticket.js: fix performStatusChange() overwriting lt-status-* classes - dashboard.js: fix updateSelectionCount() using is-visible instead of style.display - dashboard.js: fix populateKanbanCards() to use #kanban-col-* IDs (TDS v1.2) - dashboard.js: fix setViewMode() removing references to old non-TDS elements - dashboard.js: remove mobile-bottom-nav injection (no CSS existed for it) - dashboard.css: add full lt-kanban-card component styles with priority accents - dashboard.css: add mobile sidebar overlay, filter toggle, ticket preview popup CSS - DashboardView.php: replace priority badges with lt-chip component - TicketView.php: add lt-avatar with initials to comment author display - ApiKeysView.php: enhance API usage section with lt-code-block component + curl example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -115,8 +115,26 @@ include __DIR__ . '/../../views/layout_header.php';
|
||||
<div class="lt-section-header">API Usage</div>
|
||||
<div class="lt-section-body">
|
||||
<p class="lt-text-sm lt-text-muted">Include the API key in your requests using the Authorization header:</p>
|
||||
<pre class="lt-text-xs lt-text-cyan" style="border:1px solid rgba(0,255,65,0.2);padding:0.5rem;overflow-x:auto"><code>Authorization: Bearer YOUR_API_KEY</code></pre>
|
||||
<p class="lt-text-xs lt-text-muted">API keys provide programmatic access to create and manage tickets. Keep keys secure and rotate them regularly.</p>
|
||||
<div class="lt-code-block">
|
||||
<div class="lt-code-header">
|
||||
<span class="lt-code-lang">HTTP HEADER</span>
|
||||
<button type="button" class="lt-code-copy lt-btn-sm"
|
||||
data-copy="Authorization: Bearer YOUR_API_KEY"
|
||||
data-copy-toast>COPY</button>
|
||||
</div>
|
||||
<pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
|
||||
</div>
|
||||
<p class="lt-text-xs lt-text-muted" style="margin-top:0.5rem">
|
||||
Example — create a ticket via cURL:<br>
|
||||
</p>
|
||||
<div class="lt-code-block">
|
||||
<div class="lt-code-header"><span class="lt-code-lang">CURL</span></div>
|
||||
<pre><code>curl -X POST https://your-instance/api/create_ticket.php \
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"title":"My ticket","category":"General","type":"Issue","priority":3}'</code></pre>
|
||||
</div>
|
||||
<p class="lt-text-xs lt-text-muted" style="margin-top:0.5rem">API keys provide programmatic access to create and manage tickets. Keep keys secure and rotate them regularly.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,8 +143,13 @@ document.addEventListener('click', function (e) {
|
||||
var target = e.target.closest('[data-action]');
|
||||
if (!target) return;
|
||||
switch (target.getAttribute('data-action')) {
|
||||
case 'copy-api-key': copyApiKey(); break;
|
||||
case 'revoke-key': revokeKey(target.getAttribute('data-id')); break;
|
||||
case 'copy-api-key': copyApiKey(); break;
|
||||
case 'revoke-key': revokeKey(target.getAttribute('data-id')); break;
|
||||
case 'copy-header-example':
|
||||
navigator.clipboard.writeText('Authorization: Bearer YOUR_API_KEY')
|
||||
.then(function() { lt.toast.success('Copied!'); })
|
||||
.catch(function() { lt.toast.error('Copy failed'); });
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user