refactor: format markdown files using prettier, fix spelling concerns, reduce Taskfile bloat
This commit is contained in:
608 files changed
+63317
-10219
No files matched your search
@@ -17,7 +17,12 @@ const tokens = computed(() => tokenizeJson(props.text));
|
||||
|
||||
<template>
|
||||
<template v-if="tokens">
|
||||
<span v-for="(token, i) in tokens" :key="i" :class="tokenClass(token.kind)">{{ token.text }}</span>
|
||||
<span
|
||||
v-for="(token, i) in tokens"
|
||||
:key="i"
|
||||
:class="tokenClass(token.kind)"
|
||||
>{{ token.text }}</span
|
||||
>
|
||||
</template>
|
||||
<template v-else>{{ props.text }}</template>
|
||||
</template>
|
||||
</template>
|
||||
+21
-5
@@ -1,5 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { fmtValue, LEVEL_COLOR, levelKind, shortTime, type LogEntry } from "@/lib/log";
|
||||
import {
|
||||
fmtValue,
|
||||
LEVEL_COLOR,
|
||||
levelKind,
|
||||
shortTime,
|
||||
type LogEntry,
|
||||
} from "@/lib/log";
|
||||
|
||||
/**
|
||||
* Shared log-entry rendering. Both the daemon-wide log page and a task's own
|
||||
@@ -15,18 +21,28 @@ const fields = () => Object.entries(props.entry.fields ?? {});
|
||||
<div
|
||||
class="grid grid-cols-[62px_52px_1fr] items-baseline gap-3 border-b border-border px-1 py-2 hover:bg-accent"
|
||||
>
|
||||
<span class="font-mono text-fg-subtle">{{ shortTime(props.entry.time) }}</span>
|
||||
<span class="text-[10px] font-semibold tracking-[0.04em]" :class="LEVEL_COLOR[levelKind(props.entry.level)]">
|
||||
<span class="font-mono text-fg-subtle">{{
|
||||
shortTime(props.entry.time)
|
||||
}}</span>
|
||||
<span
|
||||
class="text-[10px] font-semibold tracking-[0.04em]"
|
||||
:class="LEVEL_COLOR[levelKind(props.entry.level)]"
|
||||
>
|
||||
{{ (props.entry.level || "info").toUpperCase() }}
|
||||
</span>
|
||||
<span class="flex min-w-0 flex-wrap items-baseline gap-2">
|
||||
<span class="break-words text-foreground">{{ props.entry.message || props.entry.msg || "" }}</span>
|
||||
<span class="break-words text-foreground">{{
|
||||
props.entry.message || props.entry.msg || ""
|
||||
}}</span>
|
||||
<span
|
||||
v-for="[k, v] in fields()"
|
||||
:key="k"
|
||||
class="max-w-full truncate rounded-sm bg-muted px-2 text-fg-muted"
|
||||
>
|
||||
<span class="text-fg-subtle after:opacity-60 after:content-['=']">{{ k }}</span>{{ fmtValue(v) }}
|
||||
<span class="text-fg-subtle after:opacity-60 after:content-['=']">{{
|
||||
k
|
||||
}}</span
|
||||
>{{ fmtValue(v) }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -14,9 +14,12 @@ const props = defineProps<{
|
||||
segments: Array<{ label: string; value: number; kind?: StatusKind }>;
|
||||
}>();
|
||||
|
||||
const total = computed(() => props.segments.reduce((a, s) => a + (s.value || 0), 0) || 1);
|
||||
const total = computed(
|
||||
() => props.segments.reduce((a, s) => a + (s.value || 0), 0) || 1,
|
||||
);
|
||||
|
||||
const partWidth = (value: number) => `${((value / total.value) * 100).toFixed(1)}%`;
|
||||
const partWidth = (value: number) =>
|
||||
`${((value / total.value) * 100).toFixed(1)}%`;
|
||||
const fill = (kind?: StatusKind) => STATUS_FILL[kind ?? "idle"];
|
||||
</script>
|
||||
|
||||
|
||||
@@ -6,7 +6,12 @@ import { computed } from "vue";
|
||||
* number carries the precision.
|
||||
*/
|
||||
const props = withDefaults(
|
||||
defineProps<{ series: number[]; stroke?: string; width?: number; height?: number }>(),
|
||||
defineProps<{
|
||||
series: number[];
|
||||
stroke?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}>(),
|
||||
{ stroke: "var(--ok)", width: 220, height: 34 },
|
||||
);
|
||||
|
||||
@@ -14,7 +19,10 @@ const points = computed(() => {
|
||||
const max = Math.max(...props.series, 1);
|
||||
const min = Math.min(...props.series, 0);
|
||||
const span = max - min || 1;
|
||||
const step = props.series.length > 1 ? props.width / (props.series.length - 1) : props.width;
|
||||
const step =
|
||||
props.series.length > 1
|
||||
? props.width / (props.series.length - 1)
|
||||
: props.width;
|
||||
|
||||
return props.series
|
||||
.map(
|
||||
|
||||
@@ -3,7 +3,14 @@ import { TrendingDown, TrendingUp } from "@lucide/vue";
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Card,
|
||||
CardAction,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import Sparkline from "./Sparkline.vue";
|
||||
|
||||
/**
|
||||
@@ -31,9 +38,15 @@ const props = withDefaults(
|
||||
{ series: () => [], goodDirection: "up" },
|
||||
);
|
||||
|
||||
const dir = computed(() => (props.trend == null ? null : props.trend >= 0 ? "up" : "down"));
|
||||
const good = computed(() => (dir.value == null ? null : dir.value === props.goodDirection));
|
||||
const trendIcon = computed(() => (dir.value === "up" ? TrendingUp : TrendingDown));
|
||||
const dir = computed(() =>
|
||||
props.trend == null ? null : props.trend >= 0 ? "up" : "down",
|
||||
);
|
||||
const good = computed(() =>
|
||||
dir.value == null ? null : dir.value === props.goodDirection,
|
||||
);
|
||||
const trendIcon = computed(() =>
|
||||
dir.value === "up" ? TrendingUp : TrendingDown,
|
||||
);
|
||||
const trendLabel = computed(() => `${Math.abs(props.trend ?? 0).toFixed(1)}%`);
|
||||
</script>
|
||||
|
||||
@@ -41,7 +54,9 @@ const trendLabel = computed(() => `${Math.abs(props.trend ?? 0).toFixed(1)}%`);
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{{ props.label }}</CardTitle>
|
||||
<CardDescription v-if="props.compare">{{ props.compare }}</CardDescription>
|
||||
<CardDescription v-if="props.compare">{{
|
||||
props.compare
|
||||
}}</CardDescription>
|
||||
<CardAction v-if="dir">
|
||||
<Badge :variant="good ? 'ok' : 'danger'">
|
||||
<component :is="trendIcon" />
|
||||
@@ -51,7 +66,10 @@ const trendLabel = computed(() => `${Math.abs(props.trend ?? 0).toFixed(1)}%`);
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-3xl font-semibold tracking-[-0.03em]">
|
||||
{{ props.value }}<span v-if="props.unit" class="ml-1 text-lg text-fg-muted">{{ props.unit }}</span>
|
||||
{{ props.value
|
||||
}}<span v-if="props.unit" class="ml-1 text-lg text-fg-muted">{{
|
||||
props.unit
|
||||
}}</span>
|
||||
</div>
|
||||
<Sparkline
|
||||
v-if="props.series.length > 1"
|
||||
|
||||
Reference in new issue
Block a user