diff --git a/README.md b/README.md index 5599e94599e44eef72811f2b3fb1b341bb3f92f8..5fdcafd2992c853e78c4c5cce8b15b1015c6e1b2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@

logo

-

Dash-FastAPI-Admin v1.2.1

+

Dash-FastAPI-Admin v1.3.0

基于Dash+FastAPI前后端分离的纯Python快速开发框架

- + @@ -14,6 +14,7 @@ + ## 平台简介 Dash-FastAPI-Admin是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。 diff --git a/dash-fastapi-backend/.env.dev b/dash-fastapi-backend/.env.dev index 7dfa8170eae13eb9fd5337828b03595a4e7516b5..993f83b47d0c21398b19bfe68364acd6dc74cbd6 100644 --- a/dash-fastapi-backend/.env.dev +++ b/dash-fastapi-backend/.env.dev @@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0' # 应用端口 APP_PORT = 9099 # 应用版本 -APP_VERSION= '1.2.1' +APP_VERSION= '1.3.0' # 应用是否开启热重载 APP_RELOAD = true diff --git a/dash-fastapi-backend/.env.prod b/dash-fastapi-backend/.env.prod index b496d9ffc34333556e76f010e40108e7c5d5915f..3ec163c75331df156c1cf6a6e690c78ca8795b56 100644 --- a/dash-fastapi-backend/.env.prod +++ b/dash-fastapi-backend/.env.prod @@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0' # 应用端口 APP_PORT = 9099 # 应用版本 -APP_VERSION= '1.2.1' +APP_VERSION= '1.3.0' # 应用是否开启热重载 APP_RELOAD = false diff --git a/dash-fastapi-frontend/callbacks/layout_c/index_c.py b/dash-fastapi-frontend/callbacks/layout_c/index_c.py index 82b8cd47c6e2634c58ce78c42eea89b8f7e961dd..d966cf87cba8802f9c86fd1b5db5005074bcdf67 100644 --- a/dash-fastapi-frontend/callbacks/layout_c/index_c.py +++ b/dash-fastapi-frontend/callbacks/layout_c/index_c.py @@ -3,7 +3,7 @@ from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate import feffery_antd_components as fac from jsonpath_ng import parse -from flask import json +from flask import json, session from collections import OrderedDict from server import app @@ -53,10 +53,12 @@ def handle_tab_switch_and_create(currentKey, tabCloseCounts, latestDeletePane, o if currentKey == '个人资料': menu_title = '个人资料' button_perms = [] + role_perms = [] menu_modules = 'system.user.profile' else: menu_title = find_title_by_key(menu_info.get('menu_info'), currentKey) button_perms = [item.get('perms') for item in menu_list.get('menu_list') if str(item.get('parent_id')) == currentKey] + role_perms = [item.get('role_key') for item in session.get('role_info')] # 判断当前选中的菜单栏项是否存在module,如果有,则动态导入module,否则返回404页面 menu_modules = find_modules_by_key(menu_info.get('menu_info'), currentKey) @@ -106,7 +108,7 @@ def handle_tab_switch_and_create(currentKey, tabCloseCounts, latestDeletePane, o { 'label': menu_title, 'key': currentKey, - 'children': eval('views.' + menu_modules + '.render(button_perms)'), + 'children': eval('views.' + menu_modules + '.render(button_perms=button_perms, role_perms=role_perms)'), 'contextMenu': context_menu } ) diff --git a/dash-fastapi-frontend/views/monitor/cache/control/__init__.py b/dash-fastapi-frontend/views/monitor/cache/control/__init__.py index e19d8875e73262858da587f8add95e2c55996083..08dd3fbf5956903b3b7569fc74dc2f52479124d0 100644 --- a/dash-fastapi-frontend/views/monitor/cache/control/__init__.py +++ b/dash-fastapi-frontend/views/monitor/cache/control/__init__.py @@ -5,7 +5,8 @@ import callbacks.monitor_c.cache_c.control_c from api.cache import get_cache_statistical_info_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') command_stats = [] db_size = '' info = {} diff --git a/dash-fastapi-frontend/views/monitor/cache/list/__init__.py b/dash-fastapi-frontend/views/monitor/cache/list/__init__.py index 7db8b26f7ab1548560ae4e6d14a022026deb218a..015739c3b78c9a05f458faa6822586566876bdbb 100644 --- a/dash-fastapi-frontend/views/monitor/cache/list/__init__.py +++ b/dash-fastapi-frontend/views/monitor/cache/list/__init__.py @@ -5,7 +5,7 @@ from api.cache import get_cache_name_list_api import callbacks.monitor_c.cache_c.list_c -def render(button_perms): +def render(*args, **kwargs): cache_name_data = [] cache_name_res = get_cache_name_list_api() if cache_name_res.get('code') == 200: diff --git a/dash-fastapi-frontend/views/monitor/druid/__init__.py b/dash-fastapi-frontend/views/monitor/druid/__init__.py index 67faba2d9e668a0f79e204a127d233aa06d1c086..a79fa8cdcc7f919c0f08eccc65f870f4acee41a8 100644 --- a/dash-fastapi-frontend/views/monitor/druid/__init__.py +++ b/dash-fastapi-frontend/views/monitor/druid/__init__.py @@ -3,6 +3,6 @@ import feffery_utils_components as fuc import feffery_antd_components as fac -def render(button_perms): +def render(*args, **kwargs): return html.Div('我是数据监控') diff --git a/dash-fastapi-frontend/views/monitor/job/__init__.py b/dash-fastapi-frontend/views/monitor/job/__init__.py index 7785e341dea1a429551ad7703d9b8178b013831c..03dec390b2b4c1c2d070fd0307e91014aa9fb4ab 100644 --- a/dash-fastapi-frontend/views/monitor/job/__init__.py +++ b/dash-fastapi-frontend/views/monitor/job/__init__.py @@ -8,7 +8,8 @@ from api.job import get_job_list_api from api.dict import query_dict_data_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') option = [] option_table = [] diff --git a/dash-fastapi-frontend/views/monitor/logininfor/__init__.py b/dash-fastapi-frontend/views/monitor/logininfor/__init__.py index 55c9b37e6c0c1d1b07aa710c9fa8f14fd06cec9e..ebe85e5c4f9fb051eb1c606e7fec8b5072479558 100644 --- a/dash-fastapi-frontend/views/monitor/logininfor/__init__.py +++ b/dash-fastapi-frontend/views/monitor/logininfor/__init__.py @@ -5,7 +5,8 @@ import callbacks.monitor_c.logininfor_c from api.log import get_login_log_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') login_log_params = dict(page_num=1, page_size=10) table_info = get_login_log_list_api(login_log_params) diff --git a/dash-fastapi-frontend/views/monitor/online/__init__.py b/dash-fastapi-frontend/views/monitor/online/__init__.py index 9560c1b885f0ec671ea3523948ff027f63bd8ad4..db80ae5fefd74c9e98a1c0b583bdfdedde77991b 100644 --- a/dash-fastapi-frontend/views/monitor/online/__init__.py +++ b/dash-fastapi-frontend/views/monitor/online/__init__.py @@ -5,7 +5,8 @@ import callbacks.monitor_c.online_c from api.online import get_online_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') online_params = dict(page_num=1, page_size=10) table_info = get_online_list_api(online_params) diff --git a/dash-fastapi-frontend/views/monitor/operlog/__init__.py b/dash-fastapi-frontend/views/monitor/operlog/__init__.py index 8c1f3a7c0604a06c2d8578dedb57eb1e5779ab63..6e7715784fba06d736ed8f1b0441b811c2b52da2 100644 --- a/dash-fastapi-frontend/views/monitor/operlog/__init__.py +++ b/dash-fastapi-frontend/views/monitor/operlog/__init__.py @@ -7,7 +7,8 @@ from api.log import get_operation_log_list_api from api.dict import query_dict_data_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') option = [] option_table = [] diff --git a/dash-fastapi-frontend/views/monitor/server/__init__.py b/dash-fastapi-frontend/views/monitor/server/__init__.py index 324a03bac1335a9ed1c8ee5ff39ecdc7269f4d55..b88944e5861c9b34d6fa75aa075a69c3e502d0e8 100644 --- a/dash-fastapi-frontend/views/monitor/server/__init__.py +++ b/dash-fastapi-frontend/views/monitor/server/__init__.py @@ -4,7 +4,8 @@ import feffery_antd_components as fac from api.server import get_server_statistical_info_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') cpu = {} mem = {} sys = {} diff --git a/dash-fastapi-frontend/views/system/config/__init__.py b/dash-fastapi-frontend/views/system/config/__init__.py index 9a3457507f1e526205e535313f6e33ebf671de1e..2b5093c2041234c6980550d65d3442898b08af1f 100644 --- a/dash-fastapi-frontend/views/system/config/__init__.py +++ b/dash-fastapi-frontend/views/system/config/__init__.py @@ -5,7 +5,8 @@ import callbacks.system_c.config_c from api.config import get_config_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') config_params = dict(page_num=1, page_size=10) table_info = get_config_list_api(config_params) diff --git a/dash-fastapi-frontend/views/system/dept/__init__.py b/dash-fastapi-frontend/views/system/dept/__init__.py index 354bb6effe299ef7d35364f2f7208a598f9f941f..5983d0342477b890cbd8e49ed050858c025a4c5b 100644 --- a/dash-fastapi-frontend/views/system/dept/__init__.py +++ b/dash-fastapi-frontend/views/system/dept/__init__.py @@ -6,7 +6,8 @@ from api.dept import get_dept_list_api from utils.tree_tool import list_to_tree -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') table_data_new = [] default_expanded_row_keys = [] table_info = get_dept_list_api({}) diff --git a/dash-fastapi-frontend/views/system/dict/__init__.py b/dash-fastapi-frontend/views/system/dict/__init__.py index 608f59ee035c4a89c78d092a150f97118960663d..ac8824a0b815a4232925fddc946a20ddb4f54285 100644 --- a/dash-fastapi-frontend/views/system/dict/__init__.py +++ b/dash-fastapi-frontend/views/system/dict/__init__.py @@ -6,7 +6,8 @@ from . import dict_data from api.dict import get_dict_type_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') dict_type_params = dict(page_num=1, page_size=10) table_info = get_dict_type_list_api(dict_type_params) diff --git a/dash-fastapi-frontend/views/system/menu/__init__.py b/dash-fastapi-frontend/views/system/menu/__init__.py index 12f0f2a45db86a07fab1b1bbea3299c28f186629..0e8988d07bf6f613feccb8a6430ea629d643f6a4 100644 --- a/dash-fastapi-frontend/views/system/menu/__init__.py +++ b/dash-fastapi-frontend/views/system/menu/__init__.py @@ -7,7 +7,8 @@ from views.system.menu.components.icon_category import render_icon import callbacks.system_c.menu_c.menu_c -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') table_data_new = [] table_info = get_menu_list_api({}) if table_info['code'] == 200: diff --git a/dash-fastapi-frontend/views/system/notice/__init__.py b/dash-fastapi-frontend/views/system/notice/__init__.py index 04cb68d14bc66547cc3f662b40763b06053edadc..dea00474097007f8a70267c9c7def49a9ec76192 100644 --- a/dash-fastapi-frontend/views/system/notice/__init__.py +++ b/dash-fastapi-frontend/views/system/notice/__init__.py @@ -11,7 +11,8 @@ from api.notice import get_notice_list_api from api.dict import query_dict_data_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') option = [] option_table = [] diff --git a/dash-fastapi-frontend/views/system/post/__init__.py b/dash-fastapi-frontend/views/system/post/__init__.py index af668e8c10aa69da5ed50eaa816fb02b1cc4d1fd..b19207b6db7573654d0bf202bd33d3013c190934 100644 --- a/dash-fastapi-frontend/views/system/post/__init__.py +++ b/dash-fastapi-frontend/views/system/post/__init__.py @@ -5,7 +5,8 @@ import callbacks.system_c.post_c from api.post import get_post_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') post_params = dict(page_num=1, page_size=10) table_info = get_post_list_api(post_params) diff --git a/dash-fastapi-frontend/views/system/role/__init__.py b/dash-fastapi-frontend/views/system/role/__init__.py index 27fba42ee712b69a616eeb3bb1231207e75a64a7..715045ed39fe9144d975054539475d8265c893c5 100644 --- a/dash-fastapi-frontend/views/system/role/__init__.py +++ b/dash-fastapi-frontend/views/system/role/__init__.py @@ -6,7 +6,8 @@ from . import data_scope, allocate_user from api.role import get_role_list_api -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') role_params = dict(page_num=1, page_size=10) table_info = get_role_list_api(role_params) diff --git a/dash-fastapi-frontend/views/system/user/__init__.py b/dash-fastapi-frontend/views/system/user/__init__.py index 646878e7236ff33d21c3114dd689c8e26771866b..934d9b6e70c4f3542b4702971b47ec33cb73926b 100644 --- a/dash-fastapi-frontend/views/system/user/__init__.py +++ b/dash-fastapi-frontend/views/system/user/__init__.py @@ -10,7 +10,8 @@ from config.global_config import ApiBaseUrlConfig import callbacks.system_c.user_c.user_c -def render(button_perms): +def render(*args, **kwargs): + button_perms = kwargs.get('button_perms') dept_params = dict(dept_name='') user_params = dict(page_num=1, page_size=10) tree_info = get_dept_tree_api(dept_params) diff --git a/dash-fastapi-frontend/views/system/user/profile/__init__.py b/dash-fastapi-frontend/views/system/user/profile/__init__.py index 74eafbf4f9b356137a0e60f79b4ca392e6a834c5..4d73f63c7e75ee9c2daa4f6ff72bd872bd17eca8 100644 --- a/dash-fastapi-frontend/views/system/user/profile/__init__.py +++ b/dash-fastapi-frontend/views/system/user/profile/__init__.py @@ -5,7 +5,7 @@ from flask import session from . import user_avatar, user_info, reset_pwd -def render(button_perms): +def render(*args, **kwargs): return [ fac.AntdRow( diff --git a/dash-fastapi-frontend/views/tool/build/__init__.py b/dash-fastapi-frontend/views/tool/build/__init__.py index f51065953bf1c746bfba46d4f57b1167d161bdc9..eed12cc1c9f6c4fa62b73f8c7597d9e200815a5f 100644 --- a/dash-fastapi-frontend/views/tool/build/__init__.py +++ b/dash-fastapi-frontend/views/tool/build/__init__.py @@ -3,6 +3,6 @@ import feffery_utils_components as fuc import feffery_antd_components as fac -def render(button_perms): +def render(*args, **kwargs): return html.Div('我是表单构建') diff --git a/dash-fastapi-frontend/views/tool/gen/__init__.py b/dash-fastapi-frontend/views/tool/gen/__init__.py index db8cbf6cf3c948e7260303d2bd3599983ea3d823..3b7564a3acea4e8b0e498999800d3748e8d2de38 100644 --- a/dash-fastapi-frontend/views/tool/gen/__init__.py +++ b/dash-fastapi-frontend/views/tool/gen/__init__.py @@ -3,6 +3,6 @@ import feffery_utils_components as fuc import feffery_antd_components as fac -def render(button_perms): +def render(*args, **kwargs): return html.Div('我是代码生成') diff --git a/dash-fastapi-frontend/views/tool/swagger/__init__.py b/dash-fastapi-frontend/views/tool/swagger/__init__.py index ef7d13d1d40b17ca326a80c794d7147c71ba6245..aeafa30830e217af78693e83dba5dee5a96333d8 100644 --- a/dash-fastapi-frontend/views/tool/swagger/__init__.py +++ b/dash-fastapi-frontend/views/tool/swagger/__init__.py @@ -3,7 +3,7 @@ import feffery_utils_components as fuc from config.global_config import ApiBaseUrlConfig -def render(button_perms): +def render(*args, **kwargs): return [ html.Div(