dsh-plugin-trim 0.3.8 → 0.3.9
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 +1 -1
- package/client.js +198 -50
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ npm i dsh-plugin-trim
|
|
|
13
13
|
从 GitHub Release 安装(备用):
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm i "https://github.com/Starlit-Sky-code/dsh-experience-optimizer/releases/download/v0.3.
|
|
16
|
+
npm i "https://github.com/Starlit-Sky-code/dsh-experience-optimizer/releases/download/v0.3.9/dsh-plugin-trim-0.3.9.tgz"
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
本地包:
|
package/client.js
CHANGED
|
@@ -214,17 +214,17 @@ window.__ModuleLoader__.load({
|
|
|
214
214
|
.eo-tabs::-webkit-scrollbar{display:none}
|
|
215
215
|
.eo-tab{appearance:none;border:0;background:transparent;color:var(--eo-tertiary);font:inherit;font-size:13px;line-height:20px;padding:7px 1px 9px;cursor:pointer;position:relative;border-radius:0;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
|
|
216
216
|
.eo-icon{flex:0 0 auto}
|
|
217
|
-
.eo-progress-track{display:block;width:100%;min-width:40px;height:
|
|
218
|
-
.eo-progress-track i{display:block;height:100%;border-radius:
|
|
219
|
-
.eo-severity-bar{display:flex;gap:3px;height:
|
|
220
|
-
.eo-severity-bar span{display:block;height:100%;border-radius:
|
|
217
|
+
.eo-progress-track{display:block;width:100%;min-width:40px;height:6px;border-radius:6px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.1));overflow:hidden;margin-top:7px;box-shadow:inset 0 0 0 .5px var(--eo-border)}
|
|
218
|
+
.eo-progress-track i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--eo-primary),color-mix(in srgb,var(--eo-primary) 55%,var(--dsw-alias-state-business-primary,#4a7fd6)));transition:width .45s var(--eo-ease,cubic-bezier(.16,1,.3,1));min-width:2px}
|
|
219
|
+
.eo-severity-bar{display:flex;gap:3px;height:8px;margin:0 0 8px;border-radius:5px;overflow:hidden;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.1))}
|
|
220
|
+
.eo-severity-bar span{display:block;height:100%;border-radius:4px}
|
|
221
221
|
.eo-severity-error{background:var(--eo-error)}
|
|
222
222
|
.eo-severity-warn{background:var(--dsw-alias-state-warning-primary,#9a6700)}
|
|
223
223
|
.eo-severity-info{background:var(--dsw-alias-state-business-primary,#4a7fd6)}
|
|
224
224
|
.eo-severity-empty{background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.12));flex:1}
|
|
225
|
-
.eo-progress-ok i{background:var(--eo-success)}
|
|
226
|
-
.eo-progress-warn i{background:var(--dsw-alias-state-warning-primary,#9a6700)}
|
|
227
|
-
.eo-progress-danger i{background:var(--eo-error)}
|
|
225
|
+
.eo-progress-ok i{background:linear-gradient(90deg,var(--eo-success),color-mix(in srgb,var(--eo-success) 65%,var(--dsw-alias-state-business-primary,#4a7fd6)))}
|
|
226
|
+
.eo-progress-warn i{background:linear-gradient(90deg,var(--dsw-alias-state-warning-primary,#9a6700),var(--amber,#fbbf24))}
|
|
227
|
+
.eo-progress-danger i{background:linear-gradient(90deg,var(--eo-error),color-mix(in srgb,var(--eo-error) 70%,var(--dsw-alias-state-warning-primary,#9a6700)))}
|
|
228
228
|
.eo-progress-dots{display:flex;gap:6px;align-items:center;margin:12px 0 2px}
|
|
229
229
|
.eo-progress-dot{width:6px;height:6px;border-radius:50%;background:var(--eo-border-strong)}
|
|
230
230
|
.eo-progress-dot-active{width:18px;border-radius:4px;background:var(--eo-primary)}
|
|
@@ -294,27 +294,27 @@ window.__ModuleLoader__.load({
|
|
|
294
294
|
.eo-inventory-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
|
|
295
295
|
.eo-inventory-card code{font:400 11px/16px var(--eo-code);word-break:break-all;color:var(--eo-secondary)}
|
|
296
296
|
.eo-inventory-card-meta{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px;color:var(--eo-tertiary);font-size:11px}
|
|
297
|
-
.eo-main-guide{position:fixed;
|
|
298
|
-
.eo-guide-beacon{position:fixed;left:18px;bottom:
|
|
299
|
-
.eo-guide-beacon span{padding:
|
|
297
|
+
.eo-main-guide{position:fixed;left:18px;right:auto;bottom:150px;z-index:30;box-sizing:border-box;width:min(380px,calc(100vw - 32px));padding:16px 18px;border:.5px solid var(--dsw-alias-border-l4,rgba(127,127,127,.25));border-radius:14px;background:var(--dsw-alias-bg-layer-1,#fff);box-shadow:0 14px 44px rgba(0,0,0,.2);color:var(--eo-primary);font-size:14px;line-height:22px}
|
|
298
|
+
.eo-guide-beacon{position:fixed;left:18px;bottom:84px;z-index:31;display:flex;flex-direction:column;align-items:center;gap:2px;color:var(--eo-primary);pointer-events:none;font-size:12px;line-height:17px}
|
|
299
|
+
.eo-guide-beacon span{padding:2px 8px;border-radius:5px;background:var(--dsw-alias-bg-layer-1,#fff);border:.5px solid var(--eo-border-strong);box-shadow:0 4px 14px rgba(0,0,0,.12)}
|
|
300
300
|
.eo-guide-beacon .eo-icon{color:var(--eo-primary);animation:eo-guide-bob 1.6s ease-in-out infinite}
|
|
301
301
|
@keyframes eo-guide-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(5px)}}
|
|
302
|
-
.eo-guide-arrow{position:absolute;left
|
|
303
|
-
.eo-guide-kicker{margin:0 0
|
|
304
|
-
.eo-main-guide h3{margin:0 0
|
|
305
|
-
.eo-guide-path{display:flex;align-items:center;gap:
|
|
306
|
-
.eo-guide-path span{padding:2px
|
|
302
|
+
.eo-guide-arrow{position:absolute;left:6px;top:auto;bottom:-27px;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:var(--dsw-alias-button-primary-fill,var(--eo-primary));color:var(--dsw-alias-label-primary-inverted,#fff);box-shadow:0 8px 20px rgba(0,0,0,.18)}
|
|
303
|
+
.eo-guide-kicker{margin:0 0 4px;color:var(--eo-tertiary);font:500 11px/17px var(--eo-code);letter-spacing:.12em}
|
|
304
|
+
.eo-main-guide h3{margin:0 0 9px;font-size:18px;line-height:26px}
|
|
305
|
+
.eo-guide-path{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 9px;font-size:13px;line-height:20px;font-weight:500}
|
|
306
|
+
.eo-guide-path span{padding:2px 8px;border-radius:5px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.08))}
|
|
307
307
|
.eo-guide-path i{font-style:normal;color:var(--eo-tertiary)}
|
|
308
|
-
.eo-guide-note{margin:0;color:var(--eo-tertiary);font-size:
|
|
309
|
-
.eo-guide-steps{max-height:
|
|
310
|
-
.eo-guide-steps li{display:flex;gap:
|
|
311
|
-
.eo-guide-steps b{font:500
|
|
312
|
-
.eo-guide-steps span{flex:0 0 auto;font-weight:500;font-size:
|
|
313
|
-
.eo-guide-steps small{color:var(--eo-tertiary);font-size:
|
|
308
|
+
.eo-guide-note{margin:0;color:var(--eo-tertiary);font-size:12.5px;line-height:19px}
|
|
309
|
+
.eo-guide-steps{max-height:180px;overflow:auto;margin:11px 0 0;padding:0;list-style:none;border-top:.5px solid var(--eo-border)}
|
|
310
|
+
.eo-guide-steps li{display:flex;gap:8px;align-items:flex-start;padding:8px 0;border-bottom:.5px solid var(--eo-border)}
|
|
311
|
+
.eo-guide-steps b{font:500 11px/19px var(--eo-code);color:var(--eo-tertiary);flex:0 0 auto}
|
|
312
|
+
.eo-guide-steps span{flex:0 0 auto;font-weight:500;font-size:13px;line-height:19px}
|
|
313
|
+
.eo-guide-steps small{color:var(--eo-tertiary);font-size:12px;line-height:18px}
|
|
314
314
|
.eo-guide-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
|
|
315
|
-
.eo-main-guide .eo-btn{height:
|
|
316
|
-
@media(max-width:600px){.eo-main-guide{left:12px;right:12px;bottom:12px;width:auto}.eo-guide-beacon{position:fixed;left:18px;bottom:
|
|
317
|
-
.eo-guide-beacon span{padding:
|
|
315
|
+
.eo-main-guide .eo-btn{height:30px;font-size:12px;padding:0 10px}
|
|
316
|
+
@media(max-width:600px){.eo-main-guide{left:12px;right:12px;bottom:12px;width:auto;max-height:calc(100vh - 24px);overflow:auto;font-size:13px;line-height:20px}.eo-guide-beacon{position:fixed;left:18px;bottom:84px;z-index:31;display:flex;flex-direction:column;align-items:center;gap:2px;color:var(--eo-primary);pointer-events:none;font-size:12px;line-height:17px}
|
|
317
|
+
.eo-guide-beacon span{padding:2px 8px;border-radius:5px;background:var(--dsw-alias-bg-layer-1,#fff);border:.5px solid var(--eo-border-strong);box-shadow:0 4px 14px rgba(0,0,0,.12)}
|
|
318
318
|
.eo-guide-beacon .eo-icon{color:var(--eo-primary);animation:eo-guide-bob 1.6s ease-in-out infinite}
|
|
319
319
|
@keyframes eo-guide-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(5px)}}
|
|
320
320
|
.eo-guide-arrow{display:none}}
|
|
@@ -386,8 +386,31 @@ window.__ModuleLoader__.load({
|
|
|
386
386
|
.eo-owner-list{display:flex;flex-direction:column;gap:7px}
|
|
387
387
|
.eo-owner-head{display:flex;justify-content:space-between;gap:10px;font-size:12px;line-height:18px;color:var(--eo-tertiary)}
|
|
388
388
|
.eo-owner-head span:first-child{font-family:var(--eo-code);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
389
|
-
.eo-
|
|
390
|
-
.eo-
|
|
389
|
+
.eo-context-mix{display:flex;align-items:center;gap:18px;padding:2px 0 12px;margin-bottom:10px;border-bottom:.5px solid var(--eo-border)}
|
|
390
|
+
.eo-context-donut{position:relative;width:82px;height:82px;border-radius:50%;flex:0 0 auto;background:conic-gradient(var(--eo-success) 0 var(--eo-ok,0%),var(--dsw-alias-state-warning-primary,#9a6700) var(--eo-ok,0%) 100%)}
|
|
391
|
+
.eo-context-donut:after{content:"";position:absolute;inset:10px;border-radius:50%;background:var(--eo-card-bg,#fff)}
|
|
392
|
+
.eo-context-donut-label{position:absolute;inset:10px;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
|
|
393
|
+
.eo-context-donut-label b{font-size:17px;line-height:22px;font-weight:600;color:var(--eo-primary)}
|
|
394
|
+
.eo-context-donut-label small{font-size:9px;line-height:13px;color:var(--eo-tertiary);margin-top:2px}
|
|
395
|
+
.eo-context-legend{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
|
|
396
|
+
.eo-context-legend-row{display:grid;grid-template-columns:8px minmax(0,1fr) auto auto;gap:7px;align-items:center;font-size:11px;line-height:17px;color:var(--eo-tertiary)}
|
|
397
|
+
.eo-context-legend-row strong{color:var(--eo-primary);font-weight:500;font-family:var(--eo-code);font-size:11px}
|
|
398
|
+
.eo-context-legend-row em{font-style:normal;color:var(--eo-tertiary);font-family:var(--eo-code);font-size:10px;min-width:34px;text-align:right}
|
|
399
|
+
.eo-dot-ok,.eo-dot-warn,.eo-dot-error,.eo-dot-info{display:inline-block;width:7px;height:7px;border-radius:50%;flex:0 0 auto}
|
|
400
|
+
.eo-dot-ok{background:var(--eo-success)}
|
|
401
|
+
.eo-dot-warn{background:var(--dsw-alias-state-warning-primary,#9a6700)}
|
|
402
|
+
.eo-dot-error{background:var(--eo-error)}
|
|
403
|
+
.eo-dot-info{background:var(--dsw-alias-state-business-primary,#4a7fd6)}
|
|
404
|
+
.eo-severity-legend{display:flex;flex-wrap:wrap;gap:12px;margin:0 0 10px;color:var(--eo-tertiary);font-size:11px;line-height:17px}
|
|
405
|
+
.eo-severity-legend span{display:inline-flex;align-items:center;gap:5px}
|
|
406
|
+
.eo-compat-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:.5px solid var(--eo-border)}
|
|
407
|
+
.eo-share-cell{display:flex;flex-direction:column;gap:3px;min-width:64px}
|
|
408
|
+
.eo-share-bar{width:52px;height:4px;border-radius:4px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.1));overflow:hidden}
|
|
409
|
+
.eo-share-bar i{display:block;height:100%;min-width:2px;border-radius:4px;background:linear-gradient(90deg,var(--eo-primary),var(--dsw-alias-state-business-primary,#4a7fd6))}
|
|
410
|
+
.eo-inventory-share{height:4px;border-radius:4px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.1));overflow:hidden;margin-top:9px}
|
|
411
|
+
.eo-inventory-share i{display:block;height:100%;min-width:2px;border-radius:4px;background:linear-gradient(90deg,var(--eo-primary),var(--dsw-alias-state-business-primary,#4a7fd6));opacity:.85}
|
|
412
|
+
.eo-bar{height:6px;border-radius:6px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.1));margin-top:5px;overflow:hidden;box-shadow:inset 0 0 0 .5px var(--eo-border)}
|
|
413
|
+
.eo-bar i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--eo-primary),var(--dsw-alias-state-business-primary,#4a7fd6));opacity:.85;transition:width .45s var(--eo-ease,cubic-bezier(.16,1,.3,1))}
|
|
391
414
|
.eo-issue{display:flex;gap:8px;align-items:flex-start;padding:8px 10px;border-radius:var(--dsw-radius-md,8px);font-size:12px;line-height:18px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.06));border:.5px solid var(--eo-border)}
|
|
392
415
|
.eo-issue-error{border-color:color-mix(in srgb,var(--eo-error) 35%,transparent);color:var(--eo-error)}
|
|
393
416
|
.eo-issue-warn{border-color:color-mix(in srgb,var(--dsw-alias-state-warning-primary,#9a6700) 35%,transparent)}
|
|
@@ -430,7 +453,28 @@ window.__ModuleLoader__.load({
|
|
|
430
453
|
.eo-settings-row-wide .eo-settings-control{width:100%;flex:1 1 240px}
|
|
431
454
|
.eo-check{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--eo-primary);cursor:pointer;min-height:30px}
|
|
432
455
|
.eo-check input{width:14px;height:14px;accent-color:var(--eo-primary);cursor:pointer}
|
|
433
|
-
|
|
456
|
+
.eo-param{display:flex;flex-direction:column;gap:5px;flex:1 1 220px;min-width:220px}
|
|
457
|
+
.eo-param-section{display:flex;flex-direction:column;gap:0;margin-top:14px;padding-top:12px;border-top:.5px solid var(--eo-border)}
|
|
458
|
+
.eo-param-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:4px}
|
|
459
|
+
.eo-param-section-head strong{font-size:13px;line-height:20px;color:var(--eo-primary)}
|
|
460
|
+
.eo-param-section-head span{font-size:11px;line-height:17px;color:var(--eo-tertiary)}
|
|
461
|
+
.eo-param-row{display:flex;align-items:center;gap:14px;padding:8px 0;border-bottom:.5px solid var(--eo-border)}
|
|
462
|
+
.eo-param-row:last-child{border-bottom:0;padding-bottom:0}
|
|
463
|
+
.eo-param-row>span{flex:0 0 120px;color:var(--eo-secondary);font-size:12px;line-height:18px}
|
|
464
|
+
.eo-param-head{display:flex;align-items:center;gap:5px}
|
|
465
|
+
.eo-param-input{width:70px;height:30px;padding:0 7px;text-align:center;font:500 12px/18px var(--eo-code);appearance:textfield}
|
|
466
|
+
.eo-param-input::-webkit-inner-spin-button,.eo-param-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
|
|
467
|
+
.eo-stepper{display:flex;flex-direction:column;gap:2px}
|
|
468
|
+
.eo-stepper-btn{width:22px;height:14px;display:grid;place-items:center;padding:0;border:.5px solid var(--eo-border-strong);border-radius:4px;background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.05));color:var(--eo-secondary);cursor:pointer;transition:background .16s ease,color .16s ease,border-color .16s ease}
|
|
469
|
+
.eo-stepper-btn:hover{border-color:var(--eo-primary);color:var(--eo-primary);background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.1))}
|
|
470
|
+
.eo-stepper-btn:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--eo-primary));outline-offset:1px}
|
|
471
|
+
.eo-stepper-btn .eo-icon{display:block}
|
|
472
|
+
.eo-stepper-up .eo-icon{transform:rotate(180deg)}
|
|
473
|
+
.eo-param-track{position:relative;height:6px;border-radius:6px;background:var(--eo-border)}
|
|
474
|
+
.eo-param-track i{display:block;height:100%;min-width:3px;border-radius:6px;background:linear-gradient(90deg,var(--eo-primary),var(--dsw-alias-state-success-primary,#1a7f37));transition:width .28s var(--eo-ease,cubic-bezier(.16,1,.3,1))}
|
|
475
|
+
.eo-param-track b{position:absolute;top:50%;width:9px;height:9px;border-radius:50%;background:var(--dsw-alias-bg-layer-1,#fff);border:1.5px solid var(--eo-primary);transform:translate(-50%,-50%);box-shadow:0 1px 4px rgba(0,0,0,.15)}
|
|
476
|
+
.eo-param-scale{display:flex;justify-content:space-between;color:var(--eo-tertiary);font:10px/14px var(--eo-code);letter-spacing:.02em}
|
|
477
|
+
@media(max-width:560px){.eo-settings-control{width:100%;flex:1 1 100%}.eo-param-row{align-items:flex-start;flex-direction:column;gap:5px}.eo-param-row>span{flex:0 0 auto}.eo-param{width:100%;min-width:0}}
|
|
434
478
|
.eo-codeblock{margin:0;padding:12px;border:.5px solid var(--eo-border-strong);border-radius:var(--dsw-radius-md,8px);background:var(--dsw-alias-bg-module-platform,rgba(127,127,127,.05));font:400 11px/18px var(--eo-code);color:var(--eo-secondary);white-space:pre-wrap;word-break:break-word}
|
|
435
479
|
.eo-faq{border-bottom:.5px solid var(--eo-border);padding:8px 0}
|
|
436
480
|
.eo-faq:last-child{border-bottom:0}
|
|
@@ -1115,7 +1159,7 @@ window.__ModuleLoader__.load({
|
|
|
1115
1159
|
h(
|
|
1116
1160
|
'div',
|
|
1117
1161
|
{ className: 'eo-main-guide', role: 'dialog', 'aria-label': tr('初次使用路径', 'First-run path') },
|
|
1118
|
-
h('div', { className: 'eo-guide-arrow' }, h(Icon, { name: '
|
|
1162
|
+
h('div', { className: 'eo-guide-arrow' }, h(Icon, { name: 'arrowDown', size: 28 })),
|
|
1119
1163
|
h('p', { className: 'eo-guide-kicker' }, tr('初次使用', 'FIRST RUN')),
|
|
1120
1164
|
h('h3', null, tr('从这里打开插件体检', 'Open Plugin checkup here')),
|
|
1121
1165
|
h(
|
|
@@ -1188,7 +1232,7 @@ window.__ModuleLoader__.load({
|
|
|
1188
1232
|
const [locale, setLocale] = useState(detectLocale)
|
|
1189
1233
|
const [showOnboarding, setShowOnboarding] = useState(false)
|
|
1190
1234
|
const [onboardingStep, setOnboardingStep] = useState(0)
|
|
1191
|
-
const [collapsedCards, setCollapsedCards] = useState({
|
|
1235
|
+
const [collapsedCards, setCollapsedCards] = useState({})
|
|
1192
1236
|
const [layout, setLayout] = useState(() => readPref('layout', 'standard'))
|
|
1193
1237
|
const [density, setDensity] = useState(() => readPref('density', 'comfortable'))
|
|
1194
1238
|
const [overview, setOverview] = useState(null)
|
|
@@ -1370,7 +1414,7 @@ window.__ModuleLoader__.load({
|
|
|
1370
1414
|
} catch (err) {
|
|
1371
1415
|
const message = err instanceof Error ? err.message : String(err)
|
|
1372
1416
|
setUpdateInfo({
|
|
1373
|
-
current: '0.3.
|
|
1417
|
+
current: '0.3.9',
|
|
1374
1418
|
latest: null,
|
|
1375
1419
|
updateAvailable: false,
|
|
1376
1420
|
error: /unknown endpoint/i.test(message)
|
|
@@ -1848,6 +1892,32 @@ window.__ModuleLoader__.load({
|
|
|
1848
1892
|
}
|
|
1849
1893
|
}
|
|
1850
1894
|
|
|
1895
|
+
async function copyCompatibilityPlan() {
|
|
1896
|
+
const all = overview ? overview.findings.filter((finding) => finding.severity !== 'info') : []
|
|
1897
|
+
if (all.length === 0) {
|
|
1898
|
+
notify(tr('没有需要处理的兼容性问题。', 'No compatibility findings to handle.'), 'warn')
|
|
1899
|
+
return
|
|
1900
|
+
}
|
|
1901
|
+
const lines = [
|
|
1902
|
+
tr('# 兼容性处理清单', '# Compatibility checklist'),
|
|
1903
|
+
'',
|
|
1904
|
+
tr('只读生成;不会自动修改任何插件。', 'Generated read-only; no plugin is changed automatically.'),
|
|
1905
|
+
'',
|
|
1906
|
+
]
|
|
1907
|
+
for (const finding of all) {
|
|
1908
|
+
lines.push('- [ ] [' + finding.severity + '] ' + finding.code + ' — ' + finding.title)
|
|
1909
|
+
if (finding.subjects?.length) lines.push(' ' + tr('对象:', 'Subjects: ') + finding.subjects.join(', '))
|
|
1910
|
+
if (finding.fix?.summary) lines.push(' ' + tr('建议:', 'Fix: ') + finding.fix.summary)
|
|
1911
|
+
if (finding.evidence) lines.push(' ' + tr('证据:', 'Evidence: ') + (Array.isArray(finding.evidence) ? finding.evidence.join('; ') : String(finding.evidence)))
|
|
1912
|
+
}
|
|
1913
|
+
try {
|
|
1914
|
+
await navigator.clipboard.writeText(lines.join('\n'))
|
|
1915
|
+
notify(tr('已复制 ' + all.length + ' 项兼容性处理清单', 'Copied ' + all.length + ' compatibility items'))
|
|
1916
|
+
} catch {
|
|
1917
|
+
notify(tr('无法访问剪贴板,请手动复制问题详情', 'Clipboard unavailable; copy the findings manually'), 'warn')
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1851
1921
|
function renderSettings() {
|
|
1852
1922
|
if (settingsBusy && settings === null) {
|
|
1853
1923
|
return h('div', { className: 'eo-loading' }, h('span', { className: 'eo-spinner' }), tr('正在读取当前生效设置…', 'Loading effective settings…'))
|
|
@@ -1859,14 +1929,37 @@ window.__ModuleLoader__.load({
|
|
|
1859
1929
|
const form = settingsDraft || settings
|
|
1860
1930
|
const dirty = settingsChanged
|
|
1861
1931
|
const option = (labelZh, labelEn, value) => h('option', { key: value, value }, tr(labelZh, labelEn))
|
|
1862
|
-
const inputNumber = (field, min, max) =>
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
min,
|
|
1866
|
-
max,
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1932
|
+
const inputNumber = (field, min, max, displayMax = max, step = 1) => {
|
|
1933
|
+
const current = Math.min(max, Math.max(min, Number(form[field]) || min))
|
|
1934
|
+
const visualMax = Math.min(max, Math.max(min + 1, displayMax))
|
|
1935
|
+
const percent = Math.min(100, Math.max(0, ((current - min) / (visualMax - min)) * 100))
|
|
1936
|
+
const setValue = (value) => updateSettingsField(field, Math.min(max, Math.max(min, Number(value) || min)))
|
|
1937
|
+
return h(
|
|
1938
|
+
'div',
|
|
1939
|
+
{ className: 'eo-param' },
|
|
1940
|
+
h(
|
|
1941
|
+
'div',
|
|
1942
|
+
{ className: 'eo-param-head' },
|
|
1943
|
+
h('input', {
|
|
1944
|
+
className: 'eo-input eo-param-input',
|
|
1945
|
+
type: 'number',
|
|
1946
|
+
min,
|
|
1947
|
+
max,
|
|
1948
|
+
step,
|
|
1949
|
+
value: form[field],
|
|
1950
|
+
onChange: (event) => setValue(event.target.value),
|
|
1951
|
+
}),
|
|
1952
|
+
h(
|
|
1953
|
+
'div',
|
|
1954
|
+
{ className: 'eo-stepper' },
|
|
1955
|
+
h('button', { type: 'button', className: 'eo-stepper-btn eo-stepper-up', onClick: () => setValue(current + step), 'aria-label': tr('增加', 'Increase') }, h(Icon, { name: 'chevron', size: 11 })),
|
|
1956
|
+
h('button', { type: 'button', className: 'eo-stepper-btn', onClick: () => setValue(current - step), 'aria-label': tr('减少', 'Decrease') }, h(Icon, { name: 'chevron', size: 11 })),
|
|
1957
|
+
),
|
|
1958
|
+
),
|
|
1959
|
+
h('div', { className: 'eo-param-track', 'aria-hidden': 'true' }, h('i', { style: { width: percent + '%' } }), h('b', { style: { left: percent + '%' } })),
|
|
1960
|
+
h('div', { className: 'eo-param-scale' }, h('span', null, String(min)), h('span', null, String(visualMax) + (max > visualMax ? ' · ' + tr('上限 ', 'max ') + max : ''))),
|
|
1961
|
+
)
|
|
1962
|
+
}
|
|
1870
1963
|
return h(
|
|
1871
1964
|
'div',
|
|
1872
1965
|
{ className: 'eo-stack' },
|
|
@@ -1926,7 +2019,6 @@ window.__ModuleLoader__.load({
|
|
|
1926
2019
|
option('仅超过阈值时审批', 'Approve only above threshold', 'risk-based'),
|
|
1927
2020
|
),
|
|
1928
2021
|
),
|
|
1929
|
-
h('div', { className: 'eo-settings-row' }, h('span', null, tr('审批阈值', 'Approval threshold')), inputNumber('approvalThreshold', 1, 100)),
|
|
1930
2022
|
h('div', { className: 'eo-settings-row' }, h('span', null, tr('建议策略', 'Suggestion policy')),
|
|
1931
2023
|
h('select', { className: 'eo-select eo-settings-control', value: form.suggestionPolicy, onChange: (event) => updateSettingsField('suggestionPolicy', event.target.value) },
|
|
1932
2024
|
option('证据优先(推荐)', 'Evidence-first (recommended)', 'conservative'),
|
|
@@ -1939,8 +2031,6 @@ window.__ModuleLoader__.load({
|
|
|
1939
2031
|
h('span', null, form.trackUsage ? tr('开启', 'On') : tr('关闭', 'Off')),
|
|
1940
2032
|
),
|
|
1941
2033
|
),
|
|
1942
|
-
h('div', { className: 'eo-settings-row' }, h('span', null, tr('账本保留', 'Ledger retention')), inputNumber('usageRetentionDays', 1, 365)),
|
|
1943
|
-
h('div', { className: 'eo-settings-row' }, h('span', null, tr('草稿/还原点上限', 'Draft/snapshot limit')), inputNumber('maxDrafts', 1, 200)),
|
|
1944
2034
|
h('div', { className: 'eo-settings-row eo-settings-row-wide' }, h('span', null, tr('保护名单', 'Protect list')),
|
|
1945
2035
|
h('input', { className: 'eo-input eo-settings-control', value: form.protect.join(', '), placeholder: tr('包名,用逗号分隔', 'Package names, comma separated'), onChange: (event) => updateSettingsField('protect', splitList(event.target.value)) }),
|
|
1946
2036
|
),
|
|
@@ -1948,6 +2038,19 @@ window.__ModuleLoader__.load({
|
|
|
1948
2038
|
h('input', { className: 'eo-input eo-settings-control', value: form.pinned.join(', '), placeholder: tr('包名,用逗号分隔', 'Package names, comma separated'), onChange: (event) => updateSettingsField('pinned', splitList(event.target.value)) }),
|
|
1949
2039
|
),
|
|
1950
2040
|
),
|
|
2041
|
+
h(
|
|
2042
|
+
'div',
|
|
2043
|
+
{ className: 'eo-param-section' },
|
|
2044
|
+
h(
|
|
2045
|
+
'div',
|
|
2046
|
+
{ className: 'eo-param-section-head' },
|
|
2047
|
+
h('strong', null, tr('参数范围', 'Parameter ranges')),
|
|
2048
|
+
h('span', null, tr('上下箭头微调;进度条按推荐范围显示,右侧标注配置上限', 'Use the arrows to tune; the bar shows the recommended range, with the config cap on the right')),
|
|
2049
|
+
),
|
|
2050
|
+
h('div', { className: 'eo-param-row' }, h('span', null, tr('审批阈值', 'Approval threshold')), inputNumber('approvalThreshold', 1, 100, 20)),
|
|
2051
|
+
h('div', { className: 'eo-param-row' }, h('span', null, tr('账本保留', 'Ledger retention')), inputNumber('usageRetentionDays', 1, 365, 90)),
|
|
2052
|
+
h('div', { className: 'eo-param-row' }, h('span', null, tr('草稿/还原点上限', 'Draft/snapshot limit')), inputNumber('maxDrafts', 1, 200, 50)),
|
|
2053
|
+
),
|
|
1951
2054
|
h('div', { className: 'eo-muted', style: { marginTop: '10px' } }, tr('配置目录:', 'Config directory: ') + form.profileDir),
|
|
1952
2055
|
settingsError ? h('div', { className: 'eo-error', style: { marginTop: '10px' } }, h('span', null, settingsError)) : null,
|
|
1953
2056
|
dirty
|
|
@@ -1963,7 +2066,7 @@ window.__ModuleLoader__.load({
|
|
|
1963
2066
|
h(
|
|
1964
2067
|
Card,
|
|
1965
2068
|
{ title: tr('更新与反馈', 'Updates & feedback'), subtitle: tr('检查 npm 最新版本;反馈请走 GitHub Issues', 'Check the latest npm version; feedback via GitHub Issues') },
|
|
1966
|
-
h('div', { className: 'eo-settings-row' }, h('span', null, tr('当前版本', 'Current version')), h('code', null, updateInfo?.current || '0.3.
|
|
2069
|
+
h('div', { className: 'eo-settings-row' }, h('span', null, tr('当前版本', 'Current version')), h('code', null, updateInfo?.current || '0.3.9')),
|
|
1967
2070
|
h('div', { className: 'eo-settings-row' }, h('span', null, tr('最新版本', 'Latest version')), h('code', null, updateInfo ? (updateInfo.latest || tr('检查失败', 'Check failed')) : tr('未检查', 'Not checked'))),
|
|
1968
2071
|
updateInfo && updateInfo.updateAvailable
|
|
1969
2072
|
? h('div', { className: 'eo-issue' }, h('span', null, tr('发现新版本:', 'New version available: ') + updateInfo.latest + ' · '), h('a', { href: updateInfo.url, target: '_blank', rel: 'noreferrer' }, tr('查看 npm', 'View npm')))
|
|
@@ -2022,7 +2125,7 @@ window.__ModuleLoader__.load({
|
|
|
2022
2125
|
{ className: 'eo-about-card' },
|
|
2023
2126
|
h('div', { className: 'eo-inline', style: { marginBottom: '8px' } }, h(Icon, { name: 'shield', size: 24 }), h('strong', null, 'DSH Plugin Checkup')),
|
|
2024
2127
|
h('p', null, tr('少一点插件负担,多一点兼容确定性。', 'Less plugin overhead, more compatibility certainty.')),
|
|
2025
|
-
h('p', null, tr('版本:', 'Version: ') + '0.3.
|
|
2128
|
+
h('p', null, tr('版本:', 'Version: ') + '0.3.9 · AGPL-3.0-only'),
|
|
2026
2129
|
h('p', null, tr('作者:Starlit Sky', 'Author: Starlit Sky')),
|
|
2027
2130
|
),
|
|
2028
2131
|
h(
|
|
@@ -2098,6 +2201,9 @@ window.__ModuleLoader__.load({
|
|
|
2098
2201
|
}
|
|
2099
2202
|
|
|
2100
2203
|
function renderTrim() {
|
|
2204
|
+
const shareOf = (bundle) => totalContextTokens > 0
|
|
2205
|
+
? Math.min(100, Math.max(0, (bundle.contextTokens / totalContextTokens) * 100))
|
|
2206
|
+
: 0
|
|
2101
2207
|
const renderInventoryCards = () =>
|
|
2102
2208
|
h(
|
|
2103
2209
|
'div',
|
|
@@ -2140,6 +2246,9 @@ window.__ModuleLoader__.load({
|
|
|
2140
2246
|
bundle.protected ? h('span', null, tr('受保护', 'Protected')) : null,
|
|
2141
2247
|
h('span', null, bundle.guardStatus ? guardLabel(bundle.guardStatus) : '—'),
|
|
2142
2248
|
),
|
|
2249
|
+
h('div', { className: 'eo-inventory-share', title: tr('占可归属上下文的比例', 'Share of attributable context') },
|
|
2250
|
+
h('i', { style: { width: shareOf(bundle) + '%' } }),
|
|
2251
|
+
),
|
|
2143
2252
|
),
|
|
2144
2253
|
),
|
|
2145
2254
|
)
|
|
@@ -2155,8 +2264,8 @@ window.__ModuleLoader__.load({
|
|
|
2155
2264
|
h(Metric, {
|
|
2156
2265
|
key: 'tokens',
|
|
2157
2266
|
label: tr('可归属上下文', 'Attributable context'),
|
|
2158
|
-
value: formatTokens(
|
|
2159
|
-
hint: tr('
|
|
2267
|
+
value: formatTokens(attributedContext),
|
|
2268
|
+
hint: Math.round(contextPct) + tr('% 占比 · 未归属 ', '% share · unattributed ') + formatTokens(overview.context.unattributedTokens),
|
|
2160
2269
|
progress: contextPct,
|
|
2161
2270
|
progressTone: 'ok',
|
|
2162
2271
|
}),
|
|
@@ -2255,6 +2364,13 @@ window.__ModuleLoader__.load({
|
|
|
2255
2364
|
compat.info > 0 ? h('span', { key: 'i', className: 'eo-severity-info', style: { flex: compat.info } }) : null,
|
|
2256
2365
|
],
|
|
2257
2366
|
),
|
|
2367
|
+
compat.error + compat.warn + compat.info > 0
|
|
2368
|
+
? h('div', { className: 'eo-severity-legend' },
|
|
2369
|
+
h('span', null, h('i', { className: 'eo-dot-error' }), compat.error + tr(' 错误', ' errors')),
|
|
2370
|
+
h('span', null, h('i', { className: 'eo-dot-warn' }), compat.warn + tr(' 警告', ' warnings')),
|
|
2371
|
+
h('span', null, h('i', { className: 'eo-dot-info' }), compat.info + tr(' 信息', ' info')),
|
|
2372
|
+
)
|
|
2373
|
+
: null,
|
|
2258
2374
|
findings.length === 0
|
|
2259
2375
|
? h('div', { className: 'eo-empty' }, tr('没有匹配的兼容性问题。', 'No matching compatibility findings.'))
|
|
2260
2376
|
: h(
|
|
@@ -2294,6 +2410,22 @@ window.__ModuleLoader__.load({
|
|
|
2294
2410
|
),
|
|
2295
2411
|
),
|
|
2296
2412
|
),
|
|
2413
|
+
h(
|
|
2414
|
+
'div',
|
|
2415
|
+
{ className: 'eo-compat-footer' },
|
|
2416
|
+
h('span', { className: 'eo-muted' }, tr('生成只读修复清单;不会自动修改插件。', 'Creates a read-only fix checklist; no plugin is changed.')),
|
|
2417
|
+
h(
|
|
2418
|
+
Button,
|
|
2419
|
+
{
|
|
2420
|
+
variant: 'accent',
|
|
2421
|
+
onClick: () => void copyCompatibilityPlan(),
|
|
2422
|
+
disabled: compat.error + compat.warn === 0,
|
|
2423
|
+
},
|
|
2424
|
+
compat.error + compat.warn > 0
|
|
2425
|
+
? tr('处理兼容性 · ' + (compat.error + compat.warn) + ' 项', 'Handle compatibility · ' + (compat.error + compat.warn))
|
|
2426
|
+
: tr('没有待处理项', 'Nothing to handle'),
|
|
2427
|
+
),
|
|
2428
|
+
),
|
|
2297
2429
|
),
|
|
2298
2430
|
h(
|
|
2299
2431
|
Card,
|
|
@@ -2311,6 +2443,23 @@ window.__ModuleLoader__.load({
|
|
|
2311
2443
|
showContext ? tr('收起明细', 'Collapse details') : tr('查看明细', 'View details'),
|
|
2312
2444
|
),
|
|
2313
2445
|
},
|
|
2446
|
+
h(
|
|
2447
|
+
'div',
|
|
2448
|
+
{ className: 'eo-context-mix' },
|
|
2449
|
+
h('div', {
|
|
2450
|
+
className: 'eo-context-donut',
|
|
2451
|
+
style: { '--eo-ok': contextPct + '%' },
|
|
2452
|
+
role: 'img',
|
|
2453
|
+
'aria-label': tr('可归属与未归属上下文的构成', 'Attributable vs unattributed context'),
|
|
2454
|
+
title: tr('可归属与未归属上下文的构成', 'Attributable vs unattributed context'),
|
|
2455
|
+
}, h('div', { className: 'eo-context-donut-label' }, h('b', null, Math.round(contextPct) + '%'), h('small', null, tr('可归属', 'attributed')))),
|
|
2456
|
+
h(
|
|
2457
|
+
'div',
|
|
2458
|
+
{ className: 'eo-context-legend' },
|
|
2459
|
+
h('div', { className: 'eo-context-legend-row' }, h('i', { className: 'eo-dot-ok' }), h('span', null, tr('可归属', 'Attributable')), h('strong', null, formatNumber(attributedContext)), h('em', null, Math.round(contextPct) + '%')),
|
|
2460
|
+
h('div', { className: 'eo-context-legend-row' }, h('i', { className: 'eo-dot-warn' }), h('span', null, tr('未归属', 'Unattributed')), h('strong', null, formatNumber(overview.context.unattributedTokens)), h('em', null, Math.round(100 - contextPct) + '%')),
|
|
2461
|
+
),
|
|
2462
|
+
),
|
|
2314
2463
|
h(
|
|
2315
2464
|
'div',
|
|
2316
2465
|
{ className: 'eo-owner-list' },
|
|
@@ -2322,11 +2471,11 @@ window.__ModuleLoader__.load({
|
|
|
2322
2471
|
'div',
|
|
2323
2472
|
{ className: 'eo-owner-head' },
|
|
2324
2473
|
h('span', null, owner.owner),
|
|
2325
|
-
h('span', null, formatNumber(owner.tokens)),
|
|
2474
|
+
h('span', null, formatNumber(owner.tokens) + ' · ' + Math.round((owner.tokens / Math.max(1, totalContextTokens)) * 100) + '%'),
|
|
2326
2475
|
),
|
|
2327
2476
|
h(
|
|
2328
2477
|
'div',
|
|
2329
|
-
{ className: 'eo-bar' },
|
|
2478
|
+
{ className: 'eo-bar', title: owner.owner + ' · ' + formatNumber(owner.tokens) + ' tokens' },
|
|
2330
2479
|
h('i', {
|
|
2331
2480
|
style: { width: Math.max(3, (owner.tokens / maxOwner) * 100) + '%' },
|
|
2332
2481
|
}),
|
|
@@ -2501,9 +2650,8 @@ window.__ModuleLoader__.load({
|
|
|
2501
2650
|
h(
|
|
2502
2651
|
'td',
|
|
2503
2652
|
{ className: 'eo-muted eo-share-cell', title: tr('占可归属上下文的比例', 'Share of attributable context') },
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
: '—',
|
|
2653
|
+
h('span', null, Math.round(shareOf(bundle)) + '%'),
|
|
2654
|
+
h('div', { className: 'eo-share-bar' }, h('i', { style: { width: shareOf(bundle) + '%' } })),
|
|
2507
2655
|
),
|
|
2508
2656
|
h(
|
|
2509
2657
|
'td',
|
package/dist/index.js
CHANGED
|
@@ -4588,7 +4588,7 @@ function registerCompatTool(ctx, config) {
|
|
|
4588
4588
|
}
|
|
4589
4589
|
// src/api.ts
|
|
4590
4590
|
const API_PREFIX = "/api/dsh-experience-optimizer";
|
|
4591
|
-
const CURRENT_VERSION = "0.3.
|
|
4591
|
+
const CURRENT_VERSION = "0.3.9";
|
|
4592
4592
|
let updateCache;
|
|
4593
4593
|
const TASK_TAGS = [
|
|
4594
4594
|
"bugfix",
|