diff --git a/applications/common/utils/http.py b/applications/common/utils/http.py index 2a31877..75f4cd8 100644 --- a/applications/common/utils/http.py +++ b/applications/common/utils/http.py @@ -3,18 +3,18 @@ from flask import jsonify def success_api(msg: str = "成功"): """ 成功响应 默认值”成功“ """ - return jsonify(success=True, message=msg) + return jsonify(success=True, msg=msg) def fail_api(msg: str = "失败"): """ 失败响应 默认值“失败” """ - return jsonify(success=False, message=msg) + return jsonify(success=False, msg=msg) def table_api(msg: str = "", count=0, data=None, limit=10): """ 动态表格渲染响应 """ res = { - 'message': msg, + 'msg': msg, 'code': 0, 'data': data, 'count': count, diff --git a/applications/configs/config.py b/applications/configs/config.py index bc40b96..b40fb10 100644 --- a/applications/configs/config.py +++ b/applications/configs/config.py @@ -16,6 +16,8 @@ class BaseConfig: MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306) MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask" + UPLOADED_PHOTOS_DEST = '/static' + # mysql 数据库的配置信息 SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}" # 默认日志等级 diff --git a/applications/templates/admin/admin_log/main.html b/applications/templates/admin/admin_log/main.html index 4958ab3..cf5a1a8 100644 --- a/applications/templates/admin/admin_log/main.html +++ b/applications/templates/admin/admin_log/main.html @@ -40,74 +40,74 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/common/header.html b/applications/templates/admin/common/header.html index 50bee36..61721d1 100644 --- a/applications/templates/admin/common/header.html +++ b/applications/templates/admin/common/header.html @@ -2,4 +2,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/applications/templates/admin/console/console.html b/applications/templates/admin/console/console.html index 78b99d3..e266b68 100644 --- a/applications/templates/admin/console/console.html +++ b/applications/templates/admin/console/console.html @@ -1,356 +1,413 @@ - - 首页 - {% include 'admin/common/header.html' %} - + + 首页 + {% include 'admin/common/header.html' %} + - - - - -
-
-
-
-
今日访问
-
-
-
- 0 -
-
- - - - - - - - - -
-
-
-
-
-
-
-
提交次数
-
-
-
- 0 -
-
- - - - - - - - - - - - - -
-
-
-
-
-
-
-
下载数量
-
-
-
- 0 -
-
- - - - - - - - - - -
-
-
-
-
-
-
-
流量统计
-
-
-
- 0 -
-
- - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
动态
-
-
-
-
-
-

七彩枫叶 在 Pear Admin 专区 回答问题

- 几秒前 -
-
-
-
-
-

简 在 Pear Admin 专区 进行了 提问

- 2天前 -
-
-
-
-
-

恒宇少年 将 Pear Admin 更新至 2.3.0 版本

- 7天前 -
-
-
-
-
-

如花 在 Pear Admin 社区 发布了 建议

- 7天前 -
-
-
-
-
-

就眠仪式 在 Pear Admin 社区 发布了 建议

- 8天前 -
-
-
-
-
-

贤心 在 Pear Admin 专区 进行了 提问

- 8天前 -
-
-
-
-
-
-
-
-
最近更新
-
-
    -
  • 优化代码格式2020-06-04 11:28
  • -
  • 新增消息组件2020-06-01 04:23
  • -
  • 移动端兼容2020-05-22 21:38
  • -
  • 系统布局优化2020-05-15 14:26
  • -
  • 兼容多系统菜单模式2020-05-13 16:32
  • -
  • 兼容多标签页切换2019-12-9 14:58
  • -
  • 扩展下拉组件2019-12-7 9:06
  • -
  • 扩展卡片样式2019-12-1 10:26
  • -
