AIS fixes + daily

This commit is contained in:
2026-06-27 13:38:52 -04:00
parent bea55ac448
commit c5477d05ad
13 changed files with 251 additions and 259 deletions

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import Loading from '@/components/Loading.vue';
import {getUVLabel} from '@/services/units.ts';
import {inject, computed } from 'vue';
import {useWeather} from '../services/api';
@@ -96,17 +97,17 @@ const arc = computed(() => {
<div class="stat">
<span class="stat-label">Daylight</span>
<div v-if="!data" class="w-100 pos-rel br-2 overflow-hidden" style="height: 1.75em"><Loading /></div>
<span v-else class="stat-value">{{ data.daylight?.toFixed(2) }} <span class="fg-muted">hrs</span></span>
<span v-else class="stat-value">{{ data.daylight?.toFixed(2) ?? '—' }} <span v-if="data.daylight" class="fg-muted">hrs</span></span>
</div>
<div class="stat" @click="openGraph?.('lux')">
<span class="stat-label">Lux</span>
<span class="stat-label">Brightness</span>
<div v-if="!data" class="w-100 pos-rel br-2 overflow-hidden" style="height: 1.75em"><Loading /></div>
<span v-else class="stat-value">{{ data.lux }}</span>
<span v-else class="stat-value">{{ data.lux ?? '—' }} <span v-if="data.lux != null" class="fg-muted">lm/m²</span></span>
</div>
<div class="stat" @click="openGraph?.('solar_wm2')">
<span class="stat-label">Solar W/</span>
<span class="stat-label">Irradiance</span>
<div v-if="!data" class="w-100 pos-rel br-2 overflow-hidden" style="height: 1.75em"><Loading /></div>
<span v-else class="stat-value">{{ data.solar_wm2 }}</span>
<span v-else class="stat-value">{{ data.solar_wm2 ?? '—' }} <span v-if="data.lux != null" class="fg-muted">W/m²</span></span>
</div>
</div>
@@ -116,17 +117,17 @@ const arc = computed(() => {
<div class="stat" @click="openGraph?.('uv_index')">
<span class="stat-label">UV Index</span>
<div v-if="!data" class="w-100 pos-rel br-2 overflow-hidden" style="height: 1.75em"><Loading /></div>
<span v-else class="stat-value">{{ data.uv_index.toFixed(1) }} <span class="fg-muted">({{ data.uv_index_label }})</span></span>
<span v-else class="stat-value">{{ data.uv_index?.toFixed(1) ?? '—' }} <span v-if="data.uv_index != null" class="fg-muted">({{ getUVLabel(data.uv_index) }})</span></span>
</div>
<div class="stat" @click="openGraph?.('uv_dose')">
<span class="stat-label">UV Dose</span>
<div v-if="!data" class="w-100 pos-rel br-2 overflow-hidden" style="height: 1.75em"><Loading /></div>
<span v-else class="stat-value">{{ data.uv_dose?.toFixed(0) }} <span class="fg-muted">J/m²</span></span>
<span v-else class="stat-value">{{ data.uv_dose?.toFixed(0) ?? '—' }} <span v-if="data.uv_dose != null" class="fg-muted">J/m²</span></span>
</div>
<div class="stat" @click="openGraph?.('uv_index_max')">
<span class="stat-label">UV Max</span>
<div v-if="!data" class="w-100 pos-rel br-2 overflow-hidden" style="height: 1.75em"><Loading /></div>
<span v-else class="stat-value">{{ data.uv_index_max ?? '—' }}</span>
<span v-else class="stat-value">{{ data.uv_index_max ?? '—' }} <span v-if="data.uv_index_max != null" class="fg-muted">({{getUVLabel(data.uv_index_max)}})</span></span>
</div>
</div>
</div>