重构 monorepo 并完善网页端订阅与首页体验
- 迁移为 frontend-web、frontend-electron、backend-web 与 docker 部署结构 - 网页端:订阅门禁二次弹窗、套餐/支付组件化、顶栏分组对齐 - 首页:最近文件与模板库布局优化,缩略图对齐,下载与删除操作 - 新增管理后台、支付与云端文件 API,更新 README 与项目规范 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var I = function () { return window.AdminI18n; };
|
||||
|
||||
function headerHtml(opts) {
|
||||
opts = opts || {};
|
||||
return '<header class="soon-admin-header" id="adminShellHeader">' +
|
||||
'<div class="soon-admin-header__brand">' +
|
||||
'<img class="soon-admin-logo" src="' + I().esc(opts.logoSrc || '../../assets/images/logo.png') + '" alt="">' +
|
||||
'<span>' + I().esc(opts.title || 'SoonDesign Admin') + '</span>' +
|
||||
(opts.env ? '<span class="soon-admin-header__env">' + I().esc(opts.env) + '</span>' : '') +
|
||||
'</div>' +
|
||||
'<div class="soon-admin-header__user">' +
|
||||
(opts.designEntry !== false
|
||||
? '<a href="' + I().esc(opts.designHref || '../index.web.html') +
|
||||
'" class="soon-btn soon-btn--sm" id="adminDesignEntry" target="_blank" rel="noopener">进入设计端</a>'
|
||||
: '') +
|
||||
'<span id="adminEmail" class="soon-admin-header__email"></span>' +
|
||||
'<button type="button" class="soon-btn soon-btn--ghost soon-btn--sm soon-admin-logout-btn" id="adminLogout">退出</button>' +
|
||||
'</div></header>';
|
||||
}
|
||||
|
||||
function mountHeader(container, opts) {
|
||||
if (!container) return;
|
||||
container.innerHTML = headerHtml(opts);
|
||||
}
|
||||
|
||||
function bindHeader(handlers) {
|
||||
handlers = handlers || {};
|
||||
var logout = document.getElementById('adminLogout');
|
||||
if (logout && handlers.onLogout) logout.onclick = handlers.onLogout;
|
||||
}
|
||||
|
||||
window.AdminShell = {
|
||||
headerHtml: headerHtml,
|
||||
mountHeader: mountHeader,
|
||||
bindHeader: bindHeader,
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user