2026-02-06 03:34:50 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="role-policy-demo">
|
|
|
|
|
|
<div class="demo-header">
|
|
|
|
|
|
<h4>角色与策略关系可视化</h4>
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<p class="intro-text">拖动查看角色如何关联多个策略</p>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<div class="demo-content">
|
|
|
|
|
|
<div class="visualization-container">
|
|
|
|
|
|
<!-- Central Role -->
|
|
|
|
|
|
<div class="central-role">
|
|
|
|
|
|
<div class="role-core" @click="toggleRoleDetails"
|
|
|
|
|
|
:class="{ expanded: showRoleDetails }">
|
|
|
|
|
|
<div class="role-icon">🎭</div>
|
|
|
|
|
|
<div class="role-info">
|
|
|
|
|
|
<span class="role-name">{{ roleName }}</span>
|
|
|
|
|
|
<span class="role-type">{{ roleType }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="expand-icon">{{ showRoleDetails ? '▼' : '▶' }}</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<!-- Trust Policy -->
|
|
|
|
|
|
<div class="trust-policy" v-if="showRoleDetails">
|
|
|
|
|
|
<div class="policy-header">
|
|
|
|
|
|
<span class="policy-icon">🔐</span>
|
|
|
|
|
|
<span class="policy-title">信任策略 (Trust Policy)</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="policy-content">
|
|
|
|
|
|
<div class="policy-item" v-for="(trust, i) in trustPolicy" :key="i">
|
|
|
|
|
|
<span class="principal">{{ trust.principal }}</span>
|
|
|
|
|
|
<span class="action">可执行: {{ trust.action }}</span>
|
|
|
|
|
|
<span class="condition" v-if="trust.condition">条件: {{ trust.condition }}</span>
|
|
|
|
|
|
</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<!-- Connection Lines (SVG) -->
|
|
|
|
|
|
<svg class="connection-lines" v-if="mounted">
|
|
|
|
|
|
<line
|
|
|
|
|
|
v-for="(line, index) in connectionLines"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
:x1="line.x1"
|
|
|
|
|
|
:y1="line.y1"
|
|
|
|
|
|
:x2="line.x2"
|
|
|
|
|
|
:y2="line.y2"
|
|
|
|
|
|
:class="['connection-line', line.type, { active: hoveredPolicy === line.policyIndex }]"
|
|
|
|
|
|
@mouseenter="hoveredPolicy = line.policyIndex"
|
|
|
|
|
|
@mouseleave="hoveredPolicy = null"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Attached Policies -->
|
|
|
|
|
|
<div class="attached-policies">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="(policy, index) in attachedPolicies"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
class="policy-card"
|
|
|
|
|
|
:class="{ active: hoveredPolicy === index, selected: selectedPolicy === index }"
|
|
|
|
|
|
:style="getPolicyPosition(index)"
|
|
|
|
|
|
@mouseenter="hoveredPolicy = index"
|
|
|
|
|
|
@mouseleave="hoveredPolicy = null"
|
|
|
|
|
|
@click="selectPolicy(index)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="policy-header">
|
|
|
|
|
|
<span class="policy-icon">{{ policy.icon }}</span>
|
|
|
|
|
|
<span class="policy-name">{{ policy.name }}</span>
|
|
|
|
|
|
</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<div class="policy-permissions" v-if="selectedPolicy === index">
|
|
|
|
|
|
<div class="permission-item" v-for="(perm, i) in policy.permissions" :key="i">
|
|
|
|
|
|
<span class="perm-effect" :class="perm.effect">{{ perm.effect }}</span>
|
|
|
|
|
|
<span class="perm-action">{{ perm.action }}</span>
|
|
|
|
|
|
<span class="perm-resource">{{ perm.resource }}</span>
|
|
|
|
|
|
</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-02-13 22:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
<div class="info-box">
|
|
|
|
|
|
<strong>💡 策略叠加:</strong>一个角色可以附加多个策略,最终的权限是所有策略的叠加结果。Deny 策略优先级高于 Allow。
|
|
|
|
|
|
</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
|
|
|
|
|
|
|
|
|
|
|
// Role Data
|
|
|
|
|
|
const roleName = ref('CrossAccountS3AccessRole')
|
|
|
|
|
|
const roleType = ref('跨账号访问角色')
|
|
|
|
|
|
const showRoleDetails = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const trustPolicy = ref([
|
|
|
|
|
|
{ principal: '账号 A (123456789012)', action: 'sts:AssumeRole', condition: 'ExternalId 匹配' },
|
|
|
|
|
|
{ principal: '特定 IAM 用户', action: 'sts:AssumeRole', condition: 'IP 白名单' }
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
// Policies Data
|
|
|
|
|
|
const attachedPolicies = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'S3ReadWritePolicy',
|
|
|
|
|
|
icon: '📦',
|
|
|
|
|
|
permissions: [
|
|
|
|
|
|
{ effect: 'Allow', action: 's3:GetObject', resource: 'arn:aws:s3:::bucket/*' },
|
|
|
|
|
|
{ effect: 'Allow', action: 's3:PutObject', resource: 'arn:aws:s3:::bucket/*' },
|
|
|
|
|
|
{ effect: 'Allow', action: 's3:ListBucket', resource: 'arn:aws:s3:::bucket' }
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'CloudWatchLogsPolicy',
|
|
|
|
|
|
icon: '📊',
|
|
|
|
|
|
permissions: [
|
|
|
|
|
|
{ effect: 'Allow', action: 'logs:CreateLogGroup', resource: '*' },
|
|
|
|
|
|
{ effect: 'Allow', action: 'logs:CreateLogStream', resource: '*' },
|
|
|
|
|
|
{ effect: 'Allow', action: 'logs:PutLogEvents', resource: '*' }
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'DenySensitiveData',
|
|
|
|
|
|
icon: '🚫',
|
|
|
|
|
|
permissions: [
|
|
|
|
|
|
{ effect: 'Deny', action: 's3:GetObject', resource: 'arn:aws:s3:::bucket/sensitive/*' },
|
|
|
|
|
|
{ effect: 'Deny', action: 's3:DeleteObject', resource: 'arn:aws:s3:::bucket/*' }
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
// State
|
|
|
|
|
|
const hoveredPolicy = ref(null)
|
|
|
|
|
|
const selectedPolicy = ref(0)
|
|
|
|
|
|
const mounted = ref(false)
|
|
|
|
|
|
const connectionLines = ref([])
|
|
|
|
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
|
|
function toggleRoleDetails() {
|
|
|
|
|
|
showRoleDetails.value = !showRoleDetails.value
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function selectPolicy(index) {
|
|
|
|
|
|
selectedPolicy.value = index
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getPolicyPosition(index) {
|
|
|
|
|
|
const positions = [
|
|
|
|
|
|
{ top: '0%', right: '0%' },
|
|
|
|
|
|
{ top: '35%', right: '5%' },
|
|
|
|
|
|
{ top: '70%', right: '0%' }
|
|
|
|
|
|
]
|
|
|
|
|
|
return positions[index] || positions[0]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function calculateConnections() {
|
|
|
|
|
|
connectionLines.value = attachedPolicies.value.map((_, index) => ({
|
|
|
|
|
|
x1: 50,
|
|
|
|
|
|
y1: 50,
|
|
|
|
|
|
x2: 80 + (index * 5),
|
|
|
|
|
|
y2: 20 + (index * 30),
|
|
|
|
|
|
type: index === 2 ? 'deny' : 'allow',
|
|
|
|
|
|
policyIndex: index
|
|
|
|
|
|
}))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Lifecycle
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
|
mounted.value = true
|
|
|
|
|
|
calculateConnections()
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
|
mounted.value = false
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.role-policy-demo {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
background: var(--vp-c-bg-soft);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 1.5rem;
|
|
|
|
|
|
margin: 1rem 0;
|
|
|
|
|
|
max-height: 600px;
|
|
|
|
|
|
overflow-y: auto;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.demo-header {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-bottom: 1rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.demo-header h4 {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin: 0 0 0.5rem 0;
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.intro-text {
|
2026-02-06 03:34:50 +08:00
|
|
|
|
margin: 0;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-2);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.demo-content {
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.visualization-container {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
min-height: 500px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Central Role */
|
|
|
|
|
|
.central-role {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 5%;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
|
width: 280px;
|
|
|
|
|
|
z-index: 10;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-core {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 1.25rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
cursor: pointer;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-core:hover {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
border-color: var(--vp-c-brand);
|
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-core.expanded {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
border-radius: 8px 8px 0 0;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-icon {
|
|
|
|
|
|
font-size: 2.5rem;
|
|
|
|
|
|
text-align: center;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-bottom: 0.5rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-info {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-name {
|
|
|
|
|
|
display: block;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
font-size: 1rem;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-bottom: 0.25rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.role-type {
|
|
|
|
|
|
display: block;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-2);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.expand-icon {
|
|
|
|
|
|
text-align: center;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
|
color: var(--vp-c-text-3);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Trust Policy */
|
|
|
|
|
|
.trust-policy {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
border-radius: 0 0 8px 8px;
|
|
|
|
|
|
padding: 1rem 1.25rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-bottom: 0.75rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-icon {
|
|
|
|
|
|
font-size: 1.2rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-title {
|
|
|
|
|
|
font-weight: 700;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-content {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 0.5rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-item {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border-radius: 6px;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
padding: 0.5rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 0.125rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.principal {
|
|
|
|
|
|
font-weight: 600;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-brand-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.action {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-2);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.condition {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-3);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Connection Lines SVG */
|
|
|
|
|
|
.connection-lines {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.connection-line {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
stroke: var(--vp-c-divider);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
stroke-width: 2;
|
|
|
|
|
|
fill: none;
|
|
|
|
|
|
pointer-events: stroke;
|
|
|
|
|
|
cursor: pointer;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
transition: all 0.2s ease;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.connection-line.allow {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
stroke: var(--vp-c-brand);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.connection-line.deny {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
stroke: var(--vp-c-brand-delta);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
stroke-dasharray: 5, 5;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.connection-line:hover,
|
|
|
|
|
|
.connection-line.active {
|
|
|
|
|
|
stroke-width: 4;
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Attached Policies */
|
|
|
|
|
|
.attached-policies {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 5%;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
|
width: 240px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-card {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
|
margin-bottom: 0.75rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
cursor: pointer;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-card:hover,
|
|
|
|
|
|
.policy-card.active {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
border-color: var(--vp-c-brand);
|
|
|
|
|
|
transform: translateX(-4px);
|
|
|
|
|
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-card.selected {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
border-color: var(--vp-c-brand);
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-card .policy-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 0.625rem;
|
|
|
|
|
|
margin-bottom: 0.5rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-card .policy-icon {
|
|
|
|
|
|
font-size: 1.4rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-card .policy-name {
|
|
|
|
|
|
font-weight: 700;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.policy-permissions {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-top: 0.75rem;
|
|
|
|
|
|
padding-top: 0.75rem;
|
|
|
|
|
|
border-top: 1px solid var(--vp-c-divider);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.permission-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
padding: 0.375rem;
|
|
|
|
|
|
margin-bottom: 0.25rem;
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.perm-effect {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
padding: 0.125rem 0.375rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
font-size: 0.65rem;
|
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.perm-effect.Allow {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
background: var(--vp-c-brand-soft);
|
|
|
|
|
|
color: var(--vp-c-brand-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.perm-effect.Deny {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
background: rgba(var(--vp-c-brand-delta-rgb), 0.15);
|
|
|
|
|
|
color: var(--vp-c-brand-delta);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.perm-action {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
font-family: var(--vp-font-family-mono);
|
|
|
|
|
|
color: var(--vp-c-brand-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.perm-resource {
|
2026-02-13 22:10:03 +08:00
|
|
|
|
color: var(--vp-c-text-3);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-size: 0.6rem;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.info-box {
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-left: 4px solid var(--vp-c-brand);
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-box strong {
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
@media (max-width: 1024px) {
|
|
|
|
|
|
.visualization-container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 1rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.central-role,
|
|
|
|
|
|
.attached-policies {
|
|
|
|
|
|
position: static;
|
|
|
|
|
|
transform: none;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.connection-lines {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|