dsh-watch-together 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/CREDITS.md +37 -0
- package/README.md +24 -5
- package/docs/INTERFACES.zh.md +13 -0
- package/dsh.plugin.json +12 -12
- package/examples/floating-chat/glass_static.py +158 -0
- package/examples/floating-chat/window.py +380 -50
- package/lib/client.js +41 -9
- package/package.json +133 -118
- package/scripts/check-expand-message.py +279 -0
- package/scripts/check-input-caret.py +151 -0
- package/src/settings/config.js +53 -0
- package/src/settings/page.html +38 -4
- package/src/settings/server.js +8 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""check-input-caret.py — 输入框光标的回归(不需要真的开窗)。
|
|
2
|
+
|
|
3
|
+
跑法(仓库根):
|
|
4
|
+
|
|
5
|
+
python scripts/check-input-caret.py
|
|
6
|
+
|
|
7
|
+
覆盖两件事:
|
|
8
|
+
|
|
9
|
+
1. **光标跟着插入点走**:`LiveGlass._visible_input` 要以插入点为锚点开窗,
|
|
10
|
+
并把插入点换算成可见段里的下标。旧实现只从左边砍(`text = text[1:]`),
|
|
11
|
+
光标恒在末尾 —— 左右键移动时画面上那条线根本不动(#20 的同一处输入框)。
|
|
12
|
+
2. **右边留余量**:插入点不在原文末尾时,可见段右端必须比插入点再多几个字符,
|
|
13
|
+
否则往左移动时光标一直贴着右缘,看不出右边还有内容。
|
|
14
|
+
|
|
15
|
+
`_visible_input` 只用到 `self.fonts.get(11).measure`,所以这里拿一个等宽假字体
|
|
16
|
+
注入,边界值可以手算核对,不需要 Tk、不需要显示器。
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
import sys
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
HERE = Path(__file__).resolve().parent
|
|
25
|
+
sys.path.insert(0, str(HERE.parent / "examples" / "floating-chat"))
|
|
26
|
+
|
|
27
|
+
CHAR_W = 10 # 假字体:每个字符固定 10px,断言才能手算
|
|
28
|
+
|
|
29
|
+
failures: list[str] = []
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class FakeFont:
|
|
33
|
+
def measure(self, s):
|
|
34
|
+
return len(s) * CHAR_W
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class FakeFonts:
|
|
38
|
+
def get(self, _size, _bold=False):
|
|
39
|
+
return FakeFont()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def check(name, cond, detail=""):
|
|
43
|
+
if not cond:
|
|
44
|
+
failures.append(f"{name}{(': ' + detail) if detail else ''}")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def visible_input(text, maxw, caret):
|
|
48
|
+
"""调真实实现:只绑 fonts,其余属性都用不到。"""
|
|
49
|
+
from window import LiveGlass
|
|
50
|
+
|
|
51
|
+
stub = object.__new__(LiveGlass)
|
|
52
|
+
stub.fonts = FakeFonts()
|
|
53
|
+
return LiveGlass._visible_input(stub, text, maxw, caret)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def legacy_visible(text, maxw):
|
|
57
|
+
"""改动前的实现,作为对照:只从左边砍,光标恒在末尾。"""
|
|
58
|
+
font = FakeFont()
|
|
59
|
+
while text and font.measure(text) > maxw:
|
|
60
|
+
text = text[1:]
|
|
61
|
+
return text
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_caret_stays_visible():
|
|
65
|
+
"""每个插入点位置,光标都必须落在可见段里,且下标换算不错位。"""
|
|
66
|
+
text = "0123456789abcdefghij" # 20 字符
|
|
67
|
+
maxw = 10 * CHAR_W # 可见 10 字符
|
|
68
|
+
for caret in range(len(text) + 1):
|
|
69
|
+
shown, idx = visible_input(text, maxw, caret)
|
|
70
|
+
check(f"caret={caret} 可见段不超宽",
|
|
71
|
+
FakeFont().measure(shown) <= maxw, f"{shown!r}")
|
|
72
|
+
check(f"caret={caret} 光标在可见段内",
|
|
73
|
+
0 <= idx <= len(shown), f"idx={idx} len={len(shown)}")
|
|
74
|
+
# 光标右边那个字符若也在可见段里,必须对得上原文(下标没错位)
|
|
75
|
+
if caret < len(text) and idx < len(shown):
|
|
76
|
+
check(f"caret={caret} 下标不错位",
|
|
77
|
+
shown[idx] == text[caret], f"{shown[idx]!r} != {text[caret]!r}")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def test_right_padding():
|
|
81
|
+
"""插入点不在末尾时,右边要留得出余量。"""
|
|
82
|
+
text = "0123456789abcdefghij"
|
|
83
|
+
maxw = 10 * CHAR_W
|
|
84
|
+
for caret in range(len(text)): # 不含末尾
|
|
85
|
+
shown, idx = visible_input(text, maxw, caret)
|
|
86
|
+
check(f"caret={caret} 右边有余量", len(shown) - idx >= 1,
|
|
87
|
+
f"右余量={len(shown) - idx}")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def test_legacy_loses_caret():
|
|
91
|
+
"""对照:旧实现在插入点靠前时,连插入点那个字符都不在可见段里。"""
|
|
92
|
+
text = "0123456789abcdefghij"
|
|
93
|
+
maxw = 10 * CHAR_W
|
|
94
|
+
old = legacy_visible(text, maxw)
|
|
95
|
+
check("旧实现把句首砍掉了", text[3] not in old,
|
|
96
|
+
f"{old!r} 里不该还有 {text[3]!r}")
|
|
97
|
+
# 新实现同样位置必须看得见
|
|
98
|
+
shown, idx = visible_input(text, maxw, 3)
|
|
99
|
+
check("新实现句首可见", idx < len(shown) and shown[idx] == text[3],
|
|
100
|
+
f"{shown!r} idx={idx}")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def test_short_text_untouched():
|
|
104
|
+
"""放得下就原样返回,插入点下标不变 —— 不能为了开窗改短消息的观感。"""
|
|
105
|
+
for text, caret in (("", 0), ("abc", 0), ("abc", 3), ("0123456789", 5)):
|
|
106
|
+
shown, idx = visible_input(text, 10 * CHAR_W, caret)
|
|
107
|
+
check(f"{text!r} 原样返回", (shown, idx) == (text, caret),
|
|
108
|
+
f"得到 {(shown, idx)}")
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def test_narrow_window():
|
|
112
|
+
"""窗口窄到只剩一个字符时也不能抛、不能返回负下标。"""
|
|
113
|
+
text = "0123456789abcdefghij"
|
|
114
|
+
for maxw in (CHAR_W, CHAR_W * 2, CHAR_W * 3):
|
|
115
|
+
for caret in (0, 5, len(text)):
|
|
116
|
+
shown, idx = visible_input(text, maxw, caret)
|
|
117
|
+
check(f"maxw={maxw} caret={caret} 不超宽",
|
|
118
|
+
FakeFont().measure(shown) <= maxw, f"{shown!r}")
|
|
119
|
+
check(f"maxw={maxw} caret={caret} 下标合法",
|
|
120
|
+
0 <= idx <= len(shown), f"idx={idx}")
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def test_blink_contract():
|
|
124
|
+
"""闪烁只认两个常量和三个方法;改名了这里要跟着改。"""
|
|
125
|
+
from window import LiveGlass
|
|
126
|
+
|
|
127
|
+
check("CARET_MS 是 530", LiveGlass.CARET_MS == 530, str(LiveGlass.CARET_MS))
|
|
128
|
+
check("CARET_PAD 是 3", LiveGlass.CARET_PAD == 3, str(LiveGlass.CARET_PAD))
|
|
129
|
+
for m in ("_schedule_caret", "_blink_caret", "_visible_input"):
|
|
130
|
+
check(f"{m} 还在", callable(getattr(LiveGlass, m, None)))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def main():
|
|
134
|
+
test_caret_stays_visible()
|
|
135
|
+
test_right_padding()
|
|
136
|
+
test_legacy_loses_caret()
|
|
137
|
+
test_short_text_untouched()
|
|
138
|
+
test_narrow_window()
|
|
139
|
+
test_blink_contract()
|
|
140
|
+
|
|
141
|
+
if failures:
|
|
142
|
+
print(f"FAIL ({len(failures)})")
|
|
143
|
+
for f in failures:
|
|
144
|
+
print(" -", f)
|
|
145
|
+
return 1
|
|
146
|
+
print("OK: 光标跟随插入点、右边留余量、短文本不动、窄窗口不崩")
|
|
147
|
+
return 0
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
if __name__ == "__main__":
|
|
151
|
+
raise SystemExit(main())
|
package/src/settings/config.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* ~/.dsh/video.json { browserPort, launchBrowser } (与分镜插件共享)
|
|
6
6
|
* ~/.dsh/voice.json { adapter } (voice-adapter.js 已读)
|
|
7
7
|
* ~/.dsh/watch.json { chatPort } (本页新增,chat-server 读取)
|
|
8
|
+
* ~/.dsh/watch-window.json { glass, geometry, name, … } (悬浮窗自己读写;本页只碰 glass)
|
|
8
9
|
*
|
|
9
10
|
* 这里不 import chat-server,避免 chat-server -> settings -> chat-server 的环。
|
|
10
11
|
*/
|
|
@@ -14,6 +15,19 @@ import { homedir } from 'node:os';
|
|
|
14
15
|
import { dirname, join } from 'node:path';
|
|
15
16
|
|
|
16
17
|
export const DEFAULT_CHAT_PORT = 9377;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 悬浮窗样式预设。
|
|
21
|
+
*
|
|
22
|
+
* `auto` 不落盘(写进去等于删掉 `glass` 键):窗口自己会按环境判断 ——
|
|
23
|
+
* 远程桌面/录屏用 solid(WDA 会让整窗在对面消失),其余用 live。
|
|
24
|
+
*
|
|
25
|
+
* 三个具体的档位:
|
|
26
|
+
* live 实时玻璃,抓屏 + 模糊,最好看也最吃 CPU
|
|
27
|
+
* frost 静态磨砂,一张预生成的底板,不抓屏(低配机/高分屏选这个)
|
|
28
|
+
* solid 纯色底板,最省
|
|
29
|
+
*/
|
|
30
|
+
export const WINDOW_STYLES = Object.freeze(['auto', 'live', 'frost', 'solid']);
|
|
17
31
|
const MAX_TEXT = 300;
|
|
18
32
|
|
|
19
33
|
export function dshHome(env = process.env) {
|
|
@@ -23,6 +37,8 @@ export function dshHome(env = process.env) {
|
|
|
23
37
|
export function videoConfigPath(env = process.env) { return join(dshHome(env), 'video.json'); }
|
|
24
38
|
export function voiceConfigPath(env = process.env) { return join(dshHome(env), 'voice.json'); }
|
|
25
39
|
export function watchConfigPath(env = process.env) { return join(dshHome(env), 'watch.json'); }
|
|
40
|
+
/** 悬浮窗自己的配置(窗口进程也往这里写 geometry/name);本页只改 `glass`。 */
|
|
41
|
+
export function windowConfigPath(env = process.env) { return join(dshHome(env), 'watch-window.json'); }
|
|
26
42
|
|
|
27
43
|
function readObject(path) {
|
|
28
44
|
if (!existsSync(path)) return { data: {}, error: null, exists: false };
|
|
@@ -78,6 +94,42 @@ export function writeWatchSettings(patch = {}, env = process.env) {
|
|
|
78
94
|
return readWatchSettings(env);
|
|
79
95
|
}
|
|
80
96
|
|
|
97
|
+
/**
|
|
98
|
+
* 悬浮窗样式(`watch-window.json` 的 `glass`)。
|
|
99
|
+
*
|
|
100
|
+
* 为什么写这个文件而不是 `watch.json`:窗口进程每 250ms 只看 `watch-window.json`
|
|
101
|
+
* 的 mtime,改这里才能**当场换过来**;写成别的文件要等下次开窗。
|
|
102
|
+
* 这个文件窗口自己也写(geometry / name / hidden),所以只能读-改-写,不能覆盖。
|
|
103
|
+
*/
|
|
104
|
+
export function readWindowSettings(env = process.env) {
|
|
105
|
+
const path = windowConfigPath(env);
|
|
106
|
+
const raw = readObject(path);
|
|
107
|
+
const value = typeof raw.data.glass === 'string' ? raw.data.glass.trim().toLowerCase() : '';
|
|
108
|
+
return {
|
|
109
|
+
path,
|
|
110
|
+
exists: raw.exists,
|
|
111
|
+
error: raw.error,
|
|
112
|
+
style: WINDOW_STYLES.includes(value) ? value : 'auto',
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function writeWindowSettings(patch = {}, env = process.env) {
|
|
117
|
+
const path = windowConfigPath(env);
|
|
118
|
+
const { data } = readObject(path);
|
|
119
|
+
const next = { ...data };
|
|
120
|
+
if (patch.style !== undefined) {
|
|
121
|
+
const style = String(patch.style ?? '').trim().toLowerCase();
|
|
122
|
+
if (!WINDOW_STYLES.includes(style)) {
|
|
123
|
+
throw new Error('style 必须是 auto / live / frost / solid');
|
|
124
|
+
}
|
|
125
|
+
// `auto` 不落盘:窗口把"没有 glass 键"理解成自动,写个 auto 进去反而看不懂
|
|
126
|
+
if (style === 'auto') delete next.glass;
|
|
127
|
+
else next.glass = style;
|
|
128
|
+
}
|
|
129
|
+
writeObject(path, next);
|
|
130
|
+
return readWindowSettings(env);
|
|
131
|
+
}
|
|
132
|
+
|
|
81
133
|
export function readVideoSettings(env = process.env) {
|
|
82
134
|
const path = videoConfigPath(env);
|
|
83
135
|
const raw = readObject(path);
|
|
@@ -144,5 +196,6 @@ export function configPaths(env = process.env) {
|
|
|
144
196
|
video: videoConfigPath(env),
|
|
145
197
|
voice: voiceConfigPath(env),
|
|
146
198
|
watch: watchConfigPath(env),
|
|
199
|
+
window: windowConfigPath(env),
|
|
147
200
|
};
|
|
148
201
|
}
|
package/src/settings/page.html
CHANGED
|
@@ -62,6 +62,22 @@ code{font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var
|
|
|
62
62
|
<div class="banner" id="voiceHint">留空 = 台词只写进聊天记录,不念出来。</div>
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
|
+
<div class="card">
|
|
66
|
+
<h2>悬浮窗样式</h2>
|
|
67
|
+
<div class="grid">
|
|
68
|
+
<label class="field">外观预设
|
|
69
|
+
<select id="windowStyle">
|
|
70
|
+
<option value="auto">自动 —— 远程/录屏用纯色,其余实时玻璃</option>
|
|
71
|
+
<option value="live">实时玻璃 —— 跟着桌面模糊(好看,吃 CPU)</option>
|
|
72
|
+
<option value="frost">静态磨砂 —— 不吃性能</option>
|
|
73
|
+
<option value="solid">纯色 —— 最省,背后不透</option>
|
|
74
|
+
</select>
|
|
75
|
+
<span class="hint">改完立刻生效,不用重开窗口;窗口开着时也能切。</span>
|
|
76
|
+
</label>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="banner" id="windowHint">实时玻璃每帧都要抓一次屏再模糊 —— 低配机、高分屏上「卡」就是这么来的。选「静态磨砂」后窗口不再抓屏,只画一张预生成的底板。</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
65
81
|
<div class="card">
|
|
66
82
|
<h2>依赖与下载</h2>
|
|
67
83
|
<p>缺少的依赖会出现官方下载按钮;插件只打开官方来源,不静默安装、不执行下载的文件。装好后回到本页点“重新检查”。</p>
|
|
@@ -105,7 +121,7 @@ code{font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var
|
|
|
105
121
|
const token = new URLSearchParams(location.search).get('token') || '';
|
|
106
122
|
const apiBase = '/dsh-watch-together/settings/api';
|
|
107
123
|
const $ = (id) => document.getElementById(id);
|
|
108
|
-
const state = { video: null, watch: null, voice: null, checks: [], paths: {} };
|
|
124
|
+
const state = { video: null, watch: null, voice: null, window: null, checks: [], paths: {} };
|
|
109
125
|
|
|
110
126
|
async function api(path, body) {
|
|
111
127
|
const res = await fetch(apiBase + path, {
|
|
@@ -132,18 +148,28 @@ code{font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var
|
|
|
132
148
|
const v = state.video || {};
|
|
133
149
|
const w = state.watch || {};
|
|
134
150
|
const s = state.voice || {};
|
|
151
|
+
const win = state.window || {};
|
|
135
152
|
$('browserPort').value = v.browserPort || '';
|
|
136
153
|
$('chatPort').value = w.chatPort || '';
|
|
137
154
|
$('adapter').value = s.adapter || '';
|
|
155
|
+
$('windowStyle').value = win.style || 'auto';
|
|
138
156
|
$('positionHint').textContent = v.browserPort
|
|
139
157
|
? '浏览器调试端口:' + v.browserPort + ';扩展上报优先,端口用于直接读页面。'
|
|
140
158
|
: '未配置调试端口:仍可用扩展上报或 SMTC;都没有时才需要手动传 cursor。';
|
|
141
159
|
$('voiceHint').textContent = s.adapter
|
|
142
160
|
? '当前适配器:' + s.adapter + '(下一场开始时挂载)'
|
|
143
161
|
: '留空 = 台词只写进聊天记录,不念出来。';
|
|
162
|
+
$('windowHint').textContent = win.style === 'frost'
|
|
163
|
+
? '当前:静态磨砂 —— 不抓屏、不逐帧合成,CPU 占用接近 0。'
|
|
164
|
+
: win.style === 'solid'
|
|
165
|
+
? '当前:纯色 —— 不抓屏、不设 WDA,远程桌面和录屏里也能看见。'
|
|
166
|
+
: win.style === 'live'
|
|
167
|
+
? '当前:实时玻璃 —— 每帧抓屏 + 模糊。觉得卡就换成「静态磨砂」。'
|
|
168
|
+
: '当前:自动 —— 远程/录屏环境用纯色,其余用实时玻璃;觉得卡可以手动选「静态磨砂」。';
|
|
144
169
|
$('paths').innerHTML = '<div>video.json:<code>' + escapeHtml(state.paths.video || '') + '</code></div>'
|
|
145
170
|
+ '<div>watch.json:<code>' + escapeHtml(state.paths.watch || '') + '</code></div>'
|
|
146
|
-
+ '<div>voice.json:<code>' + escapeHtml(state.paths.voice || '') + '</code></div>'
|
|
171
|
+
+ '<div>voice.json:<code>' + escapeHtml(state.paths.voice || '') + '</code></div>'
|
|
172
|
+
+ '<div>watch-window.json:<code>' + escapeHtml(state.paths.window || '') + '</code></div>';
|
|
147
173
|
}
|
|
148
174
|
|
|
149
175
|
function renderChecks() {
|
|
@@ -185,6 +211,7 @@ code{font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var
|
|
|
185
211
|
try {
|
|
186
212
|
const data = await api('/state');
|
|
187
213
|
state.video = data.video; state.watch = data.watch; state.voice = data.voice;
|
|
214
|
+
state.window = data.window;
|
|
188
215
|
state.checks = data.checks || []; state.paths = data.paths || {};
|
|
189
216
|
render(); renderChecks();
|
|
190
217
|
setStatus('');
|
|
@@ -200,10 +227,12 @@ code{font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var
|
|
|
200
227
|
};
|
|
201
228
|
const watch = { chatPort: Number($('chatPort').value) };
|
|
202
229
|
const voice = { adapter: $('adapter').value };
|
|
203
|
-
const
|
|
230
|
+
const win = { style: $('windowStyle').value };
|
|
231
|
+
const data = await api('/save', { video, watch, voice, window: win });
|
|
204
232
|
state.video = data.video; state.watch = data.watch; state.voice = data.voice;
|
|
233
|
+
state.window = data.window;
|
|
205
234
|
render();
|
|
206
|
-
setStatus('
|
|
235
|
+
setStatus('已保存;悬浮窗样式立刻生效,语音下一场生效,聊天端口若服务已在跑需重启 DSH。', 'ok');
|
|
207
236
|
} catch (e) { setStatus(e.message, 'bad'); }
|
|
208
237
|
}
|
|
209
238
|
|
|
@@ -219,6 +248,11 @@ code{font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var
|
|
|
219
248
|
|
|
220
249
|
$('save').addEventListener('click', save);
|
|
221
250
|
$('check').addEventListener('click', check);
|
|
251
|
+
// 下拉一改就把说明也换掉(真正落盘还是点保存;这里只是别让提示和选中的对不上)
|
|
252
|
+
$('windowStyle').addEventListener('change', () => {
|
|
253
|
+
state.window = { ...(state.window || {}), style: $('windowStyle').value };
|
|
254
|
+
render();
|
|
255
|
+
});
|
|
222
256
|
document.addEventListener('click', async (event) => {
|
|
223
257
|
const btn = event.target.closest('button.copy');
|
|
224
258
|
if (!btn) return;
|
package/src/settings/server.js
CHANGED
|
@@ -10,7 +10,8 @@ import { randomBytes } from 'node:crypto';
|
|
|
10
10
|
import { checkEnvironment } from './deps.js';
|
|
11
11
|
import {
|
|
12
12
|
configPaths, readVideoSettings, readVoiceSettings, readWatchSettings,
|
|
13
|
-
writeVideoSettings, writeVoiceSettings, writeWatchSettings,
|
|
13
|
+
readWindowSettings, writeVideoSettings, writeVoiceSettings, writeWatchSettings,
|
|
14
|
+
writeWindowSettings,
|
|
14
15
|
} from './config.js';
|
|
15
16
|
import { settingsPage } from './page.js';
|
|
16
17
|
|
|
@@ -63,6 +64,7 @@ function statePayload(env) {
|
|
|
63
64
|
video: readVideoSettings(env),
|
|
64
65
|
watch: readWatchSettings(env),
|
|
65
66
|
voice: readVoiceSettings(env),
|
|
67
|
+
window: readWindowSettings(env),
|
|
66
68
|
paths: configPaths(env),
|
|
67
69
|
};
|
|
68
70
|
}
|
|
@@ -104,6 +106,8 @@ export function createSettingsPage({ ctx, env = process.env, log = () => {} } =
|
|
|
104
106
|
if (body.video !== undefined) writeVideoSettings(body.video, env);
|
|
105
107
|
if (body.watch !== undefined) writeWatchSettings(body.watch, env);
|
|
106
108
|
if (body.voice !== undefined) writeVoiceSettings(body.voice, env);
|
|
109
|
+
// 悬浮窗样式:写 watch-window.json,窗口下一拍(250ms)自己换过来
|
|
110
|
+
if (body.window !== undefined) writeWindowSettings(body.window, env);
|
|
107
111
|
return json(res, 200, statePayload(env));
|
|
108
112
|
}
|
|
109
113
|
if (req.method === 'POST' && action === '/check') {
|
|
@@ -145,7 +149,8 @@ export function createSettingsPage({ ctx, env = process.env, log = () => {} } =
|
|
|
145
149
|
name: 'watch_together_settings',
|
|
146
150
|
description: [
|
|
147
151
|
'Open the local watch_together settings page: browser debugging port,',
|
|
148
|
-
'chat service port, voice adapter path,
|
|
152
|
+
'chat service port, voice adapter path, floating-window appearance preset',
|
|
153
|
+
'(live glass / static frost / solid), and a read-only dependency check',
|
|
149
154
|
'with official download buttons for Python, the browser extension, and ffmpeg.',
|
|
150
155
|
'Returns a tokenized local URL; the Web GUI also renders the same settings natively in the bundle detail page and Settings > Built-in plugins.',
|
|
151
156
|
].join(' '),
|
|
@@ -175,6 +180,7 @@ export function createSettingsPage({ ctx, env = process.env, log = () => {} } =
|
|
|
175
180
|
'一起看设置页:',
|
|
176
181
|
url,
|
|
177
182
|
'在浏览器打开;页面里的 API 用这个 URL 的 token 校验,不要把它发给别人。',
|
|
183
|
+
'悬浮窗样式(实时玻璃 / 静态磨砂 / 纯色)改完立刻生效,不用重开窗口。',
|
|
178
184
|
'语音适配器下一场开始时挂载;聊天端口在聊天服务启动时读取(服务已在跑需重启 DSH)。',
|
|
179
185
|
'台词/ASR 的 key 在视频分镜设置页配置。',
|
|
180
186
|
].join('\n'),
|