Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
drudge committed Dec 16, 2024
1 parent 87a5ce2 commit bd16e03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
16 changes: 5 additions & 11 deletions apps/dokploy/components/dashboard/docker/logs/docker-logs-id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -13,8 +13,6 @@ interface Props {
serverId?: string | null;
}

type TimeFilter = "all" | "timestamp" | "1h" | "6h" | "24h" | "168h" | "720h";

export const priorities = [
{
label: "Info",
Expand Down Expand Up @@ -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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -44,7 +44,7 @@ const timeRanges = [
label: "Last 30 days",
value: "720h",
},
];
] as const;

interface SinceLogsFilterProps {
value: string;
Expand Down

0 comments on commit bd16e03

Please sign in to comment.