@nestim/koishi-plugin-qqgm-webui 0.2.14 → 0.2.15

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/index.js CHANGED
@@ -114,7 +114,7 @@ function apply(ctx, config) {
114
114
  ctx.server.get(`${route}/api/health`, (koa) => json(koa, {
115
115
  ok: true,
116
116
  name,
117
- version: '0.2.14',
117
+ version: '0.2.15',
118
118
  route,
119
119
  tokenRequired: !!config.token,
120
120
  remoteAllowed: !!config.allowRemote,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestim/koishi-plugin-qqgm-webui",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "QQGM 附属 WebUI:插件识别、监控看板、记忆库、配置与日志。",
5
5
  "main": "index.js",
6
6
  "files": [
package/public/app.js CHANGED
@@ -126,6 +126,17 @@ async function initMemoryData() {
126
126
  if (!data || !data.installed) return;
127
127
  const badge = $('.nav-badge');
128
128
  if (badge) badge.textContent = String(data.total || 0);
129
+ const headP = $('#page-memory .page-head p');
130
+ if (headP) {
131
+ headP.textContent = data.useSqlite
132
+ ? `当前 SQLite · ${data.total || 0} 条;切换前备份 koishi.yml`
133
+ : (data.needsMigration
134
+ ? `当前 MD · 识别到 ${data.md?.total || 0} 条旧记忆,可迁移到 SQLite`
135
+ : '当前 MD · 没有识别到旧记忆文件');
136
+ }
137
+ const segButtons = $$('#page-memory .segmented button');
138
+ if (segButtons[0]) segButtons[0].classList.toggle('active', !data.useSqlite);
139
+ if (segButtons[1]) segButtons[1].classList.toggle('active', !!data.useSqlite);
129
140
  const migrateBtn = $('#migrateMemory');
130
141
  const switchBtn = $('#switchMd');
131
142
  if (migrateBtn) migrateBtn.hidden = !data.needsMigration;