新增对象存储/账单/保留IP页面,成本今天视图与样式收敛
CI / test (push) Successful in 42s

This commit is contained in:
2026-07-21 12:11:22 +08:00
parent d813225ac4
commit ac457282ce
91 changed files with 6672 additions and 652 deletions
+8
View File
@@ -27,6 +27,14 @@ export function fmtBytes(n: number): string {
return `${(n / 2 ** (10 * i)).toFixed(1)} ${units[i]}`
}
/** 金额展示:千分位 + 2 位小数,常见币种转符号前缀,其余保留币种码 */
export function fmtMoney(n: number, currency = 'USD'): string {
const sym: Record<string, string> = { USD: '$', EUR: '€', GBP: '£', JPY: '¥', CNY: '¥' }
const s = n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
const p = sym[currency]
return p ? p + s : `${currency} ${s}`.trim()
}
/** OCID 中段省略:ocid1.instance.oc1..aaaa…mc25a */
export function truncOcid(ocid: string, head = 24, tail = 6): string {
if (!ocid || ocid.length <= head + tail + 1) return ocid