forked from Shared/esg
144 lines
9.1 KiB
HTML
144 lines
9.1 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="color-scheme" content="dark light" />
|
|
<title>Inquiry Gateway Console</title>
|
|
<link rel="stylesheet" href="/dashboard/styles.css" />
|
|
<script defer src="/dashboard/app.js"></script>
|
|
</head>
|
|
<body>
|
|
<main class="shell">
|
|
<section id="loginView" class="auth-card">
|
|
<div class="brand-mark">ESG</div>
|
|
<p class="eyebrow">External Services Gateway</p>
|
|
<h1>Operations console</h1>
|
|
<p class="muted">Sign in with the seeded SUPER_ADMIN account to inspect health, logs, and inquiries.</p>
|
|
<form id="loginForm" class="stack">
|
|
<label>Username<input id="username" name="username" autocomplete="username" required /></label>
|
|
<label>Password<input id="password" name="password" type="password" autocomplete="current-password" required /></label>
|
|
<button class="primary" type="submit">Sign in</button>
|
|
</form>
|
|
<p id="loginError" class="error" role="alert"></p>
|
|
</section>
|
|
|
|
<section id="appView" class="hidden">
|
|
<header class="topbar">
|
|
<div>
|
|
<p class="eyebrow">External Services Gateway</p>
|
|
<h1>Operations console</h1>
|
|
</div>
|
|
<div class="topbar-actions">
|
|
<span id="profileLabel" class="pill"></span>
|
|
<button id="logoutButton" class="ghost" type="button">Sign out</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div id="appError" class="error banner" role="alert"></div>
|
|
|
|
<section class="grid two">
|
|
<article class="panel health-panel">
|
|
<div class="panel-heading"><h2>System health</h2><button id="refreshHealth" class="icon-button" type="button" title="Refresh health">↻</button></div>
|
|
<div id="healthStatus" class="health-status"><span class="status-dot"></span><span>Loading…</span></div>
|
|
<pre id="healthOutput" class="code compact">Loading readiness details…</pre>
|
|
</article>
|
|
<article class="panel">
|
|
<div class="panel-heading"><h2>Inquiry metrics</h2><button id="refreshMetrics" class="icon-button" type="button" title="Refresh metrics">↻</button></div>
|
|
<div class="metric-grid">
|
|
<div><span>Total requests</span><strong id="metricTotal">—</strong></div>
|
|
<div><span>Evaluated</span><strong id="metricEvaluated">—</strong></div>
|
|
<div><span>Success rate*</span><strong id="metricSuccess">—</strong></div>
|
|
<div><span>Operational failures</span><strong id="metricFailure">—</strong></div>
|
|
<div><span>No-match results</span><strong id="metricNoMatch">—</strong></div>
|
|
<div><span>Avg duration</span><strong id="metricDuration">—</strong></div>
|
|
</div>
|
|
<p class="metric-note">* Success rate excludes valid provider responses with no matching policy or owner.</p>
|
|
</article>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel-heading"><div><p class="eyebrow">Manual request</p><h2>Run an inquiry</h2></div></div>
|
|
<form id="inquiryForm" class="inquiry-form">
|
|
<label>Inquiry type
|
|
<select id="inquiryType">
|
|
<option value="person">Person</option>
|
|
<option value="realEstate">Real estate</option>
|
|
<option value="sheba">Sheba</option>
|
|
<option value="shahkar">Shahkar</option>
|
|
<option value="postalCode">Postal code</option>
|
|
<option value="legalPerson">Legal person</option>
|
|
<option value="carByPlate">Car by plate</option>
|
|
<option value="carByChassis">Car by chassis</option>
|
|
<option value="carByMotor">Car by motor number</option>
|
|
<option value="thirdPartyCar">Third-party car</option>
|
|
<option value="policyByChassis">Policy by chassis</option>
|
|
<option value="policyByPlate">Policy by plate</option>
|
|
<option value="policyByNationalCode">Policy by national code</option>
|
|
</select>
|
|
</label>
|
|
<label>Idempotency key <input id="idempotencyKey" /></label>
|
|
<div class="request-toolbar wide">
|
|
<span id="inquiryHint" class="muted"></span>
|
|
<button id="toggleRawButton" class="ghost" type="button">Use JSON mode</button>
|
|
</div>
|
|
<div id="fieldMode" class="wide">
|
|
<div id="inquiryFields" class="form-fields"></div>
|
|
</div>
|
|
<div id="rawMode" class="wide hidden">
|
|
<label>JSON payload
|
|
<textarea id="inquiryPayload" rows="9" spellcheck="false"></textarea>
|
|
</label>
|
|
<button id="applyJsonButton" class="ghost" type="button">Apply JSON to form fields</button>
|
|
</div>
|
|
<button class="primary" type="submit">Send inquiry</button>
|
|
</form>
|
|
<pre id="inquiryOutput" class="code response-box">The formatted response will appear here.</pre>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel-heading"><div><p class="eyebrow">Batch input</p><h2>Test vehicle inquiries from JSON</h2></div></div>
|
|
<p class="muted">Choose plate, chassis/VIN, motor number, or a combined mode. Each lookup produces an independently expandable result with separate logs, traces, and cURLs.</p>
|
|
<div class="batch-controls">
|
|
<label>JSON/TXT file<input id="batchFile" type="file" accept=".json,.txt,application/json,text/plain" /></label>
|
|
<label>Inquiry mode
|
|
<select id="batchInquiryMode">
|
|
<option value="carByPlate">By plate</option>
|
|
<option value="carByChassis">By chassis / VIN</option>
|
|
<option value="carByMotor">By motor number</option>
|
|
<option value="both" selected>Plate and chassis</option>
|
|
<option value="all">Plate, chassis, and motor</option>
|
|
</select>
|
|
</label>
|
|
<label>Delay between requests (ms)<input id="batchDelay" type="number" min="0" max="10000" step="100" value="0" /></label>
|
|
</div>
|
|
<label class="wide">Input preview / paste JSON
|
|
<textarea id="batchPayload" rows="8" spellcheck="false" placeholder='[{"nationalCode":"4311402422","plk1":"12","plk2":"ب","plk3":"345","plksrl":"67","vin":"IRFC89R2VSY976455","motorNo":"147H0403219"}]'></textarea>
|
|
</label>
|
|
<div class="batch-actions">
|
|
<button id="runBatchButton" class="primary" type="button">Run batch test</button>
|
|
<button id="stopBatchButton" class="ghost hidden" type="button">Stop after current request</button>
|
|
<span id="batchSummary" class="muted"></span>
|
|
</div>
|
|
<div id="batchCoverage" class="coverage-grid hidden" aria-live="polite">
|
|
<article class="coverage-card coverage-card-good"><span>Answered by plate or VIN</span><strong id="coverageAnswered">0 / 0</strong><small id="coverageAnsweredRate">0.0%</small></article>
|
|
<article class="coverage-card coverage-card-bad"><span>No answer from either</span><strong id="coverageUnanswered">0 / 0</strong><small id="coverageUnansweredRate">0.0%</small></article>
|
|
<article class="coverage-card coverage-card-pending"><span>Inconclusive</span><strong id="coverageInconclusive">0</strong><small>failure or invalid input</small></article>
|
|
<article class="coverage-card coverage-card-recovered"><span>Recovered by motor</span><strong id="coverageMotorRecovered">0</strong><small>plate + VIN still count as no-answer</small></article>
|
|
</div>
|
|
<label id="batchCoverageFilter" class="checkbox coverage-filter hidden"><input id="batchUnansweredOnly" type="checkbox" /> Show only records with no plate or VIN answer</label>
|
|
<progress id="batchProgress" class="batch-progress hidden" max="1" value="0"></progress>
|
|
<div class="table-wrap"><table><thead><tr><th>#</th><th>Input</th><th>Endpoint</th><th>Status</th><th>Tracking code</th><th>Message</th><th>Coverage / follow-up</th></tr></thead><tbody id="batchResultsBody"></tbody></table></div>
|
|
<p id="batchOutput" class="table-hint" role="status">Click a request row to expand its full response.</p>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel-heading"><div><p class="eyebrow">MongoDB audit trail</p><h2>Recent inquiry logs</h2></div><div class="panel-actions"><button id="refreshLogs" class="ghost" type="button">Refresh logs</button><button id="clearLogsButton" class="danger" type="button">Clear all logs</button></div></div>
|
|
<div class="table-wrap"><table><thead><tr><th>Time</th><th>Type</th><th>Provider</th><th>Status</th><th>Duration</th><th>Tracking code</th></tr></thead><tbody id="logsBody"></tbody></table></div>
|
|
<p id="logOutput" class="table-hint" role="status">Click a request row to expand its masked request and response.</p>
|
|
</section>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|