Files
HomeDash/conf.example.yml
JianFeeeee f8c4771828 fix(admin,theme): make admin actually work; glass theme targets real DOM
后台之前有两处让它完全不可用的问题(都属于「看着有、实际不工作」):
1. 写操作 401 —— admin UI 从未带 Authorization 头,而 admin-server 强制校验
   NAVI_ADMIN_TOKEN。于是添加/删除一直静默失败。
2. JSON 键名不匹配 —— Section/NavItem 只有 yaml tag,没有 json tag,
   接口返回 {"Name":..,"Items":[{"Title":..}]},而前端读 s.name / it.title,
   渲染直接抛异常(菜单区永远停在「加载中…」)。

修法:
- admin-server:token 改为**默认不校验**(/admin/ 已在外层门户登录墙内,
  用户确认无需叠加),仅当显式设 NAVI_ADMIN_REQUIRE_TOKEN=1 时才校验;
  历史 DELETE 不受影响(那条路径被门户放行,仍必须自带 token)。
- 补 json tag;Config/Section/NavItem 加 yaml ",inline" 保留未知键,
  避免保存 conf.yml 时把不认识的配置(layout/pages/item 的 target 等)丢掉。
- 新增 /api/pageinfo(标题/副标题/页脚/顶部导航可在后台编辑)与
  /api/icon(图标上传,限 png/svg/jpg,512KB)。
- 重写 admin UI:站点信息 + 顶部导航编辑、图标上传(.ico 用 canvas 转 PNG,
  因为 Dashy 的 isImage() 只认 svg/png/jpg)、可选令牌。

主题:旧 customCss 大部分是死代码 —— .tile / .item-group / .item-group-outer
在页面里根本不存在(querySelectorAll 计数为 0),卡片灰底其实来自 a.item,
而 .home 的不透明背景盖住了 body 渐变,所以玻璃效果一直看不出来。
现按真实类名(a.item / .item-wrapper / .collapsable / .collapsible-content /
.home / header)重写,并加入工作空间侧边栏的溢出修复。

安装页:.btn 自带 display 会盖掉浏览器默认的 [hidden]{display:none},
未配置商店时「一键安装」按钮仍然可见且 href 为空(点了没反应)。
现显式兜住 [hidden],并把浏览器识别补全(iOS/Android 单独提示为不可安装、
Edge/Brave/Vivaldi/Opera 给出各自的 extensions 地址、优先用 userAgentData)。
2026-09-11 11:43:44 +08:00

54 lines
7.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

