Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -1,18 +1,46 @@
|
||||
<script lang="ts">
|
||||
import type { PlutoniumVersion } from '$lib/plutonium.js';
|
||||
import { uiNow } from '$ui/stores/servers.js';
|
||||
let { name, version, after, ready = true }: { name: string; version?: PlutoniumVersion; after?: string | null; ready?: boolean } = $props();
|
||||
const fresh = $derived(ready && version?.checked_at && $uiNow - Date.parse(version.checked_at) < 3_600_000 && (!after || version.checked_at > after));
|
||||
let {
|
||||
name,
|
||||
version,
|
||||
after,
|
||||
ready = true
|
||||
}: {
|
||||
name: string;
|
||||
version?: PlutoniumVersion;
|
||||
after?: string | null;
|
||||
ready?: boolean;
|
||||
} = $props();
|
||||
const fresh = $derived(
|
||||
ready &&
|
||||
version?.checked_at &&
|
||||
$uiNow - Date.parse(version.checked_at) < 3_600_000 &&
|
||||
(!after || version.checked_at > after)
|
||||
);
|
||||
const revision = $derived(fresh ? version?.revision : null);
|
||||
const outdated = $derived(fresh && version?.update_status === 'outdated');
|
||||
</script>
|
||||
|
||||
<a class:outdated href={`/maintenance?kind=updates&server=${encodeURIComponent(name)}`} title="View Plutonium updates and verification">
|
||||
<a
|
||||
class:outdated
|
||||
href={`/maintenance?kind=updates&server=${encodeURIComponent(name)}`}
|
||||
title="View Plutonium updates and verification"
|
||||
>
|
||||
Plutonium {revision ? `r${revision}` : 'unverified'}{outdated ? ' · Update available' : ''}
|
||||
</a>
|
||||
|
||||
<style>
|
||||
a { font-size: var(--text-xs); color: var(--text-secondary); text-decoration: none; }
|
||||
a:hover { color: var(--accent-primary-hover); text-decoration: underline; }
|
||||
.outdated { color: var(--state-warning); }
|
||||
a {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: var(--accent-primary-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
.outdated {
|
||||
color: var(--state-warning);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user