Skip to content

Commit f955945

Browse files
insistencegitee-org
authored andcommitted
!20 Dash-FastAPI-Admin v1.3.0
Merge pull request !20 from insistence/develop
2 parents e0c7f0b + 3ee2cec commit f955945

File tree

24 files changed

+43
-26
lines changed

24 files changed

+43
-26
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
<p align="center">
22
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
33
</p>
4-
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Dash-FastAPI-Admin v1.2.1</h1>
4+
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Dash-FastAPI-Admin v1.3.0</h1>
55
<h4 align="center">基于Dash+FastAPI前后端分离的纯Python快速开发框架</h4>
66
<p align="center">
77
<a href="https://gitee.com/insistence2022/dash-fastapi-admin/stargazers"><img src="https://gitee.com/insistence2022/dash-fastapi-admin/badge/star.svg?theme=dark"></a>
88
<a href="https://github.com/insistence/Dash-FastAPI-Admin"><img src="https://img.shields.io/github/stars/insistence/Dash-FastAPI-Admin?style=social"></a>
9-
<a href="https://gitee.com/insistence2022/dash-fastapi-admin"><img src="https://img.shields.io/badge/DashFastAPIAdmin-v1.2.1-brightgreen.svg"></a>
9+
<a href="https://gitee.com/insistence2022/dash-fastapi-admin"><img src="https://img.shields.io/badge/DashFastAPIAdmin-v1.3.0-brightgreen.svg"></a>
1010
<a href="https://gitee.com/insistence2022/dash-fastapi-admin/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
1111
<img src="https://img.shields.io/badge/python-3.8 | 3.9-blue">
1212
<img src="https://img.shields.io/badge/MySQL-≥5.7-blue">
1313
</p>
1414

1515

1616

17+
1718
## 平台简介
1819

1920
Dash-FastAPI-Admin是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。

dash-fastapi-backend/.env.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '1.2.1'
13+
APP_VERSION= '1.3.0'
1414
# 应用是否开启热重载
1515
APP_RELOAD = true
1616

dash-fastapi-backend/.env.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '1.2.1'
13+
APP_VERSION= '1.3.0'
1414
# 应用是否开启热重载
1515
APP_RELOAD = false
1616

dash-fastapi-frontend/callbacks/layout_c/index_c.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from dash.exceptions import PreventUpdate
44
import feffery_antd_components as fac
55
from jsonpath_ng import parse
6-
from flask import json
6+
from flask import json, session
77
from collections import OrderedDict
88

99
from server import app
@@ -53,10 +53,12 @@ def handle_tab_switch_and_create(currentKey, tabCloseCounts, latestDeletePane, o
5353
if currentKey == '个人资料':
5454
menu_title = '个人资料'
5555
button_perms = []
56+
role_perms = []
5657
menu_modules = 'system.user.profile'
5758
else:
5859
menu_title = find_title_by_key(menu_info.get('menu_info'), currentKey)
5960
button_perms = [item.get('perms') for item in menu_list.get('menu_list') if str(item.get('parent_id')) == currentKey]
61+
role_perms = [item.get('role_key') for item in session.get('role_info')]
6062
# 判断当前选中的菜单栏项是否存在module,如果有,则动态导入module,否则返回404页面
6163
menu_modules = find_modules_by_key(menu_info.get('menu_info'), currentKey)
6264

@@ -106,7 +108,7 @@ def handle_tab_switch_and_create(currentKey, tabCloseCounts, latestDeletePane, o
106108
{
107109
'label': menu_title,
108110
'key': currentKey,
109-
'children': eval('views.' + menu_modules + '.render(button_perms)'),
111+
'children': eval('views.' + menu_modules + '.render(button_perms=button_perms, role_perms=role_perms)'),
110112
'contextMenu': context_menu
111113
}
112114
)

dash-fastapi-frontend/views/monitor/cache/control/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from api.cache import get_cache_statistical_info_api
66

77

8-
def render(button_perms):
8+
def render(*args, **kwargs):
9+
button_perms = kwargs.get('button_perms')
910
command_stats = []
1011
db_size = ''
1112
info = {}

dash-fastapi-frontend/views/monitor/cache/list/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import callbacks.monitor_c.cache_c.list_c
66

77

8-
def render(button_perms):
8+
def render(*args, **kwargs):
99
cache_name_data = []
1010
cache_name_res = get_cache_name_list_api()
1111
if cache_name_res.get('code') == 200:

dash-fastapi-frontend/views/monitor/druid/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
import feffery_antd_components as fac
44

55

6-
def render(button_perms):
6+
def render(*args, **kwargs):
77

88
return html.Div('我是数据监控')

dash-fastapi-frontend/views/monitor/job/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from api.dict import query_dict_data_list_api
99

1010

11-
def render(button_perms):
11+
def render(*args, **kwargs):
12+
button_perms = kwargs.get('button_perms')
1213

1314
option = []
1415
option_table = []

dash-fastapi-frontend/views/monitor/logininfor/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from api.log import get_login_log_list_api
66

77

8-
def render(button_perms):
8+
def render(*args, **kwargs):
9+
button_perms = kwargs.get('button_perms')
910

1011
login_log_params = dict(page_num=1, page_size=10)
1112
table_info = get_login_log_list_api(login_log_params)

dash-fastapi-frontend/views/monitor/online/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from api.online import get_online_list_api
66

77

8-
def render(button_perms):
8+
def render(*args, **kwargs):
9+
button_perms = kwargs.get('button_perms')
910

1011
online_params = dict(page_num=1, page_size=10)
1112
table_info = get_online_list_api(online_params)

0 commit comments

Comments
 (0)