Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
miaoermua authored Sep 17, 2024
1 parent 87fe106 commit 2baa52c
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,34 @@
}
</style>

<script>
document.addEventListener('DOMContentLoaded', function() {
const url = new URL(window.location.href);
const domain = url.hostname;

document.getElementById('current-domain').textContent = domain;

// 源信息映射
const domainSources = {
'repo.miaoer.xyz': '广州 - 阿里云主站',
'github.catwrt.eu.org': 'Github Pages',
'cfnetlify.catwrt.eu.org': '☁️ Cloudflare - Netlify',
'cfvercel.catwrt.eu.org': '☁️ Cloudflare - Vercel',
'netlify.catwrt.eu.org': 'Netlify',
'vercel.catwrt.eu.org': 'Vercel',
};

// 查找域名对应源信息
let sourceInfo;
if (domainSources.hasOwnProperty(domain)) {
sourceInfo = domainSources[domain];
} else if (/^(?:\d{1,3}\.){3}\d{1,3}$/.test(domain)) { // IP 地址格式
sourceInfo = '本地部署';
} else {
sourceInfo = '未知源';
}

// 显示源信息
document.getElementById('source-info').textContent = `站点:${sourceInfo}`;
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const url = new URL(window.location.href);
const domain = url.hostname;

document.getElementById('current-domain').textContent = domain;

const domainSources = {
'repo.miaoer.xyz': '阿里云',
'github.catwrt.eu.org': 'Github Pages',
'cfnetlify.catwrt.eu.org': '☁️ Cloudflare - Netlify',
'cfvercel.catwrt.eu.org': '☁️ Cloudflare - Vercel',
'netlify.catwrt.eu.org': 'Netlify',
'vercel.catwrt.eu.org': 'Vercel',
};

let sourceInfo;
if (domainSources.hasOwnProperty(domain)) {
sourceInfo = domainSources[domain];
} else if (/^(?:\d{1,3}\.){3}\d{1,3}$/.test(domain)) {
sourceInfo = '本地部署';
} else {
sourceInfo = '未知源';
}

document.getElementById('source-info').textContent = `站点:${sourceInfo}`;
});
</script>
</head>

<body>
Expand Down

0 comments on commit 2baa52c

Please sign in to comment.
  NODES
COMMUNITY 1
Note 1
Project 3
USERS 1