sun-panel-guanfang

zaixiangjian/sun-panel-guanfang Docker Image

zaixiangjian

该镜像用于部署Sun Panel面板,支持通过Docker或docker-compose快速安装,提供可视化侧边导航栏(含移动端适配按钮)及平滑滚动定位功能,便于面板内容的高效浏览与管理。

下载次数: 0状态:社区镜像维护者:zaixiangjian仓库类型:镜像最近更新:

Sun Panel官方镜像说明

镜像概述

本镜像为Sun Panel面板的官方Docker镜像,旨在简化面板的部署流程,提供便捷的可视化导航功能,帮助用户高效管理面板内容。支持Docker单容器部署和docker-compose编排,适配桌面端与移动端使用场景。

核心功能

  1. 侧边导航栏:固定于左侧的全高度导航组件,支持平滑滚动定位到对应内容区域
  2. 移动端适配:自动识别设备宽度,移动端隐藏导航栏并提供呼出按钮
  3. 样式优化:半透明模糊背景、高亮状态提示,提升视觉体验
  4. 自动更新:通过MutationObserver监听页面变化,实时更新导航内容

使用场景

  • 个人或团队的内部面板导航管理
  • 需要可视化目录的文档类网站部署
  • 快速搭建带有导航功能的Web应用面板

配置说明

挂载目录说明

本地路径容器路径用途
/home/docker/sun-panel/conf/app/conf配置文件目录
/home/docker/sun-panel/data/app/data数据存储目录
/home/docker/sun-panel/database/app/database数据库文件目录
/home/docker/sun-panel/lang/app/lang语言包目录
/home/docker/sun-panel/runtime/app/runtime运行时文件目录
/var/run/docker.sock/var/run/docker.sockDocker socket(可选,用于容器管理)

部署示例

1. docker-compose部署

yaml
version: "3.8"
services:
  sun-panel:
    image: docker.xuanyuan.run/zaixiangjian/sun-panel:latest
    container_name: sun-panel
    restart: unless-stopped
    ports:
      - "6979:3002"
    volumes:
      - /home/docker/sun-panel/conf:/app/conf
      - /home/docker/sun-panel/data:/app/data
      - /home/docker/sun-panel/database:/app/database
      - /home/docker/sun-panel/lang:/app/lang
      - /home/docker/sun-panel/runtime:/app/runtime

2. Docker单容器部署

bash
docker run -d --restart=always -p 3002:3002 \
-v ~/docker_data/sun-panel/conf:/app/conf \
-v /var/run/docker.sock:/var/run/docker.sock \
--name sun-panel \
docker.xuanyuan.run/zaixiangjian/sun-panel-guanfang:latest

初始账号信息

  • 账号:admin@sun.cc
  • 密码:12345678

自定义页脚代码

可在面板中添加以下JS代码实现侧边导航功能:

