@tzyc/dsh-model-visibility 1.10.1 → 1.10.2
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 +105 -48
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](package.json)
|
|
11
11
|
[](test)
|
|
12
|
-
[](https://github.com/TZYCeng/dsh-model-visibility/releases)
|
|
13
13
|
[](https://awesome-dsh-plugin.com/p/TZYCeng/dsh-model-visibility/)
|
|
14
14
|
|
|
15
15
|
</div>
|
package/client.js
CHANGED
|
@@ -26,7 +26,7 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
define("catalog-store", function (require, module, exports) {
|
|
27
27
|
const { API } = require("constants")
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
function createCatalog(ctx) {
|
|
30
30
|
const listeners = new Set()
|
|
31
31
|
let state = {
|
|
32
32
|
status: 'idle',
|
|
@@ -178,7 +178,7 @@ window.__ModuleLoader__.load({
|
|
|
178
178
|
* answers 404 and the editor stays hidden behind the `overrides` feature
|
|
179
179
|
* flag.
|
|
180
180
|
*/
|
|
181
|
-
|
|
181
|
+
function createOverrides() {
|
|
182
182
|
const listeners = new Set()
|
|
183
183
|
let state = { status: 'idle', entries: [], available: null, error: null }
|
|
184
184
|
let inflight = null
|
|
@@ -304,7 +304,7 @@ window.__ModuleLoader__.load({
|
|
|
304
304
|
* so the client only polls and prints. An older Host answers 404 and the
|
|
305
305
|
* strip renders its "host is stale" hint.
|
|
306
306
|
*/
|
|
307
|
-
|
|
307
|
+
function createUsageApi() {
|
|
308
308
|
const listeners = new Set()
|
|
309
309
|
let state = { status: 'idle', snapshot: null, error: null }
|
|
310
310
|
let inflight = null
|
|
@@ -382,7 +382,7 @@ window.__ModuleLoader__.load({
|
|
|
382
382
|
* keeps the run in memory, so the store just mirrors its snapshots and keeps
|
|
383
383
|
* one 2 s poll alive while a sweep is running (or being observed).
|
|
384
384
|
*/
|
|
385
|
-
|
|
385
|
+
function createVerifyApi() {
|
|
386
386
|
const listeners = new Set()
|
|
387
387
|
let state = { status: 'idle', snapshot: null, error: null }
|
|
388
388
|
let inflight = null
|
|
@@ -489,6 +489,11 @@ window.__ModuleLoader__.load({
|
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
+
|
|
493
|
+
exports.createCatalog = createCatalog
|
|
494
|
+
exports.createOverrides = createOverrides
|
|
495
|
+
exports.createUsageApi = createUsageApi
|
|
496
|
+
exports.createVerifyApi = createVerifyApi
|
|
492
497
|
})
|
|
493
498
|
|
|
494
499
|
// -------------------------------------------------------- checker-view
|
|
@@ -535,7 +540,7 @@ window.__ModuleLoader__.load({
|
|
|
535
540
|
}
|
|
536
541
|
}
|
|
537
542
|
|
|
538
|
-
|
|
543
|
+
function VerifyPanel({ verify, catalog, t, canUse }) {
|
|
539
544
|
const state = useSource(verify)
|
|
540
545
|
const [pick, setPick] = React.useState(readPick)
|
|
541
546
|
const [message, setMessage] = React.useState(null)
|
|
@@ -715,6 +720,8 @@ window.__ModuleLoader__.load({
|
|
|
715
720
|
)
|
|
716
721
|
}
|
|
717
722
|
|
|
723
|
+
|
|
724
|
+
exports.VerifyPanel = VerifyPanel
|
|
718
725
|
})
|
|
719
726
|
|
|
720
727
|
// -------------------------------------------------------- composer-filter
|
|
@@ -736,7 +743,7 @@ window.__ModuleLoader__.load({
|
|
|
736
743
|
* model stays listed even while hidden, because the shipped trigger
|
|
737
744
|
* resolves its label from this same catalog.
|
|
738
745
|
*/
|
|
739
|
-
|
|
746
|
+
function patchDirectoryStore(store, form) {
|
|
740
747
|
const readBase = store.getSnapshot.bind(store)
|
|
741
748
|
const subscribeBase = store.subscribe.bind(store)
|
|
742
749
|
const originalGet = store.getSnapshot
|
|
@@ -823,7 +830,7 @@ window.__ModuleLoader__.load({
|
|
|
823
830
|
* owning the trigger, the Model / Effort rows, and third-party menu
|
|
824
831
|
* enhancements such as the reasoning-effort slider.
|
|
825
832
|
*/
|
|
826
|
-
|
|
833
|
+
function installComposerFilter(scope, form) {
|
|
827
834
|
const models = scope.modelDirectories
|
|
828
835
|
const original = models.directoryFor
|
|
829
836
|
if (typeof original !== 'function') return
|
|
@@ -873,23 +880,26 @@ window.__ModuleLoader__.load({
|
|
|
873
880
|
|
|
874
881
|
/* ----------------------------------------------------- settings page */
|
|
875
882
|
|
|
883
|
+
|
|
884
|
+
exports.patchDirectoryStore = patchDirectoryStore
|
|
885
|
+
exports.installComposerFilter = installComposerFilter
|
|
876
886
|
})
|
|
877
887
|
|
|
878
888
|
// -------------------------------------------------------- constants
|
|
879
889
|
define("constants", function (require, module, exports) {
|
|
880
890
|
/** Dictionary namespace owned by this plugin. */
|
|
881
|
-
|
|
891
|
+
const NS = 'model-visibility'
|
|
882
892
|
/** Host entry id from cordis.patch.yml; also the settings namespace. */
|
|
883
|
-
|
|
893
|
+
const ENTRY = 'model-visibility'
|
|
884
894
|
/** Config field persisted by the Host settings document. */
|
|
885
|
-
|
|
895
|
+
const FIELD = 'hidden'
|
|
886
896
|
/** Settings section id. */
|
|
887
|
-
|
|
897
|
+
const SECTION_ID = 'model-visibility'
|
|
888
898
|
/**
|
|
889
899
|
* Same-origin route the Host half registers through `connection.fetch`.
|
|
890
900
|
* Resolved against the page base so a reverse-proxy prefix is preserved.
|
|
891
901
|
*/
|
|
892
|
-
|
|
902
|
+
const API = (() => {
|
|
893
903
|
if (typeof document === 'undefined') return '/api/dsh-model-visibility'
|
|
894
904
|
try {
|
|
895
905
|
return new URL('api/dsh-model-visibility', document.baseURI).pathname
|
|
@@ -898,11 +908,17 @@ window.__ModuleLoader__.load({
|
|
|
898
908
|
}
|
|
899
909
|
})()
|
|
900
910
|
|
|
911
|
+
|
|
912
|
+
exports.NS = NS
|
|
913
|
+
exports.ENTRY = ENTRY
|
|
914
|
+
exports.FIELD = FIELD
|
|
915
|
+
exports.SECTION_ID = SECTION_ID
|
|
916
|
+
exports.API = API
|
|
901
917
|
})
|
|
902
918
|
|
|
903
919
|
// -------------------------------------------------------- css
|
|
904
920
|
define("css", function (require, module, exports) {
|
|
905
|
-
|
|
921
|
+
const CSS = `
|
|
906
922
|
.mvp_page{box-sizing:border-box;width:100%;height:100%;min-height:0;flex-direction:column;display:flex;overflow-y:auto;padding-bottom:24px}
|
|
907
923
|
.mvp_head{flex:none;flex-direction:column;gap:6px;padding:4px 0 14px;display:flex}
|
|
908
924
|
.mvp_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}
|
|
@@ -1151,11 +1167,13 @@ window.__ModuleLoader__.load({
|
|
|
1151
1167
|
|
|
1152
1168
|
`
|
|
1153
1169
|
|
|
1170
|
+
|
|
1171
|
+
exports.CSS = CSS
|
|
1154
1172
|
})
|
|
1155
1173
|
|
|
1156
1174
|
// -------------------------------------------------------- dict
|
|
1157
1175
|
define("dict", function (require, module, exports) {
|
|
1158
|
-
|
|
1176
|
+
const DICT = {
|
|
1159
1177
|
zh: {
|
|
1160
1178
|
'nav': '模型显示',
|
|
1161
1179
|
'page.title': '模型显示',
|
|
@@ -1582,30 +1600,32 @@ window.__ModuleLoader__.load({
|
|
|
1582
1600
|
'provider.account': 'DeepSeek Account',
|
|
1583
1601
|
},
|
|
1584
1602
|
}
|
|
1603
|
+
|
|
1604
|
+
exports.DICT = DICT
|
|
1585
1605
|
})
|
|
1586
1606
|
|
|
1587
1607
|
// -------------------------------------------------------- format
|
|
1588
1608
|
define("format", function (require, module, exports) {
|
|
1589
1609
|
const { FIELD } = require("constants")
|
|
1590
1610
|
|
|
1591
|
-
|
|
1611
|
+
function keyOf(provider, model) {
|
|
1592
1612
|
return provider + '/' + model
|
|
1593
1613
|
}
|
|
1594
1614
|
|
|
1595
|
-
|
|
1615
|
+
function hiddenSetOf(snapshot) {
|
|
1596
1616
|
const value = snapshot && snapshot.value
|
|
1597
1617
|
const list = value && Array.isArray(value[FIELD]) ? value[FIELD] : []
|
|
1598
1618
|
return new Set(list)
|
|
1599
1619
|
}
|
|
1600
1620
|
|
|
1601
|
-
|
|
1621
|
+
function providerLabel(group, t) {
|
|
1602
1622
|
return group.id === 'deepseek-account' ? t('provider.account') : group.name
|
|
1603
1623
|
}
|
|
1604
1624
|
|
|
1605
|
-
|
|
1625
|
+
const COLLAPSE_KEY = 'dsh-model-visibility:collapsed-groups:v1'
|
|
1606
1626
|
|
|
1607
1627
|
/** Group ids whose model lists the page keeps collapsed. */
|
|
1608
|
-
|
|
1628
|
+
function readCollapsedGroups() {
|
|
1609
1629
|
try {
|
|
1610
1630
|
const raw = window.localStorage.getItem(COLLAPSE_KEY)
|
|
1611
1631
|
if (raw === null) return new Set()
|
|
@@ -1616,7 +1636,7 @@ window.__ModuleLoader__.load({
|
|
|
1616
1636
|
}
|
|
1617
1637
|
}
|
|
1618
1638
|
|
|
1619
|
-
|
|
1639
|
+
function persistCollapsedGroups(collapsed) {
|
|
1620
1640
|
try {
|
|
1621
1641
|
window.localStorage.setItem(COLLAPSE_KEY, JSON.stringify(Array.from(collapsed)))
|
|
1622
1642
|
} catch (_error) {
|
|
@@ -1625,14 +1645,14 @@ window.__ModuleLoader__.load({
|
|
|
1625
1645
|
}
|
|
1626
1646
|
}
|
|
1627
1647
|
|
|
1628
|
-
|
|
1648
|
+
function countModels(groups) {
|
|
1629
1649
|
let total = 0
|
|
1630
1650
|
for (const group of groups || []) total += (group.models || []).length
|
|
1631
1651
|
return total
|
|
1632
1652
|
}
|
|
1633
1653
|
|
|
1634
1654
|
/** Human context size: 1048576 → "1M", 128000 → "128K". */
|
|
1635
|
-
|
|
1655
|
+
function formatContext(tokens) {
|
|
1636
1656
|
if (!Number.isFinite(tokens) || tokens <= 0) return null
|
|
1637
1657
|
if (tokens >= 1_000_000) return Math.round(tokens / 100_000) / 10 + 'M'
|
|
1638
1658
|
if (tokens >= 1_000) return Math.round(tokens / 100) / 10 + 'K'
|
|
@@ -1640,7 +1660,7 @@ window.__ModuleLoader__.load({
|
|
|
1640
1660
|
}
|
|
1641
1661
|
|
|
1642
1662
|
/** Effort display names in catalog order. */
|
|
1643
|
-
|
|
1663
|
+
function effortNames(reasoning) {
|
|
1644
1664
|
const efforts = reasoning && Array.isArray(reasoning.efforts) ? reasoning.efforts : []
|
|
1645
1665
|
const names = []
|
|
1646
1666
|
for (const effort of efforts) {
|
|
@@ -1652,7 +1672,7 @@ window.__ModuleLoader__.load({
|
|
|
1652
1672
|
}
|
|
1653
1673
|
|
|
1654
1674
|
/** Display name of the default effort, or null when none is published. */
|
|
1655
|
-
|
|
1675
|
+
function defaultEffortName(reasoning) {
|
|
1656
1676
|
if (!reasoning || typeof reasoning.defaultEffort !== 'string') return null
|
|
1657
1677
|
const efforts = Array.isArray(reasoning.efforts) ? reasoning.efforts : []
|
|
1658
1678
|
const found = efforts.find((effort) => effort !== null && effort.id === reasoning.defaultEffort)
|
|
@@ -1662,85 +1682,110 @@ window.__ModuleLoader__.load({
|
|
|
1662
1682
|
}
|
|
1663
1683
|
|
|
1664
1684
|
/** Localized name of one input modality. */
|
|
1665
|
-
|
|
1685
|
+
function modalityLabel(id, t) {
|
|
1666
1686
|
const key = 'modality.' + id
|
|
1667
1687
|
const label = t(key)
|
|
1668
1688
|
return label === key ? id : label
|
|
1669
1689
|
}
|
|
1670
1690
|
|
|
1671
1691
|
/** Localized provenance label ("adapter", "relay model list", …). */
|
|
1672
|
-
|
|
1692
|
+
function sourceLabel(source, t) {
|
|
1673
1693
|
const key = 'source.' + (source || 'unknown')
|
|
1674
1694
|
const label = t(key)
|
|
1675
1695
|
return label === key ? t('source.unknown') : label
|
|
1676
1696
|
}
|
|
1677
1697
|
|
|
1678
1698
|
/** Per-field provenance recorded by the Host. */
|
|
1679
|
-
|
|
1699
|
+
function sourceOf(model, field) {
|
|
1680
1700
|
const sources = model && model.sources
|
|
1681
1701
|
return sources && typeof sources[field] === 'string' ? sources[field] : 'unknown'
|
|
1682
1702
|
}
|
|
1683
1703
|
|
|
1684
1704
|
/** Catalog and name heuristics are completed values, not declarations. */
|
|
1685
|
-
|
|
1705
|
+
function isInferredSource(source) {
|
|
1686
1706
|
return source === 'catalog' || source === 'inferred'
|
|
1687
1707
|
}
|
|
1688
1708
|
|
|
1689
1709
|
/** Kind with a safe fallback for records from an older Host. */
|
|
1690
|
-
|
|
1710
|
+
function kindOf(model) {
|
|
1691
1711
|
return model && typeof model.kind === 'string' && model.kind !== '' ? model.kind : 'chat'
|
|
1692
1712
|
}
|
|
1693
1713
|
|
|
1694
1714
|
/** Filter bucket: chat / image / video / other. */
|
|
1695
|
-
|
|
1715
|
+
function bucketOf(kind) {
|
|
1696
1716
|
if (kind === 'image') return 'image'
|
|
1697
1717
|
if (kind === 'video') return 'video'
|
|
1698
1718
|
if (kind === 'chat') return 'chat'
|
|
1699
1719
|
return 'other'
|
|
1700
1720
|
}
|
|
1701
1721
|
|
|
1702
|
-
|
|
1722
|
+
function isGenerationKind(kind) {
|
|
1703
1723
|
return kind === 'image' || kind === 'video' || kind === 'audio'
|
|
1704
1724
|
}
|
|
1705
1725
|
|
|
1706
1726
|
/** Resolution tier advertised in the model id ("-4k", "2K"). */
|
|
1707
|
-
|
|
1727
|
+
function resolutionOf(model) {
|
|
1708
1728
|
const text = String((model && model.id) || '')
|
|
1709
1729
|
const match = /(?:^|[-_/])(4k|2k|8k|uhd|hd)(?:$|[-_/])/i.exec(text)
|
|
1710
1730
|
return match === null ? null : match[1].toUpperCase()
|
|
1711
1731
|
}
|
|
1712
1732
|
|
|
1713
1733
|
/** "文本 / 图像" for one modality array. */
|
|
1714
|
-
|
|
1734
|
+
function modalityNames(modalities, t) {
|
|
1715
1735
|
return (Array.isArray(modalities) ? modalities : []).map((id) => modalityLabel(id, t)).join(' / ')
|
|
1716
1736
|
}
|
|
1717
1737
|
|
|
1718
1738
|
/** Input modalities the manual editor can declare, in display order. */
|
|
1719
|
-
|
|
1739
|
+
const OVERRIDE_MODALITIES = ['text', 'image', 'audio', 'video', 'file']
|
|
1720
1740
|
|
|
1721
1741
|
/** Effort levels the manual editor can declare, in display order. */
|
|
1722
|
-
|
|
1742
|
+
const OVERRIDE_EFFORTS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max']
|
|
1723
1743
|
|
|
1724
1744
|
/** Localized name of one effort id. */
|
|
1725
|
-
|
|
1745
|
+
function effortLabel(id, t) {
|
|
1726
1746
|
const key = 'effort.' + id
|
|
1727
1747
|
const label = t(key)
|
|
1728
1748
|
return label === key ? id : label
|
|
1729
1749
|
}
|
|
1730
1750
|
|
|
1731
1751
|
/** Identity of a manual override entry; same shape as the row key. */
|
|
1732
|
-
|
|
1752
|
+
function overrideKeyOf(entry) {
|
|
1733
1753
|
return entry ? keyOf(entry.provider, entry.model) : null
|
|
1734
1754
|
}
|
|
1735
1755
|
|
|
1736
1756
|
/** Model fields whose provenance can be manual. */
|
|
1737
|
-
|
|
1757
|
+
function manualFieldsOf(model) {
|
|
1738
1758
|
const sources = model && model.sources ? model.sources : {}
|
|
1739
1759
|
return ['kind', 'reasoning', 'context', 'modalities'].filter(
|
|
1740
1760
|
(field) => sources[field] === 'manual',
|
|
1741
1761
|
)
|
|
1742
1762
|
}
|
|
1743
1763
|
|
|
1764
|
+
|
|
1765
|
+
exports.keyOf = keyOf
|
|
1766
|
+
exports.hiddenSetOf = hiddenSetOf
|
|
1767
|
+
exports.providerLabel = providerLabel
|
|
1768
|
+
exports.COLLAPSE_KEY = COLLAPSE_KEY
|
|
1769
|
+
exports.readCollapsedGroups = readCollapsedGroups
|
|
1770
|
+
exports.persistCollapsedGroups = persistCollapsedGroups
|
|
1771
|
+
exports.countModels = countModels
|
|
1772
|
+
exports.formatContext = formatContext
|
|
1773
|
+
exports.effortNames = effortNames
|
|
1774
|
+
exports.defaultEffortName = defaultEffortName
|
|
1775
|
+
exports.modalityLabel = modalityLabel
|
|
1776
|
+
exports.sourceLabel = sourceLabel
|
|
1777
|
+
exports.sourceOf = sourceOf
|
|
1778
|
+
exports.isInferredSource = isInferredSource
|
|
1779
|
+
exports.kindOf = kindOf
|
|
1780
|
+
exports.bucketOf = bucketOf
|
|
1781
|
+
exports.isGenerationKind = isGenerationKind
|
|
1782
|
+
exports.resolutionOf = resolutionOf
|
|
1783
|
+
exports.modalityNames = modalityNames
|
|
1784
|
+
exports.OVERRIDE_MODALITIES = OVERRIDE_MODALITIES
|
|
1785
|
+
exports.OVERRIDE_EFFORTS = OVERRIDE_EFFORTS
|
|
1786
|
+
exports.effortLabel = effortLabel
|
|
1787
|
+
exports.overrideKeyOf = overrideKeyOf
|
|
1788
|
+
exports.manualFieldsOf = manualFieldsOf
|
|
1744
1789
|
})
|
|
1745
1790
|
|
|
1746
1791
|
// -------------------------------------------------------- hooks
|
|
@@ -2078,13 +2123,13 @@ window.__ModuleLoader__.load({
|
|
|
2078
2123
|
*/
|
|
2079
2124
|
|
|
2080
2125
|
/** Number of one bucket's token sum, guarding partial buckets. */
|
|
2081
|
-
|
|
2126
|
+
function bucketTotalOf(buckets) {
|
|
2082
2127
|
if (!Array.isArray(buckets)) return 0
|
|
2083
2128
|
return buckets.reduce((sum, value) => sum + (Number.isFinite(value) ? value : 0), 0)
|
|
2084
2129
|
}
|
|
2085
2130
|
|
|
2086
2131
|
/** 1234567 → "1.2M"; 4096 → "4.1K"; 0/undefined → "0". */
|
|
2087
|
-
|
|
2132
|
+
function formatTokens(value) {
|
|
2088
2133
|
const tokens = Number.isFinite(value) ? value : 0
|
|
2089
2134
|
if (tokens >= 1_000_000) {
|
|
2090
2135
|
const millions = Math.round((tokens / 100_000)) / 10
|
|
@@ -2098,14 +2143,14 @@ window.__ModuleLoader__.load({
|
|
|
2098
2143
|
}
|
|
2099
2144
|
|
|
2100
2145
|
/** Local-calendar `YYYY-MM-DD` stamp used by the ledger's day buckets. */
|
|
2101
|
-
|
|
2146
|
+
function dayKeyOf(time) {
|
|
2102
2147
|
const date = new Date(Number.isFinite(time) ? time : Date.now())
|
|
2103
2148
|
if (Number.isNaN(date.getTime())) return ''
|
|
2104
2149
|
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
|
|
2105
2150
|
}
|
|
2106
2151
|
|
|
2107
2152
|
/** First day (Monday) of the local ISO week of `time`. */
|
|
2108
|
-
|
|
2153
|
+
function weekKeyOf(time) {
|
|
2109
2154
|
const date = new Date(Number.isFinite(time) ? time : Date.now())
|
|
2110
2155
|
const weekday = (date.getDay() + 6) % 7
|
|
2111
2156
|
date.setDate(date.getDate() - weekday)
|
|
@@ -2113,7 +2158,7 @@ window.__ModuleLoader__.load({
|
|
|
2113
2158
|
}
|
|
2114
2159
|
|
|
2115
2160
|
/** Local calendar month prefix of `time`. */
|
|
2116
|
-
|
|
2161
|
+
function monthPrefixOf(time) {
|
|
2117
2162
|
return dayKeyOf(time).slice(0, 7)
|
|
2118
2163
|
}
|
|
2119
2164
|
|
|
@@ -2124,7 +2169,7 @@ window.__ModuleLoader__.load({
|
|
|
2124
2169
|
* simpler pass (visibility only). Inputs are the loaded groups plus the five
|
|
2125
2170
|
* filter axes; output keeps the group objects in order with only kept models.
|
|
2126
2171
|
*/
|
|
2127
|
-
|
|
2172
|
+
function computeFilteredGroups(groups, { filter = 'all', query = '', multimodalOnly = false, reasoningOnly = false, minContext = 0 } = {}) {
|
|
2128
2173
|
const normalized = String(query ?? '').trim().toLowerCase()
|
|
2129
2174
|
const filtered = []
|
|
2130
2175
|
for (const group of groups ?? []) {
|
|
@@ -2159,14 +2204,14 @@ window.__ModuleLoader__.load({
|
|
|
2159
2204
|
}
|
|
2160
2205
|
|
|
2161
2206
|
/** Counts per kind bucket for the whole list. */
|
|
2162
|
-
|
|
2207
|
+
function countKinds(models) {
|
|
2163
2208
|
const counts = { chat: 0, image: 0, video: 0, other: 0 }
|
|
2164
2209
|
for (const model of models ?? []) counts[bucket(model)] += 1
|
|
2165
2210
|
return counts
|
|
2166
2211
|
}
|
|
2167
2212
|
|
|
2168
2213
|
/** Checker-model candidates from a loaded catalog state. */
|
|
2169
|
-
|
|
2214
|
+
function checkerRoutesOf(groups) {
|
|
2170
2215
|
const routes = []
|
|
2171
2216
|
for (const group of groups ?? []) {
|
|
2172
2217
|
if (group === null || typeof group !== 'object') continue
|
|
@@ -2177,7 +2222,7 @@ window.__ModuleLoader__.load({
|
|
|
2177
2222
|
}
|
|
2178
2223
|
|
|
2179
2224
|
/** Compact label + tooltip for one provider probe diagnostic. */
|
|
2180
|
-
|
|
2225
|
+
function probeOf(state, group, t) {
|
|
2181
2226
|
const list = Array.isArray(state.providers) ? state.providers : []
|
|
2182
2227
|
const diagnostic = list.find((item) => item && item.id === group.id)
|
|
2183
2228
|
if (diagnostic === undefined) return null
|
|
@@ -2207,6 +2252,16 @@ window.__ModuleLoader__.load({
|
|
|
2207
2252
|
return { label: t('group.probeSkipped'), title: details }
|
|
2208
2253
|
}
|
|
2209
2254
|
|
|
2255
|
+
|
|
2256
|
+
exports.bucketTotalOf = bucketTotalOf
|
|
2257
|
+
exports.formatTokens = formatTokens
|
|
2258
|
+
exports.dayKeyOf = dayKeyOf
|
|
2259
|
+
exports.weekKeyOf = weekKeyOf
|
|
2260
|
+
exports.monthPrefixOf = monthPrefixOf
|
|
2261
|
+
exports.computeFilteredGroups = computeFilteredGroups
|
|
2262
|
+
exports.countKinds = countKinds
|
|
2263
|
+
exports.checkerRoutesOf = checkerRoutesOf
|
|
2264
|
+
exports.probeOf = probeOf
|
|
2210
2265
|
})
|
|
2211
2266
|
|
|
2212
2267
|
// -------------------------------------------------------- settings-section
|
|
@@ -3040,7 +3095,7 @@ window.__ModuleLoader__.load({
|
|
|
3040
3095
|
anchor.remove()
|
|
3041
3096
|
}
|
|
3042
3097
|
|
|
3043
|
-
|
|
3098
|
+
function UsageToolbar({ usage, t, features }) {
|
|
3044
3099
|
const state = useSource(usage)
|
|
3045
3100
|
const supported = features.length === 0 || features.includes('usage')
|
|
3046
3101
|
const ranges = state.snapshot?.ranges
|
|
@@ -3114,6 +3169,8 @@ window.__ModuleLoader__.load({
|
|
|
3114
3169
|
)
|
|
3115
3170
|
}
|
|
3116
3171
|
|
|
3172
|
+
|
|
3173
|
+
exports.UsageToolbar = UsageToolbar
|
|
3117
3174
|
})
|
|
3118
3175
|
|
|
3119
3176
|
// -------------------------------------------------------- entry
|