Merge branch 'HFC-para' of https://github.com/MaiM-with-u/MaiBot into HFC-para
This commit is contained in:
@@ -512,7 +512,8 @@ class StatisticOutputTask(AsyncTask):
|
||||
# format总在线时间
|
||||
|
||||
# 按模型分类统计
|
||||
model_rows = "\n".join([
|
||||
model_rows = "\n".join(
|
||||
[
|
||||
f"<tr>"
|
||||
f"<td>{model_name}</td>"
|
||||
f"<td>{count}</td>"
|
||||
@@ -522,9 +523,11 @@ class StatisticOutputTask(AsyncTask):
|
||||
f"<td>{stat_data[COST_BY_MODEL][model_name]:.4f} ¥</td>"
|
||||
f"</tr>"
|
||||
for model_name, count in sorted(stat_data[REQ_CNT_BY_MODEL].items())
|
||||
])
|
||||
]
|
||||
)
|
||||
# 按请求类型分类统计
|
||||
type_rows = "\n".join([
|
||||
type_rows = "\n".join(
|
||||
[
|
||||
f"<tr>"
|
||||
f"<td>{req_type}</td>"
|
||||
f"<td>{count}</td>"
|
||||
@@ -534,9 +537,11 @@ class StatisticOutputTask(AsyncTask):
|
||||
f"<td>{stat_data[COST_BY_TYPE][req_type]:.4f} ¥</td>"
|
||||
f"</tr>"
|
||||
for req_type, count in sorted(stat_data[REQ_CNT_BY_TYPE].items())
|
||||
])
|
||||
]
|
||||
)
|
||||
# 按用户分类统计
|
||||
user_rows = "\n".join([
|
||||
user_rows = "\n".join(
|
||||
[
|
||||
f"<tr>"
|
||||
f"<td>{user_id}</td>"
|
||||
f"<td>{count}</td>"
|
||||
@@ -546,12 +551,15 @@ class StatisticOutputTask(AsyncTask):
|
||||
f"<td>{stat_data[COST_BY_USER][user_id]:.4f} ¥</td>"
|
||||
f"</tr>"
|
||||
for user_id, count in sorted(stat_data[REQ_CNT_BY_USER].items())
|
||||
])
|
||||
]
|
||||
)
|
||||
# 聊天消息统计
|
||||
chat_rows = "\n".join([
|
||||
chat_rows = "\n".join(
|
||||
[
|
||||
f"<tr><td>{self.name_mapping[chat_id][0]}</td><td>{count}</td></tr>"
|
||||
for chat_id, count in sorted(stat_data[MSG_CNT_BY_CHAT].items())
|
||||
])
|
||||
]
|
||||
)
|
||||
# 生成HTML
|
||||
return f"""
|
||||
<div id=\"{div_id}\" class=\"tab-content\">
|
||||
|
||||
Reference in New Issue
Block a user