-
-
-
-
- 链接 -
-
- 官 网 -
- 下 载 -
- 后 端 -
-
-
-
-
- - {% include 'admin/common/footer.html' %} - - + }) + + \ No newline at end of file diff --git a/applications/templates/admin/dept/add.html b/applications/templates/admin/dept/add.html index 3941ee5..30b7b68 100644 --- a/applications/templates/admin/dept/add.html +++ b/applications/templates/admin/dept/add.html @@ -81,43 +81,43 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dept/edit.html b/applications/templates/admin/dept/edit.html index b003e0f..ac9a6c9 100644 --- a/applications/templates/admin/dept/edit.html +++ b/applications/templates/admin/dept/edit.html @@ -26,21 +26,24 @@
-
-
-
@@ -48,16 +51,19 @@
- + - +
-
@@ -87,31 +93,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dept/main.html b/applications/templates/admin/dept/main.html index 58aa086..ac1f015 100644 --- a/applications/templates/admin/dept/main.html +++ b/applications/templates/admin/dept/main.html @@ -34,33 +34,36 @@ @@ -68,158 +71,158 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/dict/add.html b/applications/templates/admin/dict/add.html index a3d6d9e..4722d80 100644 --- a/applications/templates/admin/dict/add.html +++ b/applications/templates/admin/dict/add.html @@ -55,31 +55,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/data/add.html b/applications/templates/admin/dict/data/add.html index ff9911e..794c441 100644 --- a/applications/templates/admin/dict/data/add.html +++ b/applications/templates/admin/dict/data/add.html @@ -26,7 +26,8 @@
-
@@ -62,31 +63,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/data/edit.html b/applications/templates/admin/dict/data/edit.html index a652618..a822fc3 100644 --- a/applications/templates/admin/dict/data/edit.html +++ b/applications/templates/admin/dict/data/edit.html @@ -32,7 +32,7 @@
-
@@ -48,7 +48,7 @@
-
@@ -71,31 +71,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/edit.html b/applications/templates/admin/dict/edit.html index 45f202c..5e9c9dc 100644 --- a/applications/templates/admin/dict/edit.html +++ b/applications/templates/admin/dict/edit.html @@ -12,21 +12,21 @@
-
-
-
@@ -42,8 +42,8 @@
- +
@@ -63,33 +63,33 @@ - {% include 'admin/common/footer.html' %} +{% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/main.html b/applications/templates/admin/dict/main.html index b86e530..bfe2f32 100644 --- a/applications/templates/admin/dict/main.html +++ b/applications/templates/admin/dict/main.html @@ -38,7 +38,29 @@
- + + + + + + + + + + + + + + + +
@@ -70,8 +92,8 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/index.html b/applications/templates/admin/index.html index 0b9280e..1089def 100644 --- a/applications/templates/admin/index.html +++ b/applications/templates/admin/index.html @@ -71,43 +71,42 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/login.html b/applications/templates/admin/login.html index b1191c8..da7a49f 100644 --- a/applications/templates/admin/login.html +++ b/applications/templates/admin/login.html @@ -1,30 +1,31 @@ - + 登录 - - + + - +
- +
Pear Admin
明 湖 区 最 具 影 响 力 的 设 计 规 范 之 一
- +
- +
- +
@@ -38,7 +39,7 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/monitor.html b/applications/templates/admin/monitor.html index 800da81..29dd4dc 100644 --- a/applications/templates/admin/monitor.html +++ b/applications/templates/admin/monitor.html @@ -3,7 +3,7 @@ 首页 {% include 'admin/common/header.html' %} - +
@@ -19,13 +19,13 @@
核心数
-
{{ cpu_count }}
+
{{ cpu_count }}
空闲率
-
+
@@ -96,20 +96,20 @@
磁盘信息
    - {% for i in disk_partitions_list %} -
  • -

    {{ i.device }}

    -

    {{ i.fstype }}

    - 磁盘大小 {{ i.total }}M   - 空闲大小 {{ i.free }}M   -
    -
    - 已经使用 {{ i.used }}M   - 使用概率 {{ i.percent }}% -
    - 详情 -
  • - {% endfor %} + {% for i in disk_partitions_list %} +
  • +

    {{ i.device }}

    +

    {{ i.fstype }}

    + 磁盘大小 {{ i.total }}M   + 空闲大小 {{ i.free }}M   +
    +
    + 已经使用 {{ i.used }}M   + 使用概率 {{ i.percent }}% +
    + 详情 +
  • + {% endfor %}
@@ -153,14 +153,14 @@
{% include 'admin/common/footer.html' %} {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/power/add.html b/applications/templates/admin/power/add.html index ef6f53a..d1a9642 100644 --- a/applications/templates/admin/power/add.html +++ b/applications/templates/admin/power/add.html @@ -25,7 +25,8 @@
- +
@@ -39,7 +40,8 @@
- +
@@ -61,7 +63,8 @@
- +
@@ -82,83 +85,83 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/power/edit.html b/applications/templates/admin/power/edit.html index 4bc2d9c..44d5283 100644 --- a/applications/templates/admin/power/edit.html +++ b/applications/templates/admin/power/edit.html @@ -59,7 +59,8 @@
@@ -96,102 +97,102 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/power/main.html b/applications/templates/admin/power/main.html index c8ccf0f..2f54309 100644 --- a/applications/templates/admin/power/main.html +++ b/applications/templates/admin/power/main.html @@ -33,27 +33,29 @@ @@ -67,12 +69,13 @@ 按钮 {{# } }} - " |safe}} + " |safe }} \ No newline at end of file diff --git a/applications/templates/admin/role/add.html b/applications/templates/admin/role/add.html index 24479d7..0dfb365 100644 --- a/applications/templates/admin/role/add.html +++ b/applications/templates/admin/role/add.html @@ -60,31 +60,31 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/role/edit.html b/applications/templates/admin/role/edit.html index 673ee14..ff29109 100644 --- a/applications/templates/admin/role/edit.html +++ b/applications/templates/admin/role/edit.html @@ -11,7 +11,7 @@
-
@@ -32,14 +32,17 @@
- - + +
-
@@ -47,7 +50,7 @@
+ class="layui-textarea">{{ role.details }}
@@ -69,31 +72,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/role/main.html b/applications/templates/admin/role/main.html index 95806a1..4d1f6aa 100644 --- a/applications/templates/admin/role/main.html +++ b/applications/templates/admin/role/main.html @@ -37,223 +37,227 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/role/power.html b/applications/templates/admin/role/power.html index 378bbb2..105268d 100644 --- a/applications/templates/admin/role/power.html +++ b/applications/templates/admin/role/power.html @@ -27,53 +27,53 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/user/add.html b/applications/templates/admin/user/add.html index 9ce3430..f48b464 100644 --- a/applications/templates/admin/user/add.html +++ b/applications/templates/admin/user/add.html @@ -35,10 +35,10 @@
- {% for role in roles %} - + {% for role in roles %} + {% endfor %}
@@ -61,37 +61,37 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/user/center.html b/applications/templates/admin/user/center.html index 4777723..aba1bb5 100644 --- a/applications/templates/admin/user/center.html +++ b/applications/templates/admin/user/center.html @@ -4,15 +4,17 @@ 个人中心 {% include 'admin/common/header.html' %}
+ {# 左侧栏 #}
+ {# 个人信息卡片 #}
@@ -27,6 +29,7 @@ {{ user_info.remark }}
+ {# 登录信息卡片 #}
登录记录 @@ -34,13 +37,18 @@
    {% for log in user_logs %} -
  • {{ log.url }}{{ log.create_time }}
  • +
  • + {{ log.url }} + {{ log.create_time }} +
  • {% endfor %}
+ {# 右侧栏 #}
+ {# 个人信息卡片 #}
个人信息
@@ -51,27 +59,32 @@
- +
- +
- +
- +
@@ -81,6 +94,7 @@
+ {# 个人文章记录 #}
我的文章 @@ -106,7 +120,8 @@
- +
为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
@@ -156,56 +171,57 @@
{% include 'admin/common/footer.html' %} - diff --git a/applications/templates/admin/user/edit.html b/applications/templates/admin/user/edit.html index 3e9b369..f5d3a0e 100644 --- a/applications/templates/admin/user/edit.html +++ b/applications/templates/admin/user/edit.html @@ -24,14 +24,15 @@ autocomplete="off" placeholder="请输入标题" class="layui-input">
-
+
-
-
+
    @@ -43,11 +44,11 @@
    {% for role in roles %} - + {% endfor %}
    @@ -70,48 +71,48 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/user/edit_password.html b/applications/templates/admin/user/edit_password.html index 310f3f1..f21355d 100644 --- a/applications/templates/admin/user/edit_password.html +++ b/applications/templates/admin/user/edit_password.html @@ -35,7 +35,8 @@
    - @@ -48,32 +49,33 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/user/main.html b/applications/templates/admin/user/main.html index 44a1710..b6465c6 100644 --- a/applications/templates/admin/user/main.html +++ b/applications/templates/admin/user/main.html @@ -1,11 +1,12 @@ - 用户管理 - {% include 'admin/common/header.html' %} - + 用户管理 + {% include 'admin/common/header.html' %} + +{# 查询表单 #}
    @@ -30,38 +31,39 @@
    -
    -
    -
    -
    全 部 用 户
    -
    默 认 分 组
    -
    -
      -
      +
      +
      +
      +
      全 部 用 户
      +
      默 认 分 组
      +
      +
        -
        -
        -
        -
        -
        +
        +{# 用户表格 #} +
        +
        +
        +
        +
        - +{# 表格操作 #} +{# 用户修改操作 #} +{# 启动与禁用 #} +{# 用户注册时间 #} + +{# 用户更新时间 #} + {% include 'admin/common/footer.html' %} + \ No newline at end of file diff --git a/applications/templates/admin/user/profile.html b/applications/templates/admin/user/profile.html index 2d81be0..e626995 100644 --- a/applications/templates/admin/user/profile.html +++ b/applications/templates/admin/user/profile.html @@ -12,17 +12,22 @@
        -
        +
        - - - - + + + +
        建议:图片的尺寸宽高比为1:1,大小在5m以内。
        @@ -31,91 +36,91 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/errors/403.html b/applications/templates/errors/403.html index 7776800..c928e53 100644 --- a/applications/templates/errors/403.html +++ b/applications/templates/errors/403.html @@ -1,19 +1,19 @@ - - - - - - - -
        - -
        -

        403

        -

        抱歉,你无权访问该页面

        - -
        -
        - + + + + + + + +
        + +
        +

        403

        +

        抱歉,你无权访问该页面

        + +
        +
        + diff --git a/applications/templates/errors/404.html b/applications/templates/errors/404.html index 74e1550..699507f 100644 --- a/applications/templates/errors/404.html +++ b/applications/templates/errors/404.html @@ -1,19 +1,19 @@ - - - - - - - -
        - -
        -

        404

        -

        抱歉,你访问的页面不存在或仍在开发中

        - -
        -
        - + + + + + + + +
        + +
        +

        404

        +

        抱歉,你访问的页面不存在或仍在开发中

        + +
        +
        + diff --git a/applications/templates/errors/500.html b/applications/templates/errors/500.html index 0f8b624..a198fb2 100644 --- a/applications/templates/errors/500.html +++ b/applications/templates/errors/500.html @@ -1,19 +1,19 @@ - - - - - - - admin/ -
        - -
        -

        500

        -

        抱歉,服务器出错了

        - -
        -
        - + + + + + + +admin/ +
        + +
        +

        500

        +

        抱歉,服务器出错了

        + +
        +
        + diff --git a/applications/templates/index/index.html b/applications/templates/index/index.html index c3a86c1..bb31903 100644 --- a/applications/templates/index/index.html +++ b/applications/templates/index/index.html @@ -1,147 +1,161 @@ - - - pear-admin-flask - - - - - - - - - - - -
        - -
        - - -
        -
        - -
        -
        -
        -
        - - -

        💐 致 力 于 让 " Web " 开 发 变 得 简 单 优 雅

        - -
        -
        -
        - -
        -
        -
        -
        -
        -
        -
        -
        -
        + + + pear-admin-flask + + + + + + + + + + + +
        + +
        + + +
        +
        + +
        +
        +
        +
        + + +

        💐 致 力 于 让 " Web " 开 发 变 得 简 单 优 雅

        + +
        +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        -
        -
        - 用法演示 -
        -
        -
        +
        +
        + 用法演示 +
        +
        +
        -
        -
        -
        - -
        -
        -

        合作伙伴

        -

        Sponsorship and cooperation

        -
        -
        -
        +
        +
        +
        + +
        +
        +

        合作伙伴

        +

        Sponsorship and cooperation

        +
        +
        +
        -
        -
        -
        -
        -
        - +
        +
        +
        +
        +
        + - - - + + + - - + + diff --git a/applications/view/__init__.py b/applications/view/__init__.py index d6225e3..1fbc819 100644 --- a/applications/view/__init__.py +++ b/applications/view/__init__.py @@ -1,14 +1,7 @@ -from flask import Flask, redirect - from applications.view.admin import init_admin_views from applications.view.index import init_index_views -def init_view(app: Flask): +def init_view(app): init_admin_views(app) init_index_views(app) - - # 重定向到后台管理首页 - @app.route('/') - def redirect_index(): - return redirect('/admin/login') diff --git a/applications/view/index/__init__.py b/applications/view/index/__init__.py index c1f9ea0..98bc06a 100644 --- a/applications/view/index/__init__.py +++ b/applications/view/index/__init__.py @@ -2,6 +2,8 @@ from flask import Blueprint index_bp = Blueprint('Index', __name__, url_prefix='/') +from . import index + def init_index_views(app): """ diff --git a/requirement/requirement.txt b/requirement/requirement.txt deleted file mode 100644 index 71b619e..0000000 --- a/requirement/requirement.txt +++ /dev/null @@ -1,34 +0,0 @@ -alembic==1.6.5 -blinker==1.4 -captcha==0.3 -click==8.0.1 -colorama==0.4.4 -Flask==2.0.1 -Flask-DebugToolbar==0.11.0 -Flask-Login==0.5.0 -flask-marshmallow==0.14.0 -Flask-Migrate==3.0.1 -Flask-Reuploaded==1.1.0 -Flask-Script==2.0.6 -Flask-SQLAlchemy==2.5.1 -greenlet==1.1.0 -importlib-metadata==4.5.0 -itsdangerous==2.0.1 -Jinja2==3.0.1 -Mako==1.1.4 -MarkupSafe==2.0.1 -marshmallow==3.12.1 -marshmallow-sqlalchemy==0.26.1 -Pillow==8.2.0 -psutil==5.8.0 -PyMySQL==1.0.2 -python-dateutil==2.8.1 -python-dotenv==0.17.1 -python-editor==1.0.4 -PyYAML==5.4.1 -six==1.16.0 -SQLAlchemy==1.4.18 -sqlparse==0.4.1 -typing-extensions==3.10.0.0 -Werkzeug==2.0.1 -zipp==3.4.1 diff --git a/static/upload/1623509219000.jpg b/static/upload/1623509219000.jpg new file mode 100644 index 0000000..6836126 Binary files /dev/null and b/static/upload/1623509219000.jpg differ diff --git a/static/upload/1623509456000.jpg b/static/upload/1623509456000.jpg new file mode 100644 index 0000000..b360fbd Binary files /dev/null and b/static/upload/1623509456000.jpg differ