From 5a91c0fdd1a45a219595a26f5973b4d95a738657 Mon Sep 17 00:00:00 2001 From: cryptooda Date: Fri, 10 Oct 2025 02:25:50 +0700 Subject: [PATCH] Update front --- .../sqlmonitoring/sqlMonitoring.tsx | 231 +++++++++--------- 1 file changed, 111 insertions(+), 120 deletions(-) diff --git a/src/Managing.WebApp/src/pages/settingsPage/sqlmonitoring/sqlMonitoring.tsx b/src/Managing.WebApp/src/pages/settingsPage/sqlmonitoring/sqlMonitoring.tsx index c8971164..19ec9a44 100644 --- a/src/Managing.WebApp/src/pages/settingsPage/sqlmonitoring/sqlMonitoring.tsx +++ b/src/Managing.WebApp/src/pages/settingsPage/sqlmonitoring/sqlMonitoring.tsx @@ -87,20 +87,8 @@ const SqlMonitoring: React.FC = () => { { Header: 'Repository', accessor: 'repository', - disableSortBy: true, - disableFilters: true, - }, - { - Header: 'Method', - accessor: 'method', - disableSortBy: true, - disableFilters: true, - }, - { - Header: 'Query Pattern', - accessor: 'queryPattern', Cell: ({ value }: { value: string }) => ( -
+
{value}
), @@ -108,24 +96,46 @@ const SqlMonitoring: React.FC = () => { disableFilters: true, }, { - Header: 'Executions', + Header: 'Method', + accessor: 'method', + Cell: ({ value }: { value: string }) => ( +
+ {value} +
+ ), + disableSortBy: true, + disableFilters: true, + }, + { + Header: 'Query', + accessor: 'queryPattern', + Cell: ({ value }: { value: string }) => ( +
+ {value} +
+ ), + disableSortBy: true, + disableFilters: true, + }, + { + Header: 'Count', accessor: 'executionCount', Cell: ({ value }: { value: number }) => { const numValue = Number(value) || 0 return ( - {numValue} + {numValue} ) }, disableSortBy: true, disableFilters: true, }, { - Header: 'Per Minute', + Header: '/Min', accessor: 'executionsPerMinute', Cell: ({ value }: { value: number }) => { const numValue = Number(value) || 0 return ( - 20 ? 'badge-warning' : 'badge-info'}`}> + 20 ? 'badge-warning' : 'badge-info'}`}> {numValue.toFixed(1)} ) @@ -134,12 +144,12 @@ const SqlMonitoring: React.FC = () => { disableFilters: true, }, { - Header: 'Avg Time (ms)', + Header: 'Time (ms)', accessor: 'averageExecutionTime', Cell: ({ value }: { value: number }) => { const numValue = Number(value) || 0 return ( - 1000 ? 'badge-error' : numValue > 500 ? 'badge-warning' : 'badge-success'}`}> + 1000 ? 'badge-error' : numValue > 500 ? 'badge-warning' : 'badge-success'}`}> {numValue.toFixed(0)} ) @@ -151,19 +161,8 @@ const SqlMonitoring: React.FC = () => { Header: 'Status', accessor: 'isActive', Cell: ({ value }: { value: boolean }) => ( - - {value ? 'Active' : 'Inactive'} - - ), - disableSortBy: true, - disableFilters: true, - }, - { - Header: 'Last Execution', - accessor: 'lastExecution', - Cell: ({ value }: { value: string }) => ( - - {value ? new Date(value).toLocaleString() : 'N/A'} + + {value ? '✓' : '✗'} ), disableSortBy: true, @@ -180,7 +179,7 @@ const SqlMonitoring: React.FC = () => { Header: 'Query Pattern', accessor: 'queryPattern', Cell: ({ value }: { value: string }) => ( -
+
{value}
), @@ -188,28 +187,17 @@ const SqlMonitoring: React.FC = () => { disableFilters: true, }, { - Header: 'Execution Count', + Header: 'Count', accessor: 'executionCount', Cell: ({ value }: { value: number }) => { const numValue = Number(value) || 0 return ( - {numValue} + {numValue} ) }, disableSortBy: true, disableFilters: true, }, - { - Header: 'Timestamp', - accessor: 'timestamp', - Cell: ({ value }: { value: string }) => ( - - {new Date(value).toLocaleString()} - - ), - disableSortBy: true, - disableFilters: true, - }, ], [] ) @@ -222,7 +210,7 @@ const SqlMonitoring: React.FC = () => { accessor: 'severity', Cell: ({ value }: { value: string }) => ( { : 'badge-info' }`} > - {value} + {value === 'Critical' ? '!' : value === 'Error' ? 'E' : value === 'Warning' ? 'W' : 'I'} ), disableSortBy: true, disableFilters: true, }, - { - Header: 'Type', - accessor: 'type', - disableSortBy: true, - disableFilters: true, - }, { Header: 'Repository', accessor: 'repository', + Cell: ({ value }: { value: string }) => ( +
+ {value} +
+ ), disableSortBy: true, disableFilters: true, }, { Header: 'Method', accessor: 'method', + Cell: ({ value }: { value: string }) => ( +
+ {value} +
+ ), disableSortBy: true, disableFilters: true, }, { Header: 'Message', accessor: 'message', - disableSortBy: true, - disableFilters: true, - }, - { - Header: 'Timestamp', - accessor: 'timestamp', + Cell: ({ value }: { value: string }) => ( +
+ {value} +
+ ), disableSortBy: true, disableFilters: true, }, @@ -271,16 +262,16 @@ const SqlMonitoring: React.FC = () => { ) return ( -
+
{/* Header */} -
-

SQL Monitoring Dashboard

+
+

SQL Monitoring

@@ -289,73 +280,73 @@ const SqlMonitoring: React.FC = () => {
) : ( -
+
{/* Overview Cards */} -
-
-
Total Tracked Queries
-
+
+
+
Total Queries
+
{statistics?.totalTrackedQueries || 0}
-
All time
+
All time
-
-
Active Queries
-
+
+
Active
+
{statistics?.activeQueries || 0}
-
Currently monitored
+
Currently monitored
-
-
Total Alerts
-
+
+
Alerts
+
{alerts?.length || 0}
-
All alerts
+
All alerts
-
-
Monitoring Status
-
+
+
Status
+
{health?.isEnabled ? 'Active' : 'Inactive'}
-
System status
+
System status
{/* Health Status */}
-
-

System Health

+
+

System Health

{health ? ( -
+
- Monitoring - - {health.isEnabled ? 'Enabled' : 'Disabled'} + Monitoring + + {health.isEnabled ? 'On' : 'Off'}
- Logging - - {health.loggingEnabled ? 'Enabled' : 'Disabled'} + Logging + + {health.loggingEnabled ? 'On' : 'Off'}
- Sentry - - {health.sentryEnabled ? 'Enabled' : 'Disabled'} + Sentry + + {health.sentryEnabled ? 'On' : 'Off'}
- Loop Detection - - {health.loopDetectionEnabled ? 'Enabled' : 'Disabled'} + Loop Detection + + {health.loopDetectionEnabled ? 'On' : 'Off'}
- Performance - - {health.performanceMonitoringEnabled ? 'Enabled' : 'Disabled'} + Performance + + {health.performanceMonitoringEnabled ? 'On' : 'Off'}
@@ -372,14 +363,14 @@ const SqlMonitoring: React.FC = () => { {/* Alerts Section */}
-
-

Recent Alerts

+
+

Recent Alerts

{alertsData.length === 0 ? ( -
- +
+ - No alerts found. The system is running smoothly! + No alerts found. System running smoothly!
) : (
@@ -396,17 +387,17 @@ const SqlMonitoring: React.FC = () => { {/* Loop Detection Statistics */}
-
-

Loop Detection Statistics

-

- Detailed performance metrics for tracked queries with loop detection +

+

Loop Detection

+

+ Performance metrics for tracked queries

{loopDetectionData.length === 0 ? ( -
- +
+ - No loop detection data available yet + No loop detection data available
) : (
@@ -423,17 +414,17 @@ const SqlMonitoring: React.FC = () => { {/* Context Statistics */}
-
-

Query Execution Counts

-

- Simple execution count tracking for all query patterns +

+

Query Counts

+

+ Simple execution count tracking

{contextStatsData.length === 0 ? ( -
- +
+ - No context statistics available yet + No context statistics available
) : (