Files
MoShiro/web/shared/buildInfo.ts
T
justme 83f54978d2 feat(web): acrylic theme, node flags and icons, build info
Acrylic cards and topbar over a blurred background, country flags, ISP and
OS icons, per-node version tags, a build info footer and an admin versions
tab. Overview cards drop the sparkline and widen the hover area.
2026-10-06 21:22:04 +08:00

22 lines
815 B
TypeScript

/** 前端自己的构建信息(构建时由 Vite 写进来,见 web/build-info.mjs)。 */
declare const __APP_VERSION__: string
declare const __APP_TAG__: string
declare const __APP_COMMIT__: string
declare const __APP_BUILT_AT__: string
export const frontendBuild = {
version: __APP_VERSION__,
tag: __APP_TAG__,
commit: __APP_COMMIT__,
builtAt: __APP_BUILT_AT__,
}
/** 构建时间显示成本地时间「2026-10-06 20:30」;没有(开发服务器)就是空。 */
export function fmtBuiltAt(iso: string | null | undefined): string {
if (!iso) return ''
const d = new Date(iso)
if (Number.isNaN(d.getTime())) return iso
const p = (n: number) => String(n).padStart(2, '0')
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`
}