优化任务账号名称展示
This commit is contained in:
@@ -34,6 +34,30 @@ const emit = defineEmits<{
|
||||
copyBindUrl: [url: string]
|
||||
openBindUrl: [url: string]
|
||||
}>()
|
||||
|
||||
function formatCloudSourcePriority(flow: KuaishouCloudFlow) {
|
||||
return formatAccountNames(flow.binding.cloudSourceLabels, flow.binding.cloudSourceKeys)
|
||||
}
|
||||
|
||||
function formatResolvedCloudSource(flow: KuaishouCloudFlow) {
|
||||
return flow.binding.resolvedSourceLabel || flow.binding.resolvedSourceKey || '-'
|
||||
}
|
||||
|
||||
function formatAccountNames(labels: string[] | undefined, keys: string[] | undefined) {
|
||||
const displayNames = Array.isArray(labels)
|
||||
? labels.map((value) => String(value || '').trim()).filter(Boolean)
|
||||
: []
|
||||
|
||||
if (displayNames.length > 0) {
|
||||
return displayNames.join(' / ')
|
||||
}
|
||||
|
||||
const fallbackKeys = Array.isArray(keys)
|
||||
? keys.map((value) => String(value || '').trim()).filter(Boolean)
|
||||
: []
|
||||
|
||||
return fallbackKeys.length > 0 ? fallbackKeys.join(' / ') : '-'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -222,13 +246,11 @@ const emit = defineEmits<{
|
||||
<div class="flow-meta-list flow-meta-list--two-column">
|
||||
<div>
|
||||
<span>账号优先级</span>
|
||||
<strong>{{
|
||||
flow.binding.cloudSourceKeys?.length ? flow.binding.cloudSourceKeys.join(' / ') : '-'
|
||||
}}</strong>
|
||||
<strong>{{ formatCloudSourcePriority(flow) }}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>实际使用账号</span>
|
||||
<strong>{{ flow.binding.resolvedSourceKey || '-' }}</strong>
|
||||
<strong>{{ formatResolvedCloudSource(flow) }}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>cloud SKU</span>
|
||||
|
||||
Reference in New Issue
Block a user