MCPcopy Create free account
hub / github.com/su-kaka/gcli2api / resetSingleUsageStats

Function resetSingleUsageStats

front/common.js:2970–2991  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

2968}
2969
2970async function resetSingleUsageStats(filename) {
2971 if (!confirm(`确定要重置 ${filename} 的使用统计吗?`)) return;
2972
2973 try {
2974 const response = await fetch('./usage/reset', {
2975 method: 'POST',
2976 headers: getAuthHeaders(),
2977 body: JSON.stringify({ filename })
2978 });
2979
2980 const data = await response.json();
2981
2982 if (response.ok && data.success) {
2983 showStatus(data.message, 'success');
2984 await refreshUsageStats();
2985 } else {
2986 showStatus(`重置失败: ${data.message || data.detail || data.error || '未知错误'}`, 'error');
2987 }
2988 } catch (error) {
2989 showStatus(`网络错误: ${error.message}`, 'error');
2990 }
2991}
2992
2993async function resetAllUsageStats() {
2994 if (!confirm('确定要重置所有文件的使用统计吗?此操作不可恢复!')) return;

Callers

nothing calls this directly

Calls 3

getAuthHeadersFunction · 0.85
showStatusFunction · 0.85
refreshUsageStatsFunction · 0.85

Tested by

no test coverage detected