feat: 主页 Header 加语言切换 + RBAC 用户登录(参考 sage shell)
This commit is contained in:
parent
d4bc917327
commit
d0fe4c98cf
35
wwwroot/i18n/language.ui
Normal file
35
wwwroot/i18n/language.ui
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"id": "language",
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"tip": "切换语言",
|
||||
"otext": "🌐",
|
||||
"cwidth": 4,
|
||||
"css": "clickable",
|
||||
"cfontsize": 1.2
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "click",
|
||||
"actiontype": "urlwidget",
|
||||
"target": "Popup",
|
||||
"popup_options": {
|
||||
"eventpos": true,
|
||||
"cwidth": 11,
|
||||
"cheight": 10,
|
||||
"dismiss_events": ["command"]
|
||||
},
|
||||
"options": {
|
||||
"url": "{{entire_url('menu.ui')}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"wid": "app",
|
||||
"event": "lang",
|
||||
"actiontype": "script",
|
||||
"target": "self",
|
||||
"script": "this.set_otext(bricks.app.lang)"
|
||||
}
|
||||
]
|
||||
}
|
||||
29
wwwroot/i18n/menu.ui
Normal file
29
wwwroot/i18n/menu.ui
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"widgettype": "Menu",
|
||||
"options": {
|
||||
"cwidth": 11,
|
||||
"target": "app",
|
||||
"items": [
|
||||
{
|
||||
"name": "zh",
|
||||
"label": "中文",
|
||||
"script": "this.change_language('zh')"
|
||||
},
|
||||
{
|
||||
"name": "en",
|
||||
"label": "English",
|
||||
"script": "this.change_language('en')"
|
||||
},
|
||||
{
|
||||
"name": "jp",
|
||||
"label": "日本語",
|
||||
"script": "this.change_language('jp')"
|
||||
},
|
||||
{
|
||||
"name": "ko",
|
||||
"label": "한국어",
|
||||
"script": "this.change_language('ko')"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -46,6 +46,18 @@
|
||||
},
|
||||
{
|
||||
"widgettype": "Filler"
|
||||
},
|
||||
{
|
||||
"widgettype": "urlwidget",
|
||||
"options": {
|
||||
"url": "{{entire_url('i18n/language.ui')}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "urlwidget",
|
||||
"options": {
|
||||
"url": "{{entire_url('/rbac/user/user_panel.ui')}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user