appConfig:
theme: jianf-glass
dayTheme: default
nightTheme: midnight
customColors: {}
externalStyleSheet: []
webSearch:
searchEngine: custom
customSearchEngine: /search?q=
openingMethod: newtab
customCss: "/* ═══ JianF 玻璃拟态主题 v2 ═══\n 注意:必须按 Dashy 真实渲染出的类名写。此前版本用了 .tile / .item-group /\n .item-group-outer —— 这三个类在页面里并不存在(querySelectorAll 计数为 0),\n 所以大部分规则是死代码,界面才一直显得平。\n\n 真实结构(自内向外):\n a.item ← 卡片表面(灰底就来自这里)\n div.item-wrapper ← 网格单元\n div.there-are-items\n div.content-inner\n div.collapsible-content\n div.collapsable.section_<名字> ← 分组容器\n div.item-group-container\n */\n\n/* ── 背景 ──\n .home 有不透明背景会盖住 body 渐变,必须一起透明掉,否则彩色背景完全看不见。 */\nhtml[data-theme] body {\n background:\n radial-gradient(1200px 720px at 6% -12%, #a5b4fc 0%, transparent 56%),\n radial-gradient(1000px 640px at 96% 2%, #7dd3fc 0%, transparent 52%),\n radial-gradient(900px 700px at 46% 112%, #f0abfc 0%, transparent 56%),\n linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #ecfeff 100%) !important;\n background-attachment: fixed !important;\n min-height: 100vh;\n}\nhtml[data-theme]\
\ .home {\n background: transparent !important;\n}\n\n/* ── 顶栏 ── */\nhtml[data-theme] header {\n background: rgba(255,255,255,.44) !important;\n backdrop-filter: blur(18px) saturate(180%) !important;\n -webkit-backdrop-filter: blur(18px) saturate(180%) !important;\n border-bottom: 1px solid rgba(255,255,255,.6) !important;\n box-shadow: 0 6px 24px rgba(15,23,42,.06) !important;\n}\n\n/* ── 卡片:真正的表面是 a.item ── */\nhtml[data-theme] a.item {\n background: rgba(255,255,255,.52) !important;\n backdrop-filter: blur(18px) saturate(180%) !important;\n -webkit-backdrop-filter: blur(18px) saturate(180%) !important;\n border: 1px solid rgba(255,255,255,.66) !important;\n border-radius: 18px !important;\n box-shadow:\n 0 6px 18px rgba(15,23,42,.07),\n inset 0 1px 0 rgba(255,255,255,.85) !important;\n transition: transform .28s cubic-bezier(.34,1.2,.64,1),\n box-shadow .28s ease, background .28s ease, border-color .28s ease !important;\n}\nhtml[data-theme] a.item:hover\
\ {\n background: rgba(255,255,255,.88) !important;\n border-color: rgba(147,197,253,.85) !important;\n transform: translateY(-4px) !important;\n box-shadow:\n 0 18px 36px rgba(30,64,175,.18),\n 0 0 0 1px rgba(147,197,253,.35),\n inset 0 1px 0 rgba(255,255,255,.9) !important;\n}\n/* 外层网格单元保持透明,避免叠两层底 */\nhtml[data-theme] div.item-wrapper {\n background: transparent !important;\n backdrop-filter: none !important;\n -webkit-backdrop-filter: none !important;\n border: none !important;\n box-shadow: none !important;\n}\nhtml[data-theme] a.item .tile-icon,\nhtml[data-theme] a.item .item-icon {\n border-radius: 13px !important;\n filter: drop-shadow(0 3px 6px rgba(15,23,42,.10)) !important;\n transition: transform .28s cubic-bezier(.34,1.2,.64,1) !important;\n}\nhtml[data-theme] a.item:hover .tile-icon { transform: scale(1.08) !important; }\nhtml[data-theme] a.item .tile-title { font-weight: 650 !important; letter-spacing: .1px !important; }\nhtml[data-theme] a.item .description,\n\
html[data-theme] a.item .item-url { color: #64748b !important; }\n\n/* ── 分组容器 ── */\nhtml[data-theme] div.collapsable {\n background: rgba(255,255,255,.40) !important;\n backdrop-filter: blur(20px) saturate(180%) !important;\n -webkit-backdrop-filter: blur(20px) saturate(180%) !important;\n border: 1px solid rgba(255,255,255,.6) !important;\n border-radius: 24px !important;\n box-shadow:\n 0 12px 32px rgba(15,23,42,.09),\n inset 0 1px 0 rgba(255,255,255,.85) !important;\n overflow: hidden !important;\n}\nhtml[data-theme] div.collapsible-content {\n background: transparent !important;\n border-radius: 0 0 22px 22px !important;\n}\nhtml[data-theme] div.collapsable .content-inner { padding: 10px 12px !important; }\nhtml[data-theme] .item-group-container { padding: 0 4px !important; }\n\n/* 分组标题 */\nhtml[data-theme] .collapsable .title,\nhtml[data-theme] .collapsable h1,\nhtml[data-theme] .collapsable h2 {\n font-weight: 700 !important;\n letter-spacing: .2px !important;\n\
}\n\n/* ── 搜索 ── */\nhtml[data-theme] .search-container,\nhtml[data-theme] header input[type=\"text\"] {\n background: rgba(255,255,255,.6) !important;\n border: 1px solid rgba(255,255,255,.7) !important;\n border-radius: 16px !important;\n backdrop-filter: blur(14px) saturate(170%) !important;\n -webkit-backdrop-filter: blur(14px) saturate(170%) !important;\n box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 4px 14px rgba(15,23,42,.05) !important;\n}\nhtml[data-theme] .navi-search-bar:focus-within {\n box-shadow: 0 14px 34px rgba(37,99,235,.22), 0 0 0 3px rgba(37,99,235,.16) !important;\n}\n\n/* ── 滚动条 ── */\nhtml[data-theme] ::-webkit-scrollbar { width: 10px; height: 10px; }\nhtml[data-theme] ::-webkit-scrollbar-track { background: transparent; }\nhtml[data-theme] ::-webkit-scrollbar-thumb {\n background: rgba(100,116,139,.32);\n border-radius: 999px;\n border: 2px solid transparent;\n background-clip: content-box;\n}\nhtml[data-theme] ::-webkit-scrollbar-thumb:hover {\n\
\ background: rgba(100,116,139,.5);\n background-clip: content-box;\n}\n\n/* ── 工作空间侧边栏 ──\n 底部「切换视图」按钮组内容 70px 塞进 56px 的栏里,把 side-bar 撑出横向\n 滚动条,必须左右滑动才能看全。这里让它换行并收住溢出。 */\nhtml[data-theme] nav.side-bar { overflow-x: hidden !important; }\nhtml[data-theme] nav.side-bar .switch-view-buttons {\n width: 100% !important;\n display: flex !important;\n flex-wrap: wrap !important;\n justify-content: center !important;\n align-items: center !important;\n gap: 2px !important;\n margin: 8px 0 0 !important;\n}\nhtml[data-theme] nav.side-bar .switch-view-buttons > * {\n flex: 0 0 auto !important;\n min-width: 0 !important;\n max-width: 100% !important;\n}\n\n/* ── 设置抽屉 / 菜单 / 提示 ── */\nhtml[data-theme] .settings-outer,\nhtml[data-theme] .config-container,\nhtml[data-theme] .context-menu,\nhtml[data-theme] .toast,\nhtml[data-theme] .welcome-popup {\n background: rgba(255,255,255,.72) !important;\n backdrop-filter: blur(20px) saturate(180%) !important;\n -webkit-backdrop-filter:\
\ blur(20px) saturate(180%) !important;\n border: 1px solid rgba(255,255,255,.66) !important;\n border-radius: 18px !important;\n box-shadow: 0 14px 34px rgba(15,23,42,.14) !important;\n}\n\n@media (prefers-reduced-motion: reduce) {\n html[data-theme] a.item,\n html[data-theme] a.item .tile-icon { transition: none !important; }\n html[data-theme] a.item:hover { transform: none !important; }\n}\n"
layout: masonry
iconSize: large
language: zh-CN
statusCheck: true
statusCheckInterval: 60
pageInfo:
title: Navigation Portal
description: Self-hosted unified navigation
navLinks: []
footer: ''
sections:
- name: Favorites
icon: fas fa-star
collapsed: false
items:
- title: Gitea
description: Code repository
icon: fas fa-code-branch
url: http://192.168.1.100:3000
statusCheck: true
- name: History
icon: fas fa-history
collapsed: false
items:
- title: 安装浏览历史插件
description: 一键安装,自动按访问频次排序
icon: fas fa-download
url: /extension/install.html
- name: Tools
icon: fas fa-tools
collapsed: true
items:
- title: Example Service
description: Add your own services
icon: fas fa-cog
url: http://192.168.1.100:8080