File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed
Pages/Authenticated/Components/Quality Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ import { tequila } from '../../../../api/tequila'
1111import styled from 'styled-components'
1212import { Link } from '../../../../Components/Common/Link'
1313import { NODE_QUALITY } from '../../../../constants/urls'
14+ import { useAppSelector } from '../../../../commons/hooks'
15+ import { selectors } from '../../../../redux/selectors'
1416
15- type IndicatorVariants = 'good' | 'normal' | 'poor'
17+ type IndicatorVariants = 'good' | 'normal' | 'poor' | 'unknown'
1618interface IndicatorProps {
1719 $variant : IndicatorVariants
1820}
@@ -35,6 +37,8 @@ const Tooltip = styled.div`
3537
3638export const Quality = ( ) => {
3739 const [ quality , setQuality ] = useState ( 0 )
40+ const services = useAppSelector ( selectors . runningServices )
41+ const anyOnline = services . length > 0
3842
3943 useEffect ( ( ) => {
4044 tequila . api . provider . quality ( ) . then ( ( r ) => setQuality ( r . quality ) )
@@ -74,7 +78,7 @@ export const Quality = () => {
7478 </ Link >
7579 </ Tooltip >
7680 }
77- content = { < Indicator $variant = { resolveVariant ( quality ) } /> }
81+ content = { < Indicator $variant = { anyOnline ? resolveVariant ( quality ) : 'unknown' } /> }
7882 />
7983 )
8084}
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ const dark: Omit<Theme, 'common'> = {
169169 good : themeCommon . colorGreen ,
170170 normal : themeCommon . colorWarning ,
171171 poor : themeCommon . colorRed ,
172+ unknown : themeCommon . colorGrayBlue2 ,
172173 } ,
173174 } ,
174175 adminPanel : {
Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ const light: Omit<Theme, 'common'> = {
166166 good : themeCommon . colorGreen ,
167167 normal : themeCommon . colorWarning ,
168168 poor : themeCommon . colorRed ,
169+ unknown : themeCommon . colorGrayBlue2 ,
169170 } ,
170171 } ,
171172 adminPanel : {
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export type Theme = {
174174 good : string
175175 normal : string
176176 poor : string
177+ unknown : string
177178 }
178179 }
179180 notifications : {
You can’t perform that action at this time.
0 commit comments