feat(plugins): 4 个业务插件代码 + 前台公开页面改造
plugins/navManager:导航 CRUD + 导航分类 CRUD(独立 blueprint) plugins/friendManager:友情链接 CRUD plugins/aboutManager:关于本站 CRUD plugins/siteStats:访问统计主页 + JSON 接口 + /site/* GET 埋点 + nav 卡片点击埋点 applications/view/public/nav.py:导航聚合页 / 分类详情 / JSON 接口,支持 visit_count 注入 applications/view/public/about.py:关于本站公开页 applications/view/public/friend.py:友情链接公开页 templates/public/base.html:响应式首页(搜索框 / 分类抽屉 / 5 主题切换 / footer 隐私小字) templates/public/index.html / category.html:卡片右下角访问次数 templates/public/about.html / friend.html:关于 + 友链前台页 docs/plugins-development.md:插件开发完整指南(生命周期 + 4 个示例 + FAQ + framework 迁移) scripts/:探针与端到端验证脚本(probe_*/verify_*/test_*)
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<!-- 后台左侧菜单(侧栏) -->
|
||||
<!-- 与 templates/system/index.html 主页的 .layui-side 部分等价;供所有子模块引用 -->
|
||||
<div class="layui-side layui-bg-black">
|
||||
<div class="layui-logo">
|
||||
<img class="logo">
|
||||
<span class="title"></span>
|
||||
</div>
|
||||
<div class="layui-side-scroll">
|
||||
<div id="side"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 依赖脚本 + 框架初始化 -->
|
||||
<script src="{{ url_for('static', filename='system/component/layui/layui.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='system/component/pear/pear.js') }}"></script>
|
||||
<script>
|
||||
layui.use(['admin', 'jquery', 'popup'], function () {
|
||||
var admin = layui.admin;
|
||||
var popup = layui.popup;
|
||||
var $ = layui.jquery;
|
||||
|
||||
admin.setConfigurationPath("{{ url_for('system.rights.configs') }}");
|
||||
|
||||
admin._changeTheme = admin.changeTheme;
|
||||
admin.changeTheme = function () {
|
||||
admin._changeTheme();
|
||||
const variableKey = "--global-primary-color";
|
||||
const variableVal = localStorage.getItem("theme-color-color");
|
||||
const iframes = document.querySelectorAll('iframe');
|
||||
iframes.forEach(function (iframe) {
|
||||
try {
|
||||
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
||||
iframeDocument.documentElement.style.setProperty(variableKey, variableVal);
|
||||
} catch (e) {}
|
||||
});
|
||||
};
|
||||
|
||||
admin._switchTheme = admin.switchTheme;
|
||||
admin.switchTheme = function (checked) {
|
||||
admin.isdrak = checked;
|
||||
admin._switchTheme(checked);
|
||||
const iframes = document.querySelectorAll('iframe');
|
||||
iframes.forEach(function (iframe) {
|
||||
try {
|
||||
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
||||
if (checked === true || checked === "true") {
|
||||
iframeDocument.body.classList.add("pear-admin-dark");
|
||||
} else {
|
||||
iframeDocument.body.classList.remove("pear-admin-dark");
|
||||
}
|
||||
} catch (e) {}
|
||||
});
|
||||
};
|
||||
|
||||
admin.render();
|
||||
|
||||
admin.logout(function () {
|
||||
let loading = layer.load();
|
||||
$.ajax({
|
||||
url: '{{ url_for('system.passport.logout') }}',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
layer.close(loading);
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () { location.href = '/'; });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user