fix(plugins): close R2 workspace gaps
This commit is contained in:
@@ -128,6 +128,11 @@ const PROJECT_TEXT = {
|
||||
not_applicable: '不属于项目启用范围',
|
||||
} as const;
|
||||
|
||||
const PROJECT_POLICY_NOTICE = {
|
||||
stale: '当前项目策略使用缓存,所示能力与价格可能不是最新状态。',
|
||||
unavailable: '当前项目策略不可用,无法确认最新能力与价格。',
|
||||
} as const;
|
||||
|
||||
function billingText(item: PluginWorkspaceItem): string {
|
||||
if (item.billing === 'included') return '按平台包含,不按单次插件调用扣点。';
|
||||
if (item.billing === 'token_point') return '按 Token Point 实际用量计费,价格与回执以服务端为准。';
|
||||
@@ -218,6 +223,10 @@ export function PluginDetails(props: PluginDetailsProps) {
|
||||
const detail = props.item.official?.detail ?? null;
|
||||
const installation = props.item.official?.installation ?? null;
|
||||
const operations = detailOperations(props.item);
|
||||
const projectPolicyNotice = props.item.projectPolicyStatus === 'stale'
|
||||
|| props.item.projectPolicyStatus === 'unavailable'
|
||||
? PROJECT_POLICY_NOTICE[props.item.projectPolicyStatus]
|
||||
: null;
|
||||
const showDataService = project?.enabled
|
||||
&& project.settingsSurface === 'data-service';
|
||||
const confirmCopy = confirmation
|
||||
@@ -372,6 +381,12 @@ export function PluginDetails(props: PluginDetailsProps) {
|
||||
|
||||
<section aria-labelledby="plugin-billing-heading">
|
||||
<h3 id="plugin-billing-heading" className="text-lg font-semibold">Token Point 与计费</h3>
|
||||
{projectPolicyNotice ? (
|
||||
<p role="status" className="mt-3 flex gap-2 rounded-xl bg-warning/10 p-3 text-pretty text-sm text-warning">
|
||||
<AlertTriangle className="mt-0.5 h-4 w-4 shrink-0" />
|
||||
<span>{projectPolicyNotice}</span>
|
||||
</p>
|
||||
) : null}
|
||||
<p className="mt-2 text-pretty text-sm text-muted-foreground">{billingText(props.item)}</p>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user