dsh-model-doctor 0.5.4 → 0.5.5
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/lib/client/index.js +11 -2
- package/package.json +1 -1
package/lib/client/index.js
CHANGED
|
@@ -79,8 +79,9 @@ window.__ModuleLoader__.load({
|
|
|
79
79
|
.dmd-chip.is-ok{color:#2fa96e;background:color-mix(in srgb,#2fa96e 16%,transparent)}
|
|
80
80
|
.dmd-chip.is-bad{color:#e5484d;background:color-mix(in srgb,#e5484d 14%,transparent)}
|
|
81
81
|
.dmd-chip.is-warn{color:#d08700;background:color-mix(in srgb,#d08700 16%,transparent)}
|
|
82
|
-
/*
|
|
83
|
-
|
|
82
|
+
/* 关键:官方菜单是 width:max-content,状态条文字绝不能参与菜单的固有宽度计算。
|
|
83
|
+
width:0 + min-width:100% → 对菜单的宽度贡献为 0,但实际占满整行,不再留右侧空白。 */
|
|
84
|
+
.dmd-allbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;padding:6px 10px;margin:2px 0;font-size:11px;border-radius:8px;background:color-mix(in srgb,currentColor 6%,transparent);box-sizing:border-box;width:0;min-width:100%;max-width:100%}
|
|
84
85
|
.dmd-allbar button{font:inherit;font-size:11px;line-height:16px;padding:2px 9px;border-radius:6px;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:transparent;color:inherit;cursor:pointer;flex:none}
|
|
85
86
|
.dmd-allbar button:disabled,.dmd-allbar button.is-busy{opacity:.45;cursor:default}
|
|
86
87
|
.dmd-allbar .dmd-status,.dmd-allbar .dmd-balance{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -781,6 +782,14 @@ window.__ModuleLoader__.load({
|
|
|
781
782
|
if (hint) status.textContent = hint
|
|
782
783
|
if (before !== null && before.parentNode === host) host.insertBefore(bar, before)
|
|
783
784
|
else host.insertBefore(bar, host.firstChild)
|
|
785
|
+
// 保险:状态条靠「width:0 + min-width:100%」占满整行且不参与菜单的固有宽度计算。
|
|
786
|
+
// 万一该技巧在某引擎上没生效,条形会塌成 0 宽 —— 这里实测一次,退化成像素宽度。
|
|
787
|
+
window.requestAnimationFrame(() => {
|
|
788
|
+
if (disposed || !bar.isConnected) return
|
|
789
|
+
const hostWidth = host.clientWidth
|
|
790
|
+
if (hostWidth <= 40) return
|
|
791
|
+
if (bar.getBoundingClientRect().width < hostWidth * 0.5) bar.style.width = `${hostWidth}px`
|
|
792
|
+
})
|
|
784
793
|
}
|
|
785
794
|
|
|
786
795
|
function providerLabel(providerId) {
|
package/package.json
CHANGED