feat: 客户视图隐藏用户区域,管理员才显示完整面板
This commit is contained in:
parent
21ad2403a0
commit
85afc1f023
@ -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 %}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user