add runtime log views and standardize status dots
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
export type StatusDotTone = 'green' | 'amber' | 'red' | 'blue' | 'neutral';
|
||||
|
||||
export function statusDotToneClass(tone: StatusDotTone) {
|
||||
const tones: Record<StatusDotTone, string> = {
|
||||
green: 'bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.15)]',
|
||||
amber: 'bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.15)]',
|
||||
red: 'bg-rose-400 shadow-[0_0_0_3px_rgba(251,113,133,0.15)]',
|
||||
blue: 'bg-sky-400 shadow-[0_0_0_3px_rgba(56,189,248,0.15)]',
|
||||
neutral: 'bg-muted-foreground/60 shadow-[0_0_0_3px_rgba(148,163,184,0.12)]'
|
||||
};
|
||||
|
||||
return tones[tone];
|
||||
}
|
||||
|
||||
export function runtimeStatusDotClass(status?: string | null) {
|
||||
if (['Running', 'Bound', 'ClusterIP', 'LoadBalancer', 'Normal'].includes(status ?? '')) return statusDotToneClass('green');
|
||||
if (['Pending', 'ContainerCreating', 'Warning'].includes(status ?? '')) return statusDotToneClass('amber');
|
||||
if (['Error', 'CrashLoopBackOff', 'ImagePullBackOff', 'Failed'].includes(status ?? '')) return statusDotToneClass('red');
|
||||
return statusDotToneClass('neutral');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user