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

Function resetAllUsageStats

front/common.js:2993–3014  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2991}
2992
2993async function resetAllUsageStats() {
2994 if (!confirm('确定要重置所有文件的使用统计吗?此操作不可恢复!')) return;
2995
2996 try {
2997 const response = await fetch('./usage/reset', {
2998 method: 'POST',
2999 headers: getAuthHeaders(),
3000 body: JSON.stringify({})
3001 });
3002
3003 const data = await response.json();
3004
3005 if (response.ok && data.success) {
3006 showStatus(data.message, 'success');
3007 await refreshUsageStats();
3008 } else {
3009 showStatus(`重置失败: ${data.message || data.detail || data.error || '未知错误'}`, 'error');
3010 }
3011 } catch (error) {
3012 showStatus(`网络错误: ${error.message}`, 'error');
3013 }
3014}
3015
3016// =====================================================================
3017// 冷却倒计时自动更新

Callers

nothing calls this directly

Calls 3

getAuthHeadersFunction · 0.85
showStatusFunction · 0.85
refreshUsageStatsFunction · 0.85

Tested by

no test coverage detected