sage/wwwroot/index.ui

186 lines
6.5 KiB
XML

{% set userorgid = get_userorgid() %}
{% set sor = db.sqlorContext() %}
{% set org = sor.execute_sql('SELECT orgname, iconid FROM organization WHERE id = ${orgid}$', {'orgid': userorgid}).first() %}
{% set orgname = org.orgname if org and org.orgname else 'OpenComputing' %}
{% set icon = org.iconid if org and org.iconid else 'imgs/ocai.svg' %}
{
"widgettype": "VBox",
"options": {
"css": "sage-shell",
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"css": "sage-topbar",
"width": "100%",
"height": "56px",
"padding": "0 16px",
"alignItems": "center"
},
"subwidgets": [
{
"widgettype": "Button",
"id": "sidebar_toggle_btn",
"options": {
"css": "sidebar-toggle",
"label": "",
"width": "36px",
"height": "36px",
"padding": "0"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "sageToggleSidebar()"
}
]
},
{
"widgettype": "Svg",
"options": {
"css": "sage-logo",
"rate": 2,
"url": "{{entire_url('/appbase/show_icon.dspy')}}?id={{icon}}"
}
},
{
"widgettype": "Title4",
"options": {
"css": "sage-brand-title",
"text": "{{orgname}}",
"fontWeight": "bold",
"marginLeft": "8px"
}
},
{
"widgettype": "Filler"
},
{
"widgettype": "Button",
"id": "theme_toggle_btn",
"options": {
"css": "theme-toggle",
"label": "",
"width": "36px",
"height": "36px",
"padding": "0"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "sageToggleTheme()"
}
]
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('i18n/language.ui')}}"
}
},
{
"widgettype": "Svg",
"options": {
"css": "clickable",
"rate": 2,
"tip": "显示所有已最小化的窗口",
"url": "{{entire_url('/bricks/imgs/app-dock.svg')}}"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "app",
"script": "bricks.app.show_windows_panel(event)"
}
]
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('/rbac/user/user_panel.ui')}}"
}
}
]
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "calc(100% - 56px)"
},
"subwidgets": [
{
"widgettype": "VBox",
"id": "sage_sidebar",
"options": {
"css": "sage-sidebar",
"width": "240px",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('global_menu.ui')}}"
}
}
],
"binds": [
{
"wid": "app",
"event": "user_logined",
"actiontype": "script",
"target": "self",
"script": "sageReloadMenu()"
},
{
"wid": "app",
"event": "sage_logout",
"actiontype": "script",
"target": "self",
"script": "sageReloadMenu()"
}
]
},
{
"widgettype": "VBox",
"id": "sage_main_content",
"options": {
"css": "sage-main",
"height": "100%",
"padding": "24px"
},
"binds": [
{
"wid": "app",
"event": "user_logined",
"actiontype": "script",
"target": "self",
"script": "sageOnLogin('{{entire_url('/dashboard_for_sage/index.ui')}}')"
}
],
"subwidgets": [
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('/dashboard_for_sage/index.ui')}}"
}
}
]
}
]
}
]
}