Skip to content

Commit

Permalink
At #538 Card View Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeheesnet committed Oct 21, 2024
1 parent 64cba83 commit afa280d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
16 changes: 13 additions & 3 deletions frontend/src/device_management/components/PredictionTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ import {PREDICTION_TOOLTIP_HEADER} from 'src/device_management/constants/predict

interface Props extends PredictionTooltipNode {
status?: string
isBlink?: boolean
isCritical?: boolean
isWarning?: boolean
isSelected?: boolean
}
function PredictionTooltip({
cpu,
memory,
name,
traffic,
isBlink,
isCritical,
isWarning,
isSelected = true,
}: Props) {
const {
Expand All @@ -39,7 +41,15 @@ function PredictionTooltip({
style={{minWidth: TOOLTIP_WIDTH}}
className={`prediction-tooltip-content ${isSelected ? '' : 'grey'}`}
>
<div className={isBlink ? `prediction-tooltip--blink` : ''}>
<div
className={
isCritical
? `prediction-tooltip--blink`
: isWarning
? 'blink-opacity-animation-warning'
: ''
}
>
<Table>
<TableBody>
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FancyScrollbar from 'src/shared/components/FancyScrollbar'
import PredictionTooltip from 'src/device_management/components/PredictionTooltip'

// Type
import {HexagonInputData} from 'src/types'
import {AlertHostList, HexagonInputData} from 'src/types'

// Utils
import {statusCal} from 'src/device_management/utils'
Expand All @@ -18,7 +18,7 @@ interface Props {
onHexbinClick: (host: string, filteredHexbinHost?: string) => void
//redux
filteredHexbinHost?: string
alertHostList?: string[]
alertHostList?: AlertHostList
}
function PredictionTooltipView({
inputData,
Expand All @@ -45,7 +45,8 @@ function PredictionTooltipView({
traffic={tooltip.traffic}
name={tooltip.name}
status={statusCal((tooltip.cpu + tooltip.memory) / 2)}
isBlink={alertHostList.includes(tooltip.name)}
isCritical={alertHostList.critical.includes(tooltip.name)}
isWarning={alertHostList.warning.includes(tooltip.name)}
isSelected={filteredHexbinHost === tooltip.name}
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/device_management/containers/AiRoutePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ const AiRoutePage = (props: Props) => {
group?: string
}) => {
const {milliseconds, group} = option
console.log(milliseconds)
group
? onChooseCloudAutoRefresh({[group]: milliseconds})
: onChooseAutoRefresh(milliseconds)
Expand Down

0 comments on commit afa280d

Please sign in to comment.