SCQC / server /static /admin.html
raianand's picture
Upload folder using huggingface_hub
86b459c verified
Raw History Blame Contribute Delete
15.9 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>SCQC admin</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Hind:wght@400;500;600&family=Hind+Siliguri:wght@400;500;600&display=swap">
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<header class="bar">
<h1>SCQC</h1>
<div class="actions" style="align-items:center">
<span class="userchip hidden" id="me"><span class="avatar" id="me-avatar"></span><span class="small" id="me-name"></span></span>
<button id="logout" class="hidden">Log out</button>
</div>
</header>
<nav class="tabs hidden" id="tabs" aria-label="Sections">
<button data-tab="projects" data-role="admin">Projects</button>
<button data-tab="dashboard" data-role="admin">Dashboard</button>
<button data-tab="builder" data-role="admin">Task Builder</button>
<button data-tab="review">Review Queue</button>
<button data-tab="analytics" data-role="admin">Analytics</button>
<button data-tab="payments" data-role="admin">Payments</button>
<button data-tab="team" data-role="admin">Team</button>
</nav>
<main class="wrap wide">
<section id="tab-projects" class="hidden"></section>
<!-- Login / first-run setup -->
<section id="login" class="panel stack hidden" style="max-width:460px;margin:40px auto 0">
<h2 style="margin-top:0" id="login-title">Log in</h2>
<form id="login-form" class="stack">
<div><label for="l-user">User name</label><input type="text" id="l-user" required autocomplete="username"></div>
<div id="l-name-row" class="hidden"><label for="l-name">Your name</label><input type="text" id="l-name" autocomplete="name"></div>
<div><label for="l-pass">Password</label><input type="password" id="l-pass" required autocomplete="current-password"></div>
<div id="l-token-row" class="hidden"><label for="l-token">Server admin token (SCQC_ADMIN_TOKEN)</label>
<input type="password" id="l-token" autocomplete="off">
<p class="small muted">No accounts exist yet. The token proves you run this server; the account you create here is its first admin.</p></div>
<div class="actions"><button class="primary" type="submit" id="l-submit">Log in</button></div>
<p class="errors small" id="login-error" role="alert"></p>
</form>
</section>
<section id="tab-dashboard" class="hidden stack"></section>
<section id="tab-builder" class="hidden stack">
<div class="panel stack">
<div class="actions" style="justify-content:space-between;align-items:center">
<h2 style="margin:0">Project</h2>
<div class="actions"><button id="b-new">New project</button><button id="b-load">Load selected project</button></div>
</div>
<div class="row">
<div><label for="b-pid">Project ID</label><input type="text" id="b-pid" placeholder="e.g. HINDI_READ_2026"></div>
<div><label for="b-title">Title</label><input type="text" id="b-title"></div>
</div>
<details class="project-languages"><summary>Languages <span class="muted small">· Select languages</span></summary><div class="checks" id="b-langs"></div></details>
<details class="project-advanced"><summary>Advanced project settings · Consent and rewards</summary><div class="row">
<div><label for="b-consent-version">Consent version</label><input type="text" id="b-consent-version" value="v1"></div>
<div><label for="b-reward">Default reward per approved recording (₹)</label><input type="text" id="b-reward" inputmode="decimal" value="0"></div>
</div>
</details>
<div class="actions"><button id="b-apply-project">Apply project settings</button></div>
</div>
<div class="panel stack">
<h2 style="margin-top:0">Create a new task</h2>
<div class="panel workflow-panel" style="margin-bottom:12px">
<label for="workflow-type">Project workflow</label>
<select id="workflow-type" aria-label="Project workflow">
<option value="collection">Speech Collection</option>
<option value="auditing">Dataset Auditing (existing audio and references)</option>
</select>
<p class="muted small" id="workflow-help">Collect new speech with configurable quality checks.</p>
<div id="collection-options">
<label for="collection-focus">Speech task</label>
<select id="collection-focus"><option value="read_speech">Read speech</option><option value="image_description">Image-prompted / spontaneous speech</option></select>
<div id="validation-mode-wrap" style="margin-top:12px"><label for="validation-mode">Validation mode</label>
<select id="validation-mode"><option value="lexical">Lexical fidelity — match expected words</option><option value="semantic">Semantic / intent fidelity — allow equivalent commands</option></select>
<p class="muted small">Semantic mode uses explicitly configured equivalent phrases and confusable intents; uncertain cases go to human review. It does not claim open-ended semantic understanding.</p>
</div>
<label class="checks" style="margin-top:12px"><span><input type="checkbox" id="prosody-enabled"> Enable prosody-focused collection</span></label>
<p class="muted small" id="prosody-help">Off by default. Enable for intonation, focus, pauses, or expressive delivery.</p>
<div id="prosody-options" class="hidden"><label for="prosody-focus">Prosody task</label>
<select id="prosody-focus"><option value="prosody_pair">Meaning-changing prosody pair</option><option value="tts_prosody">Punctuation and emphasis</option><option value="emotion">Expressive delivery</option></select></div>
</div>
<p id="audit-notice" class="muted small hidden">Dataset auditing is a project-level workflow. The existing recording task editor is disabled here until the audio/reference import and adjudication pipeline is configured. No recordings will be imported automatically.</p>
</div>
<div class="row">
<div class="hidden"><label for="t-type">Task type</label>
<select id="t-type">
<option value="read_speech">Read speech (ASR data)</option>
<option value="image_description">Image-prompted speech (ASR data)</option>
<option value="tts_prosody">TTS reading: punctuation and emphasis</option>
<option value="prosody_pair">Prosody minimal pair (one member)</option>
<option value="command">Legacy command (existing projects only)</option>
<option value="emotion">Expressive speech</option>
</select></div>
<div><label for="t-lang">Language</label><select id="t-lang"></select></div>
</div>
<div class="row">
<div><label for="t-id">Task ID</label><input type="text" id="t-id" placeholder="left empty: generated"></div>
<div><label for="t-level">Validation level</label>
<select id="t-level">
<option value="L1">L1 Acoustic: signal checks only</option>
<option value="L2" selected>L2 Intelligent: acoustic + ASR matching</option>
<option value="L3">L3 Task-specific: + intent, prosody, alignment</option>
<option value="L4">L4 Human verified: + two reviewers</option>
</select></div>
</div>
<div class="t-field" data-for="read_speech tts_prosody prosody_pair command"><label for="t-text">Prompt text</label>
<textarea id="t-text" style="min-height:70px;font-family:inherit;font-size:1.2rem"></textarea></div>
<div class="t-field row" data-for="image_description">
<div><label for="t-image">Image link (Google Drive or https)</label><input type="text" id="t-image"></div>
<div><label for="t-scenario">Instruction shown with the image</label><input type="text" id="t-scenario"></div>
</div>
<div class="t-field" data-for="image_description"><label for="t-suggested">Suggested text (a guide for reviewers, never an exact target)</label>
<textarea id="t-suggested" style="min-height:60px;font-family:inherit;font-size:1rem"></textarea></div>
<div class="t-field row" data-for="tts_prosody prosody_pair">
<div><label for="t-emphasis">Word to stress (optional)</label><input type="text" id="t-emphasis"></div>
<div class="t-field" data-for="prosody_pair"><label for="t-pair">Pair ID (both members share it)</label><input type="text" id="t-pair"></div>
</div>
<div class="t-field" data-for="prosody_pair"><label for="t-interp">Intended meaning (shown to the speaker, hidden from listeners)</label><input type="text" id="t-interp"></div>
<div class="t-field row" data-for="read_speech command" id="intent-fields">
<div><label for="t-intent">Expected intent ID (semantic mode)</label><input type="text" id="t-intent" placeholder="e.g. lights_on"></div>
<div><label for="t-confusable">Confusable intent IDs (comma-separated)</label><input type="text" id="t-confusable"></div>
<div><label for="t-equivalents">Equivalent spoken phrases (one per line)</label><textarea id="t-equivalents" placeholder="बत्ती जला दो" rows="3"></textarea></div>
</div>
<div class="t-field" data-for="emotion"><label for="t-situation">Situation</label><input type="text" id="t-situation"></div>
<div class="t-field" data-for="emotion"><label for="t-emotion">Target emotion (never shown to the speaker)</label><input type="text" id="t-emotion"></div>
<div class="row">
<div><label for="t-conf">Auto-accept at confidence of at least</label><input type="text" id="t-conf" inputmode="decimal" placeholder="e.g. 0.85 (empty: rubric only)"></div>
<div><label for="t-reward">Reward for this task (₹, empty: project default)</label><input type="text" id="t-reward" inputmode="decimal"></div>
</div>
<div class="actions">
<button class="primary" id="t-add">Add task</button>
<label class="button" for="t-csv" style="cursor:pointer">Import tasks from CSV</label>
<input type="file" id="t-csv" accept=".csv,text/csv" class="hidden">
</div>
<p class="small muted">CSV columns: task_type, language, text, image_url, suggested_text, emphasis, pair_id, interpretation,
intent, equivalents, confusable, validation_mode, level, accept_confidence, reward, task_id. Only task_type and language are always required.</p>
<div id="t-list"></div>
</div>
<div id="ethics-form" class="panel stack">
<h2 style="margin-top:0">Ethics review</h2>
<p class="muted small">Every project must say whether ethics committee approval is required. Participants see what you enter here before they consent.</p>
<fieldset class="stack" style="border:0;padding:0;margin:0">
<legend style="font-weight:600;margin-bottom:6px">Is ethics committee approval required for this project?</legend>
<label class="checks"><span><input type="radio" name="e-req" value="yes"> Yes</span></label>
<label class="checks"><span><input type="radio" name="e-req" value="no"> No</span></label>
</fieldset>
<div id="e-no" class="stack hidden">
<div><label for="e-reason">Why not? Participants will see this.</label>
<textarea id="e-reason" style="min-height:80px;font-family:inherit;font-size:1rem"></textarea></div>
</div>
<div id="e-yes" class="stack hidden">
<div><label for="e-status">Status</label>
<select id="e-status">
<option value="pending">Waiting for approval (closed to participants)</option>
<option value="approved">Approved</option>
<option value="internal_test">Internal test by the team only (not used as data)</option>
</select></div>
<div class="row">
<div><label for="e-committee">Committee</label><input type="text" id="e-committee"></div>
<div><label for="e-institution">Institution</label><input type="text" id="e-institution"></div>
</div>
<div class="row">
<div><label for="e-protocol">Protocol or reference number</label><input type="text" id="e-protocol"></div>
<div><label for="e-amendment">Amendment number, if any</label><input type="text" id="e-amendment"></div>
</div>
<div class="row">
<div><label for="e-approved">Approval date</label><input type="date" id="e-approved"></div>
<div><label for="e-expiry">Expiry date</label><input type="date" id="e-expiry"></div>
</div>
<div class="row">
<div><label for="e-max">Maximum participants</label><input type="text" id="e-max" inputmode="numeric"></div>
<div><label for="e-age">Minimum age</label><input type="text" id="e-age" inputmode="numeric" value="18"></div>
</div>
<div class="row">
<div><label for="e-retention">Keep recordings for (days)</label><input type="text" id="e-retention" inputmode="numeric"></div>
<div><label for="e-hosting">Where recordings are stored</label><input type="text" id="e-hosting"></div>
</div>
<div><label for="e-uses">Approved uses, one per line</label>
<textarea id="e-uses" style="min-height:70px;font-family:inherit;font-size:1rem"></textarea></div>
<div class="row">
<div><label for="e-researcher">Researcher contact</label><input type="text" id="e-researcher"></div>
<div><label for="e-committee-contact">Committee contact for participants</label><input type="text" id="e-committee-contact"></div>
</div>
<div><label for="e-letter">Approval letter (PDF, visible to admins only)</label>
<input type="file" id="e-letter" accept="application/pdf,.pdf"></div>
<div id="e-consent" class="stack"></div>
</div>
<div class="actions">
<button class="primary" id="e-apply">Apply ethics details</button>
<button id="e-draft">Download draft application</button>
</div>
<div id="e-result" aria-live="polite"></div>
</div>
<div class="panel stack">
<details class="advanced"><summary>Manifest JSON (advanced)</summary>
<p class="muted small">Everything above edits this JSON. <a href="/api/schema" target="_blank" rel="noopener">See the schema</a>.</p>
<input type="file" id="m-file" accept="application/json,.json" aria-label="Load a manifest file">
<textarea id="m-text" spellcheck="false" aria-label="Manifest JSON"></textarea>
</details>
<div class="actions">
<button id="m-check">Check</button>
<button class="primary" id="m-publish">Publish project</button>
</div>
<div id="m-result" aria-live="polite"></div>
</div>
</section>
<section id="tab-review" class="hidden">
<div class="split">
<div>
<div class="actions" style="justify-content:space-between;margin-bottom:10px">
<h2 style="margin:0" id="queue-count">Review queue</h2>
<button id="reload">Refresh</button>
</div>
<div class="chips" id="filters" style="margin-bottom:10px"></div>
<ul class="queue" id="queue"></ul>
<p class="muted small" style="margin-top:12px">Keys: space plays, A accepts, R rejects, J moves to the next item.</p>
</div>
<div id="detail" class="panel stack"><p class="muted">Pick a recording from the queue.</p></div>
</div>
</section>
<section id="tab-analytics" class="hidden stack"></section>
<section id="tab-payments" class="hidden stack"></section>
<section id="tab-team" class="hidden stack"></section>
</main>
<script type="module" src="/static/admin.js"></script>
</body>
</html>