diff --git a/src/components/wired-tools/WiredCreatorToolsView.tsx b/src/components/wired-tools/WiredCreatorToolsView.tsx index c189cf5..7c188fc 100644 --- a/src/components/wired-tools/WiredCreatorToolsView.tsx +++ b/src/components/wired-tools/WiredCreatorToolsView.tsx @@ -10,6 +10,7 @@ import { DIRECTION_NAMES, EDITABLE_FURNI_VARIABLES, EDITABLE_USER_VARIABLES, INS import { createEmptyMonitorSnapshot, formatMonitorHistoryOccurrence, formatMonitorLatestOccurrence, formatMonitorSource, formatVariableTimestamp, getHotelDateTimeParts, getHotelTimeFormatter, normalizeMonitorReason } from './WiredCreatorTools.helpers'; import { HotelDateTimeParts, InspectionElementButton, InspectionElementType, InspectionFurniLiveState, InspectionFurniSelection, InspectionUserLiveState, InspectionUserSelection, InspectionUserTeamData, InspectionVariable, ManagedHolderVariableEntry, MonitorLog, MonitorLogDetails, MonitorSnapshot, MonitorStat, ParsedWallLocation, TeamEffectData, VariableDefinition, VariableHighlightOverlay, VariableHighlightTarget, VariableManageEntry, VariableTextValue, VariablesElementButton, VariablesElementType, WiredToolsTab } from './WiredCreatorTools.types'; import { WiredInspectionTabView } from './WiredInspectionTabView'; +import { WiredMonitorTabView } from './WiredMonitorTabView'; import { WiredToolsSettingsTabView } from './WiredToolsSettingsTabView'; import { WiredVariablesTabView } from './WiredVariablesTabView'; @@ -3073,182 +3074,15 @@ export const WiredCreatorToolsView: FC<{}> = () => { (activeTab === 'monitor') && -
-
-
-
- Statistics: - -
- { monitorStats.map(stat => ( -
- { stat.label }: - { stat.value } -
- )) } -
-
- Monitor preview -
-
-
- Logs: -
- - - - - - - - - - - { monitorLogs.map((log, index) => ( - openMonitorLogDetails(log.type, { - severity: log.category, - amount: log.amount, - latest: log.latest, - reason: log.latestReason, - sourceLabel: log.latestSourceLabel, - sourceId: log.latestSourceId - }) }> - - - - - - )) } - -
TypeSeverityAmountLatest occurrence
{ log.type }{ log.category }{ log.amount }{ log.latest }
-
-
- - -
-
- { false && isMonitorHistoryOpen && -
-
-
- Wired Monitor Logs - -
-
-
- Severity: - { [ 'ALL', 'WARNING', 'ERROR' ].map(severity => ( - - )) } - Type: - -
-
- - - - - - - - - - - - { !filteredMonitorHistoryRows.length && - - - } - { filteredMonitorHistoryRows.map((row, index) => ( - openMonitorLogDetails(row.type, { - severity: row.category, - occurredAt: row.occurredAt, - reason: row.reason, - sourceLabel: row.sourceLabel, - sourceId: row.sourceId - }) }> - - - - - - - )) } - -
TypeSeverityTriggerMotivationOccurred at
No log history for the current filters
{ row.type }{ row.category }{ formatMonitorSource(row.sourceLabel, row.sourceId) }{ row.reason }{ row.occurredAt }
-
-
-
-
} - { false && isMonitorInfoOpen && -
-
-
- Wired Monitor Information - -
-
- { monitorInfoSections.map(section => ( -
- { section.title } - { section.lines.map((line, index) => ( - { line } - )) } -
- )) } -
-
-
} - { false && !!selectedMonitorErrorInfo && -
-
-
- Wired Error Information - -
-
-
- { selectedMonitorErrorInfo.title } - - { selectedMonitorLogDetails?.severity ?? selectedMonitorErrorInfo.severity } - -
- { !!selectedMonitorLogDetails && -
- Trigger: { selectedMonitorDetailSource } - Motivation: { selectedMonitorLogDetails.reason } - { !!selectedMonitorLogDetails.amount && Amount: { selectedMonitorLogDetails.amount } } - { !!selectedMonitorLogDetails.latest && Latest occurrence: { selectedMonitorLogDetails.latest } } - { !!selectedMonitorLogDetails.occurredAt && Occurred at: { selectedMonitorLogDetails.occurredAt } } -
} - { selectedMonitorErrorInfo.description.map((paragraph, index) => ( - { paragraph } - )) } -
-
-
} -
} + setIsMonitorInfoOpen(true) } + onOpenMonitorHistory={ () => setIsMonitorHistoryOpen(true) } + onClearMonitorLogs={ clearMonitorLogs } + onOpenMonitorLogDetails={ openMonitorLogDetails } + /> } { (activeTab === 'inspection') && void; + onOpenMonitorHistory: () => void; + onClearMonitorLogs: () => void; + onOpenMonitorLogDetails: (type: string, details: Pick) => void; +} + +/** + * The "Monitor" tab body of WiredCreatorToolsView, extracted from the + * parent's inline JSX. The three modal overlays that used to live + * inside this block were dead code (`{ false && ... }`) and have been + * dropped; the live versions of those modals (Monitor History, Monitor + * Info, Error Info) are mounted outside the NitroCardView by the parent. + */ +export const WiredMonitorTabView = (props: WiredMonitorTabViewProps) => +{ + const { + monitorStats, + monitorLogs, + monitorHistoryRows, + onOpenMonitorInfo, + onOpenMonitorHistory, + onClearMonitorLogs, + onOpenMonitorLogDetails + } = props; + + return ( +
+
+
+
+ Statistics: + +
+ { monitorStats.map(stat => ( +
+ { stat.label }: + { stat.value } +
+ )) } +
+
+ Monitor preview +
+
+
+ Logs: +
+ + + + + + + + + + + { monitorLogs.map((log, index) => ( + onOpenMonitorLogDetails(log.type, { + severity: log.category, + amount: log.amount, + latest: log.latest, + reason: log.latestReason, + sourceLabel: log.latestSourceLabel, + sourceId: log.latestSourceId + }) }> + + + + + + )) } + +
TypeSeverityAmountLatest occurrence
{ log.type }{ log.category }{ log.amount }{ log.latest }
+
+
+ + +
+
+
+ ); +};