Files
texrra-web/index.html
T
gloamxun cecad51f91 Make the engine choice explicit and show route-D telemetry
The toolbar now treats the engine as route-d|v1 instead of a boolean whose v1
state omitted the query parameter (which now means route-d on the server). Both
preview and PDF always send an explicit engine query, the old localStorage key
migrates, and route-D is the default with a v1 escape hatch.

The preview status tolerates a missing duration, displays the warning count with
details on hover, and reports when X-Preview-Engine differs from the selected
engine; PDF export shows a fallback notice. The README documents the toggle and
the X-Preview-Engine response header.
2026-10-27 12:23:32 +08:00

98 lines
3.8 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>texrra</title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/fonts.css">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<header>
<div class="brand" id="brand"><span class="brand-mark">T</span>texrra</div>
<div class="header-actions" id="header-actions"></div>
</header>
<main>
<section class="projects-view" id="projects-view" hidden>
<div class="projects-inner">
<div class="hero">
<div>
<h1>项目</h1>
<p>上传 zip 项目或新建空白项目,进入项目后可以编辑、预览和导出 PDF。</p>
</div>
<div class="hero-actions">
<button class="btn" id="upload-zip">上传 ZIP</button>
<button class="btn primary" id="new-project">新建项目</button>
</div>
</div>
<div class="drop-zone" id="drop-zone">把 <strong>.zip</strong> 拖到这里上传</div>
<div class="project-grid" id="project-grid"></div>
<div class="empty-state" id="projects-empty" hidden>还没有项目。上传一个 zip,或点“新建项目”。</div>
</div>
</section>
<section class="workspace" id="workspace" hidden>
<aside class="file-panel">
<div class="file-panel-head">
<button class="icon-btn" id="back-button" title="返回项目列表">←</button>
<span class="project-title" id="project-title"></span>
</div>
<div class="file-tools">
<button class="btn" id="upload-files">上传文件</button>
<button class="btn" id="new-file">新建文件</button>
<button class="btn" id="download-project">下载 ZIP</button>
</div>
<div class="file-tree" id="file-tree"></div>
<div class="file-panel-foot" id="file-panel-foot"></div>
</aside>
<div class="editor-panel">
<div class="panel-head">
<span class="path" id="open-file-path">未打开文件</span>
<span class="status" id="save-status"></span>
</div>
<textarea id="source" spellcheck="false" aria-label="文件内容"></textarea>
<div class="binary-notice" id="binary-notice" hidden>
<div class="big" id="binary-icon">▣</div>
<div id="binary-text">这个文件是二进制文件,无法在编辑器中打开。</div>
<a class="btn" id="binary-download" href="#">下载文件</a>
</div>
</div>
<div class="preview-panel">
<div class="panel-head">
<span>实时预览</span>
<span class="head-right">
<span class="status" id="preview-status"></span>
<button class="btn small" id="toggle-engine" title="切换预览使用的排版内核(Route-D 为实验引擎)">引擎: Route-D (实验)</button>
<button class="btn small" id="export-pdf">导出 PDF</button>
</span>
</div>
<div class="preview-scroll" id="preview-scroll">
<div id="preview-error" hidden><strong>编译失败</strong><pre id="preview-error-text"></pre></div>
<div id="pages"></div>
<img class="asset-preview" id="asset-preview" alt="" hidden>
</div>
</div>
</section>
</main>
<footer>
<span>texrra · Rust 排版引擎</span>
<span>·</span>
<span>项目保存在本地 <code>projects/</code> 目录</span>
<span>·</span>
<span>Ctrl/Cmd+S 保存</span>
</footer>
<input id="zip-input" type="file" accept=".zip,application/zip" hidden>
<input id="file-input" type="file" multiple hidden>
<div id="context-menu" hidden></div>
<div id="toast" hidden></div>
<script src="/app.js"></script>
</body>
</html>