478c9c2bc3
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 0s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 4s
CI/CD Pipeline / Check push changed paths (push) Successful in 9s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 24s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 26s
CI/CD Pipeline / Build Staging API Image (push) Successful in 16s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 27s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 54s
CI/CD Pipeline / CI Gate (pull_request) Successful in 5s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 1m56s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m1s
CI/CD Pipeline / Validate - Style (push) Successful in 2m14s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 2m7s
CI/CD Pipeline / Integration Tests (push) Successful in 2m54s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m30s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m11s
CI/CD Pipeline / Validate - Security (push) Successful in 5m13s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m50s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m54s
AI Code Review / AI Code Review (pull_request) Successful in 6m20s
CI/CD Pipeline / Unit Tests (push) Failing after 7m50s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 4m6s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 7m15s
CI/CD Pipeline / Canary Release to Production (push) Failing after 229h47m32s
CI/CD Pipeline / CI Gate (push) Failing after 229h47m46s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 229h47m46s
CI/CD Pipeline / Build Production API Image (push) Failing after 229h47m46s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 229h52m6s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 229h52m58s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 229h52m58s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 229h54m40s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 229h54m49s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 229h54m49s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 229h54m49s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 229h54m55s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 229h54m56s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 229h54m56s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 229h55m12s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 229h55m12s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 229h55m34s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 229h55m33s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 229h55m34s
CI/CD Pipeline / Validate - Security (pull_request) Failing after 229h55m34s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 229h55m35s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 229h55m39s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 229h55m39s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 229h55m39s
CI/CD Pipeline / Frontend Lint (push) Failing after 229h55m40s
CI/CD Pipeline / PR Build Web Image (push) Failing after 229h55m40s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 229h55m43s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 229h55m44s
CI/CD Pipeline / Deploy Production (push) Failing after 230h22m21s
CI/CD Pipeline / Build Production Web Image (push) Failing after 230h22m23s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 230h27m35s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 230h29m26s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 230h29m32s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 230h29m49s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 230h30m11s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Failing after 230h30m11s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 230h30m16s
CI/CD Pipeline / PR Build API Image (push) Failing after 230h30m17s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import type { ConfigDisplayFields } from "../types/templateLibrary"
|
|
import {
|
|
TEMPLATE_TYPES,
|
|
CATEGORY_GRADIENT_MAP,
|
|
DEFAULT_GRADIENT,
|
|
MATERIAL_TYPE_LABELS,
|
|
} from "../constants/templateLibrary"
|
|
|
|
/** 获取类型对应颜色 */
|
|
export const getTypeColor = (type: string): string => {
|
|
const found = TEMPLATE_TYPES.find((t) => t.type === type)
|
|
return found?.color ?? "#6366f1"
|
|
}
|
|
|
|
/** 根据 category 生成占位渐变色 */
|
|
export const gradientForCategory = (category: string): string => {
|
|
return CATEGORY_GRADIENT_MAP[category] ?? DEFAULT_GRADIENT
|
|
}
|
|
|
|
/** 格式化配置对象为可读文本 */
|
|
export const formatConfig = (config?: object): string => {
|
|
if (!config || Object.keys(config).length === 0) return "默认"
|
|
const c = config as ConfigDisplayFields
|
|
const parts: string[] = []
|
|
if (c.font_size) parts.push(`字号: ${c.font_size}`)
|
|
if (c.font_family) parts.push(`字体: ${c.font_family}`)
|
|
if (c.color) parts.push(`颜色: ${c.color}`)
|
|
if (c.position) parts.push(`位置: ${c.position}`)
|
|
if (c.volume !== undefined) parts.push(`音量: ${c.volume}%`)
|
|
if (c.name) parts.push(String(c.name))
|
|
return parts.length > 0 ? parts.join(" / ") : JSON.stringify(config)
|
|
}
|
|
|
|
/** 获取素材类型标签文本 */
|
|
export const getMaterialTypeLabel = (materialType: string | null | undefined): string => {
|
|
if (!materialType) return "不限"
|
|
return MATERIAL_TYPE_LABELS[materialType] ?? materialType
|
|
}
|