Skip to content

fix: formatting alert time in the table, add seconds #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 21 additions & 28 deletions src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ import { useAlertsStore } from "@/hooks/useAlertsStore";
import { Markdown } from "./Markdown";
import { PieChart } from "@/viz/PieChart";
import { Switch } from "./ui/switch";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "./ui/tooltip";
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
import { useSearchParams } from "react-router-dom";
import { AlertConversation } from "@/api/generated";
import { getMaliciousPackage } from "@/lib/utils";
Expand Down Expand Up @@ -154,25 +149,23 @@ export function Dashboard() {

<div className="flex items-center gap-8">
<div className="flex items-center space-x-2">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center space-x-2">
<Switch
id="airplane-mode"
checked={isMaliciousFilterActive}
onCheckedChange={handleToggleFilter}
/>
<label htmlFor="airplane-mode" className="text-sm">
Malicious Packages
</label>
</div>
</TooltipTrigger>
<TooltipContent>
<p>Filter by malicious packages</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center space-x-2">
<Switch
id="airplane-mode"
checked={isMaliciousFilterActive}
onCheckedChange={handleToggleFilter}
/>
<label htmlFor="airplane-mode" className="text-sm">
Malicious Packages
</label>
</div>
</TooltipTrigger>
<TooltipContent>
<p>Filter by malicious packages</p>
</TooltipContent>
</Tooltip>
</div>
<Input
icon={
Expand Down Expand Up @@ -206,8 +199,8 @@ export function Dashboard() {
<TableHead className="w-[150px]">Trigger Type</TableHead>
<TableHead className="w-[300px]">Trigger Token</TableHead>
<TableHead className="w-[150px]">File</TableHead>
<TableHead className="w-[300px]">Code</TableHead>
<TableHead className="w-[150px]">Timestamp</TableHead>
<TableHead className="w-[250px]">Code</TableHead>
<TableHead className="w-[100px]">Timestamp</TableHead>
</TableRow>
</TableHeader>
<TableBody>
Expand All @@ -234,7 +227,7 @@ export function Dashboard() {
{format(new Date(alert.timestamp ?? ""), "y/MM/dd")}
</div>
<div data-testid="time">
{format(new Date(alert.timestamp ?? ""), "HH:mm a")}
{format(new Date(alert.timestamp ?? ""), "hh:mm:ss a")}
</div>
</TableCell>
</TableRow>
Expand Down
Loading