dsh-key-usage 0.1.1 → 0.2.0
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/client/client.js +159 -117
- package/client/client.js.map +1 -1
- package/lib/index.js +4 -1
- package/lib/routes.js +9 -3
- package/lib/session-meta.js +101 -0
- package/lib/session-usage.js +28 -1
- package/lib/sessions.js +13 -4
- package/package.json +3 -3
package/client/client.js
CHANGED
|
@@ -163,48 +163,48 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
163
163
|
css: css$5
|
|
164
164
|
});
|
|
165
165
|
var shared_module_css_default = {
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"cardGridAuto": "LhdpGW_cardGridAuto",
|
|
170
|
-
"card": "LhdpGW_card",
|
|
171
|
-
"tipDivider": "LhdpGW_tipDivider",
|
|
172
|
-
"tipName": "LhdpGW_tipName",
|
|
173
|
-
"sortActive": "LhdpGW_sortActive",
|
|
166
|
+
"ghost": "LhdpGW_ghost",
|
|
167
|
+
"statExtra": "LhdpGW_statExtra",
|
|
168
|
+
"disabled": "LhdpGW_disabled",
|
|
174
169
|
"footnote": "LhdpGW_footnote",
|
|
175
|
-
"tipBar": "LhdpGW_tipBar",
|
|
176
|
-
"tipRow": "LhdpGW_tipRow",
|
|
177
|
-
"tipRate": "LhdpGW_tipRate",
|
|
178
|
-
"tabBar": "LhdpGW_tabBar",
|
|
179
|
-
"blockLabel": "LhdpGW_blockLabel",
|
|
180
170
|
"empty": "LhdpGW_empty",
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
171
|
+
"titleActions": "LhdpGW_titleActions",
|
|
172
|
+
"chipRow": "LhdpGW_chipRow",
|
|
173
|
+
"tipAmount": "LhdpGW_tipAmount",
|
|
174
|
+
"tipDivider": "LhdpGW_tipDivider",
|
|
175
|
+
"groupLabel": "LhdpGW_groupLabel",
|
|
176
|
+
"cardGrid4": "LhdpGW_cardGrid4",
|
|
177
|
+
"title": "LhdpGW_title",
|
|
178
|
+
"cardGridAuto": "LhdpGW_cardGridAuto",
|
|
179
|
+
"warning": "LhdpGW_warning",
|
|
187
180
|
"refreshBtn": "LhdpGW_refreshBtn",
|
|
188
|
-
"legend": "LhdpGW_legend",
|
|
189
181
|
"footnoteList": "LhdpGW_footnoteList",
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
193
|
-
"cardGrid3": "LhdpGW_cardGrid3",
|
|
182
|
+
"clickable": "LhdpGW_clickable",
|
|
183
|
+
"statusDot": "LhdpGW_statusDot",
|
|
184
|
+
"tipSub": "LhdpGW_tipSub",
|
|
194
185
|
"tipTitle": "LhdpGW_tipTitle",
|
|
186
|
+
"statLabel": "LhdpGW_statLabel",
|
|
187
|
+
"tipRate": "LhdpGW_tipRate",
|
|
188
|
+
"tipName": "LhdpGW_tipName",
|
|
195
189
|
"statValue": "LhdpGW_statValue",
|
|
196
|
-
"
|
|
197
|
-
"
|
|
190
|
+
"total": "LhdpGW_total",
|
|
191
|
+
"blockLabel": "LhdpGW_blockLabel",
|
|
192
|
+
"sortArrow": "LhdpGW_sortArrow",
|
|
193
|
+
"tipRow": "LhdpGW_tipRow",
|
|
194
|
+
"section": "LhdpGW_section",
|
|
195
|
+
"cardGrid3": "LhdpGW_cardGrid3",
|
|
198
196
|
"active": "LhdpGW_active",
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"chipRow": "LhdpGW_chipRow",
|
|
202
|
-
"chip": "LhdpGW_chip",
|
|
203
|
-
"tooltip": "LhdpGW_tooltip",
|
|
204
|
-
"tipAmount": "LhdpGW_tipAmount",
|
|
197
|
+
"sortActive": "LhdpGW_sortActive",
|
|
198
|
+
"dim": "LhdpGW_dim",
|
|
205
199
|
"table": "LhdpGW_table",
|
|
206
|
-
"
|
|
207
|
-
"
|
|
200
|
+
"sortable": "LhdpGW_sortable",
|
|
201
|
+
"legend": "LhdpGW_legend",
|
|
202
|
+
"tooltip": "LhdpGW_tooltip",
|
|
203
|
+
"tipBar": "LhdpGW_tipBar",
|
|
204
|
+
"mono": "LhdpGW_mono",
|
|
205
|
+
"tabBar": "LhdpGW_tabBar",
|
|
206
|
+
"card": "LhdpGW_card",
|
|
207
|
+
"chip": "LhdpGW_chip"
|
|
208
208
|
};
|
|
209
209
|
//#endregion
|
|
210
210
|
//#region src/client/tooltip.tsx
|
|
@@ -370,36 +370,36 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
370
370
|
css: css$4
|
|
371
371
|
});
|
|
372
372
|
var overview_module_css_default = {
|
|
373
|
-
"
|
|
374
|
-
"
|
|
373
|
+
"danger": "J7Idbq_danger",
|
|
374
|
+
"rowLink": "J7Idbq_rowLink",
|
|
375
|
+
"heatmapCard": "J7Idbq_heatmapCard",
|
|
375
376
|
"quotaCell": "J7Idbq_quotaCell",
|
|
376
|
-
"heatWeekdays": "J7Idbq_heatWeekdays",
|
|
377
|
-
"heatGrid": "J7Idbq_heatGrid",
|
|
378
|
-
"warn": "J7Idbq_warn",
|
|
379
|
-
"heatmapHead": "J7Idbq_heatmapHead",
|
|
380
|
-
"heatmapBody": "J7Idbq_heatmapBody",
|
|
381
|
-
"off": "J7Idbq_off",
|
|
382
|
-
"idle": "J7Idbq_idle",
|
|
383
|
-
"keyDisplay": "J7Idbq_keyDisplay",
|
|
384
377
|
"disabledRow": "J7Idbq_disabledRow",
|
|
385
|
-
"
|
|
378
|
+
"idle": "J7Idbq_idle",
|
|
379
|
+
"heatGrid": "J7Idbq_heatGrid",
|
|
380
|
+
"heatMonths": "J7Idbq_heatMonths",
|
|
381
|
+
"free": "J7Idbq_free",
|
|
382
|
+
"keyEnv": "J7Idbq_keyEnv",
|
|
383
|
+
"heatCell": "J7Idbq_heatCell",
|
|
386
384
|
"heatGridCol": "J7Idbq_heatGridCol",
|
|
385
|
+
"keyDisplay": "J7Idbq_keyDisplay",
|
|
386
|
+
"heatWeek": "J7Idbq_heatWeek",
|
|
387
|
+
"dim": "J7Idbq_dim",
|
|
387
388
|
"clickable": "J7Idbq_clickable",
|
|
388
|
-
"
|
|
389
|
+
"quotaText": "J7Idbq_quotaText",
|
|
390
|
+
"heatmapBody": "J7Idbq_heatmapBody",
|
|
389
391
|
"heatmapTitle": "J7Idbq_heatmapTitle",
|
|
390
|
-
"
|
|
392
|
+
"warn": "J7Idbq_warn",
|
|
393
|
+
"heatmapHead": "J7Idbq_heatmapHead",
|
|
394
|
+
"keyTable": "J7Idbq_keyTable",
|
|
395
|
+
"sub": "J7Idbq_sub",
|
|
391
396
|
"miniBar": "J7Idbq_miniBar",
|
|
392
|
-
"
|
|
393
|
-
"tag": "J7Idbq_tag",
|
|
394
|
-
"rowLink": "J7Idbq_rowLink",
|
|
397
|
+
"heatmapScroll": "J7Idbq_heatmapScroll",
|
|
395
398
|
"empty": "J7Idbq_empty",
|
|
396
|
-
"
|
|
397
|
-
"
|
|
398
|
-
"keyTable": "J7Idbq_keyTable",
|
|
399
|
-
"dim": "J7Idbq_dim",
|
|
399
|
+
"tag": "J7Idbq_tag",
|
|
400
|
+
"off": "J7Idbq_off",
|
|
400
401
|
"cellKey": "J7Idbq_cellKey",
|
|
401
|
-
"
|
|
402
|
-
"heatCell": "J7Idbq_heatCell"
|
|
402
|
+
"heatWeekdays": "J7Idbq_heatWeekdays"
|
|
403
403
|
};
|
|
404
404
|
//#endregion
|
|
405
405
|
//#region src/client/components/Heatmap.tsx
|
|
@@ -719,29 +719,29 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
719
719
|
css: css$3
|
|
720
720
|
});
|
|
721
721
|
var detail_module_css_default = {
|
|
722
|
-
"rangeLeft": "V9QVRa_rangeLeft",
|
|
723
|
-
"shareBar": "V9QVRa_shareBar",
|
|
724
|
-
"chartTitle": "V9QVRa_chartTitle",
|
|
725
|
-
"bars": "V9QVRa_bars",
|
|
726
|
-
"barsDense": "V9QVRa_barsDense",
|
|
727
722
|
"subRowCell": "V9QVRa_subRowCell",
|
|
728
|
-
"
|
|
729
|
-
"
|
|
730
|
-
"
|
|
731
|
-
"rangeCaption": "V9QVRa_rangeCaption",
|
|
732
|
-
"barLabels": "V9QVRa_barLabels",
|
|
723
|
+
"barsDense": "V9QVRa_barsDense",
|
|
724
|
+
"rangeLeft": "V9QVRa_rangeLeft",
|
|
725
|
+
"rangeBar": "V9QVRa_rangeBar",
|
|
733
726
|
"subModel": "V9QVRa_subModel",
|
|
734
|
-
"segCache": "V9QVRa_segCache",
|
|
735
727
|
"subName": "V9QVRa_subName",
|
|
736
|
-
"
|
|
737
|
-
"subRow": "V9QVRa_subRow",
|
|
728
|
+
"subChannel": "V9QVRa_subChannel",
|
|
738
729
|
"subNumber": "V9QVRa_subNumber",
|
|
739
|
-
"active": "V9QVRa_active",
|
|
740
|
-
"rangeTabs": "V9QVRa_rangeTabs",
|
|
741
|
-
"rangeBar": "V9QVRa_rangeBar",
|
|
742
730
|
"rangeInput": "V9QVRa_rangeInput",
|
|
743
|
-
"
|
|
744
|
-
"
|
|
731
|
+
"segCache": "V9QVRa_segCache",
|
|
732
|
+
"segOut": "V9QVRa_segOut",
|
|
733
|
+
"subHead": "V9QVRa_subHead",
|
|
734
|
+
"toggleArrow": "V9QVRa_toggleArrow",
|
|
735
|
+
"rangeTabs": "V9QVRa_rangeTabs",
|
|
736
|
+
"active": "V9QVRa_active",
|
|
737
|
+
"barColumn": "V9QVRa_barColumn",
|
|
738
|
+
"chartTitle": "V9QVRa_chartTitle",
|
|
739
|
+
"shareBar": "V9QVRa_shareBar",
|
|
740
|
+
"rangeCaption": "V9QVRa_rangeCaption",
|
|
741
|
+
"bars": "V9QVRa_bars",
|
|
742
|
+
"barLabels": "V9QVRa_barLabels",
|
|
743
|
+
"subRow": "V9QVRa_subRow",
|
|
744
|
+
"segIn": "V9QVRa_segIn"
|
|
745
745
|
};
|
|
746
746
|
//#endregion
|
|
747
747
|
//#region src/client/components/ShareBar.tsx
|
|
@@ -1374,7 +1374,7 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
//#endregion
|
|
1376
1376
|
//#region \0dsh-css:D:\EasyJob\.plugin\dsh-key-usage\src\client\styles\lists.module.css.mjs
|
|
1377
|
-
const css$2 = ".QpFKma_filterBar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:14px;display:flex}.QpFKma_searchInput{border:1px solid var(--dsw-alias-border-l2,#2c2c34);min-width:180px;color:var(--dsw-alias-label-primary,#e8e8ec);font:inherit;background:0 0;border-radius:9px;flex:1;padding:6px 12px;font-size:12.5px}.QpFKma_searchInput::placeholder{color:var(--dsw-alias-label-tertiary,#67676f)}.QpFKma_filterSelect{background:var(--dsw-alias-bg-layer-2,#1d1d22);border:1px solid var(--dsw-alias-border-l2,#2c2c34);color:var(--dsw-alias-label-secondary,#9a9aa6);font:inherit;cursor:pointer;border-radius:9px;padding:6px 10px;font-size:12px}.QpFKma_listTitle{align-items:center;gap:10px;min-width:0;display:flex}.QpFKma_listMain{color:var(--dsw-alias-label-primary,#e8e8ec);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600;overflow:hidden}.QpFKma_listSub{color:var(--dsw-alias-label-tertiary,#67676f);text-overflow:ellipsis;white-space:nowrap;margin-top:1px;font-size:10.5px;overflow:hidden}.QpFKma_listBar{background:var(--dsw-alias-fill-l2,#80808c2e);vertical-align:middle;border-radius:3px;width:70px;height:5px;display:inline-block;overflow:hidden}.QpFKma_listBar>i{border-radius:3px;height:100%;display:block}.QpFKma_sessionDay td{background:var(--dsw-alias-bg-layer-2,#1d1d22);color:var(--dsw-alias-label-primary,#e8e8ec);border-bottom:1px solid var(--dsw-alias-border-l1,#2c2c34);font-size:12px;font-weight:600;text-align:left!important;padding:7px 10px!important}.QpFKma_dayCount{color:var(--dsw-alias-label-tertiary,#67676f);margin-left:8px;font-size:11px;font-weight:500}";
|
|
1377
|
+
const css$2 = ".QpFKma_filterBar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:14px;display:flex}.QpFKma_searchInput{border:1px solid var(--dsw-alias-border-l2,#2c2c34);min-width:180px;color:var(--dsw-alias-label-primary,#e8e8ec);font:inherit;background:0 0;border-radius:9px;flex:1;padding:6px 12px;font-size:12.5px}.QpFKma_searchInput::placeholder{color:var(--dsw-alias-label-tertiary,#67676f)}.QpFKma_filterSelect{background:var(--dsw-alias-bg-layer-2,#1d1d22);border:1px solid var(--dsw-alias-border-l2,#2c2c34);color:var(--dsw-alias-label-secondary,#9a9aa6);font:inherit;cursor:pointer;border-radius:9px;padding:6px 10px;font-size:12px}.QpFKma_listTitle{align-items:center;gap:10px;min-width:0;display:flex}.QpFKma_listMain{color:var(--dsw-alias-label-primary,#e8e8ec);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600;overflow:hidden}.QpFKma_listSub{color:var(--dsw-alias-label-tertiary,#67676f);text-overflow:ellipsis;white-space:nowrap;margin-top:1px;font-size:10.5px;overflow:hidden}.QpFKma_listBar{background:var(--dsw-alias-fill-l2,#80808c2e);vertical-align:middle;border-radius:3px;width:70px;height:5px;display:inline-block;overflow:hidden}.QpFKma_listBar>i{border-radius:3px;height:100%;display:block}.QpFKma_sessionDay td{background:var(--dsw-alias-bg-layer-2,#1d1d22);color:var(--dsw-alias-label-primary,#e8e8ec);border-bottom:1px solid var(--dsw-alias-border-l1,#2c2c34);font-size:12px;font-weight:600;text-align:left!important;padding:7px 10px!important}.QpFKma_dayCount{color:var(--dsw-alias-label-tertiary,#67676f);margin-left:8px;font-size:11px;font-weight:500}.QpFKma_rowArchived td{opacity:.5}.QpFKma_archivedTag{color:var(--dsw-alias-label-tertiary,#67676f);border:1px solid var(--dsw-alias-border-l2,#2c2c34);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:500}";
|
|
1378
1378
|
const tagId$2 = "dsh-key-usage/lists.module.css";
|
|
1379
1379
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
1380
1380
|
const tag = document.createElement("style");
|
|
@@ -1389,15 +1389,17 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1389
1389
|
css: css$2
|
|
1390
1390
|
});
|
|
1391
1391
|
var lists_module_css_default = {
|
|
1392
|
-
"listTitle": "QpFKma_listTitle",
|
|
1393
1392
|
"listBar": "QpFKma_listBar",
|
|
1394
|
-
"
|
|
1395
|
-
"dayCount": "QpFKma_dayCount",
|
|
1396
|
-
"searchInput": "QpFKma_searchInput",
|
|
1393
|
+
"filterBar": "QpFKma_filterBar",
|
|
1397
1394
|
"listSub": "QpFKma_listSub",
|
|
1395
|
+
"rowArchived": "QpFKma_rowArchived",
|
|
1398
1396
|
"listMain": "QpFKma_listMain",
|
|
1399
1397
|
"sessionDay": "QpFKma_sessionDay",
|
|
1400
|
-
"
|
|
1398
|
+
"archivedTag": "QpFKma_archivedTag",
|
|
1399
|
+
"listTitle": "QpFKma_listTitle",
|
|
1400
|
+
"searchInput": "QpFKma_searchInput",
|
|
1401
|
+
"filterSelect": "QpFKma_filterSelect",
|
|
1402
|
+
"dayCount": "QpFKma_dayCount"
|
|
1401
1403
|
};
|
|
1402
1404
|
//#endregion
|
|
1403
1405
|
//#region src/client/tabs/ProjectsTab.tsx
|
|
@@ -1510,7 +1512,8 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1510
1512
|
row.workspace,
|
|
1511
1513
|
" · ",
|
|
1512
1514
|
row.sessionCount,
|
|
1513
|
-
" 个会话"
|
|
1515
|
+
" 个会话",
|
|
1516
|
+
row.archivedSessionCount > 0 ? "(含 " + row.archivedSessionCount + " 个已归档,仍计入)" : ""
|
|
1514
1517
|
]
|
|
1515
1518
|
})] })
|
|
1516
1519
|
}) }),
|
|
@@ -1575,26 +1578,26 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1575
1578
|
css: css$1
|
|
1576
1579
|
});
|
|
1577
1580
|
var quota_module_css_default = {
|
|
1581
|
+
"quotaList": "F7iUHa_quotaList",
|
|
1582
|
+
"quotaProvider": "F7iUHa_quotaProvider",
|
|
1583
|
+
"windowReset": "F7iUHa_windowReset",
|
|
1584
|
+
"quotaEnv": "F7iUHa_quotaEnv",
|
|
1585
|
+
"windowName": "F7iUHa_windowName",
|
|
1586
|
+
"liveChip": "F7iUHa_liveChip",
|
|
1578
1587
|
"windowItem": "F7iUHa_windowItem",
|
|
1579
|
-
"
|
|
1588
|
+
"windowRow": "F7iUHa_windowRow",
|
|
1580
1589
|
"snapshotHint": "F7iUHa_snapshotHint",
|
|
1581
|
-
"
|
|
1582
|
-
"quotaEnv": "F7iUHa_quotaEnv",
|
|
1583
|
-
"balanceItem": "F7iUHa_balanceItem",
|
|
1584
|
-
"balanceStrip": "F7iUHa_balanceStrip",
|
|
1585
|
-
"quotaTitle": "F7iUHa_quotaTitle",
|
|
1590
|
+
"bsLabel": "F7iUHa_bsLabel",
|
|
1586
1591
|
"snapshotStale": "F7iUHa_snapshotStale",
|
|
1587
|
-
"
|
|
1592
|
+
"balanceStrip": "F7iUHa_balanceStrip",
|
|
1588
1593
|
"windowValue": "F7iUHa_windowValue",
|
|
1589
|
-
"windowName": "F7iUHa_windowName",
|
|
1590
|
-
"bsValue": "F7iUHa_bsValue",
|
|
1591
|
-
"quotaCard": "F7iUHa_quotaCard",
|
|
1592
1594
|
"quotaHead": "F7iUHa_quotaHead",
|
|
1593
|
-
"
|
|
1595
|
+
"balanceItem": "F7iUHa_balanceItem",
|
|
1596
|
+
"quotaCard": "F7iUHa_quotaCard",
|
|
1594
1597
|
"windowHead": "F7iUHa_windowHead",
|
|
1595
|
-
"
|
|
1596
|
-
"
|
|
1597
|
-
"
|
|
1598
|
+
"windowBar": "F7iUHa_windowBar",
|
|
1599
|
+
"quotaTitle": "F7iUHa_quotaTitle",
|
|
1600
|
+
"bsValue": "F7iUHa_bsValue"
|
|
1598
1601
|
};
|
|
1599
1602
|
//#endregion
|
|
1600
1603
|
//#region src/client/tabs/QuotaTab.tsx
|
|
@@ -1806,8 +1809,10 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1806
1809
|
const [channelFilter, setChannelFilter] = (0, react.useState)("ALL");
|
|
1807
1810
|
const [daysFilter, setDaysFilter] = (0, react.useState)("30");
|
|
1808
1811
|
const [sortKey, setSortKey] = (0, react.useState)("recent");
|
|
1812
|
+
const [archiveFilter, setArchiveFilter] = (0, react.useState)("hide");
|
|
1809
1813
|
const [nowMs] = (0, react.useState)(() => Date.now());
|
|
1810
1814
|
const rows = props.data?.rows ?? [];
|
|
1815
|
+
const archivedCount = rows.filter((row) => row.archived).length;
|
|
1811
1816
|
const visible = (0, react.useMemo)(() => {
|
|
1812
1817
|
const keyword = query.trim().toLowerCase();
|
|
1813
1818
|
const maxAgeDays = Number(daysFilter);
|
|
@@ -1816,7 +1821,8 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1816
1821
|
const matchesQuery = keyword === "" || title.toLowerCase().includes(keyword);
|
|
1817
1822
|
const matchesChannel = channelFilter === "ALL" || row.provider === channelFilter;
|
|
1818
1823
|
const matchesAge = maxAgeDays === 0 || row.lastTime === null || nowMs - row.lastTime <= maxAgeDays * 864e5;
|
|
1819
|
-
|
|
1824
|
+
const matchesArchive = archiveFilter === "all" || (archiveFilter === "only" ? row.archived : !row.archived);
|
|
1825
|
+
return matchesQuery && matchesChannel && matchesAge && matchesArchive;
|
|
1820
1826
|
});
|
|
1821
1827
|
const sorters = {
|
|
1822
1828
|
recent: (first, second) => (second.lastTime ?? 0) - (first.lastTime ?? 0),
|
|
@@ -1831,7 +1837,8 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1831
1837
|
channelFilter,
|
|
1832
1838
|
daysFilter,
|
|
1833
1839
|
sortKey,
|
|
1834
|
-
nowMs
|
|
1840
|
+
nowMs,
|
|
1841
|
+
archiveFilter
|
|
1835
1842
|
]);
|
|
1836
1843
|
if (props.data === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1837
1844
|
className: shared_module_css_default.empty,
|
|
@@ -1914,9 +1921,37 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1914
1921
|
children: "时长最长"
|
|
1915
1922
|
})
|
|
1916
1923
|
]
|
|
1924
|
+
}),
|
|
1925
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1926
|
+
className: lists_module_css_default.filterSelect,
|
|
1927
|
+
value: archiveFilter,
|
|
1928
|
+
onChange: (event) => setArchiveFilter(event.target.value),
|
|
1929
|
+
title: "已归档会话只做标记,仍然计入统计",
|
|
1930
|
+
children: [
|
|
1931
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1932
|
+
value: "hide",
|
|
1933
|
+
children: "隐藏已归档"
|
|
1934
|
+
}),
|
|
1935
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1936
|
+
value: "all",
|
|
1937
|
+
children: "全部对话(显示已归档)"
|
|
1938
|
+
}),
|
|
1939
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1940
|
+
value: "only",
|
|
1941
|
+
children: "仅显示已归档"
|
|
1942
|
+
})
|
|
1943
|
+
]
|
|
1917
1944
|
})
|
|
1918
1945
|
]
|
|
1919
1946
|
}),
|
|
1947
|
+
archiveFilter === "hide" && archivedCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1948
|
+
className: shared_module_css_default.statExtra,
|
|
1949
|
+
children: [
|
|
1950
|
+
"另有 ",
|
|
1951
|
+
archivedCount,
|
|
1952
|
+
" 个已归档会话未显示(归档只是标记,用量仍计入上方统计)"
|
|
1953
|
+
]
|
|
1954
|
+
}),
|
|
1920
1955
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
1921
1956
|
className: shared_module_css_default.table,
|
|
1922
1957
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
@@ -1961,26 +1996,32 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
1961
1996
|
function sessionRowOf(row, channels) {
|
|
1962
1997
|
const channel = channelOf(channels, row.provider);
|
|
1963
1998
|
const costCell = costCellText(channel, row.cost ?? 0);
|
|
1964
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", {
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1999
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", {
|
|
2000
|
+
className: row.archived ? lists_module_css_default.rowArchived : void 0,
|
|
2001
|
+
children: [
|
|
2002
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("td", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2003
|
+
className: lists_module_css_default.listMain,
|
|
2004
|
+
children: [row.title ?? "会话 " + shortIdOf(row.id), row.archived && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2005
|
+
className: lists_module_css_default.archivedTag,
|
|
2006
|
+
children: "已归档"
|
|
2007
|
+
})]
|
|
2008
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2009
|
+
className: lists_module_css_default.listSub,
|
|
2010
|
+
children: row.workspace ?? "未归属工作区"
|
|
2011
|
+
})] }),
|
|
2012
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: row.providerLabel ?? displayNameOf(channels, row.provider ?? "") }),
|
|
2013
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("td", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: row.lastTime === null ? "—" : dayLabelOf(row.lastTime, Date.now()) + " " + fmtTime(row.lastTime) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2014
|
+
className: lists_module_css_default.listSub,
|
|
2015
|
+
children: ["时长 ", fmtDuration(durationOf(row))]
|
|
2016
|
+
})] }),
|
|
2017
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: fmtTokens(row.tokens) }),
|
|
2018
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: row.cacheHitRate === null ? "—" : row.cacheHitRate.toFixed(1) + "%" }),
|
|
2019
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: row.cost === null || channel === null || channel.costMode !== "perToken" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2020
|
+
className: shared_module_css_default.dim,
|
|
2021
|
+
children: costCell.text
|
|
2022
|
+
}) : costCell.text })
|
|
2023
|
+
]
|
|
2024
|
+
}, row.id);
|
|
1984
2025
|
}
|
|
1985
2026
|
function durationOf(row) {
|
|
1986
2027
|
if (row.firstTime === null || row.lastTime === null) return 0;
|
|
@@ -2201,6 +2242,7 @@ window.__ModuleLoader__.load({ id: "dsh-key-usage", factory: (require) => {
|
|
|
2201
2242
|
] }),
|
|
2202
2243
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: "热力图按可见区间内活跃日的三分位分档(少 / 中 / 高)。" }),
|
|
2203
2244
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: "项目用量、会话用量与单日「按小时」均来自会话事件,每个结算样本计一次调用(不计成本)。" }),
|
|
2245
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: "已归档会话只是标记:用量照常计入,会话列表默认隐藏、可切换显示(显示时淡化并标注)。" }),
|
|
2204
2246
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: "命中率 = 缓存读 ÷(输入 + 输出 + 缓存读)。" }),
|
|
2205
2247
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: "余额与订阅窗口实时查询官方接口(失败回落本机快照),原样展示,不做换算与建议。" })
|
|
2206
2248
|
]
|