pygmalion 0.1.9 → 0.1.10
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/docs/DEPLOY.md +10 -3
- package/package.json +2 -1
- package/preset/pygmalion-director/agent.cordis.yml +6 -2
- package/scripts/start-local-test.mjs +45 -0
- package/src/agent-life.js +11 -0
- package/src/bots.js +3 -1
- package/src/persona.js +2 -1
- package/src/session-log.js +4 -1
- package/src/tools.js +36 -17
- package/src/voice-mimo.js +95 -0
- package/src/web-public/app.js +138 -54
- package/src/web-public/index.html +104 -186
- package/src/web-public/layout.css +7 -0
- package/src/web-public/style.css +1 -56
- package/src/web-server.js +55 -17
package/src/web-public/app.js
CHANGED
|
@@ -4,9 +4,11 @@ const csrfHeader = { 'x-pygmalion-csrf': '1' };
|
|
|
4
4
|
|
|
5
5
|
const views = { auth: $('#auth-view'), app: $('#app-view') };
|
|
6
6
|
const editorView = $('#editor-view');
|
|
7
|
-
const lifeView = $('#life-view');
|
|
8
|
-
const memeView = $('#meme-view');
|
|
9
|
-
const deviceView = $('#device-view');
|
|
7
|
+
const lifeView = $('#life-view');
|
|
8
|
+
const memeView = $('#meme-view');
|
|
9
|
+
const deviceView = $('#device-view');
|
|
10
|
+
const rolesView = $('#roles-view');
|
|
11
|
+
const pageTitle = $('#page-title');
|
|
10
12
|
|
|
11
13
|
let me = null;
|
|
12
14
|
let roles = [];
|
|
@@ -14,14 +16,27 @@ let editingRoleId = null; // null = 新建
|
|
|
14
16
|
let lifeRoleId = null;
|
|
15
17
|
let memeRoleId = null;
|
|
16
18
|
|
|
17
|
-
function show(view) {
|
|
18
|
-
views.auth.classList.toggle('hidden', view !== 'auth');
|
|
19
|
-
views.app.classList.toggle('hidden', view !== 'app');
|
|
20
|
-
|
|
19
|
+
function show(view) {
|
|
20
|
+
views.auth.classList.toggle('hidden', view !== 'auth');
|
|
21
|
+
views.app.classList.toggle('hidden', view !== 'app');
|
|
22
|
+
rolesView.classList.toggle('hidden', view !== 'app');
|
|
23
|
+
editorView.classList.add('hidden');
|
|
21
24
|
lifeView.classList.add('hidden');
|
|
22
25
|
memeView.classList.add('hidden');
|
|
23
|
-
deviceView.classList.add('hidden');
|
|
24
|
-
}
|
|
26
|
+
deviceView.classList.add('hidden');
|
|
27
|
+
}
|
|
28
|
+
function setActiveNav(name) {
|
|
29
|
+
document.querySelectorAll('[data-nav]').forEach((el) => el.classList.toggle('active', el.dataset.nav === name));
|
|
30
|
+
}
|
|
31
|
+
function showRoles() {
|
|
32
|
+
editorView.classList.add('hidden');
|
|
33
|
+
lifeView.classList.add('hidden');
|
|
34
|
+
memeView.classList.add('hidden');
|
|
35
|
+
deviceView.classList.add('hidden');
|
|
36
|
+
rolesView.classList.remove('hidden');
|
|
37
|
+
pageTitle.textContent = '角色空间';
|
|
38
|
+
setActiveNav('roles');
|
|
39
|
+
}
|
|
25
40
|
function status(msg, isErr = false) {
|
|
26
41
|
const bar = $('#status-bar');
|
|
27
42
|
bar.textContent = msg;
|
|
@@ -47,9 +62,9 @@ function esc(s) {
|
|
|
47
62
|
|
|
48
63
|
/* ------------------------------- 认证 ------------------------------- */
|
|
49
64
|
let isRegister = false;
|
|
50
|
-
function setAuthMode() {
|
|
51
|
-
$('#auth-submit').textContent = isRegister ? '注册' : '登录';
|
|
52
|
-
$('#auth-display').classList.toggle('hidden', !isRegister);
|
|
65
|
+
function setAuthMode() {
|
|
66
|
+
$('#auth-submit').textContent = isRegister ? '注册' : '登录';
|
|
67
|
+
$('#auth-display').parentElement.classList.toggle('hidden', !isRegister);
|
|
53
68
|
}
|
|
54
69
|
$('#auth-toggle').addEventListener('click', () => { isRegister = !isRegister; setAuthMode(); $('#auth-error').textContent = ''; });
|
|
55
70
|
$('#auth-form').addEventListener('submit', async (e) => {
|
|
@@ -82,11 +97,12 @@ $('#btn-password').addEventListener('click', () => {
|
|
|
82
97
|
});
|
|
83
98
|
|
|
84
99
|
/* ------------------------------- 主界面 ------------------------------- */
|
|
85
|
-
async function boot() {
|
|
86
|
-
show('app');
|
|
87
|
-
$('#me-label').textContent = `${me.displayName || me.qqNumber}(${me.qqNumber})`;
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
async function boot() {
|
|
101
|
+
show('app');
|
|
102
|
+
$('#me-label').textContent = `${me.displayName || me.qqNumber}(${me.qqNumber})`;
|
|
103
|
+
$('#me-initial').textContent = String(me.displayName || me.qqNumber || 'P').trim().slice(0, 1).toUpperCase();
|
|
104
|
+
await loadRoles();
|
|
105
|
+
}
|
|
90
106
|
async function loadRoles() {
|
|
91
107
|
const r = await api('/api/me');
|
|
92
108
|
me = r.account; roles = r.roles || [];
|
|
@@ -96,12 +112,14 @@ function bindingText(role) {
|
|
|
96
112
|
if (role.binding?.openid) return `已绑定 openid ${role.binding.openid}` + (role.binding.botAppId ? ` · AppID ${role.binding.botAppId}` : '');
|
|
97
113
|
return '未绑定(首个与之聊天的 QQ 用户自动成为拥有者)';
|
|
98
114
|
}
|
|
99
|
-
function botStatusLabel(bot) {
|
|
100
|
-
if (!bot?.configured) return '未配置机器人';
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
function botStatusLabel(bot) {
|
|
116
|
+
if (!bot?.configured) return '未配置机器人';
|
|
117
|
+
if (bot.enabled === false) return '已休眠';
|
|
118
|
+
return bot.status?.state === 'ready' ? '机器人已连接' : '机器人未连接';
|
|
119
|
+
}
|
|
120
|
+
function botStatusDetail(bot) {
|
|
121
|
+
if (!bot?.configured) return '在编辑页填写 QQ 机器人的 AppID/AppSecret 即可开始聊天。';
|
|
122
|
+
if (bot.enabled === false) return '角色已休眠:QQ 接入、主动唤醒和正在运行的脚本均已停止。';
|
|
105
123
|
const s = bot.status?.state;
|
|
106
124
|
const d = bot.status?.detail ? `(${bot.status.detail})` : '';
|
|
107
125
|
const map = {
|
|
@@ -123,18 +141,19 @@ function renderRoles() {
|
|
|
123
141
|
<div class="role-card">
|
|
124
142
|
<div class="role-main">
|
|
125
143
|
<div class="row"><strong>${esc(r.persona?.name || '未命名角色')}</strong>
|
|
126
|
-
<span class="tag ${r.bot?.configured && r.bot.status?.state === 'ready' ? 'ok' : ''}">${botStatusLabel(r.bot)}</span>
|
|
144
|
+
<span class="tag ${r.bot?.enabled === false ? 'sleeping' : r.bot?.configured && r.bot.status?.state === 'ready' ? 'ok' : ''}">${botStatusLabel(r.bot)}</span>
|
|
127
145
|
<span class="tag ${r.binding?.openid ? 'ok' : ''}">${r.binding?.openid ? '已绑定' : '未绑定'}</span>
|
|
128
146
|
${r.life?.hasScript ? '<span class="tag ok">有脚本</span>' : ''}
|
|
129
147
|
</div>
|
|
130
|
-
<div class="muted">${esc(r.persona?.personality || '')}${r.persona?.age ? ` · ${esc(r.persona.age)} 岁` : ''}</div>
|
|
131
|
-
<div class="muted">${
|
|
132
|
-
<div class="muted">${r.
|
|
148
|
+
<div class="muted">${esc(r.persona?.personality || '还没有填写性格')}${r.persona?.age ? ` · ${esc(r.persona.age)} 岁` : ''}</div>
|
|
149
|
+
<div class="muted">${r.bot?.configured ? botStatusDetail(r.bot) : '尚未连接 QQ 机器人'}</div>
|
|
150
|
+
<div class="muted">${r.binding?.openid ? '已与拥有者绑定' : '等待第一次 QQ 对话完成绑定'}</div>
|
|
133
151
|
</div>
|
|
134
152
|
<div class="row role-actions">
|
|
135
153
|
<button class="ghost" data-act="edit" data-id="${esc(r.roleId)}">编辑</button>
|
|
136
154
|
<button class="ghost" data-act="life" data-id="${esc(r.roleId)}">脚本</button>
|
|
137
|
-
<button class="ghost" data-act="memes" data-id="${esc(r.roleId)}">表情包</button>
|
|
155
|
+
<button class="ghost" data-act="memes" data-id="${esc(r.roleId)}">表情包</button>
|
|
156
|
+
${r.bot?.configured ? `<button class="ghost ${r.bot.enabled === false ? 'wake' : 'sleep'}" data-act="sleep" data-id="${esc(r.roleId)}">${r.bot.enabled === false ? '唤醒' : '休眠'}</button>` : ''}
|
|
138
157
|
<button class="ghost" data-act="reset" data-id="${esc(r.roleId)}">重置绑定</button>
|
|
139
158
|
<button class="ghost danger" data-act="del" data-id="${esc(r.roleId)}">删除</button>
|
|
140
159
|
</div>
|
|
@@ -148,7 +167,8 @@ $('#role-list').addEventListener('click', async (e) => {
|
|
|
148
167
|
try {
|
|
149
168
|
if (act === 'edit') openEditor(rid);
|
|
150
169
|
else if (act === 'life') openLife(rid);
|
|
151
|
-
else if (act === 'memes') openMemes(rid);
|
|
170
|
+
else if (act === 'memes') openMemes(rid);
|
|
171
|
+
else if (act === 'sleep') await toggleSleep(rid);
|
|
152
172
|
else if (act === 'reset') { await api(`/api/me/roles/${rid}/reset-binding`, 'POST'); status('绑定已重置,下一位聊天者将成为拥有者'); await loadRoles(); }
|
|
153
173
|
else if (act === 'del') {
|
|
154
174
|
const name = roles.find((r) => r.roleId === rid)?.persona?.name || '该角色';
|
|
@@ -194,29 +214,38 @@ function openEditor(rid) {
|
|
|
194
214
|
$('#f-meme-vision-model').value = v.model || '';
|
|
195
215
|
$('#f-meme-vision-apiurl').value = v.apiUrl || '';
|
|
196
216
|
$('#f-meme-vision-apikey').value = v.apiKey || '';
|
|
197
|
-
$('#editor-error').textContent = '';
|
|
198
|
-
fillBotForm(role);
|
|
199
|
-
|
|
217
|
+
$('#editor-error').textContent = '';
|
|
218
|
+
fillBotForm(role);
|
|
219
|
+
fillVoiceForm(role);
|
|
220
|
+
rolesView.classList.add('hidden');
|
|
221
|
+
editorView.classList.remove('hidden');
|
|
200
222
|
lifeView.classList.add('hidden');
|
|
201
223
|
memeView.classList.add('hidden');
|
|
202
|
-
deviceView.classList.add('hidden');
|
|
224
|
+
deviceView.classList.add('hidden');
|
|
225
|
+
pageTitle.textContent = rid ? '编辑角色' : '创建角色';
|
|
226
|
+
setActiveNav('roles');
|
|
203
227
|
void renderDeviceChecks(p.devices || []);
|
|
204
228
|
editorView.scrollIntoView({ behavior: 'smooth' });
|
|
205
229
|
}
|
|
206
|
-
function fillBotForm(role) {
|
|
230
|
+
function fillBotForm(role) {
|
|
207
231
|
const bot = role?.bot || {};
|
|
208
232
|
$('#f-appid').value = bot.qqAppId || '';
|
|
209
233
|
$('#f-appsecret').value = '';
|
|
210
234
|
$('#f-sandbox').checked = bot.configured ? bot.sandbox !== false : true;
|
|
211
235
|
$('#f-streaming').checked = bot.configured ? bot.streaming === true : false;
|
|
212
236
|
$('#f-chatwindow').value = Math.round((bot.withinChatWindowMs || 300000) / 60000);
|
|
213
|
-
$('#bot-status-line').textContent = botStatusDetail(bot);
|
|
237
|
+
$('#bot-status-line').textContent = botStatusDetail(bot);
|
|
238
|
+
const sleep = $('#btn-toggle-sleep');
|
|
239
|
+
sleep.classList.toggle('hidden', !bot.configured);
|
|
240
|
+
sleep.textContent = bot.enabled === false ? '唤醒角色' : '休眠角色';
|
|
241
|
+
sleep.classList.toggle('wake', bot.enabled === false);
|
|
242
|
+
sleep.classList.toggle('sleep', bot.enabled !== false);
|
|
214
243
|
$('#btn-del-bot').classList.toggle('hidden', !bot.configured);
|
|
215
244
|
$('#bot-form').classList.toggle('hidden', !role);
|
|
216
245
|
$('#bot-error').textContent = '';
|
|
217
246
|
}
|
|
218
247
|
$('#btn-new-role').addEventListener('click', () => openEditor(null));
|
|
219
|
-
$('#btn-close-editor').addEventListener('click',
|
|
248
|
+
$('#btn-close-editor').addEventListener('click', showRoles);
|
|
220
249
|
$('#role-form').addEventListener('submit', async (e) => {
|
|
221
250
|
e.preventDefault();
|
|
222
251
|
const persona = {
|
|
@@ -263,7 +292,7 @@ $('#role-form').addEventListener('submit', async (e) => {
|
|
|
263
292
|
const r = await api('/api/me/roles', 'POST', body);
|
|
264
293
|
status(`角色「${r.role?.persona?.name || '新角色'}」已创建`);
|
|
265
294
|
}
|
|
266
|
-
|
|
295
|
+
showRoles();
|
|
267
296
|
await loadRoles();
|
|
268
297
|
} catch (err) { $('#editor-error').textContent = err.message; }
|
|
269
298
|
});
|
|
@@ -286,14 +315,18 @@ async function renderDevicePanel() {
|
|
|
286
315
|
<button class="ghost danger device-del" data-id="${esc(d.id)}">删除</button>
|
|
287
316
|
</div>`).join('');
|
|
288
317
|
}
|
|
289
|
-
$('#btn-devices').addEventListener('click', () => {
|
|
290
|
-
|
|
318
|
+
$('#btn-devices').addEventListener('click', () => {
|
|
319
|
+
rolesView.classList.add('hidden');
|
|
320
|
+
editorView.classList.add('hidden');
|
|
291
321
|
lifeView.classList.add('hidden');
|
|
292
322
|
memeView.classList.add('hidden');
|
|
293
|
-
deviceView.classList.remove('hidden');
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
323
|
+
deviceView.classList.remove('hidden');
|
|
324
|
+
pageTitle.textContent = '我的设备';
|
|
325
|
+
setActiveNav('devices');
|
|
326
|
+
void renderDevicePanel();
|
|
327
|
+
});
|
|
328
|
+
document.querySelector('[data-nav="roles"]').addEventListener('click', showRoles);
|
|
329
|
+
$('#btn-close-devices').addEventListener('click', showRoles);
|
|
297
330
|
$('#device-add').addEventListener('click', async () => {
|
|
298
331
|
const alias = $('#device-alias').value.trim();
|
|
299
332
|
if (!alias) return;
|
|
@@ -320,12 +353,13 @@ $('#device-list').addEventListener('click', async (e) => {
|
|
|
320
353
|
$('#bot-form').addEventListener('submit', async (e) => {
|
|
321
354
|
e.preventDefault();
|
|
322
355
|
if (!editingRoleId) return;
|
|
323
|
-
const body = {
|
|
356
|
+
const body = {
|
|
324
357
|
qqAppId: $('#f-appid').value.trim(),
|
|
325
358
|
qqSecret: $('#f-appsecret').value.trim() || undefined,
|
|
326
359
|
sandbox: $('#f-sandbox').checked,
|
|
327
360
|
streaming: $('#f-streaming').checked,
|
|
328
|
-
withinChatWindowMs: (Number($('#f-chatwindow').value) || 5) * 60000,
|
|
361
|
+
withinChatWindowMs: (Number($('#f-chatwindow').value) || 5) * 60000,
|
|
362
|
+
enabled: roles.find((r) => r.roleId === editingRoleId)?.bot?.enabled !== false,
|
|
329
363
|
};
|
|
330
364
|
try {
|
|
331
365
|
await api(`/api/me/roles/${editingRoleId}/bot`, 'PUT', body);
|
|
@@ -333,7 +367,53 @@ $('#bot-form').addEventListener('submit', async (e) => {
|
|
|
333
367
|
await loadRoles();
|
|
334
368
|
openEditor(editingRoleId);
|
|
335
369
|
} catch (err) { $('#bot-error').textContent = err.message; }
|
|
336
|
-
});
|
|
370
|
+
});
|
|
371
|
+
async function toggleSleep(rid) {
|
|
372
|
+
const role = roles.find((r) => r.roleId === rid);
|
|
373
|
+
const bot = role?.bot;
|
|
374
|
+
if (!bot?.configured) return;
|
|
375
|
+
const sleeping = bot.enabled === false;
|
|
376
|
+
const name = role?.persona?.name || '该角色';
|
|
377
|
+
if (!sleeping && !confirm(`让「${name}」进入休眠?\n\nQQ 接入、主动互动和正在运行的生活/设备脚本都会停止;角色资料与记忆会保留。`)) return;
|
|
378
|
+
try {
|
|
379
|
+
await api(`/api/me/roles/${rid}/bot`, 'PUT', { enabled: sleeping });
|
|
380
|
+
status(sleeping ? `「${name}」已唤醒,正在连接 QQ。` : `「${name}」已进入休眠。`);
|
|
381
|
+
await loadRoles();
|
|
382
|
+
if (editingRoleId === rid) openEditor(rid);
|
|
383
|
+
} catch (err) { status(err.message, true); }
|
|
384
|
+
}
|
|
385
|
+
function fillVoiceForm(role) {
|
|
386
|
+
const v = role?.voice || {};
|
|
387
|
+
$('#voice-form').classList.toggle('hidden', !role);
|
|
388
|
+
$('#f-voice-enabled').checked = v.enabled === true;
|
|
389
|
+
$('#f-mimo-key').value = '';
|
|
390
|
+
$('#f-mimo-model').value = v.model || 'mimo-v2.5-tts-voiceclone';
|
|
391
|
+
$('#f-voice-role').value = v.rolePrompt || '';
|
|
392
|
+
$('#voice-reference-info').textContent = v.reference ? `${v.reference.name} · ${(v.reference.bytes / 1024 / 1024).toFixed(2)} MB` : '支持 WAV / MP3;Base64 编码后不超过 10MB。';
|
|
393
|
+
$('#voice-status-line').textContent = v.configured && v.reference ? (v.enabled ? '已就绪:导演可发送语音消息。' : '已配置,尚未启用。') : '请配置 API Key 并上传参考音频。';
|
|
394
|
+
$('#voice-error').textContent = '';
|
|
395
|
+
}
|
|
396
|
+
$('#voice-form').addEventListener('submit', async (e) => {
|
|
397
|
+
e.preventDefault(); if (!editingRoleId) return;
|
|
398
|
+
try {
|
|
399
|
+
const r = await api(`/api/me/roles/${editingRoleId}/voice`, 'PUT', { enabled: $('#f-voice-enabled').checked, apiKey: $('#f-mimo-key').value.trim(), model: $('#f-mimo-model').value.trim(), rolePrompt: $('#f-voice-role').value.trim() });
|
|
400
|
+
const role = roles.find((x) => x.roleId === editingRoleId); if (role) role.voice = r.voice;
|
|
401
|
+
fillVoiceForm(role); status('语音配置已保存');
|
|
402
|
+
} catch (err) { $('#voice-error').textContent = err.message; }
|
|
403
|
+
});
|
|
404
|
+
$('#btn-voice-reference').addEventListener('click', async () => {
|
|
405
|
+
if (!editingRoleId) return; const input = $('#voice-reference'); const file = input.files?.[0];
|
|
406
|
+
if (!file) { $('#voice-error').textContent = '请先选择 WAV 或 MP3 文件'; return; }
|
|
407
|
+
try {
|
|
408
|
+
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
409
|
+
const r = await api(`/api/me/roles/${editingRoleId}/voice/reference`, 'POST', { data: bytesToBase64(bytes), mime: file.type || (file.name.toLowerCase().endsWith('.mp3') ? 'audio/mpeg' : 'audio/wav'), name: file.name });
|
|
410
|
+
const role = roles.find((x) => x.roleId === editingRoleId); if (role) role.voice = r.voice;
|
|
411
|
+
input.value = ''; fillVoiceForm(role); status('参考音频已上传');
|
|
412
|
+
} catch (err) { $('#voice-error').textContent = err.message; }
|
|
413
|
+
});
|
|
414
|
+
$('#btn-toggle-sleep').addEventListener('click', () => {
|
|
415
|
+
if (editingRoleId) void toggleSleep(editingRoleId);
|
|
416
|
+
});
|
|
337
417
|
$('#btn-del-bot').addEventListener('click', async () => {
|
|
338
418
|
if (!editingRoleId) return;
|
|
339
419
|
if (!confirm('删除该机器人的配置?连接将断开,之后可随时重新配置。')) return;
|
|
@@ -354,12 +434,14 @@ function startLifeRefresh() {
|
|
|
354
434
|
function stopLifeRefresh() {
|
|
355
435
|
if (lifeRefreshTimer) { clearInterval(lifeRefreshTimer); lifeRefreshTimer = null; }
|
|
356
436
|
}
|
|
357
|
-
async function openLife(rid) {
|
|
437
|
+
async function openLife(rid) {
|
|
358
438
|
lifeRoleId = rid;
|
|
359
439
|
const role = roles.find((r) => r.roleId === rid);
|
|
360
440
|
$('#life-role-name').textContent = role?.persona?.name || '未命名角色';
|
|
361
|
-
|
|
362
|
-
|
|
441
|
+
rolesView.classList.add('hidden');
|
|
442
|
+
editorView.classList.add('hidden');
|
|
443
|
+
lifeView.classList.remove('hidden');
|
|
444
|
+
pageTitle.textContent = '脚本监管';
|
|
363
445
|
lifeView.scrollIntoView({ behavior: 'smooth' });
|
|
364
446
|
await refreshLife();
|
|
365
447
|
startLifeRefresh();
|
|
@@ -487,16 +569,18 @@ $('#toy-scripts').addEventListener('click', async (e) => {
|
|
|
487
569
|
$('#toy-source').classList.remove('hidden');
|
|
488
570
|
} catch (err) { status(err.message, true); }
|
|
489
571
|
});
|
|
490
|
-
$('#btn-close-life').addEventListener('click', () => { stopLifeLogPolling(); stopLifeRefresh(); currentLifeLog = null;
|
|
572
|
+
$('#btn-close-life').addEventListener('click', () => { stopLifeLogPolling(); stopLifeRefresh(); currentLifeLog = null; showRoles(); });
|
|
491
573
|
|
|
492
574
|
/* ------------------------------- 表情包管理 ------------------------------- */
|
|
493
|
-
async function openMemes(rid) {
|
|
575
|
+
async function openMemes(rid) {
|
|
494
576
|
memeRoleId = rid;
|
|
495
577
|
const role = roles.find((r) => r.roleId === rid);
|
|
496
578
|
$('#meme-role-name').textContent = role?.persona?.name || '未命名角色';
|
|
497
|
-
|
|
579
|
+
rolesView.classList.add('hidden');
|
|
580
|
+
editorView.classList.add('hidden');
|
|
498
581
|
lifeView.classList.add('hidden');
|
|
499
|
-
memeView.classList.remove('hidden');
|
|
582
|
+
memeView.classList.remove('hidden');
|
|
583
|
+
pageTitle.textContent = '表情包库';
|
|
500
584
|
memeView.scrollIntoView({ behavior: 'smooth' });
|
|
501
585
|
await loadMemes();
|
|
502
586
|
}
|
|
@@ -571,7 +655,7 @@ function bytesToBase64(bytes) {
|
|
|
571
655
|
for (const b of bytes) bin += String.fromCharCode(b);
|
|
572
656
|
return btoa(bin);
|
|
573
657
|
}
|
|
574
|
-
$('#btn-close-meme').addEventListener('click',
|
|
658
|
+
$('#btn-close-meme').addEventListener('click', showRoles);
|
|
575
659
|
|
|
576
660
|
/* ------------------------------- 启动 ------------------------------- */
|
|
577
661
|
setAuthMode();
|