feat: role-based dashboard visibility - customer users see only customer monitoring

This commit is contained in:
yumoqing 2026-05-31 10:22:10 +08:00
parent 98a28d9770
commit b648717339

View File

@ -1,3 +1,4 @@
{% set roles = get_user_roles(get_user()) %}
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
@ -38,8 +39,9 @@
} }
} }
] ]
}, }
{ {% if 'owner.*' in roles %}
,{
"widgettype": "ResponsableBox", "widgettype": "ResponsableBox",
"options": { "options": {
"gap": "16px", "gap": "16px",
@ -411,8 +413,9 @@
] ]
} }
] ]
}, }
{ {% endif %}
,{
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"css": "card", "css": "card",
@ -434,7 +437,7 @@
"widgettype": "Title4", "widgettype": "Title4",
"options": { "options": {
"fontWeight": "600", "fontWeight": "600",
"otext": "今日模型使用(全部)", "otext": "我的今日模型使用",
"i18n": true "i18n": true
} }
}, },
@ -466,7 +469,7 @@
{ {
"widgettype": "urlwidget", "widgettype": "urlwidget",
"options": { "options": {
"url": "{{entire_url('all_today_models_chart.ui')}}" "url": "{{entire_url('user_today_models_chart.ui')}}"
} }
} }
] ]
@ -546,8 +549,9 @@
] ]
} }
] ]
}, }
{ {% if 'owner.*' in roles %}
,{
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"css": "card", "css": "card",
@ -671,6 +675,7 @@
} }
] ]
} }
{% endif %}
] ]
} }
] ]