From 85afc1f0239ed4d7fb72e3c1145c0ca51296dd99 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 23 Jul 2026 16:08:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A2=E6=88=B7=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E7=94=A8=E6=88=B7=E5=8C=BA=E5=9F=9F,?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=89=8D=E6=98=BE=E7=A4=BA=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index.ui | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/wwwroot/index.ui b/wwwroot/index.ui index fa3fda1..24b54fd 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -1,4 +1,6 @@ {% set roles = get_user_roles(get_user()) %} +{% set userorgid = get_userorgid() if get_userorgid is defined else '' %} +{% set is_admin = userorgid == '0' %} { "widgettype": "VBox", "id": "datamart_root", @@ -26,6 +28,7 @@ {"widgettype": "RefreshWidget", "id": "rt_fail", "options": {"period_seconds": 30, "url": "{{entire_url('rt_card_fail.ui')}}", "width": "28%"}} ] }, +{% if is_admin %} { "widgettype": "HBox", "options": {"width": "100%", "alignItems": "center", "marginBottom": "8px"}, @@ -43,6 +46,30 @@ {"widgettype": "RefreshWidget", "id": "rt_online", "options": {"period_seconds": 30, "url": "{{entire_url('rt_card_online.ui')}}", "width": "34%"}} ] }, +{% else %} + { + "widgettype": "HBox", + "options": {"width": "100%", "gap": "16px", "marginBottom": "16px"}, + "subwidgets": [ + { + "widgettype": "VBox", + "options": {"css": "card", "width": "50%", "padding": "16px"}, + "subwidgets": [ + {"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "我的模型(按金额Top5)", "i18n": true, "marginBottom": "8px"}}, + {"widgettype": "RefreshWidget", "options": {"period_seconds": 60, "url": "{{entire_url('sect_top_models.ui')}}", "width": "100%"}} + ] + }, + { + "widgettype": "VBox", + "options": {"css": "card", "width": "50%", "padding": "16px"}, + "subwidgets": [ + {"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "API Key排行", "i18n": true, "marginBottom": "8px"}}, + {"widgettype": "RefreshWidget", "options": {"period_seconds": 60, "url": "{{entire_url('sect_top_models.ui')}}", "width": "100%"}} + ] + } + ] + }, +{% endif %} { "widgettype": "HBox", "options": {"width": "100%", "gap": "16px", "marginBottom": "16px"}, @@ -79,6 +106,7 @@ } ] }, +{% if is_admin %} { "widgettype": "HBox", "options": {"width": "100%", "gap": "16px"}, @@ -109,6 +137,7 @@ } ] } +{% endif %} ] } ]