feat: 全栈功能增强 - 扩展 provider/pool 管理、完善调度与数据层、重构前端 Pool 页面

后端:
- 扩展 pool_admin payloads 和 provider query models,增强 endpoint key 管理
- 完善 scheduler-core 候选排序与请求候选逻辑
- 增强 usage-runtime 写入、provider-transport 网络层与 OAuth 刷新
- 改进 AI pipeline 响应转换与流式处理
- 扩展 global_models/provider_catalog 数据层查询能力
- 增强 video-tasks-core 多 provider 支持
- 新增大量集成测试覆盖 pool/keys/provider_query/frontdoor

前端:
- 重构 PoolManagement 页面,拆分状态管理/对话框逻辑到独立模块
- 新增 poolAdvancedDialog/poolSchedulingDialog/poolManagementState/poolMobilePresentation 工具函数及测试
- 改进 Dialog 组件与 provider tabs 显示

部署:
- 更新 Rust CI workflow 和 Dockerfile 构建配置

Closes #275
Co-authored-by: AAEE86 <ppk0227@hotmail.com>
This commit is contained in:
fawney19
2026-04-09 13:51:50 +08:00
parent 4fc95adfb9
commit b0b40c16ff
97 changed files with 5816 additions and 1881 deletions

View File

@@ -58,6 +58,18 @@ pub struct TerminalUsageOutcome {
pub audit_payload: Option<Value>,
}
struct TerminalUsageOutcomeBaseInput<'a> {
plan: &'a ExecutionPlan,
report_context: Option<&'a Value>,
terminal_state: UsageTerminalState,
status_code: u16,
telemetry: Option<&'a ExecutionTelemetry>,
provider_response: Option<Value>,
client_response: Option<Value>,
provider_response_headers: Option<Value>,
client_response_headers: Option<Value>,
}
pub fn build_pending_usage_record(
plan: &ExecutionPlan,
report_context: Option<&Value>,
@@ -132,17 +144,17 @@ pub fn build_sync_terminal_usage_outcome(
.clone()
.or_else(|| decode_body_for_storage(payload.body_base64.as_deref()));
let client_response = payload.client_body_json.clone();
build_terminal_usage_outcome_base(
build_terminal_usage_outcome_base(TerminalUsageOutcomeBaseInput {
plan,
report_context,
infer_sync_terminal_state(payload, provider_response.as_ref()),
payload.status_code,
payload.telemetry.as_ref(),
terminal_state: infer_sync_terminal_state(payload, provider_response.as_ref()),
status_code: payload.status_code,
telemetry: payload.telemetry.as_ref(),
provider_response,
client_response,
Some(headers_to_json(&payload.headers)),
Some(headers_to_json(&payload.headers)),
)
provider_response_headers: Some(headers_to_json(&payload.headers)),
client_response_headers: Some(headers_to_json(&payload.headers)),
})
}
pub fn build_stream_terminal_usage_outcome(
@@ -152,17 +164,17 @@ pub fn build_stream_terminal_usage_outcome(
) -> TerminalUsageOutcome {
let provider_response = decode_body_for_storage(payload.provider_body_base64.as_deref());
let client_response = decode_body_for_storage(payload.client_body_base64.as_deref());
build_terminal_usage_outcome_base(
build_terminal_usage_outcome_base(TerminalUsageOutcomeBaseInput {
plan,
report_context,
infer_stream_terminal_state(payload),
payload.status_code,
payload.telemetry.as_ref(),
terminal_state: infer_stream_terminal_state(payload),
status_code: payload.status_code,
telemetry: payload.telemetry.as_ref(),
provider_response,
client_response,
Some(headers_to_json(&payload.headers)),
Some(headers_to_json(&payload.headers)),
)
provider_response_headers: Some(headers_to_json(&payload.headers)),
client_response_headers: Some(headers_to_json(&payload.headers)),
})
}
pub fn build_terminal_usage_event_from_outcome(
@@ -239,16 +251,19 @@ pub fn build_terminal_usage_event_from_outcome(
}
fn build_terminal_usage_outcome_base(
plan: &ExecutionPlan,
report_context: Option<&Value>,
terminal_state: UsageTerminalState,
status_code: u16,
telemetry: Option<&ExecutionTelemetry>,
provider_response: Option<Value>,
client_response: Option<Value>,
provider_response_headers: Option<Value>,
client_response_headers: Option<Value>,
input: TerminalUsageOutcomeBaseInput<'_>,
) -> TerminalUsageOutcome {
let TerminalUsageOutcomeBaseInput {
plan,
report_context,
terminal_state,
status_code,
telemetry,
provider_response,
client_response,
provider_response_headers,
client_response_headers,
} = input;
let context = report_context.and_then(Value::as_object);
let client_contract = context_string(context, "client_contract")
.or_else(|| context_string(context, "client_api_format"))