diff --git a/service/log.go b/service/log_info_generate.go similarity index 98% rename from service/log.go rename to service/log_info_generate.go index 4372130c..08092cc8 100644 --- a/service/log.go +++ b/service/log_info_generate.go @@ -12,6 +12,7 @@ func GenerateTextOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, m other["group_ratio"] = groupRatio other["completion_ratio"] = completionRatio other["model_price"] = modelPrice + other["group"] = relayInfo.Group other["frt"] = float64(relayInfo.FirstResponseTime.UnixMilli() - relayInfo.StartTime.UnixMilli()) adminInfo := make(map[string]interface{}) adminInfo["use_channel"] = ctx.GetStringSlice("use_channel") diff --git a/web/src/components/LogsTable.js b/web/src/components/LogsTable.js index f27a7fd4..e391253d 100644 --- a/web/src/components/LogsTable.js +++ b/web/src/components/LogsTable.js @@ -217,6 +217,30 @@ const LogsTable = () => { ); }, }, + { + title: t('分组'), + dataIndex: 'group', + render: (text, record, index) => { + if (record.type === 0 || record.type === 2) { + let other = JSON.parse(record.other); + if (other === null) { + return <>; + } + if (other.group !== undefined) { + return ( + + {' '} + {other.group}{' '} + + ); + } else { + return <>; + } + } else { + return <>; + } + }, + }, { title: t('类型'), dataIndex: 'type',