fix(plugins): 修复 Cookie 管理子页面表格不显示与侧栏异常
根因:admin_power 菜单表中「登录用户」「登录网站」两个叶子菜单的 open_type 为 NULL,被渲染成 menu-open-type="null",点击时 Pear Admin 不会以 iframe 方式把页面加载进内容区——表格永远不显示,且页面被弹到 独立窗口,表现为"侧栏父菜单点不开子菜单"。其它页面型菜单的 open_type 均为 _iframe。 处理: - 新增迁移 b2c3d4e5f6a7,将这两行 open_type 修正为 _iframe(按 url 幂等匹配) - 清理 cookie_user/main.html 中被外部工具注入的 data-page-node-id 噪声属性 验证:本地起服务 + Playwright 登录后点击菜单项,确认内容区生成 iframe、 表格正常渲染(含工具栏、默认工具栏刷新/筛选/打印/导出、新增按钮,空表显示 "暂无登录用户"),且 cookie 页打开时侧栏父菜单仍能展开子菜单。
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""fix cookie menu open_type to _iframe
|
||||
|
||||
Cookie 管理下的「登录用户」/「登录网站」菜单项在 admin_power 表中
|
||||
open_type 为 NULL,导致点击时没有被以 iframe 方式加载进内容区,
|
||||
表格无法显示、页面被弹到独立窗口(表现为侧栏父菜单点不开子菜单)。
|
||||
修正为 _iframe 与框架其它页面保持一致。
|
||||
|
||||
Revision ID: b2c3d4e5f6a7
|
||||
Revises: 1230ff234df9
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b2c3d4e5f6a7'
|
||||
down_revision = '1230ff234df9'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute(
|
||||
"UPDATE admin_power SET open_type='_iframe' "
|
||||
"WHERE url IN ('/system/cookie-user/', '/system/cookie-site/') "
|
||||
"AND (open_type IS NULL OR open_type='')"
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute(
|
||||
"UPDATE admin_power SET open_type=NULL "
|
||||
"WHERE url IN ('/system/cookie-user/', '/system/cookie-site/')"
|
||||
)
|
||||
Reference in New Issue
Block a user