From 6a16981e9aefa1d3053c1823eff58067a84b3e3e Mon Sep 17 00:00:00 2001 From: "Randy Sugianto (Yuku)" Date: Thu, 25 May 2023 22:28:09 +0800 Subject: [PATCH 1/2] fix: Policy editor for "Cache Miss" actually modifies/reads "cacheHit" property (#159) Should be "cacheMiss" --- src/PolicyEditor/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PolicyEditor/index.jsx b/src/PolicyEditor/index.jsx index 608edef..307eba0 100644 --- a/src/PolicyEditor/index.jsx +++ b/src/PolicyEditor/index.jsx @@ -525,7 +525,7 @@ export class PolicyEditor extends Component { - {LogDetailSelector(this, "policy.logging.entries.cacheHit")} + {LogDetailSelector(this, "policy.logging.entries.cacheMiss")} {EffectiveValue(this, "logging.entries.cacheMiss")} From f82768917380cca6a792385189c61d07850dd906 Mon Sep 17 00:00:00 2001 From: Till Riedel Date: Mon, 5 Jun 2023 14:45:53 +0000 Subject: [PATCH 2/2] do not allow overlapping update requests from setInterval (#162) --- src/App.jsx | 9 +++++++-- src/SourcesTable.jsx | 36 ++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 4a9ca6e..6c92fd2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -26,6 +26,7 @@ export default class App extends Component { this.state = { runningTaskCount: 0, + isFetching: false, repoDescription: "", }; @@ -65,11 +66,15 @@ export default class App extends Component { } fetchTaskSummary() { + if( ! this.state.isFetching ) + { + this.setState({ isFetching: true }); axios.get('/api/v1/tasks-summary').then(result => { - this.setState({ runningTaskCount: result.data["RUNNING"] || 0 }); + this.setState({ isFetching: false, runningTaskCount: result.data["RUNNING"] || 0 }); }).catch(error => { - this.setState({ runningTaskCount: -1 }); + this.setState({ isFetching: false, runningTaskCount: -1 }); }); + } } componentWillUnmount() { diff --git a/src/SourcesTable.jsx b/src/SourcesTable.jsx index 4369379..29474ff 100644 --- a/src/SourcesTable.jsx +++ b/src/SourcesTable.jsx @@ -23,6 +23,7 @@ export class SourcesTable extends Component { this.state = { sources: [], isLoading: false, + isFetching: false, isRefreshing: false, error: null, @@ -51,22 +52,29 @@ export class SourcesTable extends Component { } fetchSourcesWithoutSpinner() { - axios.get('/api/v1/sources').then(result => { + if( ! this.state.isFetching ){ this.setState({ - localSourceName: result.data.localUsername + "@" + result.data.localHost, - multiUser: result.data.multiUser, - sources: result.data.sources, - isLoading: false, - isRefreshing: false, + isFetching: true, }); - }).catch(error => { - redirectIfNotConnected(error); - this.setState({ - error, - isRefreshing: false, - isLoading: false, - }); - }); + axios.get('/api/v1/sources').then(result => { + this.setState({ + localSourceName: result.data.localUsername + "@" + result.data.localHost, + multiUser: result.data.multiUser, + sources: result.data.sources, + isLoading: false, + isFetching: false, + isRefreshing: false, + }); + }).catch(error => { + redirectIfNotConnected(error); + this.setState({ + error, + isRefreshing: false, + isFetching: false, + isLoading: false, + }); + }) + } } selectOwner(h) {