dsh-reminder-notify 0.12.1 → 0.13.0
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/README.md +7 -0
- package/client.js +171 -9
- package/docs/PUBLISH.md +1 -1
- package/docs/detail.en.md +16 -9
- package/docs/detail.zh.md +15 -8
- package/index.js +15 -0
- package/package.json +1 -1
- package/publish/index.json +2 -2
package/README.md
CHANGED
|
@@ -42,6 +42,13 @@ dsh plugin --profile desktop add link:<本目录绝对路径>
|
|
|
42
42
|
`json` 通用 webhook / `text` 纯文本;`pushDecide` 管「需要你来决定」要不要推,`pushDigest` 管日报要不要推。
|
|
43
43
|
推送失败不影响桌面卡片,也不会拖慢 `notify_user`。
|
|
44
44
|
|
|
45
|
+
0.13 起设置面板只放「要改的东西」:
|
|
46
|
+
|
|
47
|
+
- 顶部一行状态摘要(位置 · 秒数 · 提示音,开了推送/日报再各加一段)+ 三个「试试看」按钮(完成卡 / 决定卡 / 通用卡),
|
|
48
|
+
点了就立刻弹一张样卡,二十秒自动关,不用等我真发。
|
|
49
|
+
- 常用两组直接展开:**基本**、**日报与推送**;其余四块(外观 / 提示音 / 排队与免打扰 / 历史·余额·宿主)收在「高级」里,点标题展开。
|
|
50
|
+
- 使用说明不再塞进面板,全部写在插件详情页(本插件的说明文档)里。
|
|
51
|
+
|
|
45
52
|
## 资产
|
|
46
53
|
|
|
47
54
|
| 东西 | 位置 |
|
package/client.js
CHANGED
|
@@ -252,6 +252,17 @@ window.__ModuleLoader__.load({
|
|
|
252
252
|
groupQueue: '排队与免打扰',
|
|
253
253
|
groupHistory: '历史与统计',
|
|
254
254
|
groupDigest: '日报与推送',
|
|
255
|
+
// 0.13:高频项在前,其余收进折叠块;说明搬到插件详情页。
|
|
256
|
+
groupAdvanced: '高级:历史、余额与宿主',
|
|
257
|
+
foldExpand: '展开',
|
|
258
|
+
foldCollapse: '收起',
|
|
259
|
+
tryTitle: '试试看:',
|
|
260
|
+
tryDone: '发一张完成卡',
|
|
261
|
+
tryDecide: '发一张决定卡',
|
|
262
|
+
tryRaw: '发一张通用卡',
|
|
263
|
+
tryShown: '已经弹出一张样卡,20 秒后自动关闭。',
|
|
264
|
+
tryQuiet: '现在在免打扰时段,样卡被拦住了(正常行为)。',
|
|
265
|
+
tryFailed: '没能弹出示意卡:',
|
|
255
266
|
speakEnabled: '朗读提醒内容',
|
|
256
267
|
buttonsEnabled: '卡片显示按钮',
|
|
257
268
|
snoozeMinutes: '「稍后提醒」延后分钟',
|
|
@@ -335,6 +346,16 @@ window.__ModuleLoader__.load({
|
|
|
335
346
|
groupQueue: 'Queue & quiet hours',
|
|
336
347
|
groupHistory: 'History & stats',
|
|
337
348
|
groupDigest: 'Digest & push',
|
|
349
|
+
groupAdvanced: 'Advanced: history, balance & host',
|
|
350
|
+
foldExpand: 'expand',
|
|
351
|
+
foldCollapse: 'collapse',
|
|
352
|
+
tryTitle: 'Try it:',
|
|
353
|
+
tryDone: 'Show a done card',
|
|
354
|
+
tryDecide: 'Show a decision card',
|
|
355
|
+
tryRaw: 'Show a plain card',
|
|
356
|
+
tryShown: 'A sample card is on screen; it closes itself in 20 seconds.',
|
|
357
|
+
tryQuiet: 'Quiet hours are active, so the sample was held back (expected).',
|
|
358
|
+
tryFailed: 'Could not show the sample: ',
|
|
338
359
|
speakEnabled: 'Speak the reminder',
|
|
339
360
|
buttonsEnabled: 'Show card buttons',
|
|
340
361
|
snoozeMinutes: 'Snooze minutes',
|
|
@@ -440,6 +461,14 @@ window.__ModuleLoader__.load({
|
|
|
440
461
|
.drn-btn.small { padding: 5px 10px; white-space: nowrap; }
|
|
441
462
|
.drn-msg { font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
442
463
|
.drn-msg.error { color: var(--dsw-alias-state-error-primary); }
|
|
464
|
+
.drn-summary { font-size: 12px; line-height: 1.55; color: var(--dsw-alias-label-secondary); border: 1px dashed var(--dsw-alias-border-l1); border-radius: 8px; padding: 8px 10px; }
|
|
465
|
+
.drn-try { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
466
|
+
.drn-try-title { font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
467
|
+
.drn-fold { border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }
|
|
468
|
+
.drn-fold-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-secondary); background: transparent; border: 0; padding: 10px 14px; cursor: pointer; text-align: left; }
|
|
469
|
+
.drn-fold-body { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
|
|
470
|
+
.drn-fold-body > .drn-group { border: 0; padding: 0; background: transparent; }
|
|
471
|
+
.drn-chevron { font-size: 11px; }
|
|
443
472
|
`
|
|
444
473
|
|
|
445
474
|
// 字段表:kind 决定控件类型,group 决定分组,缺省值来自宿主 config。
|
|
@@ -447,7 +476,7 @@ window.__ModuleLoader__.load({
|
|
|
447
476
|
{ key: 'seconds', group: 'basic', kind: 'number' },
|
|
448
477
|
{ key: 'position', group: 'basic', kind: 'select', options: ['br', 'center', 'tr'], optionLabels: ['positionBr', 'positionCenter', 'positionTr'] },
|
|
449
478
|
{ key: 'sound', group: 'basic', kind: 'boolean' },
|
|
450
|
-
{ key: 'cooldownMs', group: '
|
|
479
|
+
{ key: 'cooldownMs', group: 'host', kind: 'number' },
|
|
451
480
|
{ key: 'doneAudio', group: 'audio', kind: 'text' },
|
|
452
481
|
{ key: 'decideAudio', group: 'audio', kind: 'text' },
|
|
453
482
|
{ key: 'rawAudio', group: 'audio', kind: 'text' },
|
|
@@ -561,6 +590,16 @@ window.__ModuleLoader__.load({
|
|
|
561
590
|
const GROUPS = ['basic', 'audio', 'look', 'queue', 'history', 'digest', 'balance', 'host']
|
|
562
591
|
const GROUP_LABELS = { basic: 'groupBasic', audio: 'groupAudio', look: 'groupLook', queue: 'groupQueue', history: 'groupHistory', digest: 'groupDigest', balance: 'groupBalance', host: 'groupHost' }
|
|
563
592
|
|
|
593
|
+
// 0.13:面板分两层。常用层只放「不填就不对劲」的项,其余按主题收进四个折叠块。
|
|
594
|
+
const COMMON_DIGEST = ['pushEnabled', 'pushUrl', 'pushFormat', 'digestEnabled', 'digestTime']
|
|
595
|
+
const ADV_DIGEST = ['digestTitle', 'digestIncludeBalance', 'digestAlertCount', 'pushDecide', 'pushDigest']
|
|
596
|
+
const ADV_BLOCKS = [
|
|
597
|
+
{ id: 'look', label: 'groupLook', groups: ['look'] },
|
|
598
|
+
{ id: 'audio', label: 'groupAudio', groups: ['audio'] },
|
|
599
|
+
{ id: 'queue', label: 'groupQueue', groups: ['queue'] },
|
|
600
|
+
{ id: 'misc', label: 'groupAdvanced', groups: ['digest', 'history', 'balance', 'host'] },
|
|
601
|
+
]
|
|
602
|
+
|
|
564
603
|
function sameValue(a, b) {
|
|
565
604
|
return JSON.stringify(a) === JSON.stringify(b)
|
|
566
605
|
}
|
|
@@ -585,6 +624,9 @@ window.__ModuleLoader__.load({
|
|
|
585
624
|
const [historyBusy, setHistoryBusy] = React.useState(false)
|
|
586
625
|
const [digest, setDigest] = React.useState(null)
|
|
587
626
|
const [digestBusy, setDigestBusy] = React.useState(false)
|
|
627
|
+
// 0.13:折叠块的展开状态(默认全收起)与「试试看」的忙碌标记。
|
|
628
|
+
const [openBlocks, setOpenBlocks] = React.useState({})
|
|
629
|
+
const [tryBusy, setTryBusy] = React.useState(null)
|
|
588
630
|
|
|
589
631
|
React.useEffect(() => {
|
|
590
632
|
if (typeof fetch !== 'function') {
|
|
@@ -787,6 +829,52 @@ window.__ModuleLoader__.load({
|
|
|
787
829
|
})
|
|
788
830
|
}
|
|
789
831
|
|
|
832
|
+
// 0.13「试试看」:让宿主真的弹一张样卡(POST /preview,mode=card),
|
|
833
|
+
// 比读说明书更快知道每一档长什么样。样卡只停 20 秒,不改任何配置。
|
|
834
|
+
function tryCard(kind) {
|
|
835
|
+
if (tryBusy !== null) return
|
|
836
|
+
setTryBusy(kind)
|
|
837
|
+
setMessage(null)
|
|
838
|
+
Promise.resolve()
|
|
839
|
+
.then(() =>
|
|
840
|
+
fetch(PREVIEW_ROUTE, {
|
|
841
|
+
method: 'POST',
|
|
842
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
843
|
+
body: JSON.stringify({ mode: 'card', kind }),
|
|
844
|
+
}),
|
|
845
|
+
)
|
|
846
|
+
.then((response) => {
|
|
847
|
+
const status = response ? response.status : 0
|
|
848
|
+
const body = response && typeof response.json === 'function' ? response.json() : Promise.resolve(null)
|
|
849
|
+
return Promise.resolve(body)
|
|
850
|
+
.catch(() => null)
|
|
851
|
+
.then((data) => {
|
|
852
|
+
if (response && response.ok && data && data.ok !== false) return data
|
|
853
|
+
const detail = data && (data.detail || data.error) ? (data.detail || data.error) : 'HTTP ' + status
|
|
854
|
+
throw new Error(detail)
|
|
855
|
+
})
|
|
856
|
+
})
|
|
857
|
+
.then((data) => {
|
|
858
|
+
setTryBusy(null)
|
|
859
|
+
const label = typeof t === 'function' ? t : (key) => key
|
|
860
|
+
const card = data && data.card ? data.card : {}
|
|
861
|
+
if (card.ok === false) {
|
|
862
|
+
setMessage({ ok: false, text: label('tryFailed') + String(card.detail || card.error || '') })
|
|
863
|
+
return
|
|
864
|
+
}
|
|
865
|
+
if (card.skipped === 'quiet') {
|
|
866
|
+
setMessage({ ok: true, text: label('tryQuiet') })
|
|
867
|
+
return
|
|
868
|
+
}
|
|
869
|
+
setMessage({ ok: true, text: label('tryShown') })
|
|
870
|
+
})
|
|
871
|
+
.catch((error) => {
|
|
872
|
+
setTryBusy(null)
|
|
873
|
+
const prefix = typeof t === 'function' ? t('tryFailed') : 'cannot show a sample: '
|
|
874
|
+
setMessage({ ok: false, text: prefix + String((error && error.message) || error) })
|
|
875
|
+
})
|
|
876
|
+
}
|
|
877
|
+
|
|
790
878
|
// 余额:数字与「立即查询 / 重置基线」都走同一个路由(宿主侧问账号服务)。
|
|
791
879
|
function shortTime(ms) {
|
|
792
880
|
const n = Number(ms)
|
|
@@ -1072,8 +1160,11 @@ window.__ModuleLoader__.load({
|
|
|
1072
1160
|
return input
|
|
1073
1161
|
}
|
|
1074
1162
|
|
|
1075
|
-
|
|
1076
|
-
|
|
1163
|
+
// 一张分组卡片。allowed 有值时只渲染其中的键(用于把 digest 组拆成「常用」与「高级」两半)。
|
|
1164
|
+
const groupCard = (group, allowed, withExtras) => {
|
|
1165
|
+
const rows = FIELDS.filter(
|
|
1166
|
+
(field) => field.group === group && (allowed === undefined || allowed.includes(field.key)),
|
|
1167
|
+
).map((field) =>
|
|
1077
1168
|
h(
|
|
1078
1169
|
'div',
|
|
1079
1170
|
{ className: 'drn-row', key: field.key },
|
|
@@ -1088,7 +1179,7 @@ window.__ModuleLoader__.load({
|
|
|
1088
1179
|
h('div', { className: 'drn-control' }, control(field)),
|
|
1089
1180
|
),
|
|
1090
1181
|
)
|
|
1091
|
-
if (group === 'history') {
|
|
1182
|
+
if (withExtras !== false && group === 'history') {
|
|
1092
1183
|
const label = typeof t === 'function' ? t : (key) => key
|
|
1093
1184
|
rows.push(
|
|
1094
1185
|
h(
|
|
@@ -1132,7 +1223,7 @@ window.__ModuleLoader__.load({
|
|
|
1132
1223
|
)
|
|
1133
1224
|
}
|
|
1134
1225
|
}
|
|
1135
|
-
if (group === 'digest') {
|
|
1226
|
+
if (withExtras !== false && group === 'digest') {
|
|
1136
1227
|
const label = typeof t === 'function' ? t : (key) => key
|
|
1137
1228
|
rows.push(
|
|
1138
1229
|
h(
|
|
@@ -1149,19 +1240,19 @@ window.__ModuleLoader__.load({
|
|
|
1149
1240
|
{ className: 'drn-pick' },
|
|
1150
1241
|
h(
|
|
1151
1242
|
'button',
|
|
1152
|
-
{ type: 'button', className: 'drn-btn
|
|
1243
|
+
{ type: 'button', className: 'drn-btn drn-digest-btn', disabled: digestBusy, onClick: refreshDigest },
|
|
1153
1244
|
label('digestRefresh'),
|
|
1154
1245
|
),
|
|
1155
1246
|
h(
|
|
1156
1247
|
'button',
|
|
1157
|
-
{ type: 'button', className: 'drn-btn
|
|
1248
|
+
{ type: 'button', className: 'drn-btn drn-digest-btn', disabled: digestBusy, onClick: sendDigest },
|
|
1158
1249
|
label(digestBusy ? 'digestSending' : 'digestSend'),
|
|
1159
1250
|
),
|
|
1160
1251
|
),
|
|
1161
1252
|
),
|
|
1162
1253
|
)
|
|
1163
1254
|
}
|
|
1164
|
-
if (group === 'balance') {
|
|
1255
|
+
if (withExtras !== false && group === 'balance') {
|
|
1165
1256
|
rows.push(
|
|
1166
1257
|
h(
|
|
1167
1258
|
'div',
|
|
@@ -1198,8 +1289,76 @@ window.__ModuleLoader__.load({
|
|
|
1198
1289
|
h('div', { className: 'drn-group-title' }, typeof t === 'function' ? t(GROUP_LABELS[group]) : group),
|
|
1199
1290
|
rows,
|
|
1200
1291
|
)
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
const label = typeof t === 'function' ? t : (key) => key
|
|
1295
|
+
|
|
1296
|
+
// 一句话状态:让人不开任何折叠就知道现在是「哪儿、多久、有没有声、推送/日报开没开」。
|
|
1297
|
+
const summaryText = () => {
|
|
1298
|
+
const posKey = values.position === 'center' ? 'positionCenter' : values.position === 'tr' ? 'positionTr' : 'positionBr'
|
|
1299
|
+
const sound = values.sound === false ? label('soundOff') : label('soundOn')
|
|
1300
|
+
const secs = values.seconds === undefined || values.seconds === null ? 60 : values.seconds
|
|
1301
|
+
const parts = [`${label(posKey)} · ${secs}${label('secondsUnit')} · ${sound}`]
|
|
1302
|
+
if (values.pushEnabled === true) {
|
|
1303
|
+
const fmt =
|
|
1304
|
+
values.pushFormat === 'serverchan'
|
|
1305
|
+
? 'pushFormatServerchan'
|
|
1306
|
+
: values.pushFormat === 'json'
|
|
1307
|
+
? 'pushFormatJson'
|
|
1308
|
+
: values.pushFormat === 'text'
|
|
1309
|
+
? 'pushFormatText'
|
|
1310
|
+
: 'pushFormatWecom'
|
|
1311
|
+
parts.push(`${label('pushEnabled')} · ${label(fmt)}`)
|
|
1312
|
+
}
|
|
1313
|
+
if (values.digestEnabled === true) parts.push(`${label('digestEnabled')} · ${values.digestTime || '09:00'}`)
|
|
1314
|
+
return label('summaryPrefix') + parts.join(' · ')
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
const common = [groupCard('basic'), groupCard('digest', COMMON_DIGEST, true)]
|
|
1318
|
+
|
|
1319
|
+
const advanced = ADV_BLOCKS.map((block) => {
|
|
1320
|
+
const open = openBlocks[block.id] === true
|
|
1321
|
+
const children = block.groups.map((group) =>
|
|
1322
|
+
group === 'digest' ? groupCard('digest', ADV_DIGEST, false) : groupCard(group),
|
|
1323
|
+
)
|
|
1324
|
+
return h(
|
|
1325
|
+
'div',
|
|
1326
|
+
{ className: 'drn-fold', key: 'fold-' + block.id },
|
|
1327
|
+
h(
|
|
1328
|
+
'button',
|
|
1329
|
+
{
|
|
1330
|
+
type: 'button',
|
|
1331
|
+
className: 'drn-fold-head',
|
|
1332
|
+
onClick: () => setOpenBlocks(Object.assign({}, openBlocks, { [block.id]: !open })),
|
|
1333
|
+
},
|
|
1334
|
+
h('span', null, label(block.label)),
|
|
1335
|
+
h('span', { className: 'drn-chevron' }, open ? '▾ ' + label('foldCollapse') : '▸ ' + label('foldExpand')),
|
|
1336
|
+
),
|
|
1337
|
+
h('div', { className: 'drn-fold-body', style: open ? undefined : { display: 'none' } }, children),
|
|
1338
|
+
)
|
|
1201
1339
|
})
|
|
1202
1340
|
|
|
1341
|
+
const tryRow = h(
|
|
1342
|
+
'div',
|
|
1343
|
+
{ className: 'drn-try' },
|
|
1344
|
+
h('span', { className: 'drn-try-title' }, label('tryTitle')),
|
|
1345
|
+
h(
|
|
1346
|
+
'button',
|
|
1347
|
+
{ type: 'button', className: 'drn-btn drn-try-btn', disabled: tryBusy !== null, onClick: () => tryCard('done') },
|
|
1348
|
+
label('tryDone'),
|
|
1349
|
+
),
|
|
1350
|
+
h(
|
|
1351
|
+
'button',
|
|
1352
|
+
{ type: 'button', className: 'drn-btn drn-try-btn', disabled: tryBusy !== null, onClick: () => tryCard('decide') },
|
|
1353
|
+
label('tryDecide'),
|
|
1354
|
+
),
|
|
1355
|
+
h(
|
|
1356
|
+
'button',
|
|
1357
|
+
{ type: 'button', className: 'drn-btn drn-try-btn', disabled: tryBusy !== null, onClick: () => tryCard('raw') },
|
|
1358
|
+
label('tryRaw'),
|
|
1359
|
+
),
|
|
1360
|
+
)
|
|
1361
|
+
|
|
1203
1362
|
return h(
|
|
1204
1363
|
'div',
|
|
1205
1364
|
{ className: 'drn-panel' },
|
|
@@ -1208,8 +1367,11 @@ window.__ModuleLoader__.load({
|
|
|
1208
1367
|
{ className: 'drn-head' },
|
|
1209
1368
|
h('div', { className: 'drn-head-title' }, typeof t === 'function' ? t('title') : 'Desktop reminder settings'),
|
|
1210
1369
|
h('div', { className: 'drn-head-intro' }, typeof t === 'function' ? t(writable ? 'intro' : 'readonly') : ''),
|
|
1370
|
+
h('div', { className: 'drn-summary' }, summaryText()),
|
|
1211
1371
|
),
|
|
1212
|
-
|
|
1372
|
+
tryRow,
|
|
1373
|
+
common,
|
|
1374
|
+
advanced,
|
|
1213
1375
|
h(
|
|
1214
1376
|
'div',
|
|
1215
1377
|
{ className: 'drn-actions' },
|
package/docs/PUBLISH.md
CHANGED
|
@@ -12,7 +12,7 @@ DSH 的「插件市场 → 发现」页读的是**索引 URL**:一份 JSON(
|
|
|
12
12
|
| 索引地址(他人添加这个) | `https://jiangshuaiye1203.github.io/dsh-reminder-notify/publish/index.json` |
|
|
13
13
|
| 站点首页 | https://jiangshuaiye1203.github.io/dsh-reminder-notify/ |
|
|
14
14
|
| npm 包 | https://www.npmjs.com/package/dsh-reminder-notify |
|
|
15
|
-
| 当前版本 | **0.12.
|
|
15
|
+
| 当前版本 | **0.12.1**,装源为 **npm**(`dsh-reminder-notify@0.12.1`),不再是 git 固定提交 |
|
|
16
16
|
| Pages | Deploy from a branch,`main` / `(root)` |
|
|
17
17
|
|
|
18
18
|
发新版(npm 源):改代码 → 升 `package.json` 版本 → `scripts\publish-npm.cmd` 发布到 npm →
|
package/docs/detail.en.md
CHANGED
|
@@ -6,19 +6,26 @@ The card host is the bundled `host/ReminderHost.ps1`, drawn with the system Powe
|
|
|
6
6
|
|
|
7
7
|
## Settings
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The panel holds only what you might change; the instructions live on this page.
|
|
10
|
+
|
|
11
|
+
**Three small things at the top**
|
|
12
|
+
|
|
13
|
+
- A one-line status summary: position · duration · sound, plus `push · serverchan` and `digest · 09:00` when those are on
|
|
14
|
+
- **Try it** — three buttons (done card / decision card / plain card) so you can check position, colours and sound
|
|
15
|
+
without waiting for a real reminder. Each sample closes itself in 20 seconds
|
|
16
|
+
- **Save** / **Discard** at the bottom; saving applies immediately, no restart
|
|
17
|
+
|
|
18
|
+
**Common groups** (open by default)
|
|
10
19
|
|
|
11
20
|
- **Basics**: duration, position, sound on/off
|
|
12
|
-
- **
|
|
13
|
-
- **Look**: background image, title icon, accent colours, title/message templates (`{title}` `{message}` `{kind}` `{time}`), plus per-kind overrides for background, icon and templates
|
|
14
|
-
- **Queue & quiet hours**: spoken alerts, card buttons, snooze minutes, queue on/off and limit, merge window, quiet hours and their behaviour, compact card on fullscreen
|
|
15
|
-
- **History & stats**: record or not, entries kept, plus the total/today counts and the last 8 entries with "Refresh" and "Clear"
|
|
16
|
-
- **Digest & push**: daily digest (switch, time, title, include balance, alert threshold) and phone push (switch, URL, format, whether decisions and the digest are pushed); the panel previews today's digest text and can send one right now
|
|
17
|
-
- **Host**: script or exe host, script path, PowerShell path
|
|
21
|
+
- **Digest & push**: push switch, URL, format, digest switch, digest time; below it today's digest preview and a "send one now" button
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
**Advanced** (collapsed; click the header to expand)
|
|
20
24
|
|
|
21
|
-
- **
|
|
25
|
+
- **Look**: background image, title icon, accent colours, title/message templates (`{title}` `{message}` `{kind}` `{time}`), plus per-kind overrides
|
|
26
|
+
- **Sounds**: audio directory ("Browse…"), the three per-kind file names (wav / mp3)
|
|
27
|
+
- **Queue & quiet hours**: spoken alerts, card buttons, snooze minutes, queue on/off and limit, merge window, quiet hours and their behaviour, compact card on fullscreen
|
|
28
|
+
- **History, balance & host**: history switch and kept entries (with counts, last 8 entries, refresh / clear), DeepSeek balance (thresholds, interval, spoken alerts, check now, set baseline), host (script or exe, script path, PowerShell path, per-kind cooldown)
|
|
22
29
|
|
|
23
30
|
## Digest and phone push (0.12+)
|
|
24
31
|
|
package/docs/detail.zh.md
CHANGED
|
@@ -6,18 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
## 设置
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
面板只放「要改的东西」,说明都写在本页(你正在看的这一页)。
|
|
10
|
+
|
|
11
|
+
**最上面三件小事**
|
|
12
|
+
|
|
13
|
+
- 一行状态摘要:现在的位置 · 停留秒数 · 提示音开关;开了推送/日报会各加一段(`推送 · serverchan`、`日报 · 09:00`)
|
|
14
|
+
- 「试试看」三个按钮:**发一张完成卡 / 决定卡 / 通用卡**。二十秒后自动关,用来确认位置、配色、提示音是否合心意——不用等我真弹一张
|
|
15
|
+
- 「保存」/「放弃改动」在页面底部;保存即生效,不用重启
|
|
16
|
+
|
|
17
|
+
**常用的两组**(打开就能改)
|
|
10
18
|
|
|
11
19
|
- **基本**:停留秒数、弹窗位置、是否播放提示音
|
|
12
|
-
-
|
|
20
|
+
- **日报与推送**:推送开关、地址、格式、日报开关、日报时间;下面能预览今天的日报全文,也能「现在发一条」立刻试一次推送
|
|
21
|
+
|
|
22
|
+
**高级**(默认收起,点标题展开)
|
|
23
|
+
|
|
13
24
|
- **外观**:背景图、标题图标、强调色、标题/正文模板(`{title}` `{message}` `{kind}` `{time}`),以及每档位单独覆盖的背景 / 图标 / 模板
|
|
25
|
+
- **提示音**:提示音目录(可点「浏览…」选目录)、三档提示音文件名(wav / mp3),选了目录后下拉框会列出目录里的音频
|
|
14
26
|
- **排队与免打扰**:语音朗读、卡片按钮、「稍后提醒」分钟数、排队开关与上限、合并窗口、免打扰时段与处理方式、全屏时用紧凑卡片
|
|
15
|
-
-
|
|
16
|
-
- **日报与推送**:每日日报(开关、时间、标题、是否带余额、条数预警阈值)、手机推送(开关、地址、格式、「需要你来决定」与日报是否也推);面板里能预览今天的日报全文,也能「现在发一条」
|
|
17
|
-
- **DeepSeek 余额**:开关、阈值(默认 20,10,5 %)、检查间隔、是否语音播报;面板里能「立即查询」,也能把当前余额设为基线
|
|
18
|
-
- **宿主**:脚本模式或 exe 模式、脚本路径、PowerShell 路径
|
|
19
|
-
|
|
20
|
-
改完点「保存」,立刻生效,不用重启。
|
|
27
|
+
- **历史、余额与宿主**:历史记录开关与保留条数(含统计与最近 8 条、刷新 / 清空)、DeepSeek 余额提醒(阈值、检查间隔、语音播报、立即查询、设为基线)、宿主(脚本或 exe 模式、脚本路径、PowerShell 路径、同档位冷却)
|
|
21
28
|
|
|
22
29
|
## 日报与手机推送(0.12 起)
|
|
23
30
|
|
package/index.js
CHANGED
|
@@ -978,6 +978,21 @@ function registerPreviewRoute(ctx, getSettings) {
|
|
|
978
978
|
if (!['done', 'decide', 'raw'].includes(kind)) {
|
|
979
979
|
return reply(res, 400, { ok: false, error: `unknown kind: ${kind}` })
|
|
980
980
|
}
|
|
981
|
+
// 面板上的「试试看」:mode=card 时真的弹一张样卡,比只播提示音更能说明效果。
|
|
982
|
+
if (str(body?.mode, 'audio') === 'card') {
|
|
983
|
+
const settings = getSettings()
|
|
984
|
+
const sample = {
|
|
985
|
+
done: '这是一张「完成」卡:任务做完时这样弹,带提示音、按钮,到点自己消失。',
|
|
986
|
+
decide: '这是一张「需要你决定」卡:等你拍板时这样弹。',
|
|
987
|
+
raw: '这是一张通用提醒卡,标题和正文都由调用方给。',
|
|
988
|
+
}[kind]
|
|
989
|
+
const card = await notify(
|
|
990
|
+
kind,
|
|
991
|
+
{ message: sample, seconds: Math.min(num(settings.seconds, 60), 20) },
|
|
992
|
+
{ ...settings, quietEnabled: false },
|
|
993
|
+
)
|
|
994
|
+
return reply(res, 200, { ok: true, mode: 'card', kind, card })
|
|
995
|
+
}
|
|
981
996
|
const result = await previewAudio(kind, getSettings())
|
|
982
997
|
if (result.ok) return reply(res, 200, result)
|
|
983
998
|
const status = result.error === 'no-audio' || result.error === 'audio-not-found' ? 400 : 500
|
package/package.json
CHANGED