dsh-project-deck 0.1.5 → 0.1.7
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.
|
Binary file
|
package/backend/panel.html
CHANGED
|
@@ -184,20 +184,20 @@
|
|
|
184
184
|
<div class="hint" id="imgHint" style="margin-top:6px"></div>
|
|
185
185
|
</div>
|
|
186
186
|
|
|
187
|
-
<div class="controls" id="wxBox" style="padding:10px
|
|
188
|
-
<
|
|
189
|
-
<select id="wxType" onchange="onWxTypeChange()" style="font-size:12px;padding:
|
|
187
|
+
<div class="controls" id="wxBox" style="padding:5px 10px;gap:8px;min-height:0">
|
|
188
|
+
<i class="dot" id="wxDot"></i><b id="wxTitle" style="font-size:12px;color:var(--muted);font-weight:600">通知</b>
|
|
189
|
+
<select id="wxType" onchange="onWxTypeChange()" style="font-size:12px;padding:3px 6px;height:26px">
|
|
190
190
|
<option value="ilink">内置微信(扫码)</option>
|
|
191
191
|
<option value="wxpush">wxpush 网关</option>
|
|
192
192
|
<option value="serverchan">ServerChan</option>
|
|
193
193
|
<option value="webhook">Webhook</option>
|
|
194
194
|
<option value="command">自定义命令</option>
|
|
195
195
|
</select>
|
|
196
|
-
<input id="wxField" placeholder="" style="flex:1;min-width:
|
|
197
|
-
<button class="ghost" id="wxSaveBtn" onclick="saveWx()" style="display:none">保存</button>
|
|
198
|
-
<span class="hint" id="wxDetail"></span>
|
|
199
|
-
<button class="ghost" id="wxLoginBtn" onclick="wxLogin()" style="display:none">连接微信</button>
|
|
200
|
-
<button class="ghost" id="wxLogoutBtn" onclick="wxLogout()" style="display:none">断开</button>
|
|
196
|
+
<input id="wxField" placeholder="" style="flex:1;min-width:120px;height:26px;padding:3px 8px;font-size:12px;display:none">
|
|
197
|
+
<button class="ghost" id="wxSaveBtn" onclick="saveWx()" style="display:none;padding:3px 10px;font-size:12px">保存</button>
|
|
198
|
+
<span class="hint" id="wxDetail" style="flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11.5px"></span>
|
|
199
|
+
<button class="ghost" id="wxLoginBtn" onclick="wxLogin()" style="display:none;padding:3px 10px;font-size:12px">连接微信</button>
|
|
200
|
+
<button class="ghost" id="wxLogoutBtn" onclick="wxLogout()" style="display:none;padding:3px 10px;font-size:12px">断开</button>
|
|
201
201
|
</div>
|
|
202
202
|
<div id="wxQrWrap" style="display:none;margin:-6px 0 18px;display:none">
|
|
203
203
|
<div style="display:flex;gap:14px;align-items:center;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:12px">
|
|
@@ -357,7 +357,11 @@ function render(){
|
|
|
357
357
|
const banner = $('wxBanner');
|
|
358
358
|
if (banner) {
|
|
359
359
|
banner.style.display = wxStale ? 'block' : 'none';
|
|
360
|
-
if (wxStale)
|
|
360
|
+
if (wxStale) {
|
|
361
|
+
banner.innerHTML = (WX && WX.mode === 'ilink')
|
|
362
|
+
? '⚠️ 微信还没连接:点下面「连接微信」扫码,<b>扫码后还要在微信里给 bot 发一句话</b>,之后播报就能推送到微信。'
|
|
363
|
+
: '⚠️ 微信通道 context_token 已过期:这段时间的播报<b>不会排队堆积</b>。在微信里给 bot 发任意一句话,下一轮播报自动恢复。';
|
|
364
|
+
}
|
|
361
365
|
}
|
|
362
366
|
$('nextText').textContent = S.daemon.nextRun ? shortTime(S.daemon.nextRun) : '—';
|
|
363
367
|
|
|
@@ -929,6 +933,13 @@ async function loadImages(){
|
|
|
929
933
|
}catch(e){ /* 忽略 */ }
|
|
930
934
|
}
|
|
931
935
|
|
|
936
|
+
document.addEventListener('keydown', (e) => {
|
|
937
|
+
if (e.key !== 'Escape') return;
|
|
938
|
+
if (window.parent && window.parent !== window) {
|
|
939
|
+
window.parent.postMessage({ type: 'deck:close' }, '*');
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
|
|
932
943
|
async function refresh(){
|
|
933
944
|
try{
|
|
934
945
|
const r = await fetch('/api/state'); S = await r.json();
|
package/backend/panel.py
CHANGED
|
@@ -47,6 +47,16 @@ P = load_deck()
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
# ── 数据汇总 ────────────────────────────────────────────────
|
|
50
|
+
def channel_stale_now():
|
|
51
|
+
d = P.delivery_cfg()
|
|
52
|
+
if d['type'] == 'ilink':
|
|
53
|
+
w = P.wechat_status()
|
|
54
|
+
return not (w['logged'] and w['hasContext'])
|
|
55
|
+
if d['type'] == 'wxpush':
|
|
56
|
+
return P.channel_stale()
|
|
57
|
+
return not P.delivery_status().get('ok')
|
|
58
|
+
|
|
59
|
+
|
|
50
60
|
def wechat_view():
|
|
51
61
|
d = P.delivery_cfg()
|
|
52
62
|
if d['type'] == 'ilink':
|
|
@@ -127,7 +137,7 @@ def snapshot():
|
|
|
127
137
|
'daemon': {'running': bool(P.daemon_status()), 'pid': P.daemon_status() or 0,
|
|
128
138
|
'lastRun': last, 'nextRun': (last + interval * 3600) if last else 0},
|
|
129
139
|
'wechat': dict(wechat_state(),
|
|
130
|
-
stale=
|
|
140
|
+
stale=channel_stale_now(),
|
|
131
141
|
fails=P.channel_state().get('fails', 0),
|
|
132
142
|
lastError=P.channel_state().get('lastError', '')),
|
|
133
143
|
'counts': {
|
|
@@ -784,6 +794,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|
|
784
794
|
self.send_header('Content-Type', 'application/json; charset=utf-8')
|
|
785
795
|
self.send_header('Content-Length', str(len(body)))
|
|
786
796
|
self.send_header('Access-Control-Allow-Origin', '*')
|
|
797
|
+
self.send_header('Cache-Control', 'no-store')
|
|
787
798
|
self.end_headers()
|
|
788
799
|
self.wfile.write(body)
|
|
789
800
|
|
|
@@ -796,6 +807,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|
|
796
807
|
self.send_response(200)
|
|
797
808
|
self.send_header('Content-Type', 'text/html; charset=utf-8')
|
|
798
809
|
self.send_header('Content-Length', str(len(body)))
|
|
810
|
+
self.send_header('Cache-Control', 'no-store')
|
|
799
811
|
self.end_headers()
|
|
800
812
|
self.wfile.write(body)
|
|
801
813
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-project-deck",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "DeepSeek Harness plugin: a project deck for your repos — registry, dashboard, scheduled WeChat reports, auto-discovery, multi-node scanning.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|