feat: 新增彩云气象数据下载的时间控制
This commit is contained in:
parent
9f960c6411
commit
aa53a21685
@ -111,21 +111,13 @@
|
||||
if (!res.ok) throw new Error('实时数据不存在');
|
||||
const j = await res.json();
|
||||
setRealtimeBox(j);
|
||||
const miss = document.getElementById('rt_missing');
|
||||
if (miss) miss.classList.add('hidden');
|
||||
}
|
||||
|
||||
async function loadRealtimeAt(alias, dtStr) {
|
||||
const res = await fetch(`/api/radar/weather_at?alias=${encodeURIComponent(alias)}&dt=${encodeURIComponent(dtStr)}`);
|
||||
if (!res.ok) {
|
||||
const miss = document.getElementById('rt_missing');
|
||||
if (miss) miss.classList.remove('hidden');
|
||||
return false;
|
||||
}
|
||||
if (!res.ok) { return false; }
|
||||
const j = await res.json();
|
||||
setRealtimeBox(j);
|
||||
const miss = document.getElementById('rt_missing');
|
||||
if (miss) miss.classList.add('hidden');
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -686,7 +678,7 @@
|
||||
<div>下行短波:<span id="rt_dswrf"></span> W/m²</div>
|
||||
<div>气压:<span id="rt_p"></span> Pa</div>
|
||||
</div>
|
||||
<div id="rt_missing" class="mt-2 hidden p-2 text-sm text-yellow-800 bg-yellow-50 border border-yellow-200 rounded">提示:该时次的 10 分钟实况缺失,已显示最近/最新实况。</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card my-4">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user