fix(preview):修复按钮

This commit is contained in:
ClovertaTheTrilobita 2025-11-29 18:03:16 +00:00
parent 09d0756184
commit 81088905c9
2 changed files with 7 additions and 3 deletions

View file

@ -129,7 +129,7 @@
<div id="gallery"></div>
<!-- 下载按钮:保留 onclick不动逻辑只加样式 -->
<div class="mt-4 d-flex download-wrap">
<div class="mt-4 download-wrap" id="dl-btn">
<button class="btn btn-primary d-inline-flex align-items-center download-btn"
onclick="downloadTif()">
<i class="bi bi-download me-2"></i> 下载 TIF
@ -155,10 +155,12 @@
const ID = params.get("id");
const msg = document.getElementById("none-exist");
const btn = document.getElementById("dl-btn");
if (!ID) {
msg.textContent = "missing id in URL";
msg.hidden = false;
btn.classList.add("d-none");
} else {
try {
const res = await axios.get(API_STATUS + "?id=" + encodeURIComponent(ID));
@ -168,13 +170,16 @@
if (!exists) {
msg.textContent = `id "${ID}" 不存在`;
msg.hidden = false;
btn.classList.add("d-none");
}
else if (status == "running"){
msg.textContent = `id "${ID}" 仍在运行中,请耐心等待片刻后刷新。`;
msg.hidden = false;
btn.classList.add("d-none");
}
else {
msg.hidden = true;
btn.classList.add("d-flex");
axios.get(API_PIC + "?id=" + encodeURIComponent(ID)).then(res => {
if (res.data.ok) {
const gallery = document.getElementById("gallery");

View file

@ -102,8 +102,7 @@
<!-- 底部小提示 -->
<div class="mt-3 text-secondary small">
提示:如果你使用 Chart.js建议设置 <code>responsive: true</code><code>maintainAspectRatio: false</code>
本页样式已自动保证画布自适应容器尺寸。
训练loss曲线
</div>
</div>
</div>