From c3a40ab0ab1b7d7e683c9ba20e76048d5e61fd34 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Wed, 26 Jul 2023 08:16:47 -0700 Subject: [PATCH] Clear connectivity logs button Summary: Add the option to clear the connectivity logs. Reviewed By: antonk52 Differential Revision: D47797301 fbshipit-source-id: ce9414f3057cab367d34524717c83bfbf0703c0c --- .../src/chrome/ConnectivityHub.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-ui-core/src/chrome/ConnectivityHub.tsx b/desktop/flipper-ui-core/src/chrome/ConnectivityHub.tsx index 7ac07616f..6c441bfc2 100644 --- a/desktop/flipper-ui-core/src/chrome/ConnectivityHub.tsx +++ b/desktop/flipper-ui-core/src/chrome/ConnectivityHub.tsx @@ -19,7 +19,7 @@ import { Tabs, theme, } from 'flipper-plugin'; -import {CloseCircleFilled} from '@ant-design/icons'; +import {CloseCircleFilled, DeleteOutlined} from '@ant-design/icons'; import { CommandRecordEntry, ConnectionRecordEntry, @@ -28,6 +28,7 @@ import { import SetupDoctorScreen from '../sandy-chrome/SetupDoctorScreen'; import {ConsoleLogs} from './ConsoleLogs'; import {FlipperMessages} from './FlipperMessages'; +import {Button} from 'antd'; const rows = createDataSource([], { limit: 200000, @@ -130,6 +131,10 @@ function getRowStyle(entry: ConnectionRecordEntry): CSSProperties | undefined { return (logTypes[entry.type]?.style as any) ?? baseRowStyle; } +function clearMessages() { + rows.clear(); +} + export function ConnectivityHub() { const columns = createColumnConfig(); @@ -137,6 +142,16 @@ export function ConnectivityHub() { undefined | DataTableManager >(); + const clearButton = ( + + ); + const LogView = () => ( dataSource={rows} @@ -146,6 +161,7 @@ export function ConnectivityHub() { onRowStyle={getRowStyle} enableHorizontalScroll={false} tableManagerRef={tableManagerRef} + extraActions={clearButton} /> );