Skip to content

Commit

Permalink
fix: Show badge close button to indicate filter is active
Browse files Browse the repository at this point in the history
  • Loading branch information
mman committed Nov 29, 2024
1 parent e0bff62 commit 3298db5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/client/views/troubleshooting/Troubleshooting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import { WebSocketStatus } from "../settings/WebsocketStatus"
import ms from "ms"
import { useEffect, useRef, useState } from "react"

function TinyCloseButton() {
return <span className="opacity-50 ps-1"></span>
}

function Troubleshooting() {
const log = useSelector((state: AppState) => state.log)
const isDebugLevelEnabled = useSelector((state: AppState) => state.debug)
Expand Down Expand Up @@ -89,7 +93,7 @@ function Troubleshooting() {
className="text-decoration-none"
>
<CBadge color="primary" shape="rounded-pill" size="sm">
{labelFilter}
{labelFilter} <TinyCloseButton />
</CBadge>
</CLink>
)}
Expand Down Expand Up @@ -125,7 +129,7 @@ function LogList(props: LogListProps) {
<CTableHeaderCell className="small text-nowrap" style={{ width: "1%" }}>
Time
</CTableHeaderCell>
<CTableHeaderCell className="small text-nowrap" style={{ width: "8rem" }}>
<CTableHeaderCell className="small text-nowrap" style={{ width: "10rem" }}>
Label
</CTableHeaderCell>
<CTableHeaderCell className="small">Message</CTableHeaderCell>
Expand Down Expand Up @@ -171,6 +175,7 @@ function LogList(props: LogListProps) {
>
<CBadge textBgColor="light" textColor="secondary" shape="rounded-pill" size="sm">
{entry.label}
{props.labelFilter && <TinyCloseButton />}
</CBadge>
</CLink>
</CTableDataCell>
Expand Down

0 comments on commit 3298db5

Please sign in to comment.