@laraveladmin/dsh-stay-awake 0.2.1 → 0.2.3
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 +15 -0
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/client.js +15 -19
- package/docs/images/indicator.svg +1 -0
- package/docs/images/panel.svg +2 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# 变更记录 · Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.3 — 2026-12-03
|
|
4
|
+
|
|
5
|
+
### 修复
|
|
6
|
+
|
|
7
|
+
- 状态栏字号恢复为 12px(`--dsh-content-font-size-secondary - 1px`):0.2.1 改成宿主 pill 的
|
|
8
|
+
`font: inherit` 后继承了比之前更大的 dock 字体。
|
|
9
|
+
- 恢复状态小圆点标记(绿=保持中、红=异常/未知),此前在对齐样式的重写中被去掉。
|
|
10
|
+
|
|
11
|
+
## 0.2.2 — 2026-12-03
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
|
|
15
|
+
- 按实际宿主浮层(如「Token 用量」)再对齐:标题行右侧数值使用 `label-primary`,
|
|
16
|
+
去掉自加的关闭按钮(与宿主一致:Esc / 点外部关闭),移除分组间的额外界线,只保留标题下一条细分隔线。
|
|
17
|
+
|
|
3
18
|
## 0.2.1 — 2026-12-03
|
|
4
19
|
|
|
5
20
|
### 修复
|
package/README.en.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`@laraveladmin/dsh-stay-awake` · macOS / Windows / Linux
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
|
-
<img alt="version" src="https://img.shields.io/badge/version-0.2.
|
|
10
|
+
<img alt="version" src="https://img.shields.io/badge/version-0.2.3-blue">
|
|
11
11
|
<img alt="platform" src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-4c6ef5">
|
|
12
12
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-green">
|
|
13
13
|
</p>
|
|
@@ -63,7 +63,7 @@ A short alert when a task finishes, played on the machine that runs the DSH host
|
|
|
63
63
|
|
|
64
64
|
**Requirements**: DSH 0.2.x (Desktop or `dsh web`). The plugin has no third-party runtime dependencies and needs no Node toolchain.
|
|
65
65
|
|
|
66
|
-
Published on npm: [`@laraveladmin/dsh-stay-awake@0.2.
|
|
66
|
+
Published on npm: [`@laraveladmin/dsh-stay-awake@0.2.3`](https://www.npmjs.com/package/@laraveladmin/dsh-stay-awake)
|
|
67
67
|
|
|
68
68
|
### Option 1 — install from npm (recommended)
|
|
69
69
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`@laraveladmin/dsh-stay-awake` · macOS / Windows / Linux
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
|
-
<img alt="version" src="https://img.shields.io/badge/version-0.2.
|
|
10
|
+
<img alt="version" src="https://img.shields.io/badge/version-0.2.3-blue">
|
|
11
11
|
<img alt="platform" src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-4c6ef5">
|
|
12
12
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-green">
|
|
13
13
|
</p>
|
|
@@ -64,7 +64,7 @@ DSH 跑长任务时你离开电脑,系统按空闲策略休眠:进程被挂
|
|
|
64
64
|
|
|
65
65
|
**前置条件**:DSH 0.2.x(Desktop 或 `dsh web`)。插件零第三方运行时依赖,不需要 Node 工具链。
|
|
66
66
|
|
|
67
|
-
已发布到 npm:[`@laraveladmin/dsh-stay-awake@0.2.
|
|
67
|
+
已发布到 npm:[`@laraveladmin/dsh-stay-awake@0.2.3`](https://www.npmjs.com/package/@laraveladmin/dsh-stay-awake)
|
|
68
68
|
|
|
69
69
|
### 方式一:从 npm 安装(推荐)
|
|
70
70
|
|
package/client.js
CHANGED
|
@@ -63,7 +63,6 @@ window.__ModuleLoader__.load({
|
|
|
63
63
|
'panel.saved': '已保存',
|
|
64
64
|
'panel.saveFailed': '保存失败,请重试',
|
|
65
65
|
'panel.staleHost': '宿主端未加载最新版本:请在插件页禁用再启用「守夜」,或重启 DSH',
|
|
66
|
-
'panel.close': '关闭',
|
|
67
66
|
'panel.advanced': '防抖、兜底时长等高级参数在 profile 的 cordis.patch.yml 中配置',
|
|
68
67
|
'panel.repo': '打开代码仓库',
|
|
69
68
|
'panel.npm': '在 npm 查看该版本',
|
|
@@ -107,19 +106,19 @@ window.__ModuleLoader__.load({
|
|
|
107
106
|
'panel.saved': 'Saved',
|
|
108
107
|
'panel.saveFailed': 'Could not save, please retry',
|
|
109
108
|
'panel.staleHost': 'The host half is running an older build: disable and re-enable Stay awake in Plugins, or restart DSH',
|
|
110
|
-
'panel.close': 'Close',
|
|
111
109
|
'panel.advanced': 'Debounce, hold cap and other advanced options live in the profile cordis.patch.yml',
|
|
112
110
|
'panel.repo': 'Open the source repository',
|
|
113
111
|
'panel.npm': 'View this version on npm',
|
|
114
112
|
}
|
|
115
113
|
|
|
116
114
|
const CSS = `
|
|
117
|
-
.dsa-pill{box-sizing:border-box;border-radius:var(--dsw-radius-sm);max-width:100%;color:var(--dsw-alias-label-tertiary);font:inherit;font-variant-numeric:tabular-nums;
|
|
115
|
+
.dsa-pill{box-sizing:border-box;border-radius:var(--dsw-radius-sm);max-width:100%;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:calc(var(--dsh-content-font-size-secondary,13px) - 1px);line-height:calc(20px + var(--dsh-content-font-delta-secondary,0px));font-variant-numeric:tabular-nums;white-space:nowrap;background:0 0;border:none;align-items:center;gap:6px;padding:1px 8px;display:inline-flex;cursor:pointer;anchor-name:--dsh-stay-awake-panel}
|
|
118
116
|
.dsa-pill[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}
|
|
119
117
|
@media (hover:hover){.dsa-pill:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}}
|
|
120
118
|
.dsa-pill:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}
|
|
121
119
|
.dsa-pill svg{flex:none;width:14px;height:14px}
|
|
122
120
|
.dsa-label{text-overflow:ellipsis;min-width:0;overflow:hidden}
|
|
121
|
+
.dsa-dot{width:5px;height:5px;border-radius:50%;flex:none}
|
|
123
122
|
.dsa-panel{position:fixed;left:50%;bottom:150px;transform:translateX(-50%);z-index:1100;box-sizing:border-box;border:0;border-radius:var(--dsw-radius-lg);background:var(--dsw-specific-menu);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-secondary);width:max-content;min-width:min(300px,100vw - 24px);max-width:min(440px,100vw - 24px);max-height:calc(100dvh - 24px);overflow:hidden auto;margin:0;padding:16px;font-size:12px;line-height:18px;cursor:default;pointer-events:auto;text-align:left}
|
|
124
123
|
@supports (position-anchor: --dsh-stay-awake-panel){
|
|
125
124
|
.dsa-panel{position-anchor:--dsh-stay-awake-panel;top:max(12px, var(--dsh-frame-overlay-top,12px));bottom:max(12px, calc(anchor(top) + 8px));left:max(12px, anchor(left));right:12px;transform:none;position-try-fallbacks:flip-block, flip-inline;max-height:calc(100dvh - 12px - max(12px, var(--dsh-frame-overlay-top,12px)))}
|
|
@@ -127,15 +126,15 @@ window.__ModuleLoader__.load({
|
|
|
127
126
|
.dsa-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px;color:var(--dsw-alias-label-primary);font-weight:500}
|
|
128
127
|
.dsa-head-label{display:inline-flex;align-items:center;gap:6px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
129
128
|
.dsa-head-label svg{flex:none;width:14px;height:14px}
|
|
130
|
-
.dsa-head-value{display:inline-flex;align-items:center;gap:8px;color:var(--dsw-alias-label-
|
|
129
|
+
.dsa-head-value{display:inline-flex;align-items:center;gap:8px;color:var(--dsw-alias-label-primary);font-weight:400;flex:none}
|
|
131
130
|
.dsa-state{font-variant-numeric:tabular-nums}
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
|
|
132
|
+
|
|
134
133
|
.dsa-rule{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 0 10px}
|
|
135
134
|
.dsa-grid{display:grid;grid-template-columns:minmax(76px,auto) minmax(0,1fr);gap:6px 16px;margin:0}
|
|
136
135
|
.dsa-key{color:var(--dsw-alias-label-tertiary);margin:0;min-width:0}
|
|
137
136
|
.dsa-val{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;text-align:right;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
138
|
-
.dsa-section{margin-top:14px
|
|
137
|
+
.dsa-section{margin-top:14px}
|
|
139
138
|
.dsa-row{display:flex;align-items:center;gap:12px;min-height:24px}
|
|
140
139
|
.dsa-row+.dsa-row{margin-top:6px}
|
|
141
140
|
.dsa-grow{flex:1 1 auto;min-width:0}
|
|
@@ -317,6 +316,14 @@ window.__ModuleLoader__.load({
|
|
|
317
316
|
},
|
|
318
317
|
h(Moon, { key: 'icon', color: toneColor(view.tone) }),
|
|
319
318
|
h('span', { key: 'label', className: 'dsa-label' }, `${t('brand')} · ${t(`state.${view.key}`)}`),
|
|
319
|
+
view.tone === 'idle'
|
|
320
|
+
? null
|
|
321
|
+
: h('span', {
|
|
322
|
+
key: 'dot',
|
|
323
|
+
className: 'dsa-dot',
|
|
324
|
+
'aria-hidden': true,
|
|
325
|
+
style: { background: toneColor(view.tone) },
|
|
326
|
+
}),
|
|
320
327
|
),
|
|
321
328
|
)
|
|
322
329
|
}
|
|
@@ -394,18 +401,7 @@ window.__ModuleLoader__.load({
|
|
|
394
401
|
h(Moon, { key: 'icon', color: toneColor(view.tone) }),
|
|
395
402
|
t('brand'),
|
|
396
403
|
),
|
|
397
|
-
h(
|
|
398
|
-
'span',
|
|
399
|
-
{ className: 'dsa-head-value' },
|
|
400
|
-
h('span', { className: 'dsa-state' }, t(`state.${view.key}`)),
|
|
401
|
-
h('button', {
|
|
402
|
-
type: 'button',
|
|
403
|
-
className: 'dsa-close',
|
|
404
|
-
title: t('panel.close'),
|
|
405
|
-
'aria-label': t('panel.close'),
|
|
406
|
-
onClick: () => store.close(),
|
|
407
|
-
}, '×'),
|
|
408
|
-
),
|
|
404
|
+
h('span', { className: 'dsa-head-value' }, h('span', { className: 'dsa-state' }, t(`state.${view.key}`))),
|
|
409
405
|
),
|
|
410
406
|
h('div', { className: 'dsa-rule', key: 'rule' }),
|
|
411
407
|
staleHost || snapshot.notice === 'stale'
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<g transform="translate(258,46)">
|
|
11
11
|
<path d="M9 1.5a6 6 0 1 0 3.7 9A4.9 4.9 0 0 1 9 1.5z" fill="#22c55e" transform="scale(1.1)"/>
|
|
12
12
|
<text x="17" y="16" font-family="PingFang SC, Noto Sans SC, Helvetica, Arial, sans-serif" font-size="12" fill="#9aa0a8">守夜 · 保持中</text>
|
|
13
|
+
<circle cx="104" cy="11" r="2.6" fill="#22c55e"/>
|
|
13
14
|
</g>
|
|
14
15
|
|
|
15
16
|
<line x1="300" y1="40" x2="300" y2="30" stroke="#c9ced6"/>
|
package/docs/images/panel.svg
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<!-- title row -->
|
|
32
32
|
<path d="M46 90a7 7 0 1 0 4.4 10.5A5.8 5.8 0 0 1 46 90z" fill="#22c55e"/>
|
|
33
33
|
<text class="t title" x="62" y="101">守夜</text>
|
|
34
|
-
<text class="
|
|
34
|
+
<text class="t" x="300" y="101" text-anchor="end" font-size="13" fill="#111827">保持中</text>
|
|
35
35
|
<text class="t" x="352" y="102" text-anchor="middle" font-size="15" fill="#9aa0a8">×</text>
|
|
36
36
|
|
|
37
37
|
<line class="rule" x1="46" y1="114" x2="374" y2="114"/>
|
|
@@ -42,8 +42,6 @@
|
|
|
42
42
|
<text class="key" x="46" y="186">后端</text><text class="val" x="374" y="186" text-anchor="end">caffeinate</text>
|
|
43
43
|
<text class="key" x="46" y="210">已持续</text><text class="val" x="374" y="210" text-anchor="end">00:12:31</text>
|
|
44
44
|
|
|
45
|
-
<line class="rule" x1="46" y1="232" x2="374" y2="232"/>
|
|
46
|
-
|
|
47
45
|
<!-- switches -->
|
|
48
46
|
<text class="label" x="46" y="258">总开关</text>
|
|
49
47
|
<rect x="340" y="247" width="34" height="18" rx="9" fill="#22c55e"/>
|
|
@@ -60,8 +58,6 @@
|
|
|
60
58
|
<rect x="340" y="319" width="34" height="18" rx="9" fill="#22c55e"/>
|
|
61
59
|
<circle cx="365" cy="328" r="6" fill="#ffffff"/>
|
|
62
60
|
|
|
63
|
-
<line class="rule" x1="46" y1="348" x2="374" y2="348"/>
|
|
64
|
-
|
|
65
61
|
<!-- hold -->
|
|
66
62
|
<text class="sub" x="46" y="368">临时保持</text>
|
|
67
63
|
<rect x="46" y="376" width="64" height="22" rx="6" fill="#f3f4f6"/>
|
|
@@ -72,6 +68,6 @@
|
|
|
72
68
|
<line class="rule" x1="46" y1="410" x2="374" y2="410"/>
|
|
73
69
|
<text class="sub" x="46" y="428">防抖、音效等高级参数在 cordis.patch.yml 中配置</text>
|
|
74
70
|
<path d="M332 419 l-3 3.2 3 3.2 M338 419 l3 3.2 -3 3.2" fill="none" stroke="#9aa0a8" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
75
|
-
<text class="sub" x="352" y="428">v0.2.
|
|
71
|
+
<text class="sub" x="352" y="428">v0.2.2</text>
|
|
76
72
|
</g>
|
|
77
73
|
</svg>
|