1
- import { Box , Button , Divider , Loader , Modal , NumberInput , Stack , TextInput } from '@mantine/core' ;
1
+ import { Box , Button , Divider , Group , Loader , Modal , NumberInput , px , Stack , TextInput } from '@mantine/core' ;
2
2
import classes from '../../styles/Management.module.css' ;
3
3
import { Text } from '@mantine/core' ;
4
4
import { useAppStore } from '@/layouts/MainLayout/providers/AppProvider' ;
5
5
import { useForm } from '@mantine/form' ;
6
6
import _ from 'lodash' ;
7
7
import { useCallback , useEffect , useState } from 'react' ;
8
8
import { useStreamStore } from '../../providers/StreamProvider' ;
9
- import { IconCheck , IconTrash , IconX } from '@tabler/icons-react' ;
9
+ import { IconCheck , IconTrash , IconX , IconReload } from '@tabler/icons-react' ;
10
10
import { sanitizeBytes , convertGibToBytes } from '@/utils/formatBytes' ;
11
11
import timeRangeUtils from '@/utils/timeRangeUtils' ;
12
12
import ErrorView from './ErrorView' ;
13
13
import RestrictedView from '@/components/Misc/RestrictedView' ;
14
+ import IconButton from '@/components/Button/IconButton' ;
14
15
15
16
const { formatDateWithTimezone } = timeRangeUtils ;
16
17
18
+ const renderRefreshIcon = ( ) => < IconReload size = { px ( '1rem' ) } stroke = { 1.5 } /> ;
19
+
17
20
const Header = ( ) => {
18
21
return (
19
22
< Stack className = { classes . headerContainer } style = { { minHeight : '3rem' , maxHeight : '3rem' } } >
@@ -168,6 +171,7 @@ const DeleteHotTierModal = (props: {
168
171
169
172
const HotTierConfig = ( props : {
170
173
updateHotTierInfo : ( { size } : { size : string } ) => void ;
174
+ refetchHotTierInfo : ( ) => void ;
171
175
deleteHotTierInfo : ( { onSuccess } : { onSuccess : ( ) => void } ) => void ;
172
176
isDeleting : boolean ;
173
177
isUpdating : boolean ;
@@ -228,9 +232,17 @@ const HotTierConfig = (props: {
228
232
/>
229
233
< Stack style = { { flexDirection : 'row' , justifyContent : 'space-between' } } gap = { 8 } >
230
234
< Text className = { classes . fieldTitle } > Hot Tier Storage Size</ Text >
231
- { ! hotTierNotSet && streamType === 'UserDefined' ? (
235
+ < Group style = { { justifyContent : 'end' } } >
236
+ < IconButton
237
+ size = { 38 }
238
+ renderIcon = { renderRefreshIcon }
239
+ onClick = { props . refetchHotTierInfo }
240
+ tooltipLabel = "Refresh now"
241
+ />
242
+ { /* {!hotTierNotSet && streamType === 'UserDefined' ? ( */ }
232
243
< IconTrash onClick = { openDeleteModal } stroke = { 1.2 } size = "1.2rem" className = { classes . deleteIcon } />
233
- ) : null }
244
+ { /* ) : null} */ }
245
+ </ Group >
234
246
</ Stack >
235
247
< Stack style = { { flexDirection : 'row' , justifyContent : 'space-between' , height : '3.8rem' } } >
236
248
< Stack gap = { 4 } style = { { ...( hotTierNotSet ? { display : 'none' } : { } ) } } >
@@ -310,6 +322,7 @@ const Settings = (props: {
310
322
isLoading : boolean ;
311
323
updateRetentionConfig : ( { config } : { config : any } ) => void ;
312
324
updateHotTierInfo : ( { size } : { size : string } ) => void ;
325
+ refetchHotTierInfo : ( ) => void ;
313
326
deleteHotTierInfo : ( { onSuccess } : { onSuccess : ( ) => void } ) => void ;
314
327
isDeleting : boolean ;
315
328
isUpdating : boolean ;
@@ -333,6 +346,7 @@ const Settings = (props: {
333
346
) : (
334
347
< >
335
348
< HotTierConfig
349
+ refetchHotTierInfo = { props . refetchHotTierInfo }
336
350
updateHotTierInfo = { props . updateHotTierInfo }
337
351
deleteHotTierInfo = { props . deleteHotTierInfo }
338
352
isDeleting = { props . isDeleting }
0 commit comments