ui: show project names in IAMUserList instead of count

Display project name tags (green=monitoring, grey=not) with a
'manage' link to the policy page. Much more informative at a glance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
seaislee1209 2026-03-29 22:09:57 +08:00
parent 9e81717e08
commit 236e082349

View File

@ -51,11 +51,17 @@
<span v-else style="color:#999;font-size:12px;">未划拨</span> <span v-else style="color:#999;font-size:12px;">未划拨</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目" min-width="80" align="center"> <el-table-column label="关联项目" min-width="180">
<template #default="{ row }"> <template #default="{ row }">
<el-button link type="primary" size="small" @click="$router.push(`/iam-users/${row.id}/policies`)"> <div style="display:flex; flex-wrap:wrap; gap:4px; align-items:center;">
{{ row.monitored_project_count || 0 }} / {{ (row.projects || []).length }} <el-tag v-for="p in (row.projects || [])" :key="p.project_name"
</el-button> :type="p.monitor_enabled ? 'success' : 'info'" size="small">
{{ p.project_name }}
</el-tag>
<el-button link type="primary" size="small" @click="$router.push(`/iam-users/${row.id}/policies`)"
style="font-size:12px;">管理</el-button>
</div>
<span v-if="!(row.projects || []).length" style="color:#999;font-size:12px;">未关联</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="告警" min-width="110" align="center"> <el-table-column label="告警" min-width="110" align="center">