diff --git a/ecosystem-explorer/src/features/java-agent/components/attribute-table.tsx b/ecosystem-explorer/src/features/java-agent/components/attribute-table.tsx index 079cac2d..bc33b274 100644 --- a/ecosystem-explorer/src/features/java-agent/components/attribute-table.tsx +++ b/ecosystem-explorer/src/features/java-agent/components/attribute-table.tsx @@ -13,52 +13,82 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { useState } from "react"; import type { Attribute } from "@/types/javaagent"; +import { ChevronDown } from "lucide-react"; interface AttributeTableProps { attributes: Attribute[]; + expandVersion?: number; + collapseVersion?: number; } -export function AttributeTable({ attributes }: AttributeTableProps) { +export function AttributeTable({ attributes, expandVersion = 0, collapseVersion = 0 }: AttributeTableProps) { + const [isOpen, setIsOpen] = useState(false); + const [prevExpand, setPrevExpand] = useState(expandVersion); + const [prevCollapse, setPrevCollapse] = useState(collapseVersion); + + if (expandVersion > prevExpand) { + setPrevExpand(expandVersion); + setIsOpen(true); + } + + if (collapseVersion > prevCollapse) { + setPrevCollapse(collapseVersion); + setIsOpen(false); + } + if (attributes.length === 0) { return null; } return ( -
| - Key - | -- Type - | -||||
|---|---|---|---|---|---|
| {attr.name} | -- - {attr.type} - - | +
| + Key + | ++ Type + |
|---|
+ Provides visibility into application activity and execution flow across services and components. +
+ {instrumentation.telemetry && + instrumentation.telemetry[0] && + instrumentation.telemetry[0].spans && ( ++ Gives you the big picture of system health, like total request + counts, error rates, and average speeds over time. +
+ {instrumentation.telemetry && + instrumentation.telemetry[0] && + instrumentation.telemetry[0].metrics && ( +