@@ -11,6 +11,7 @@ const NetworkStore = {
11
11
networkSettings : [ ] ,
12
12
selectedInterfaceId : '' , // which tab is selected
13
13
selectedInterfaceIndex : 0 , // which tab is selected
14
+ isTableBusy : false ,
14
15
} ,
15
16
getters : {
16
17
dchpEnabledState : ( state ) => state . dchpEnabledState ,
@@ -19,6 +20,7 @@ const NetworkStore = {
19
20
networkSettings : ( state ) => state . networkSettings ,
20
21
selectedInterfaceId : ( state ) => state . selectedInterfaceId ,
21
22
selectedInterfaceIndex : ( state ) => state . selectedInterfaceIndex ,
23
+ isTableBusy : ( state ) => state . isTableBusy ,
22
24
} ,
23
25
mutations : {
24
26
setDchpEnabledState : ( state , dchpEnabledState ) =>
@@ -39,6 +41,7 @@ const NetworkStore = {
39
41
( state . selectedInterfaceId = selectedInterfaceId ) ,
40
42
setSelectedInterfaceIndex : ( state , selectedInterfaceIndex ) =>
41
43
( state . selectedInterfaceIndex = selectedInterfaceIndex ) ,
44
+ setIsTableBusy : ( state , isTableBusy ) => ( state . isTableBusy = isTableBusy ) ,
42
45
setNetworkSettings : ( state , data ) => {
43
46
state . networkSettings = data . map ( ( { data } ) => {
44
47
const {
@@ -121,10 +124,14 @@ const NetworkStore = {
121
124
console . log ( 'Network Data:' , error ) ;
122
125
} ) ;
123
126
} ,
124
- async getEthernetDataAfterDelay ( { dispatch } ) {
127
+ async getEthernetDataAfterDelay ( { commit, dispatch } ) {
128
+ commit ( 'setIsTableBusy' , true ) ;
125
129
setTimeout ( ( ) => {
126
130
dispatch ( 'getEthernetData' ) ;
127
131
} , 10000 ) ;
132
+ setTimeout ( ( ) => {
133
+ commit ( 'setIsTableBusy' , false ) ;
134
+ } , 15000 ) ;
128
135
} ,
129
136
async saveDomainNameState ( { commit, state, dispatch } , domainState ) {
130
137
commit ( 'setDomainNameState' , domainState ) ;
@@ -295,10 +302,8 @@ const NetworkStore = {
295
302
. then ( ( ) => {
296
303
// Getting Ethernet data here so that the toggle gets updated
297
304
dispatch ( 'getEthernetData' ) ;
298
- setTimeout ( ( ) => {
299
- // Getting Ethernet data here so that the IPv6 table gets updated
300
- dispatch ( 'getEthernetData' ) ;
301
- } , 10000 ) ;
305
+ // Getting Ethernet data here so that the IPv6 table gets updated
306
+ dispatch ( 'getEthernetDataAfterDelay' ) ;
302
307
} )
303
308
. then ( ( ) => {
304
309
return i18n . t ( 'pageNetwork.toast.successSaveNetworkSettings' , {
@@ -459,7 +464,12 @@ const NetworkStore = {
459
464
`/redfish/v1/Managers/bmc/EthernetInterfaces/${ state . selectedInterfaceId } ` ,
460
465
{ IPv4StaticAddresses : newIpv4Array }
461
466
)
462
- . then ( dispatch ( 'getEthernetData' ) )
467
+ . then ( ( ) => {
468
+ // Getting Ethernet data here so that the address is deleted immediately
469
+ dispatch ( 'getEthernetData' ) ;
470
+ // Getting Ethernet data here so that the IPv4 table gets updated
471
+ dispatch ( 'getEthernetDataAfterDelay' ) ;
472
+ } )
463
473
. then ( ( ) => {
464
474
return i18n . t ( 'pageNetwork.toast.successDeletingIpv4Server' ) ;
465
475
} )
@@ -484,7 +494,12 @@ const NetworkStore = {
484
494
`/redfish/v1/Managers/bmc/EthernetInterfaces/${ state . selectedInterfaceId } ` ,
485
495
{ IPv6StaticAddresses : newIpv6Array }
486
496
)
487
- . then ( dispatch ( 'getEthernetData' ) )
497
+ . then ( ( ) => {
498
+ // Getting Ethernet data here so that the address is deleted immediately
499
+ dispatch ( 'getEthernetData' ) ;
500
+ // Getting Ethernet data here so that the IPv6 table gets updated
501
+ dispatch ( 'getEthernetDataAfterDelay' ) ;
502
+ } )
488
503
. then ( ( ) => {
489
504
return i18n . t ( 'pageNetwork.toast.successDeletingIpv6Server' ) ;
490
505
} )
@@ -513,7 +528,12 @@ const NetworkStore = {
513
528
`/redfish/v1/Managers/bmc/EthernetInterfaces/${ state . selectedInterfaceId } ` ,
514
529
{ IPv6StaticDefaultGateways : newIpv6Array }
515
530
)
516
- . then ( dispatch ( 'getEthernetData' ) )
531
+ . then ( ( ) => {
532
+ // Getting Ethernet data here so that the address is deleted immediately
533
+ dispatch ( 'getEthernetData' ) ;
534
+ // Getting Ethernet data here so that the table gets updated
535
+ dispatch ( 'getEthernetDataAfterDelay' ) ;
536
+ } )
517
537
. then ( ( ) => {
518
538
return i18n . t (
519
539
'pageNetwork.toast.successDeletingIpv6StaticDefaultGateway'
0 commit comments