Sync with engine v5
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<div class="connection">
|
||||
<label class="connection__field">
|
||||
<span>WebSocket URL</span>
|
||||
<span>服务器地址</span>
|
||||
<input
|
||||
id="ws-url"
|
||||
type="text"
|
||||
@@ -26,12 +26,12 @@
|
||||
/>
|
||||
</label>
|
||||
<label class="connection__field connection__field--chat">
|
||||
<span>Chat ID</span>
|
||||
<span>会话 ID</span>
|
||||
<div class="chat-id-control">
|
||||
<input
|
||||
id="chat-id"
|
||||
type="text"
|
||||
placeholder="optional chatId"
|
||||
placeholder="可选"
|
||||
spellcheck="false"
|
||||
autocomplete="off"
|
||||
/>
|
||||
@@ -40,8 +40,8 @@
|
||||
class="chat-id-control__copy"
|
||||
type="button"
|
||||
disabled
|
||||
title="Copy Chat ID"
|
||||
aria-label="Copy Chat ID"
|
||||
title="复制会话 ID"
|
||||
aria-label="复制会话 ID"
|
||||
>
|
||||
<svg class="copy-icon copy-icon--default" viewBox="0 0 16 16" width="14" height="14" fill="none" aria-hidden="true">
|
||||
<rect x="5" y="5" width="8" height="9" rx="1.5" stroke="currentColor" stroke-width="1.4"/>
|
||||
@@ -54,13 +54,13 @@
|
||||
</div>
|
||||
</label>
|
||||
<button id="connect-btn" class="btn btn--primary" type="button">
|
||||
Connect
|
||||
连接
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="status">
|
||||
<span id="status-dot" class="status__dot status__dot--idle"></span>
|
||||
<span id="status-text" class="status__text">Disconnected</span>
|
||||
<span id="status-text" class="status__text">未连接</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -70,28 +70,87 @@
|
||||
<aside
|
||||
id="camera-drawer"
|
||||
class="camera-drawer"
|
||||
aria-label="Camera capture step"
|
||||
aria-label="拍照步骤"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="camera-drawer__panel">
|
||||
<div class="camera-drawer__header">
|
||||
<div>
|
||||
<p class="camera-drawer__eyebrow">Camera</p>
|
||||
<p class="camera-drawer__eyebrow">拍照</p>
|
||||
<h2>拍照步骤</h2>
|
||||
</div>
|
||||
<span id="camera-state" class="camera-drawer__state">State -</span>
|
||||
<span id="camera-state" class="camera-drawer__state">状态 -</span>
|
||||
</div>
|
||||
|
||||
<div class="camera-drawer__preview" aria-hidden="true">
|
||||
<div id="camera-preview" class="camera-drawer__preview">
|
||||
<video
|
||||
id="camera-video"
|
||||
class="camera-drawer__video"
|
||||
playsinline
|
||||
muted
|
||||
autoplay
|
||||
></video>
|
||||
<img
|
||||
id="camera-photo"
|
||||
class="camera-drawer__photo"
|
||||
alt="已选择图片预览"
|
||||
/>
|
||||
<span class="camera-drawer__corner camera-drawer__corner--tl"></span>
|
||||
<span class="camera-drawer__corner camera-drawer__corner--tr"></span>
|
||||
<span class="camera-drawer__corner camera-drawer__corner--bl"></span>
|
||||
<span class="camera-drawer__corner camera-drawer__corner--br"></span>
|
||||
<span class="camera-drawer__lens"></span>
|
||||
<span class="camera-drawer__scan"></span>
|
||||
<span id="camera-placeholder" class="camera-drawer__placeholder">
|
||||
打开摄像头实时拍摄,或从下方选择 / 上传图片
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<p id="camera-question" class="camera-drawer__question"></p>
|
||||
|
||||
<div
|
||||
id="camera-samples"
|
||||
class="camera-drawer__samples"
|
||||
aria-label="示例图片,点击选择"
|
||||
></div>
|
||||
|
||||
<div class="camera-drawer__sources">
|
||||
<label
|
||||
class="btn btn--ghost camera-drawer__source"
|
||||
>
|
||||
上传图片
|
||||
<input
|
||||
id="camera-upload"
|
||||
type="file"
|
||||
accept="image/*"
|
||||
hidden
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
id="camera-start-btn"
|
||||
class="btn btn--ghost camera-drawer__source"
|
||||
type="button"
|
||||
title="打开摄像头"
|
||||
>
|
||||
使用摄像头
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<label
|
||||
id="camera-device-row"
|
||||
class="device-picker camera-drawer__device-row"
|
||||
hidden
|
||||
>
|
||||
<span class="device-picker__label">选择摄像头</span>
|
||||
<select
|
||||
id="camera-device-select"
|
||||
class="device-picker__select"
|
||||
disabled
|
||||
>
|
||||
<option value="">默认摄像头</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<button
|
||||
id="camera-done-btn"
|
||||
class="btn btn--primary camera-drawer__button"
|
||||
@@ -100,23 +159,24 @@
|
||||
>
|
||||
拍摄完成
|
||||
</button>
|
||||
<canvas id="camera-canvas" hidden></canvas>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<section class="chat" aria-label="Conversation history">
|
||||
<section class="chat" aria-label="对话记录">
|
||||
<div id="chat-log" class="chat__log" role="log" aria-live="polite">
|
||||
<div class="chat__empty">
|
||||
<p>Connect to the engine, enable your mic, and start talking.</p>
|
||||
<p>连接服务、开启麦克风后即可开始对话。</p>
|
||||
<p class="chat__hint">
|
||||
Audio is streamed as PCM16 mono @ 16 kHz over
|
||||
<code>/ws-product</code>.
|
||||
音频通过 <code>/ws-product</code> 以 PCM16 单声道 16 kHz
|
||||
传输。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer class="controls" aria-label="Chat controls">
|
||||
<footer class="controls" aria-label="操作栏">
|
||||
<div class="meter" aria-hidden="true">
|
||||
<div id="meter-fill" class="meter__fill"></div>
|
||||
</div>
|
||||
@@ -126,7 +186,7 @@
|
||||
id="text-input"
|
||||
class="composer__input"
|
||||
rows="1"
|
||||
placeholder="Type a message, or use the mic…"
|
||||
placeholder="输入消息,或使用麦克风…"
|
||||
disabled
|
||||
></textarea>
|
||||
<button
|
||||
@@ -134,17 +194,17 @@
|
||||
class="btn btn--primary composer__send"
|
||||
type="submit"
|
||||
disabled
|
||||
title="Send message (Enter)"
|
||||
title="发送消息 (Enter)"
|
||||
>
|
||||
Send
|
||||
发送
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="controls__row">
|
||||
<label class="device-picker">
|
||||
<span class="device-picker__label">Microphone</span>
|
||||
<span class="device-picker__label">麦克风</span>
|
||||
<select id="mic-select" class="device-picker__select" disabled>
|
||||
<option value="">Default microphone</option>
|
||||
<option value="">默认麦克风</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
@@ -154,7 +214,7 @@
|
||||
type="button"
|
||||
disabled
|
||||
aria-pressed="false"
|
||||
title="Mic is off"
|
||||
title="麦克风已关闭"
|
||||
>
|
||||
<svg
|
||||
class="mic-btn__icon"
|
||||
@@ -172,52 +232,52 @@
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
<span class="mic-btn__label">Enable mic</span>
|
||||
<span class="mic-btn__label">开启麦克风</span>
|
||||
</button>
|
||||
|
||||
<div class="indicators">
|
||||
<span id="mic-indicator" class="indicator">
|
||||
<span class="indicator__dot indicator__dot--mic"></span>
|
||||
<span class="indicator__label">Mic</span>
|
||||
<span class="indicator__label">麦克风</span>
|
||||
</span>
|
||||
<span id="bot-indicator" class="indicator">
|
||||
<span class="indicator__dot indicator__dot--bot"></span>
|
||||
<span class="indicator__label">Bot</span>
|
||||
<span class="indicator__label">助手</span>
|
||||
</span>
|
||||
<span id="state-indicator" class="indicator indicator--state">
|
||||
<span class="indicator__dot indicator__dot--state"></span>
|
||||
<span id="state-label" class="indicator__label">State -</span>
|
||||
<span id="state-label" class="indicator__label">状态 -</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button id="clear-btn" class="btn btn--ghost" type="button">
|
||||
Clear
|
||||
清空
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="hint">
|
||||
Press <kbd>Enter</kbd> to send, <kbd>Shift</kbd>+<kbd>Enter</kbd>
|
||||
for newline. Sending text will interrupt the bot if it's speaking.
|
||||
Browser echo cancellation is on; use headphones if echo persists.
|
||||
按 <kbd>Enter</kbd> 发送,<kbd>Shift</kbd>+<kbd>Enter</kbd>
|
||||
换行。发送文字会打断正在说话的助手。
|
||||
浏览器回声消除已开启,如有回音请使用耳机。
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<section class="ws-log" aria-label="WebSocket log">
|
||||
<section class="ws-log" aria-label="WebSocket 日志">
|
||||
<div class="ws-log__header">
|
||||
<div class="ws-log__header-left">
|
||||
<h2>WebSocket Log</h2>
|
||||
<h2>WebSocket 日志</h2>
|
||||
<div class="ws-log__legend" aria-hidden="true">
|
||||
<span class="ws-log__legend-item ws-log__legend-item--send">Send</span>
|
||||
<span class="ws-log__legend-item ws-log__legend-item--recv">Recv</span>
|
||||
<span class="ws-log__legend-item ws-log__legend-item--send">发送</span>
|
||||
<span class="ws-log__legend-item ws-log__legend-item--recv">接收</span>
|
||||
</div>
|
||||
</div>
|
||||
<button id="clear-ws-log-btn" class="btn btn--ghost" type="button">
|
||||
Clear log
|
||||
清空日志
|
||||
</button>
|
||||
</div>
|
||||
<div id="ws-log" class="ws-log__body" role="log" aria-live="polite">
|
||||
<div class="ws-log__empty">No websocket events yet.</div>
|
||||
<div class="ws-log__empty">暂无 WebSocket 事件。</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user