chore: lint

This commit is contained in:
Nicholas Penree
2024-12-16 17:01:44 -05:00
parent 87a5ce2053
commit bd16e03602
2 changed files with 8 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { Download as DownloadIcon, Loader2 } from "lucide-react";
import React, { useEffect, useRef } from "react";
import { SinceLogsFilter } from "./since-logs-filter";
import { SinceLogsFilter, type TimeFilter } from "./since-logs-filter";
import { StatusLogsFilter } from "./status-logs-filter";
import { TerminalLine } from "./terminal-line";
import { type LogLine, getLogType, parseLogs } from "./utils";
@@ -13,8 +13,6 @@ interface Props {
serverId?: string | null;
}
type TimeFilter = "all" | "timestamp" | "1h" | "6h" | "24h" | "168h" | "720h";
export const priorities = [
{
label: "Info",
@@ -84,14 +82,10 @@ export const DockerLogsId: React.FC<Props> = ({ containerId, serverId }) => {
setLines(Number(e.target.value) || 1);
};
const handleSince = (value: string) => {
if (value === "timestamp") {
setShowTimestamp(!showTimestamp);
} else {
setRawLogs("");
setFilteredLogs([]);
setSince(value);
}
const handleSince = (value: TimeFilter) => {
setRawLogs("");
setFilteredLogs([]);
setSince(value);
};
useEffect(() => {

View File

@@ -17,9 +17,9 @@ import { cn } from "@/lib/utils";
import { CheckIcon } from "lucide-react";
import React from "react";
type TimeFilter = "all" | "1h" | "6h" | "24h" | "168h" | "720h";
export type TimeFilter = "all" | "1h" | "6h" | "24h" | "168h" | "720h";
const timeRanges = [
const timeRanges: Array<{ label: string; value: TimeFilter }> = [
{
label: "All time",
value: "all",
@@ -44,7 +44,7 @@ const timeRanges = [
label: "Last 30 days",
value: "720h",
},
];
] as const;
interface SinceLogsFilterProps {
value: string;