mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-10 21:20:20 +08:00
后端: - 扩展 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>
36 lines
910 B
TypeScript
36 lines
910 B
TypeScript
export interface SchedulingDialogPresetLike {
|
|
mutexGroup: string | null
|
|
}
|
|
|
|
export function moveStrategyItem<T extends SchedulingDialogPresetLike>(
|
|
items: readonly T[],
|
|
itemIndex: number,
|
|
direction: -1 | 1,
|
|
): T[] {
|
|
const strategyIndexes: number[] = []
|
|
|
|
items.forEach((item, index) => {
|
|
if (!item.mutexGroup) {
|
|
strategyIndexes.push(index)
|
|
}
|
|
})
|
|
|
|
const currentPosition = strategyIndexes.indexOf(itemIndex)
|
|
if (currentPosition === -1) {
|
|
return [...items]
|
|
}
|
|
|
|
const targetPosition = currentPosition + direction
|
|
if (targetPosition < 0 || targetPosition >= strategyIndexes.length) {
|
|
return [...items]
|
|
}
|
|
|
|
const sourceIndex = strategyIndexes[currentPosition]
|
|
const targetIndex = strategyIndexes[targetPosition]
|
|
const nextItems = [...items]
|
|
|
|
;[nextItems[sourceIndex], nextItems[targetIndex]] = [nextItems[targetIndex], nextItems[sourceIndex]]
|
|
|
|
return nextItems
|
|
}
|