Board row ordering, type-derived row colours, and clearer upcoming events

This commit is contained in:
2026-08-08 14:24:28 -04:00
parent 3ebc1f353a
commit 4344adabf1
11 changed files with 450 additions and 72 deletions

View File

@@ -95,7 +95,8 @@
<script setup>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import api from '@/api'
import api, { settingsApi } from '@/api'
import { formatInZone, DEFAULT_TZ } from '@/utils/datetime'
const route = useRoute()
const router = useRouter()
@@ -111,11 +112,13 @@ const diffs = ref({})
const assetname = ref('')
const loading = ref(true)
const error = ref('')
// Timestamps are stored UTC and must show in the SITE's zone, not the viewer's,
// so a remote admin and someone at the bay read the same wall clock.
const siteTimezone = ref(DEFAULT_TZ)
function formatWhen(value) {
if (!value) return 'unknown'
const d = new Date(value)
return isNaN(d) ? value : d.toLocaleString()
return formatInZone(value, siteTimezone.value, { second: '2-digit' }) || value
}
function display(value) {
@@ -124,6 +127,16 @@ function display(value) {
return String(value)
}
async function loadTimezone() {
try {
const response = await settingsApi.get('site_timezone')
const value = response?.data?.data?.value
if (value) siteTimezone.value = value
} catch (e) {
// Keep the default zone; a missing setting must not blank the page.
}
}
async function load() {
loading.value = true
error.value = ''
@@ -183,7 +196,10 @@ async function download(rev, fmt) {
URL.revokeObjectURL(link.href)
}
onMounted(load)
onMounted(async () => {
await loadTimezone()
await load()
})
</script>
<style scoped>