From b64871733942a36c3bf2fac921b15a3750f77e7e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 31 May 2026 10:22:10 +0800 Subject: [PATCH] feat: role-based dashboard visibility - customer users see only customer monitoring --- wwwroot/index.ui | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 6a6aba3..8e6c19a 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -1,3 +1,4 @@ +{% set roles = get_user_roles(get_user()) %} { "widgettype": "VBox", "options": { @@ -38,8 +39,9 @@ } } ] - }, - { + } + {% if 'owner.*' in roles %} + ,{ "widgettype": "ResponsableBox", "options": { "gap": "16px", @@ -411,8 +413,9 @@ ] } ] - }, - { + } + {% endif %} + ,{ "widgettype": "VBox", "options": { "css": "card", @@ -434,7 +437,7 @@ "widgettype": "Title4", "options": { "fontWeight": "600", - "otext": "今日模型使用(全部)", + "otext": "我的今日模型使用", "i18n": true } }, @@ -466,7 +469,7 @@ { "widgettype": "urlwidget", "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", "options": { "css": "card", @@ -671,6 +675,7 @@ } ] } + {% endif %} ] } ]