@sunshaobei/dsh-balance-panel 3.0.4 → 3.0.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.js CHANGED
@@ -95,6 +95,9 @@ window.__ModuleLoader__.load({
95
95
  }
96
96
  if (family.length === 0) {
97
97
  var prov = String(sel.provider || "").toLowerCase();
98
+ // DOM-fallback selection (no provider) matching no family:
99
+ // show nothing — an empty prov would substring-match EVERY row.
100
+ if (!prov) return null;
98
101
  for (var j = 0; j < specs.rows.length; j++) {
99
102
  var id = String(specs.rows[j].id || "").toLowerCase();
100
103
  if (prov.indexOf(id) > -1 || id.indexOf(prov) > -1)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sunshaobei/dsh-balance-panel",
3
3
  "description": "Provider quota/balance widget for the dsh web surface: an inline sidebar card above the Settings row (collapsed glanceable row expanding into a Harness-native card with a settings panel), fed by a loopback Connection RPC channel whose host half proxies each provider with credentials that never reach the browser.",
4
- "version": "3.0.4",
4
+ "version": "3.0.5",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
package/src/client.ts CHANGED
@@ -83,6 +83,11 @@
83
83
  }
84
84
  if (family.length === 0) {
85
85
  var prov = String(sel.provider || "").toLowerCase();
86
+ // A DOM-fallback selection has no provider: the model name alone
87
+ // matched no known family, so this model has no known quota
88
+ // source. Show nothing rather than a wrong provider — an empty
89
+ // prov would otherwise substring-match EVERY row.
90
+ if (!prov) return null;
86
91
  for (var j = 0; j < specs.rows.length; j++) {
87
92
  var id = String(specs.rows[j].id || "").toLowerCase();
88
93
  if (prov.indexOf(id) > -1 || id.indexOf(prov) > -1) family.push(specs.rows[j]);