哪吒探针V1美化

请输入图片描述

自定义代码(样式和脚本)

<script>
    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = 'https://font.sec.miui.com/font/css?family=MiSans:400,700:MiSans';
    document.head.appendChild(link);
</script>

<style>
    /* 全局强制应用小米 MiSans 字体 */
    * { font-family: 'MiSans', -apple-system, BlinkMacSystemFont, sans-serif !important; }
    h1, h2, h3, h4, h5 { font-family: 'MiSans', sans-serif !important; }
</style>


<script>
    // 仅在非后台管理页面(即前台)生效
    if (!window.location.pathname.includes('/dashboard')) {
        /* 前台基础信息定制 */
        window.CustomLogo = 'https://p.mqs.hk/Google/i/2026/iu520e.png'; 
        window.CustomDesc = '云主机实时监控'; 
        
        /* 前台背景图设置 */
        window.CustomBackgroundImage = 'https://p.mqs.xyz/'; 
        window.CustomMobileBackgroundImage = 'https://p.mqs.xyz/'; 

        /* 功能开关 */
        window.ShowNetTransfer = true;       /* 卡片显示实时总流量 */
        window.FixedTopServerName = true;    /* 滚动时顶部固定服务器名 */
        window.DisableAnimatedMan = true;    /* 隐藏右下角看板动画 */
        
        /* 自定义前台导航栏链接 */
        window.CustomLinks = '[{"link":"https://mqs.xyz/","name":"主页"}]';

        /* 动态精简前台页脚 */
        const observerFooterRight = new MutationObserver(() => {
            const footerRight = document.querySelector('.server-footer-theme');
            const footerLeft = document.querySelector('.server-footer-name > div:first-child');
            if (footerLeft) footerLeft.style.visibility = 'hidden';
            if (footerRight) {
                footerRight.innerHTML = '<section style="opacity:0.6;">Powered by <a href="https://github.com/nezhahq/nezha" target="_blank">NeZha</a></section>';
                observerFooterRight.disconnect();
            }
        });
        observerFooterRight.observe(document.body, { childList: true, subtree: true });

        /* 连续按三下 ESC 进入后台 */
        let escCount = 0;
        let escTimer = null;
        document.addEventListener('keydown', function(e) {
            if (e.key === 'Escape' || e.keyCode === 27) {
                escCount++;
                clearTimeout(escTimer);
                escTimer = setTimeout(() => { escCount = 0; }, 1500);
                if (escCount === 3) {
                    escCount = 0;
                    window.location.href = '/dashboard';
                }
            }
        });
    }
</script>

<style>
    /* 仅当前台页面激活时应用 */
    body:not(:has(aside)) {
        /* 💡 核心修改:强制全屏及大屏下服务器列表为单列长条布局 */
        .grid-cols-1, .md\:grid-cols-2, .lg\:grid-cols-3, .xl\:grid-cols-4 {
            grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
            max-width: 900px !important; /* 限制下单列的最大宽度,防止在超宽屏上拉得太长变形 */
            margin-left: auto !important;
            margin-right: auto !important;
        }

        /* 前台背景毛玻璃与压暗滤镜 */
        .dark .bg-cover::after {
            content: ''; position: absolute; inset: 0;
            backdrop-filter: blur(8px) !important; background-color: rgba(0, 0, 0, 0.55) !important;
        }
        .light .bg-cover::after {
            content: ''; position: absolute; inset: 0;
            backdrop-filter: blur(8px) !important; background-color: rgba(255, 255, 255, 0.25) !important;
        }
    }
</style>


<script>
    if (window.location.pathname.includes('/dashboard')) {
        window.DisableAnimatedMan = true; 

        // 动态修改后台左上角的文本
        const observerAdminTitle = new MutationObserver(mutations => {
            mutations.forEach(mutation => {
                mutation.addedNodes.forEach(node => {
                    if (node.nodeType === 1) {
                        const links = node.matches('.transition-opacity') ? [node] : node.querySelectorAll('.transition-opacity');
                        links.forEach(link => {
                            const textNode = Array.from(link.childNodes).find(n => n.nodeType === Node.TEXT_NODE && n.textContent.trim() === '哪吒监控');
                            if (textNode) {
                                textNode.textContent = '控制台'; 
                                observerAdminTitle.disconnect();
                            }
                        });
                    }
                });
            });
        });
        observerAdminTitle.observe(document.body, { childList: true, subtree: true });
    }
</script>

<style>
    /* 仅当处于后台管理页面时激活 */
    body:has(aside) {
        background: url("https://api.paugram.com/wallpaper/") no-repeat center center fixed !important;
        background-size: cover !important;

        .dark .bg-background, .dark .bg-card, .dark main, .dark .border-b {
            background-color: rgba(20, 20, 20, 0.65) !important;
            backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important;
        }
        .light .bg-background, .light .bg-card, .light main, .light .border-b {
            background-color: rgba(255, 255, 255, 0.65) !important;
            backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important;
        }

        aside, header {
            background-color: rgba(0, 0, 0, 0.1) !important;
            backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important;
        }

        img[src*="https://api.dicebear.com/7.x/notionists/svg"] {
            content: url("https://img.icons8.com/fluent/96/000000/user-male-circle.png") !important;
            border-radius: 50% !important;
        }

        img[src*="/dashboard/logo.svg"] {
            content: url("https://img.icons8.com/fluent/96/000000/dashboard.png") !important;
        }

        footer { display: none !important; }
    }
</style>