151 lines
4.1 KiB
HTML
151 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Docker 镜像加速</title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0/dist/themes/light.css" />
|
|
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0/dist/shoelace.js"></script>
|
|
<style>
|
|
body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100vh;
|
|
margin: 0;
|
|
font-family: Arial, sans-serif;
|
|
background-color: #f4f4f4;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 1.5rem;
|
|
font-weight: bold;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.domain-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.domain-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background-color: white;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
padding: 1rem 2rem;
|
|
margin-bottom: 1rem;
|
|
width: 300px;
|
|
}
|
|
|
|
.domain-text {
|
|
flex-grow: 1;
|
|
font-size: 1.2rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.copy-button {
|
|
font-size: 0.75rem;
|
|
padding: 0.2rem 0.5rem;
|
|
margin-left: 0.5rem;
|
|
}
|
|
|
|
.footer {
|
|
font-size: 0.9rem;
|
|
color: #555;
|
|
}
|
|
|
|
.github-icon {
|
|
position: fixed;
|
|
bottom: 15px;
|
|
text-align: center;
|
|
width: 100%;
|
|
}
|
|
|
|
.github-icon a {
|
|
color: #333;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.github-icon a:hover {
|
|
color: #555;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- 添加标题 -->
|
|
<h2>Docker 镜像加速(多种仓库)</h2>
|
|
|
|
<div class="domain-container">
|
|
<div class="domain-item">
|
|
<div class="domain-text">dockerhub.<span id="domain-base"></span></div>
|
|
<sl-button class="copy-button" variant="primary">复制</sl-button>
|
|
</div>
|
|
<div class="domain-item">
|
|
<div class="domain-text">ghcr.<span id="domain-base"></span></div>
|
|
<sl-button class="copy-button" variant="primary">复制</sl-button>
|
|
</div>
|
|
<div class="domain-item">
|
|
<div class="domain-text">gcr.<span id="domain-base"></span></div>
|
|
<sl-button class="copy-button" variant="primary">复制</sl-button>
|
|
</div>
|
|
<div class="domain-item">
|
|
<div class="domain-text">k8sgcr.<span id="domain-base"></span></div>
|
|
<sl-button class="copy-button" variant="primary">复制</sl-button>
|
|
</div>
|
|
<div class="domain-item">
|
|
<div class="domain-text">registryk8s.<span id="domain-base"></span></div>
|
|
<sl-button class="copy-button" variant="primary">复制</sl-button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer">
|
|
🔔个人使用,请勿分享!
|
|
</div>
|
|
<div class="footer">
|
|
✨根据对应的仓库使用对应的加速域名。
|
|
</div>
|
|
|
|
<div class="github-icon">
|
|
<a href="https://github.com/sky22333/docker-proxy" target="_blank">
|
|
<sl-icon name="github" size="24"></sl-icon>
|
|
</a>
|
|
</div>
|
|
|
|
<script>
|
|
const domainBase = new URL(window.location.href).hostname.replace(/^www\./, '');
|
|
document.querySelectorAll('#domain-base').forEach(el => {
|
|
el.textContent = domainBase;
|
|
});
|
|
|
|
document.querySelectorAll('.copy-button').forEach(button => {
|
|
button.addEventListener('click', async () => {
|
|
const domainText = button.previousElementSibling.textContent;
|
|
|
|
try {
|
|
await navigator.clipboard.writeText(domainText);
|
|
|
|
if (button.dataset.copied) return;
|
|
button.dataset.copied = true;
|
|
|
|
const originalText = button.textContent;
|
|
button.textContent = '已复制';
|
|
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
delete button.dataset.copied;
|
|
}, 1000);
|
|
} catch (err) {
|
|
console.error('复制失败', err);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|