mirror of
https://github.com/violettoolssite/CFspider.git
synced 2026-04-05 03:09:01 +08:00
fix: add missing getOperationStats function (v1.0.7)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cfspider-browser",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "CFspider 智能浏览器 - AI驱动的可视化爬虫,自然语言控制浏览器自动化",
|
||||
"keywords": [
|
||||
"browser",
|
||||
|
||||
@@ -385,6 +385,21 @@ interface OperationLog {
|
||||
let operationLogs: OperationLog[] = []
|
||||
const MAX_OPERATION_LOGS = 50
|
||||
|
||||
/**
|
||||
* 获取操作统计
|
||||
*/
|
||||
export function getOperationStats(): { total: number, successRate: number, domains: string[] } {
|
||||
const total = operationLogs.length
|
||||
const successful = operationLogs.filter(l => l.success).length
|
||||
const domains = [...new Set(operationLogs.map(l => l.domain).filter(d => d))]
|
||||
|
||||
return {
|
||||
total,
|
||||
successRate: total > 0 ? Math.round((successful / total) * 100) : 0,
|
||||
domains
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录操作日志
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user