@kenz1117/dsh-ui-usage-billing 0.9.6 → 0.9.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.
- package/README.en.md +2 -1
- package/README.md +2 -1
- package/lib/client.js +370 -295
- package/lib/index.js +562 -254
- package/lib/types/aggregate.d.ts +5 -0
- package/lib/types/balance.d.ts +5 -6
- package/lib/types/client/PerfPanel.d.ts +45 -0
- package/lib/types/client/PluginInfoCard.d.ts +12 -0
- package/lib/types/client/TokenPanel.d.ts +24 -0
- package/lib/types/client/UsageBilling.d.ts +107 -1
- package/lib/types/client/heatmap.d.ts +4 -2
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/plan-knowledge.d.ts +24 -5
- package/lib/types/client/plugin-info.d.ts +20 -0
- package/lib/types/client/usage-billing-settings.d.ts +20 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/pricing-shared.d.ts +4 -2
- package/lib/types/resilience.d.ts +49 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -34,266 +34,266 @@ window.__ModuleLoader__.load({
|
|
|
34
34
|
document.head.appendChild(tag);
|
|
35
35
|
}
|
|
36
36
|
var UsageBilling_module_css_default = {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"subscriptionExhausted": "VWh0dG_subscriptionExhausted",
|
|
48
|
-
"pluginInfoLabel": "VWh0dG_pluginInfoLabel",
|
|
49
|
-
"peakAlertText": "VWh0dG_peakAlertText",
|
|
50
|
-
"dashboardTitle": "VWh0dG_dashboardTitle",
|
|
51
|
-
"budgetFillWarn": "VWh0dG_budgetFillWarn",
|
|
52
|
-
"chartEmpty": "VWh0dG_chartEmpty",
|
|
53
|
-
"deltaUp": "VWh0dG_deltaUp",
|
|
54
|
-
"rounds": "VWh0dG_rounds",
|
|
55
|
-
"roundsEmpty": "VWh0dG_roundsEmpty",
|
|
56
|
-
"chartLine": "VWh0dG_chartLine",
|
|
57
|
-
"peakAlertHint": "VWh0dG_peakAlertHint",
|
|
58
|
-
"rangeToggle": "VWh0dG_rangeToggle",
|
|
59
|
-
"bucketCost": "VWh0dG_bucketCost",
|
|
60
|
-
"heroReadout": "VWh0dG_heroReadout",
|
|
61
|
-
"healthBadgeBad": "VWh0dG_healthBadgeBad",
|
|
62
|
-
"peakAlert": "VWh0dG_peakAlert",
|
|
63
|
-
"modelProvider": "VWh0dG_modelProvider",
|
|
64
|
-
"heroGauge": "VWh0dG_heroGauge",
|
|
65
|
-
"healthBadge": "VWh0dG_healthBadge",
|
|
37
|
+
"heroMeta": "VWh0dG_heroMeta",
|
|
38
|
+
"kpiDetail": "VWh0dG_kpiDetail",
|
|
39
|
+
"closeButton": "VWh0dG_closeButton",
|
|
40
|
+
"kpiGrid": "VWh0dG_kpiGrid",
|
|
41
|
+
"tokenModelPartIn": "VWh0dG_tokenModelPartIn",
|
|
42
|
+
"kpiLabel": "VWh0dG_kpiLabel",
|
|
43
|
+
"triggerBody": "VWh0dG_triggerBody",
|
|
44
|
+
"roundsBarCol": "VWh0dG_roundsBarCol",
|
|
45
|
+
"peakAlertClose": "VWh0dG_peakAlertClose",
|
|
46
|
+
"peakAlertSelect": "VWh0dG_peakAlertSelect",
|
|
66
47
|
"providerGroupList": "VWh0dG_providerGroupList",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"budgetHint": "VWh0dG_budgetHint",
|
|
76
|
-
"bucketStat": "VWh0dG_bucketStat",
|
|
77
|
-
"chartWrap": "VWh0dG_chartWrap",
|
|
78
|
-
"roundsBar": "VWh0dG_roundsBar",
|
|
79
|
-
"chartAxisLabel": "VWh0dG_chartAxisLabel",
|
|
80
|
-
"subscriptionPct": "VWh0dG_subscriptionPct",
|
|
81
|
-
"healthBad": "VWh0dG_healthBad",
|
|
82
|
-
"heroLabel": "VWh0dG_heroLabel",
|
|
83
|
-
"tabPanelIn": "VWh0dG_tabPanelIn",
|
|
84
|
-
"hero": "VWh0dG_hero",
|
|
85
|
-
"emptyRow": "VWh0dG_emptyRow",
|
|
86
|
-
"providerGroupName": "VWh0dG_providerGroupName",
|
|
87
|
-
"na": "VWh0dG_na",
|
|
88
|
-
"triggerSpark": "VWh0dG_triggerSpark",
|
|
89
|
-
"chartStack": "VWh0dG_chartStack",
|
|
90
|
-
"chartTooltipRow": "VWh0dG_chartTooltipRow",
|
|
48
|
+
"providerGroupBalance": "VWh0dG_providerGroupBalance",
|
|
49
|
+
"heroGaugeSvg": "VWh0dG_heroGaugeSvg",
|
|
50
|
+
"peakAlertCenter": "VWh0dG_peakAlertCenter",
|
|
51
|
+
"triggerSparkHot": "VWh0dG_triggerSparkHot",
|
|
52
|
+
"budgetFillOver": "VWh0dG_budgetFillOver",
|
|
53
|
+
"subscriptionCard": "VWh0dG_subscriptionCard",
|
|
54
|
+
"subscriptionPlan": "VWh0dG_subscriptionPlan",
|
|
55
|
+
"triggerPopValue": "VWh0dG_triggerPopValue",
|
|
91
56
|
"shareSegPeak": "VWh0dG_shareSegPeak",
|
|
92
|
-
"
|
|
93
|
-
"dashboardHead": "VWh0dG_dashboardHead",
|
|
94
|
-
"shareSegOff": "VWh0dG_shareSegOff",
|
|
95
|
-
"heroGaugeArc": "VWh0dG_heroGaugeArc",
|
|
96
|
-
"tokenModelPartOut": "VWh0dG_tokenModelPartOut",
|
|
97
|
-
"tabButton": "VWh0dG_tabButton",
|
|
98
|
-
"heroGaugeLabel": "VWh0dG_heroGaugeLabel",
|
|
99
|
-
"chartLegend": "VWh0dG_chartLegend",
|
|
100
|
-
"triggerPopBars": "VWh0dG_triggerPopBars",
|
|
101
|
-
"dashboardBody": "VWh0dG_dashboardBody",
|
|
102
|
-
"pluginInfoRow": "VWh0dG_pluginInfoRow",
|
|
103
|
-
"triggerWrap": "VWh0dG_triggerWrap",
|
|
104
|
-
"budgetOverPulse": "VWh0dG_budgetOverPulse",
|
|
105
|
-
"modelDot": "VWh0dG_modelDot",
|
|
106
|
-
"pricingChevronOpen": "VWh0dG_pricingChevronOpen",
|
|
107
|
-
"switchKnob": "VWh0dG_switchKnob",
|
|
108
|
-
"kpiTile": "VWh0dG_kpiTile",
|
|
109
|
-
"shareTrack": "VWh0dG_shareTrack",
|
|
57
|
+
"balanceCell": "VWh0dG_balanceCell",
|
|
110
58
|
"settingsTitle": "VWh0dG_settingsTitle",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"currencyToggle": "VWh0dG_currencyToggle",
|
|
115
|
-
"subscriptionGrid": "VWh0dG_subscriptionGrid",
|
|
116
|
-
"subscriptionStatus": "VWh0dG_subscriptionStatus",
|
|
117
|
-
"peakAlertPeak": "VWh0dG_peakAlertPeak",
|
|
118
|
-
"healthOk": "VWh0dG_healthOk",
|
|
119
|
-
"settingsHint": "VWh0dG_settingsHint",
|
|
120
|
-
"subscriptionTier": "VWh0dG_subscriptionTier",
|
|
121
|
-
"tableScroll": "VWh0dG_tableScroll",
|
|
122
|
-
"heatmapCellEmpty": "VWh0dG_heatmapCellEmpty",
|
|
123
|
-
"roundsBarColOff": "VWh0dG_roundsBarColOff",
|
|
124
|
-
"bandTagOff": "VWh0dG_bandTagOff",
|
|
125
|
-
"modelTableScroll": "VWh0dG_modelTableScroll",
|
|
126
|
-
"roundsAxis": "VWh0dG_roundsAxis",
|
|
127
|
-
"subscriptionFillWarn": "VWh0dG_subscriptionFillWarn",
|
|
128
|
-
"pluginInfoValue": "VWh0dG_pluginInfoValue",
|
|
129
|
-
"estimatedTag": "VWh0dG_estimatedTag",
|
|
130
|
-
"triggerSub": "VWh0dG_triggerSub",
|
|
131
|
-
"heroSideItem": "VWh0dG_heroSideItem",
|
|
132
|
-
"panelHint": "VWh0dG_panelHint",
|
|
59
|
+
"modelCell": "VWh0dG_modelCell",
|
|
60
|
+
"bucketStatSub": "VWh0dG_bucketStatSub",
|
|
61
|
+
"peakAlertPanel": "VWh0dG_peakAlertPanel",
|
|
133
62
|
"triggerPop": "VWh0dG_triggerPop",
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"tokenModelShareRow": "VWh0dG_tokenModelShareRow",
|
|
137
|
-
"heatmapYearCell": "VWh0dG_heatmapYearCell",
|
|
138
|
-
"heroSideSpacer": "VWh0dG_heroSideSpacer",
|
|
139
|
-
"roundsFlagBadge": "VWh0dG_roundsFlagBadge",
|
|
140
|
-
"dashboardIn": "VWh0dG_dashboardIn",
|
|
141
|
-
"uncataloguedTag": "VWh0dG_uncataloguedTag",
|
|
142
|
-
"subscriptionAuto": "VWh0dG_subscriptionAuto",
|
|
143
|
-
"triggerRow": "VWh0dG_triggerRow",
|
|
144
|
-
"liveTierPeak": "VWh0dG_liveTierPeak",
|
|
145
|
-
"exportBar": "VWh0dG_exportBar",
|
|
146
|
-
"providerGroup": "VWh0dG_providerGroup",
|
|
147
|
-
"heatmapGrid": "VWh0dG_heatmapGrid",
|
|
148
|
-
"shareSeg": "VWh0dG_shareSeg",
|
|
63
|
+
"chartWrap": "VWh0dG_chartWrap",
|
|
64
|
+
"subscriptionWindowLabel": "VWh0dG_subscriptionWindowLabel",
|
|
149
65
|
"rateBadge": "VWh0dG_rateBadge",
|
|
150
|
-
"heroGaugeCenter": "VWh0dG_heroGaugeCenter",
|
|
151
|
-
"pluginInfoLink": "VWh0dG_pluginInfoLink",
|
|
152
|
-
"shareSegUser": "VWh0dG_shareSegUser",
|
|
153
|
-
"delta": "VWh0dG_delta",
|
|
154
|
-
"trigger": "VWh0dG_trigger",
|
|
155
|
-
"dashboard": "VWh0dG_dashboard",
|
|
156
|
-
"dashboardSubtitle": "VWh0dG_dashboardSubtitle",
|
|
157
|
-
"tabNav": "VWh0dG_tabNav",
|
|
158
|
-
"chartSvg": "VWh0dG_chartSvg",
|
|
159
|
-
"heroGaugePctOver": "VWh0dG_heroGaugePctOver",
|
|
160
|
-
"flatTag": "VWh0dG_flatTag",
|
|
161
|
-
"chartTooltipSwatch": "VWh0dG_chartTooltipSwatch",
|
|
162
|
-
"panel": "VWh0dG_panel",
|
|
163
66
|
"bucketStatLabel": "VWh0dG_bucketStatLabel",
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"liveCostBar": "VWh0dG_liveCostBar",
|
|
171
|
-
"shareItem": "VWh0dG_shareItem",
|
|
172
|
-
"tokenModelPartIn": "VWh0dG_tokenModelPartIn",
|
|
173
|
-
"peakAlertField": "VWh0dG_peakAlertField",
|
|
174
|
-
"peakAlertCountdown": "VWh0dG_peakAlertCountdown",
|
|
175
|
-
"heroGaugeSvg": "VWh0dG_heroGaugeSvg",
|
|
176
|
-
"roundsBarWrap": "VWh0dG_roundsBarWrap",
|
|
177
|
-
"triggerSparkHot": "VWh0dG_triggerSparkHot",
|
|
178
|
-
"shareLegend": "VWh0dG_shareLegend",
|
|
179
|
-
"tokenModelBar": "VWh0dG_tokenModelBar",
|
|
180
|
-
"heroCurrency": "VWh0dG_heroCurrency",
|
|
181
|
-
"subscriptionReset": "VWh0dG_subscriptionReset",
|
|
182
|
-
"heroSideValue": "VWh0dG_heroSideValue",
|
|
183
|
-
"peakAlertTag": "VWh0dG_peakAlertTag",
|
|
184
|
-
"subscriptionWindow": "VWh0dG_subscriptionWindow",
|
|
185
|
-
"switchOn": "VWh0dG_switchOn",
|
|
67
|
+
"dashboardBody": "VWh0dG_dashboardBody",
|
|
68
|
+
"flatTag": "VWh0dG_flatTag",
|
|
69
|
+
"subscriptionTrack": "VWh0dG_subscriptionTrack",
|
|
70
|
+
"railButton": "VWh0dG_railButton",
|
|
71
|
+
"bucketSummary": "VWh0dG_bucketSummary",
|
|
72
|
+
"heatmapLegend": "VWh0dG_heatmapLegend",
|
|
186
73
|
"rateBadgeBuiltin": "VWh0dG_rateBadgeBuiltin",
|
|
74
|
+
"heatmapCellEmpty": "VWh0dG_heatmapCellEmpty",
|
|
75
|
+
"peakAlertPreview": "VWh0dG_peakAlertPreview",
|
|
76
|
+
"healthIdle": "VWh0dG_healthIdle",
|
|
77
|
+
"subscriptionPct": "VWh0dG_subscriptionPct",
|
|
78
|
+
"modelDot": "VWh0dG_modelDot",
|
|
79
|
+
"providerGroupTitle": "VWh0dG_providerGroupTitle",
|
|
187
80
|
"rangeButton": "VWh0dG_rangeButton",
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
-
"
|
|
195
|
-
"chartGrid": "VWh0dG_chartGrid",
|
|
196
|
-
"subscriptionName": "VWh0dG_subscriptionName",
|
|
197
|
-
"liveCostItem": "VWh0dG_liveCostItem",
|
|
198
|
-
"triggerIcon": "VWh0dG_triggerIcon",
|
|
199
|
-
"triggerSparkBar": "VWh0dG_triggerSparkBar",
|
|
200
|
-
"providerGroupBadge": "VWh0dG_providerGroupBadge",
|
|
201
|
-
"pricingTip": "VWh0dG_pricingTip",
|
|
202
|
-
"peakAlertPanelBody": "VWh0dG_peakAlertPanelBody",
|
|
81
|
+
"heatmapYearScroll": "VWh0dG_heatmapYearScroll",
|
|
82
|
+
"bucketSep": "VWh0dG_bucketSep",
|
|
83
|
+
"tokenModelParts": "VWh0dG_tokenModelParts",
|
|
84
|
+
"heroSideLabel": "VWh0dG_heroSideLabel",
|
|
85
|
+
"peakAlertCountdown": "VWh0dG_peakAlertCountdown",
|
|
86
|
+
"subscriptionHead": "VWh0dG_subscriptionHead",
|
|
87
|
+
"pluginInfoValue": "VWh0dG_pluginInfoValue",
|
|
203
88
|
"chartLegendLine": "VWh0dG_chartLegendLine",
|
|
204
|
-
"
|
|
89
|
+
"bucketCost": "VWh0dG_bucketCost",
|
|
90
|
+
"roundsBarColOff": "VWh0dG_roundsBarColOff",
|
|
91
|
+
"deltaUp": "VWh0dG_deltaUp",
|
|
92
|
+
"budgetControls": "VWh0dG_budgetControls",
|
|
93
|
+
"exportButton": "VWh0dG_exportButton",
|
|
94
|
+
"shareDot": "VWh0dG_shareDot",
|
|
95
|
+
"peakAlertPanelLabel": "VWh0dG_peakAlertPanelLabel",
|
|
96
|
+
"pluginInfo": "VWh0dG_pluginInfo",
|
|
97
|
+
"tokenModelShareRow": "VWh0dG_tokenModelShareRow",
|
|
98
|
+
"pricingChevronOpen": "VWh0dG_pricingChevronOpen",
|
|
99
|
+
"peakAlertCheck": "VWh0dG_peakAlertCheck",
|
|
100
|
+
"peakAlertHint": "VWh0dG_peakAlertHint",
|
|
101
|
+
"balanceDays": "VWh0dG_balanceDays",
|
|
102
|
+
"trigger": "VWh0dG_trigger",
|
|
103
|
+
"kpiValue": "VWh0dG_kpiValue",
|
|
104
|
+
"delta": "VWh0dG_delta",
|
|
105
|
+
"chartBar": "VWh0dG_chartBar",
|
|
106
|
+
"healthDot": "VWh0dG_healthDot",
|
|
107
|
+
"bucketStatValue": "VWh0dG_bucketStatValue",
|
|
205
108
|
"shareSegAssistant": "VWh0dG_shareSegAssistant",
|
|
206
|
-
"liveQuotaCrit": "VWh0dG_liveQuotaCrit",
|
|
207
|
-
"roundsBarCol": "VWh0dG_roundsBarCol",
|
|
208
|
-
"bucketSummary": "VWh0dG_bucketSummary",
|
|
209
|
-
"heroSide": "VWh0dG_heroSide",
|
|
210
|
-
"balanceCell": "VWh0dG_balanceCell",
|
|
211
|
-
"pricingToggle": "VWh0dG_pricingToggle",
|
|
212
|
-
"triggerPopValue": "VWh0dG_triggerPopValue",
|
|
213
109
|
"currencyButtonActive": "VWh0dG_currencyButtonActive",
|
|
214
|
-
"
|
|
110
|
+
"dashboard": "VWh0dG_dashboard",
|
|
111
|
+
"budgetInputWrap": "VWh0dG_budgetInputWrap",
|
|
112
|
+
"liveTierOff": "VWh0dG_liveTierOff",
|
|
113
|
+
"pricingToggleText": "VWh0dG_pricingToggleText",
|
|
114
|
+
"peakAlertField": "VWh0dG_peakAlertField",
|
|
115
|
+
"costCol": "VWh0dG_costCol",
|
|
116
|
+
"chartDot": "VWh0dG_chartDot",
|
|
215
117
|
"heroValue": "VWh0dG_heroValue",
|
|
216
|
-
"
|
|
118
|
+
"subscriptionFillWarn": "VWh0dG_subscriptionFillWarn",
|
|
119
|
+
"triggerAmount": "VWh0dG_triggerAmount",
|
|
120
|
+
"bucketThird": "VWh0dG_bucketThird",
|
|
121
|
+
"bandPriceOff": "VWh0dG_bandPriceOff",
|
|
122
|
+
"subscriptionExhausted": "VWh0dG_subscriptionExhausted",
|
|
123
|
+
"roundsFlagBadge": "VWh0dG_roundsFlagBadge",
|
|
124
|
+
"dashboardModal": "VWh0dG_dashboardModal",
|
|
125
|
+
"providerGroupHead": "VWh0dG_providerGroupHead",
|
|
126
|
+
"bandTag": "VWh0dG_bandTag",
|
|
127
|
+
"heroTop": "VWh0dG_heroTop",
|
|
128
|
+
"triggerPopRow": "VWh0dG_triggerPopRow",
|
|
129
|
+
"na": "VWh0dG_na",
|
|
130
|
+
"liveCostSep": "VWh0dG_liveCostSep",
|
|
131
|
+
"bucketOfficial": "VWh0dG_bucketOfficial",
|
|
132
|
+
"pricingChevron": "VWh0dG_pricingChevron",
|
|
133
|
+
"shareValue": "VWh0dG_shareValue",
|
|
134
|
+
"chartSvg": "VWh0dG_chartSvg",
|
|
135
|
+
"balanceDaysLow": "VWh0dG_balanceDaysLow",
|
|
136
|
+
"dashboardTitle": "VWh0dG_dashboardTitle",
|
|
217
137
|
"rangeButtonActive": "VWh0dG_rangeButtonActive",
|
|
218
|
-
"
|
|
219
|
-
"
|
|
138
|
+
"roundsBarFlagged": "VWh0dG_roundsBarFlagged",
|
|
139
|
+
"triggerPopBar": "VWh0dG_triggerPopBar",
|
|
140
|
+
"providerGroupBadge": "VWh0dG_providerGroupBadge",
|
|
141
|
+
"chartTooltipDate": "VWh0dG_chartTooltipDate",
|
|
142
|
+
"panel": "VWh0dG_panel",
|
|
143
|
+
"roundsEmpty": "VWh0dG_roundsEmpty",
|
|
144
|
+
"tableScroll": "VWh0dG_tableScroll",
|
|
145
|
+
"triggerPopBars": "VWh0dG_triggerPopBars",
|
|
146
|
+
"heroCurrency": "VWh0dG_heroCurrency",
|
|
147
|
+
"heatmapCell": "VWh0dG_heatmapCell",
|
|
148
|
+
"peakAlertTag": "VWh0dG_peakAlertTag",
|
|
149
|
+
"chartLegendBar": "VWh0dG_chartLegendBar",
|
|
150
|
+
"chartCrosshair": "VWh0dG_chartCrosshair",
|
|
151
|
+
"heroSide": "VWh0dG_heroSide",
|
|
152
|
+
"exportLabel": "VWh0dG_exportLabel",
|
|
153
|
+
"chartLine": "VWh0dG_chartLine",
|
|
154
|
+
"heroGaugePctOver": "VWh0dG_heroGaugePctOver",
|
|
155
|
+
"heroGaugePct": "VWh0dG_heroGaugePct",
|
|
156
|
+
"heroSideSpacer": "VWh0dG_heroSideSpacer",
|
|
157
|
+
"modelProvider": "VWh0dG_modelProvider",
|
|
158
|
+
"tokenPanel": "VWh0dG_tokenPanel",
|
|
159
|
+
"peakAlertPeak": "VWh0dG_peakAlertPeak",
|
|
160
|
+
"pricingTable": "VWh0dG_pricingTable",
|
|
161
|
+
"kpiTile": "VWh0dG_kpiTile",
|
|
162
|
+
"heroMain": "VWh0dG_heroMain",
|
|
163
|
+
"roundsBarWrap": "VWh0dG_roundsBarWrap",
|
|
164
|
+
"heroGaugeLabel": "VWh0dG_heroGaugeLabel",
|
|
165
|
+
"exportBar": "VWh0dG_exportBar",
|
|
166
|
+
"liveQuotaCrit": "VWh0dG_liveQuotaCrit",
|
|
167
|
+
"heroGaugeCenter": "VWh0dG_heroGaugeCenter",
|
|
168
|
+
"shareLegend": "VWh0dG_shareLegend",
|
|
169
|
+
"chartStack": "VWh0dG_chartStack",
|
|
170
|
+
"budgetOverPulse": "VWh0dG_budgetOverPulse",
|
|
171
|
+
"chartLegend": "VWh0dG_chartLegend",
|
|
172
|
+
"dashboardSubtitle": "VWh0dG_dashboardSubtitle",
|
|
173
|
+
"currencyButton": "VWh0dG_currencyButton",
|
|
174
|
+
"roundsFlagMark": "VWh0dG_roundsFlagMark",
|
|
220
175
|
"modelName": "VWh0dG_modelName",
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"
|
|
176
|
+
"triggerSub": "VWh0dG_triggerSub",
|
|
177
|
+
"emptyRow": "VWh0dG_emptyRow",
|
|
178
|
+
"triggerPopLabel": "VWh0dG_triggerPopLabel",
|
|
179
|
+
"bandPrice": "VWh0dG_bandPrice",
|
|
180
|
+
"peakAlertPanelBody": "VWh0dG_peakAlertPanelBody",
|
|
181
|
+
"heroReadout": "VWh0dG_heroReadout",
|
|
182
|
+
"tabNav": "VWh0dG_tabNav",
|
|
224
183
|
"peakAlertPanelHead": "VWh0dG_peakAlertPanelHead",
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
"
|
|
228
|
-
"tokenPanel": "VWh0dG_tokenPanel",
|
|
229
|
-
"triggerPopRow": "VWh0dG_triggerPopRow",
|
|
230
|
-
"peakAlertPanel": "VWh0dG_peakAlertPanel",
|
|
231
|
-
"settingsHead": "VWh0dG_settingsHead",
|
|
232
|
-
"shareValue": "VWh0dG_shareValue",
|
|
233
|
-
"peakAlertNum": "VWh0dG_peakAlertNum",
|
|
234
|
-
"kpiDetail": "VWh0dG_kpiDetail",
|
|
235
|
-
"subscriptionPlan": "VWh0dG_subscriptionPlan",
|
|
236
|
-
"peakAlertPanelLabel": "VWh0dG_peakAlertPanelLabel",
|
|
237
|
-
"triggerBody": "VWh0dG_triggerBody",
|
|
238
|
-
"exportButton": "VWh0dG_exportButton",
|
|
239
|
-
"pricingChevron": "VWh0dG_pricingChevron",
|
|
240
|
-
"budgetUnit": "VWh0dG_budgetUnit",
|
|
241
|
-
"bucketStatValue": "VWh0dG_bucketStatValue",
|
|
242
|
-
"exportLabel": "VWh0dG_exportLabel",
|
|
243
|
-
"roundsBarLabel": "VWh0dG_roundsBarLabel",
|
|
184
|
+
"healthBad": "VWh0dG_healthBad",
|
|
185
|
+
"tokenModelPartOut": "VWh0dG_tokenModelPartOut",
|
|
186
|
+
"bucketStat": "VWh0dG_bucketStat",
|
|
244
187
|
"budgetValue": "VWh0dG_budgetValue",
|
|
245
|
-
"
|
|
246
|
-
"
|
|
188
|
+
"roundsBarLabel": "VWh0dG_roundsBarLabel",
|
|
189
|
+
"heroSideItem": "VWh0dG_heroSideItem",
|
|
190
|
+
"chartTooltipSwatch": "VWh0dG_chartTooltipSwatch",
|
|
191
|
+
"rounds": "VWh0dG_rounds",
|
|
192
|
+
"deltaDown": "VWh0dG_deltaDown",
|
|
193
|
+
"pluginInfoLabel": "VWh0dG_pluginInfoLabel",
|
|
194
|
+
"liveCostBar": "VWh0dG_liveCostBar",
|
|
247
195
|
"budgetHead": "VWh0dG_budgetHead",
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
196
|
+
"healthBadge": "VWh0dG_healthBadge",
|
|
197
|
+
"switchKnob": "VWh0dG_switchKnob",
|
|
198
|
+
"chartGrid": "VWh0dG_chartGrid",
|
|
199
|
+
"heroGauge": "VWh0dG_heroGauge",
|
|
200
|
+
"budgetLabel": "VWh0dG_budgetLabel",
|
|
201
|
+
"chartTooltipRow": "VWh0dG_chartTooltipRow",
|
|
202
|
+
"providerGroupMeta": "VWh0dG_providerGroupMeta",
|
|
251
203
|
"rateBadgeLive": "VWh0dG_rateBadgeLive",
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"
|
|
255
|
-
"
|
|
256
|
-
"
|
|
257
|
-
"
|
|
204
|
+
"rangeToggle": "VWh0dG_rangeToggle",
|
|
205
|
+
"heatmap": "VWh0dG_heatmap",
|
|
206
|
+
"heroGaugeArcOver": "VWh0dG_heroGaugeArcOver",
|
|
207
|
+
"subscriptionAuto": "VWh0dG_subscriptionAuto",
|
|
208
|
+
"subscriptionWindow": "VWh0dG_subscriptionWindow",
|
|
209
|
+
"heatmapGrid": "VWh0dG_heatmapGrid",
|
|
210
|
+
"subscriptionName": "VWh0dG_subscriptionName",
|
|
211
|
+
"triggerMeta": "VWh0dG_triggerMeta",
|
|
212
|
+
"healthBadgeOk": "VWh0dG_healthBadgeOk",
|
|
258
213
|
"trendPanel": "VWh0dG_trendPanel",
|
|
259
|
-
"
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"
|
|
263
|
-
"
|
|
264
|
-
"
|
|
265
|
-
"
|
|
266
|
-
"
|
|
214
|
+
"budget": "VWh0dG_budget",
|
|
215
|
+
"panelHint": "VWh0dG_panelHint",
|
|
216
|
+
"triggerSparkBar": "VWh0dG_triggerSparkBar",
|
|
217
|
+
"roundsAxis": "VWh0dG_roundsAxis",
|
|
218
|
+
"chartTooltip": "VWh0dG_chartTooltip",
|
|
219
|
+
"peakAlertIn": "VWh0dG_peakAlertIn",
|
|
220
|
+
"kpiGreen": "VWh0dG_kpiGreen",
|
|
221
|
+
"planTag": "VWh0dG_planTag",
|
|
267
222
|
"peakAlertOff": "VWh0dG_peakAlertOff",
|
|
268
|
-
"
|
|
223
|
+
"heroGaugeTrack": "VWh0dG_heroGaugeTrack",
|
|
224
|
+
"shareSegUser": "VWh0dG_shareSegUser",
|
|
225
|
+
"healthBadgeBad": "VWh0dG_healthBadgeBad",
|
|
226
|
+
"panelTitle": "VWh0dG_panelTitle",
|
|
227
|
+
"shareSegOff": "VWh0dG_shareSegOff",
|
|
228
|
+
"estimatedTag": "VWh0dG_estimatedTag",
|
|
229
|
+
"tabButton": "VWh0dG_tabButton",
|
|
230
|
+
"subscriptionFillOver": "VWh0dG_subscriptionFillOver",
|
|
231
|
+
"heatmapHover": "VWh0dG_heatmapHover",
|
|
269
232
|
"switch": "VWh0dG_switch",
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"
|
|
233
|
+
"triggerWrap": "VWh0dG_triggerWrap",
|
|
234
|
+
"settingsHead": "VWh0dG_settingsHead",
|
|
235
|
+
"budgetHint": "VWh0dG_budgetHint",
|
|
236
|
+
"subscriptionFill": "VWh0dG_subscriptionFill",
|
|
237
|
+
"dashboardHead": "VWh0dG_dashboardHead",
|
|
238
|
+
"uncataloguedTag": "VWh0dG_uncataloguedTag",
|
|
239
|
+
"pluginInfoRow": "VWh0dG_pluginInfoRow",
|
|
240
|
+
"pricingTip": "VWh0dG_pricingTip",
|
|
241
|
+
"chartEmpty": "VWh0dG_chartEmpty",
|
|
242
|
+
"bandTagOff": "VWh0dG_bandTagOff",
|
|
243
|
+
"providerGroupName": "VWh0dG_providerGroupName",
|
|
244
|
+
"subscriptionReset": "VWh0dG_subscriptionReset",
|
|
245
|
+
"peakAlertCorner": "VWh0dG_peakAlertCorner",
|
|
246
|
+
"subscriptionStatus": "VWh0dG_subscriptionStatus",
|
|
247
|
+
"shareTrack": "VWh0dG_shareTrack",
|
|
248
|
+
"switchOn": "VWh0dG_switchOn",
|
|
249
|
+
"liveCostItem": "VWh0dG_liveCostItem",
|
|
250
|
+
"dashboardRight": "VWh0dG_dashboardRight",
|
|
251
|
+
"subscriptionTier": "VWh0dG_subscriptionTier",
|
|
279
252
|
"providerGroupBalanceLabel": "VWh0dG_providerGroupBalanceLabel",
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"
|
|
285
|
-
"
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"
|
|
290
|
-
"
|
|
253
|
+
"shareItem": "VWh0dG_shareItem",
|
|
254
|
+
"tabPanelIn": "VWh0dG_tabPanelIn",
|
|
255
|
+
"liveQuotaWarn": "VWh0dG_liveQuotaWarn",
|
|
256
|
+
"roundsBars": "VWh0dG_roundsBars",
|
|
257
|
+
"triggerIcon": "VWh0dG_triggerIcon",
|
|
258
|
+
"shareSegTool": "VWh0dG_shareSegTool",
|
|
259
|
+
"modelTableScroll": "VWh0dG_modelTableScroll",
|
|
260
|
+
"settingsHint": "VWh0dG_settingsHint",
|
|
261
|
+
"tabPanel": "VWh0dG_tabPanel",
|
|
262
|
+
"triggerRow": "VWh0dG_triggerRow",
|
|
263
|
+
"tokenModelBar": "VWh0dG_tokenModelBar",
|
|
264
|
+
"budgetFillWarn": "VWh0dG_budgetFillWarn",
|
|
265
|
+
"numCol": "VWh0dG_numCol",
|
|
266
|
+
"roundsBarColPeak": "VWh0dG_roundsBarColPeak",
|
|
267
|
+
"shareSeg": "VWh0dG_shareSeg",
|
|
268
|
+
"providerGroup": "VWh0dG_providerGroup",
|
|
269
|
+
"hero": "VWh0dG_hero",
|
|
270
|
+
"triggerSpark": "VWh0dG_triggerSpark",
|
|
271
|
+
"budgetUnit": "VWh0dG_budgetUnit",
|
|
272
|
+
"heatmapYearGrid": "VWh0dG_heatmapYearGrid",
|
|
273
|
+
"heatmapYearCell": "VWh0dG_heatmapYearCell",
|
|
274
|
+
"peakAlertText": "VWh0dG_peakAlertText",
|
|
275
|
+
"tabButtonActive": "VWh0dG_tabButtonActive",
|
|
276
|
+
"liveTierPeak": "VWh0dG_liveTierPeak",
|
|
277
|
+
"pluginInfoLink": "VWh0dG_pluginInfoLink",
|
|
278
|
+
"peakAlertNum": "VWh0dG_peakAlertNum",
|
|
279
|
+
"panelHead": "VWh0dG_panelHead",
|
|
280
|
+
"heatmapFooter": "VWh0dG_heatmapFooter",
|
|
281
|
+
"healthOk": "VWh0dG_healthOk",
|
|
282
|
+
"budgetInput": "VWh0dG_budgetInput",
|
|
283
|
+
"budgetTrack": "VWh0dG_budgetTrack",
|
|
284
|
+
"pricingToggle": "VWh0dG_pricingToggle",
|
|
285
|
+
"dashboardIn": "VWh0dG_dashboardIn",
|
|
286
|
+
"peakAlert": "VWh0dG_peakAlert",
|
|
291
287
|
"budgetFill": "VWh0dG_budgetFill",
|
|
292
|
-
"
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"
|
|
296
|
-
"
|
|
288
|
+
"modelTable": "VWh0dG_modelTable",
|
|
289
|
+
"subscriptionGrid": "VWh0dG_subscriptionGrid",
|
|
290
|
+
"heroSideValue": "VWh0dG_heroSideValue",
|
|
291
|
+
"roundsBar": "VWh0dG_roundsBar",
|
|
292
|
+
"chartAxisLabel": "VWh0dG_chartAxisLabel",
|
|
293
|
+
"heroLabel": "VWh0dG_heroLabel",
|
|
294
|
+
"headTitleRow": "VWh0dG_headTitleRow",
|
|
295
|
+
"currencyToggle": "VWh0dG_currencyToggle",
|
|
296
|
+
"heroGaugeArc": "VWh0dG_heroGaugeArc"
|
|
297
297
|
};
|
|
298
298
|
//#endregion
|
|
299
299
|
//#region src/client/plan-knowledge.ts
|
|
@@ -304,7 +304,11 @@ window.__ModuleLoader__.load({
|
|
|
304
304
|
const PLAN_KNOWLEDGE = {
|
|
305
305
|
"opencode-go": {
|
|
306
306
|
type: "code",
|
|
307
|
-
|
|
307
|
+
subscription: {
|
|
308
|
+
amount: 10,
|
|
309
|
+
currency: "USD",
|
|
310
|
+
period: "month"
|
|
311
|
+
},
|
|
308
312
|
tier: {
|
|
309
313
|
amount: 10,
|
|
310
314
|
currency: "USD",
|
|
@@ -314,7 +318,11 @@ window.__ModuleLoader__.load({
|
|
|
314
318
|
},
|
|
315
319
|
opencode: {
|
|
316
320
|
type: "code",
|
|
317
|
-
|
|
321
|
+
subscription: {
|
|
322
|
+
amount: 10,
|
|
323
|
+
currency: "USD",
|
|
324
|
+
period: "month"
|
|
325
|
+
},
|
|
318
326
|
tier: {
|
|
319
327
|
amount: 10,
|
|
320
328
|
currency: "USD",
|
|
@@ -322,62 +330,49 @@ window.__ModuleLoader__.load({
|
|
|
322
330
|
label: "周额度 $30"
|
|
323
331
|
}
|
|
324
332
|
},
|
|
325
|
-
"kimi-coding": {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
},
|
|
329
|
-
"
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
},
|
|
333
|
-
"
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
"
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
"
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
"
|
|
358
|
-
|
|
359
|
-
subscriptionCny: 0
|
|
360
|
-
},
|
|
361
|
-
"ark-token-plan": {
|
|
362
|
-
type: "code",
|
|
363
|
-
subscriptionCny: 0
|
|
364
|
-
},
|
|
365
|
-
"doubao-token-plan": {
|
|
366
|
-
type: "code",
|
|
367
|
-
subscriptionCny: 0
|
|
368
|
-
},
|
|
369
|
-
"minimax": {
|
|
370
|
-
type: "code",
|
|
371
|
-
subscriptionCny: 0
|
|
372
|
-
},
|
|
373
|
-
"minimax-token-plan": {
|
|
374
|
-
type: "code",
|
|
375
|
-
subscriptionCny: 0
|
|
376
|
-
}
|
|
333
|
+
"kimi-coding": { type: "code" },
|
|
334
|
+
"zai-coding-cn": { type: "code" },
|
|
335
|
+
"zai-coding": { type: "code" },
|
|
336
|
+
"qwen-token-plan": { type: "code" },
|
|
337
|
+
"qwen-token-plan-cn": { type: "code" },
|
|
338
|
+
"xiaomi-token-plan-ams": { type: "code" },
|
|
339
|
+
"xiaomi-token-plan-cn": { type: "code" },
|
|
340
|
+
"xiaomi-token-plan-sgp": { type: "code" },
|
|
341
|
+
"volcengine-token-plan": { type: "code" },
|
|
342
|
+
"ark-token-plan": { type: "code" },
|
|
343
|
+
"doubao-token-plan": { type: "code" },
|
|
344
|
+
"minimax": { type: "code" },
|
|
345
|
+
"minimax-token-plan": { type: "code" }
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* 订阅/plan provider id 变体 → PLAN_KNOWLEDGE 规范键(引用 dsh-spend 的别名归一化)。
|
|
349
|
+
* 部署配置的订阅 provider id 写法不一(glm/zhipu/bigmodel、ark/volcengine、
|
|
350
|
+
* kimi/moonshot、xiaomi…),先归一化再匹配,提升"自动识别"覆盖率。
|
|
351
|
+
* 注意:裸 qwen/dashscope/tongyi 等是按量 API(token 计费)而非订阅,不归一到
|
|
352
|
+
* 订阅键——只有显式 token-plan 后缀才由 SUBSCRIPTION_ID_RE 判定为订阅。
|
|
353
|
+
*/
|
|
354
|
+
const PLAN_PROVIDER_ALIASES = {
|
|
355
|
+
"glm": "zai-coding-cn",
|
|
356
|
+
"bigmodel": "zai-coding-cn",
|
|
357
|
+
"zhipu": "zai-coding-cn",
|
|
358
|
+
"zhipuai": "zai-coding-cn",
|
|
359
|
+
"zai": "zai-coding",
|
|
360
|
+
"ark": "volcengine-token-plan",
|
|
361
|
+
"volcengine": "volcengine-token-plan",
|
|
362
|
+
"doubao": "doubao-token-plan",
|
|
363
|
+
"moonshot": "kimi-coding",
|
|
364
|
+
"kimi": "kimi-coding",
|
|
365
|
+
"xiaomi": "xiaomi-token-plan-cn",
|
|
366
|
+
"opencode": "opencode-go"
|
|
377
367
|
};
|
|
368
|
+
/** 归一化订阅 provider id:别名命中则映射到规范键,否则原样返回。 */
|
|
369
|
+
function normalizePlanProvider(providerId) {
|
|
370
|
+
if (providerId === "") return providerId;
|
|
371
|
+
return PLAN_PROVIDER_ALIASES[providerId] ?? providerId;
|
|
372
|
+
}
|
|
378
373
|
/** 自动识别的档位月费与周期额度口径(订阅卡片展示);无档位知识返回 undefined。 */
|
|
379
374
|
function tierInfoOf(providerId) {
|
|
380
|
-
const entry = PLAN_KNOWLEDGE[providerId];
|
|
375
|
+
const entry = PLAN_KNOWLEDGE[normalizePlanProvider(providerId)];
|
|
381
376
|
return entry?.type === "code" ? entry.tier : void 0;
|
|
382
377
|
}
|
|
383
378
|
const FALLBACK_RATES = [
|
|
@@ -3141,7 +3136,9 @@ window.__ModuleLoader__.load({
|
|
|
3141
3136
|
"billing.tokenHit": "缓存命中",
|
|
3142
3137
|
"billing.tokenOutput": "输出",
|
|
3143
3138
|
"billing.tokenTotal": "总 Token",
|
|
3144
|
-
"billing.tokenShare": "占比"
|
|
3139
|
+
"billing.tokenShare": "占比",
|
|
3140
|
+
"billing.usageStatsTool": "注入用量查询工具",
|
|
3141
|
+
"billing.usageStatsToolHint": "让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(改后需重载应用生效)"
|
|
3145
3142
|
};
|
|
3146
3143
|
const en = {
|
|
3147
3144
|
"billing.title": "Usage",
|
|
@@ -3321,7 +3318,9 @@ window.__ModuleLoader__.load({
|
|
|
3321
3318
|
"billing.tokenHit": "Cache hit",
|
|
3322
3319
|
"billing.tokenOutput": "Output",
|
|
3323
3320
|
"billing.tokenTotal": "Total tokens",
|
|
3324
|
-
"billing.tokenShare": "Share"
|
|
3321
|
+
"billing.tokenShare": "Share",
|
|
3322
|
+
"billing.usageStatsTool": "Inject usage-stats tool",
|
|
3323
|
+
"billing.usageStatsToolHint": "Lets the model query usage/cost inside a conversation; it consumes context per request, so keep it off for coding (takes effect after a reload)"
|
|
3325
3324
|
};
|
|
3326
3325
|
//#endregion
|
|
3327
3326
|
//#region src/client/provider-display.ts
|
|
@@ -3916,6 +3915,38 @@ window.__ModuleLoader__.load({
|
|
|
3916
3915
|
}
|
|
3917
3916
|
}
|
|
3918
3917
|
/**
|
|
3918
|
+
* 读取 usage_stats 工具开关当前值(插件自带接口,不依赖宿主浏览器设置白名单)。
|
|
3919
|
+
* @returns 当前是否注入;读取失败(服务未起/非 JSON)返回 undefined。
|
|
3920
|
+
*/
|
|
3921
|
+
async function loadUsageTool() {
|
|
3922
|
+
try {
|
|
3923
|
+
const response = await fetch("/api/billing/usage-tool");
|
|
3924
|
+
if (!response.ok) return void 0;
|
|
3925
|
+
const parsed = JSON.parse(await response.text());
|
|
3926
|
+
return typeof parsed.enabled === "boolean" ? parsed.enabled : void 0;
|
|
3927
|
+
} catch {
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
/**
|
|
3932
|
+
* 写 usage_stats 工具开关(插件自带接口)。工具注入是启动期决策,重启应用后生效。
|
|
3933
|
+
* @param enabled - 是否注入。
|
|
3934
|
+
* @returns 是否写成功。
|
|
3935
|
+
*/
|
|
3936
|
+
async function saveUsageTool(enabled) {
|
|
3937
|
+
try {
|
|
3938
|
+
const response = await fetch("/api/billing/usage-tool", {
|
|
3939
|
+
method: "POST",
|
|
3940
|
+
headers: { "content-type": "application/json" },
|
|
3941
|
+
body: JSON.stringify({ enabled })
|
|
3942
|
+
});
|
|
3943
|
+
if (!response.ok) return false;
|
|
3944
|
+
return JSON.parse(await response.text()).ok === true;
|
|
3945
|
+
} catch {
|
|
3946
|
+
return false;
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
/**
|
|
3919
3950
|
* Sidebar footer trigger: compact pill in wide mode, icon in rail mode.
|
|
3920
3951
|
* ZINE 模式下入口由主题插件的贴纸层承担,本触发器由 CSS
|
|
3921
3952
|
* (body[data-zine-mode] 选择器)隐藏,组件本身无 zine 分支。
|
|
@@ -4046,6 +4077,23 @@ window.__ModuleLoader__.load({
|
|
|
4046
4077
|
const [tab, setTab] = (0, react.useState)("overview");
|
|
4047
4078
|
const [trendDays, setTrendDays] = (0, react.useState)(7);
|
|
4048
4079
|
const [heatmapRange, setHeatmapRange] = (0, react.useState)("month");
|
|
4080
|
+
const [usageStatsEnabled, setUsageStatsEnabled] = (0, react.useState)(false);
|
|
4081
|
+
(0, react.useEffect)(() => {
|
|
4082
|
+
let mounted = true;
|
|
4083
|
+
loadUsageTool().then((enabled) => {
|
|
4084
|
+
if (mounted && enabled !== void 0) setUsageStatsEnabled(enabled);
|
|
4085
|
+
});
|
|
4086
|
+
return () => {
|
|
4087
|
+
mounted = false;
|
|
4088
|
+
};
|
|
4089
|
+
}, []);
|
|
4090
|
+
const toggleUsageStats = (0, react.useCallback)(() => {
|
|
4091
|
+
const next = !usageStatsEnabled;
|
|
4092
|
+
setUsageStatsEnabled(next);
|
|
4093
|
+
saveUsageTool(next).then((ok) => {
|
|
4094
|
+
if (!ok) setUsageStatsEnabled(!next);
|
|
4095
|
+
});
|
|
4096
|
+
}, [usageStatsEnabled]);
|
|
4049
4097
|
const rateInfo = getRateInfo();
|
|
4050
4098
|
const money = (cny) => formatMoney(currency === "usd" ? cnyToUsd(cny) : cny, currency);
|
|
4051
4099
|
const lang = currency === "usd" ? "en" : "zh";
|
|
@@ -4847,6 +4895,32 @@ window.__ModuleLoader__.load({
|
|
|
4847
4895
|
})
|
|
4848
4896
|
]
|
|
4849
4897
|
}),
|
|
4898
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4899
|
+
className: UsageBilling_module_css_default.budget,
|
|
4900
|
+
"data-testid": "billing-usage-stats-tool-setting",
|
|
4901
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4902
|
+
className: UsageBilling_module_css_default.budgetHead,
|
|
4903
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4904
|
+
className: UsageBilling_module_css_default.budgetLabel,
|
|
4905
|
+
children: t("billing.usageStatsTool")
|
|
4906
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4907
|
+
className: UsageBilling_module_css_default.budgetControls,
|
|
4908
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4909
|
+
type: "button",
|
|
4910
|
+
role: "switch",
|
|
4911
|
+
"aria-checked": usageStatsEnabled,
|
|
4912
|
+
"aria-label": t("billing.usageStatsTool"),
|
|
4913
|
+
"data-testid": "billing-usage-stats-tool-toggle",
|
|
4914
|
+
className: clsx(UsageBilling_module_css_default.switch, usageStatsEnabled && UsageBilling_module_css_default.switchOn),
|
|
4915
|
+
onClick: toggleUsageStats,
|
|
4916
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: UsageBilling_module_css_default.switchKnob })
|
|
4917
|
+
})
|
|
4918
|
+
})]
|
|
4919
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4920
|
+
className: UsageBilling_module_css_default.budgetHint,
|
|
4921
|
+
children: t("billing.usageStatsToolHint")
|
|
4922
|
+
})]
|
|
4923
|
+
}),
|
|
4850
4924
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginInfoCard, {
|
|
4851
4925
|
t,
|
|
4852
4926
|
version: stats.pluginVersion
|
|
@@ -6275,6 +6349,7 @@ window.__ModuleLoader__.load({
|
|
|
6275
6349
|
const metrics = createBillingMetrics();
|
|
6276
6350
|
ctx.provide("billingMetrics", metrics);
|
|
6277
6351
|
const budgetStore = createBillingBudgetStore();
|
|
6352
|
+
const connection = ctx.get("connection");
|
|
6278
6353
|
ctx.effect(() => ctx.locale.register(NS, {
|
|
6279
6354
|
zh,
|
|
6280
6355
|
en
|
|
@@ -6292,7 +6367,7 @@ window.__ModuleLoader__.load({
|
|
|
6292
6367
|
inject: () => ({
|
|
6293
6368
|
checkModels: async () => {
|
|
6294
6369
|
try {
|
|
6295
|
-
const { result } = await
|
|
6370
|
+
const { result } = await connection.api.llm.models({});
|
|
6296
6371
|
if (!result.ok) return {
|
|
6297
6372
|
checked: true,
|
|
6298
6373
|
available: false,
|