Skip to content

Commit

Permalink
fix(ui): avoid infinite waiting when updating disks
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-c-wood authored and activeshadow committed Oct 1, 2024
1 parent ca1a374 commit 31ce034
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
18 changes: 7 additions & 11 deletions src/js/src/components/RunningExperiment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1541,24 +1541,20 @@
updateDisks (diskType="") {
this.disks = [];
this.isWaiting = true
this.$http.get( `disks?diskType=${diskType}` ).then(
response => {
response.json().then(
state => {
if ( state.disks.length == 0 ) {
this.isWaiting = true;
} else {
for ( let i = 0; i < state.disks.length; i++ ) {
this.disks.push( state.disks[i] );
}
this.isWaiting = false;
state => {
this.isWaiting = false
for ( let i = 0; i < state.disks.length; i++ ) {
this.disks.push( state.disks[i] );
}
}
);
}, err => {
console.log('Getting the disks failed with ' + err.status);
this.isWaiting = false;
this.errorNotification(err);
}
Expand Down
16 changes: 8 additions & 8 deletions src/js/src/components/StoppedExperiment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -671,23 +671,23 @@
},
updateDisks () {
this.isWaiting = true
this.$http.get( 'disks' + '?expName=' + this.$route.params.id ).then(
response => {
response.json().then(
state => {
if ( state.disks.length == 0 ) {
this.isWaiting = true;
} else {
for ( let i = 0; i < state.disks.length; i++ ) {
this.disks.push( state.disks[ i ] );
}
this.isWaiting = false
this.disks.sort()
this.isWaiting = false;
for ( let i = 0; i < state.disks.length; i++ ) {
this.disks.push( state.disks[i] );
}
this.disks.sort()
}
);
}, err => {
this.isWaiting = false
this.errorNotification(err);
}
);
Expand Down

0 comments on commit 31ce034

Please sign in to comment.