diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 114fbef9..a46db717 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -304,6 +304,16 @@ const ChannelsTable = () => { setLoading(false); }; + function truncateString(str, num) { + if (str.length <= num) return str; + return str.slice(0, num) + "..."; + } + + function formatUsedQuota(usedQuota) { + const quotaPerUnit = localStorage.getItem('quota_per_unit') || 500000; // 如果未设置,则使用 1 作为默认值 + return `$${(usedQuota / quotaPerUnit).toFixed(2)}`; + } + return ( <> @@ -369,6 +379,30 @@ const ChannelsTable = () => { > 响应时间 +