Skip to content

Commit bd064bc

Browse files
author
user123456
committed
修复前端一个显示问题
1 parent a04175e commit bd064bc

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/public/index.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ <h5>支持多种Registry,在镜像名前添加本站域名即可</h5>
428428
<strong>GitHub Container Registry:</strong><br>
429429
docker pull <span class="domain-base"></span>/ghcr.io/user/image<br><br>
430430

431-
<strong>Google Container Registry:</strong><br>
432-
docker pull <span class="domain-base"></span>/gcr.io/project/image<br><br>
433431

434432
<strong>Quay.io Registry:</strong><br>
435433
docker pull <span class="domain-base"></span>/quay.io/org/image<br><br>
@@ -454,18 +452,14 @@ <h5>支持多种Registry,在镜像名前添加本站域名即可</h5>
454452

455453
<script>
456454
document.addEventListener('DOMContentLoaded', function() {
457-
function getRootDomain() {
458-
let hostname = window.location.hostname;
459-
let parts = hostname.split('.');
460-
if(parts.length > 2) {
461-
return parts.slice(-2).join('.');
462-
}
463-
return hostname;
455+
function getFullDomain() {
456+
// 获取完整的域名(包括端口号)
457+
return window.location.host;
464458
}
465459

466-
let rootDomain = getRootDomain();
460+
let fullDomain = getFullDomain();
467461
document.querySelectorAll('.domain-base').forEach(span => {
468-
span.textContent = rootDomain;
462+
span.textContent = fullDomain;
469463
});
470464

471465
const modal = document.getElementById('dockerModal');

0 commit comments

Comments
 (0)