html
<script>
(function() {
  const scrollOffset = 80;
  const tocDomId = 'sun-panel-toc-dom';
  const mobileWidth = 800;
  const highlightColor = '#007aff'; 

  // 删除旧 TOC
  const oldToc = document.getElementById(tocDomId);
  if (oldToc) oldToc.remove();

  // 创建 TOC 容器
  const tocDom = document.createElement('div');
  tocDom.id = tocDomId;
  
  // 核心样式:修改为全高度排列
  Object.assign(tocDom.style, {
    position: 'fixed',
    top: '0',
    left: '0',
    width: '200px',
    height: '100vh',           // 撑满全高
    background: 'rgba(20, 20, 20, 0.4)', // 更加透明
    backdropFilter: 'blur(20px)',       // 增强模糊感
    webkitBackdropFilter: 'blur(20px)',
    color: '#efeff4',
    padding: '100px 12px 40px 12px',    // 顶部预留 100px 间距
    fontSize: '13px',
    zIndex: '9999',
    overflowY: 'auto',
    boxShadow: '1px 0 10px rgba(0,0,0,0.1)',
    transition: 'transform 0.4s cubic-bezier(0.16, 1, 0.3, 1)',
    boxSizing: 'border-box',
    borderRight: '1px solid rgba(255,255,255,0.08)'
  });

  const styleSheet = document.createElement("style");
  styleSheet.innerText = `
    #${tocDomId}::-webkit-scrollbar { width: 3px; }
    #${tocDomId}::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
    #${tocDomId} .toc-item { 
      position: relative; 
      margin-bottom: 6px; 
      padding: 10px 14px; 
      border-radius: 8px; 
      cursor: pointer; 
      transition: all 0.2s ease;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      opacity: 0.8;
    }
    #${tocDomId} .toc-item:hover {
      background: rgba(255,255,255,0.05);
      opacity: 1;
    }
    #${tocDomId} .toc-item.active {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      font-weight: 600;
      opacity: 1;
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    #${tocDomId} .toc-item.active::before {
      content: "";
      position: absolute;
      left: 0;
      top: 20%;
      height: 60%;
      width: 4px;
      background: ${highlightColor};
      border-radius: 0 4px 4px 0;
    }
  `;
  document.head.appendChild(styleSheet);
  document.body.appendChild(tocDom);

  function isMobile() { return window.innerWidth < mobileWidth; }

  function updateTOCVisibility() {
    if (isMobile()) {
      tocDom.style.transform = 'translateX(-100%)';
    } else {
      tocDom.style.transform = 'translateX(0)';
    }
  }

  window.addEventListener('resize', updateTOCVisibility);
  updateTOCVisibility();

  function buildTOC() {
    const groups = document.querySelectorAll('[class*="item-group-index-"]');
    if (!groups.length) return false;

    tocDom.innerHTML = '';
    
    // 顶部装饰标题
    const navTitle = document.createElement('div');
    navTitle.textContent = 'NAVIGATION';
    navTitle.style.cssText = 'font-size:10px; font-weight:700; color:rgba(255,255,255,0.3); letter-spacing:1.5px; margin-bottom:15px; padding-left:14px;';
    tocDom.appendChild(navTitle);

    groups.forEach((group, index) => {
      const titleElement = group.querySelector('.group-title');
      const titleText = titleElement ? titleElement.textContent.trim() : 'Group ' + (index + 1);

      const item = document.createElement('div');
      item.className = 'toc-item';
      item.textContent = titleText;

      item.addEventListener('click', () => {
        const scrollContainer = document.querySelector('.scroll-container') || window;
        const top = group.offsetTop - scrollOffset;
        (scrollContainer === window ? window : scrollContainer).scrollTo({ top, behavior: 'smooth' });
        if (isMobile()) tocDom.style.transform = 'translateX(-100%)';
      });

      tocDom.appendChild(item);
    });

    const handleScroll = () => {
      const scrollTop = window.scrollY || document.documentElement.scrollTop;
      const items = tocDom.querySelectorAll('.toc-item');
      groups.forEach((group, index) => {
        const groupTop = group.offsetTop - scrollOffset - 20;
        const nextTop = (index < groups.length - 1) ? groups[index + 1].offsetTop - scrollOffset - 20 : Infinity;
        
        if (scrollTop >= groupTop && scrollTop < nextTop) {
          items[index]?.classList.add('active');
        } else {
          items[index]?.classList.remove('active');
        }
      });
    };

    window.addEventListener('scroll', handleScroll);
    handleScroll(); // 初始化高亮状态
    return true;
  }

  const observer = new MutationObserver(() => {
    buildTOC();
    addMobileButton();
  });
  const container = document.querySelector('.scroll-container') || document.body;
  observer.observe(container, { childList: true, subtree: true });

  buildTOC();

  // -------------------
  // 手机端按钮
  // -------------------
  let mobileBtn = null;
  function addMobileButton() {
    if (!isMobile() || mobileBtn) return;
    mobileBtn = document.createElement('div');
    mobileBtn.innerHTML = '☰';
    Object.assign(mobileBtn.style, {
      position: 'fixed',
      bottom: '50px',
      right: '10px',
      width: '46px',
      height: '46px',
      background: 'rgba(0,0,0,0.6)',
      backdropFilter: 'blur(10px)',
      color: '#fff',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
      borderRadius: '50%',
      zIndex: '***',
      fontSize: '20px',
      boxShadow: '0 4px 15px rgba(0,0,0,0.3)'
    });
    document.body.appendChild(mobileBtn);

    mobileBtn.addEventListener('click', () => {
      const isHidden = tocDom.style.transform.includes('-100%');
      tocDom.style.transform = isHidden ? 'translateX(0)' : 'translateX(-100%)';
    });
  }
})();
</script>

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 sun-panel-guanfang 镜像标签

docker pull docker.xuanyuan.run/zaixiangjian/sun-panel-guanfang:<标签>

DockerHub 原生拉取命令

docker pull zaixiangjian/sun-panel-guanfang:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告