From b5cb18172a224a3bb9bd2f0d1e4317ee9555e016 Mon Sep 17 00:00:00 2001 From: Alain Mazy Date: Thu, 19 Dec 2024 09:36:57 +0100 Subject: [PATCH] PageLoadSize --- Plugin/DefaultConfiguration.json | 7 ++++++- .../src/components/SeriesDetails.vue | 6 ++---- WebApplication/src/components/SideBar.vue | 6 ++---- WebApplication/src/components/StudyList.vue | 20 +++++++++--------- WebApplication/src/orthancApi.js | 13 ++++++++---- .../src/store/modules/configuration.js | 21 +++++-------------- release-notes.md | 7 ++++++- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Plugin/DefaultConfiguration.json b/Plugin/DefaultConfiguration.json index 07253f1..6b1c19c 100644 --- a/Plugin/DefaultConfiguration.json +++ b/Plugin/DefaultConfiguration.json @@ -118,7 +118,12 @@ "wsi" ], - "MaxStudiesDisplayed": 100, // The maximum number of studies displayed in the study list + "MaxStudiesDisplayed": 100, // The maximum number of studies displayed in the study list. + // From v 1.7.0, this option is not used anymore in the local study list when using + // a DB backend that supports ExtendedFind (SQLite and PostgreSQL) + // but is still used in the DicomWeb queries. + "PageLoadSize": 50, // The number of items that are loaded when scrolling the study or instance list. + // Only applicable with a DB backend that supports ExtendedFind. "MaxMyJobsHistorySize": 5, // The maximum number of jobs appearing under 'my jobs' in side bar (0 = unlimited) "StudyListSearchMode": "search-as-you-type",// mode to trigger a search in the StudyList. Accepted values: 'search-as-you-type' or 'search-button' diff --git a/WebApplication/src/components/SeriesDetails.vue b/WebApplication/src/components/SeriesDetails.vue index 5589925..63e2126 100644 --- a/WebApplication/src/components/SeriesDetails.vue +++ b/WebApplication/src/components/SeriesDetails.vue @@ -23,12 +23,10 @@ export default { uiOptions: state => state.configuration.uiOptions, studiesSourceType: state => state.studies.sourceType, studiesRemoteSource: state => state.studies.remoteSource, + hasExtendedFind: state => state.configuration.hasExtendedFind }), - ...mapGetters([ - 'configuration/hasExtendedFind', // -> this['configuration/hasExtendedFind'] - ]), useExtendedInstanceList() { - return this['configuration/hasExtendedFind'] && this.studiesSourceType == SourceType.LOCAL_ORTHANC; + return this.hasExtendedFind && this.studiesSourceType == SourceType.LOCAL_ORTHANC; } }, async mounted() { diff --git a/WebApplication/src/components/SideBar.vue b/WebApplication/src/components/SideBar.vue index 65bcb3c..1bb3eb8 100644 --- a/WebApplication/src/components/SideBar.vue +++ b/WebApplication/src/components/SideBar.vue @@ -36,10 +36,8 @@ export default { configuration: state => state.configuration, studiesSourceType: state => state.studies.sourceType, studiesRemoteSource: state => state.studies.remoteSource, + hasExtendedFind: state => state.configuration.hasExtendedFind }), - ...mapGetters([ - 'configuration/hasExtendedFind', // -> this['configuration/hasExtendedFind'] - ]), customLogoUrl() { if (this.hasCustomLogo && this.configuration.customLogoUrl) { return this.customLogoUrl; @@ -124,7 +122,7 @@ export default { this.labelsStudyCount[label] = null; } } - if (this['configuration/hasExtendedFind']) { + if (this.hasExtendedFind) { if (this.uiOptions.EnableLabelsCount) { for (const [k, v] of Object.entries(this.labelsStudyCount)) { if (v == null) { diff --git a/WebApplication/src/components/StudyList.vue b/WebApplication/src/components/StudyList.vue index f364c2a..c2a003d 100644 --- a/WebApplication/src/components/StudyList.vue +++ b/WebApplication/src/components/StudyList.vue @@ -108,14 +108,14 @@ export default { selectedStudiesIds: state => state.studies.selectedStudiesIds, isSearching: state => state.studies.isSearching, statistics: state => state.studies.statistics, + hasExtendedFind: state => state.configuration.hasExtendedFind, + hasExtendedChanges: state => state.configuration.hasExtendedChanges }), ...mapGetters([ 'studies/isFilterEmpty', // -> this['studies/isFilterEmpty'] - 'configuration/hasExtendedFind', // -> this['configuration/hasExtendedFind'] - 'configuration/hasExtendedChanges', // -> this['configuration/hasExtendedChanges'] ]), notShowingAllResults() { - if (this.sourceType == SourceType.LOCAL_ORTHANC) { + if (this.sourceType == SourceType.LOCAL_ORTHANC && this.hasExtendedFind) { if (this.studiesIds.length >= this.statistics.CountStudies) { return false; } @@ -326,7 +326,7 @@ export default { } }, isOrderable(tagName) { - if (this.sourceType != SourceType.LOCAL_ORTHANC || !this['configuration/hasExtendedFind']) { + if (this.sourceType != SourceType.LOCAL_ORTHANC || !this.hasExtendedFind) { return false; } @@ -739,12 +739,12 @@ export default { await this.$router.replace(newUrl); }, async extendStudyList() { - if (this.sourceType == SourceType.LOCAL_ORTHANC && this['configuration/hasExtendedFind']) { + if (this.sourceType == SourceType.LOCAL_ORTHANC && this.hasExtendedFind) { await this.$store.dispatch('studies/extendFilteredStudies'); } }, async reloadStudyList() { - if (this.sourceType == SourceType.LOCAL_ORTHANC && this['configuration/hasExtendedFind']) { + if (this.sourceType == SourceType.LOCAL_ORTHANC && this.hasExtendedFind) { await this.$store.dispatch('studies/clearStudies'); await this.$store.dispatch('studies/reloadFilteredStudies'); } else { @@ -755,8 +755,8 @@ export default { await this.$store.dispatch('studies/clearStudies'); if (this.uiOptions.StudyListContentIfNoSearch == "empty") { return; - } else if (this.uiOptions.StudyListContentIfNoSearch == "most-recents" && this['configuration/hasExtendedFind']) { - const studies = await api.getMostRecentStudies((this.filterLabels.length > 0 ? this.filterLabels[0] : null)); + } else if (this.uiOptions.StudyListContentIfNoSearch == "most-recents" && this.hasExtendedFind) { + const studies = await api.getMostRecentStudiesExtended((this.filterLabels.length > 0 ? this.filterLabels[0] : null)); for (const study of studies) { this.$store.dispatch('studies/addStudy', { studyId: study["ID"], study: study, reloadStats: false }); } @@ -792,7 +792,7 @@ export default { async loadStudiesFromChange(toChangeId, limit) { let changes; let changesResponse; - if (this['configuration/hasExtendedChanges']) { + if (this.hasExtendedChanges) { changesResponse = await api.getChangesExtended(toChangeId, limit, ["NewStudy", "StableStudy"]); changes = changesResponse["Changes"]; } else { @@ -827,7 +827,7 @@ export default { } if (!this.shouldStopLoadingLatestStudies) { if (this.latestStudiesIds.size < this.statistics.CountStudies) { - if (this['configuration/hasExtendedChanges']) { + if (this.hasExtendedChanges) { if (!changesResponse["Done"]) { setTimeout(() => {this.loadStudiesFromChange(changesResponse["First"], 1000)}, 1); } diff --git a/WebApplication/src/orthancApi.js b/WebApplication/src/orthancApi.js index 0726486..7899e65 100644 --- a/WebApplication/src/orthancApi.js +++ b/WebApplication/src/orthancApi.js @@ -78,9 +78,14 @@ export default { await this.cancelFindStudies(); window.axiosFindStudiesAbortController = new AbortController(); + let limit = store.state.configuration.uiOptions.MaxStudiesDisplayed; + if (store.state.configuration.hasExtendedFind) { + limit = store.state.configuration.uiOptions.PageLoadSize; + } + let payload = { "Level": "Study", - "Limit": store.state.configuration.uiOptions.MaxStudiesDisplayed, + "Limit": limit, "Query": filterQuery, "RequestedTags": store.state.configuration.requestedTagsForStudyList, "Expand": true @@ -104,13 +109,13 @@ export default { signal: window.axiosFindStudiesAbortController.signal })).data; }, - async getMostRecentStudies(label) { + async getMostRecentStudiesExtended(label) { await this.cancelFindStudies(); window.axiosFindStudiesAbortController = new AbortController(); let payload = { "Level": "Study", - "Limit": store.state.configuration.uiOptions.MaxStudiesDisplayed, + "Limit": store.state.configuration.uiOptions.PageLoadSize, "Query": {}, "RequestedTags": store.state.configuration.requestedTagsForStudyList, "OrderBy" : [{ @@ -341,7 +346,7 @@ export default { return (await axios.get(orthancApiUrl + "series/" + orthancId + "/instances")).data; }, async getSeriesInstancesExtended(orthancId, since) { - const limit = store.state.configuration.uiOptions.MaxStudiesDisplayed; + const limit = store.state.configuration.uiOptions.PageLoadSize; let payload = { "Level": "Instance", "Limit": limit, diff --git a/WebApplication/src/store/modules/configuration.js b/WebApplication/src/store/modules/configuration.js index b0bcbfa..d6a32c1 100644 --- a/WebApplication/src/store/modules/configuration.js +++ b/WebApplication/src/store/modules/configuration.js @@ -19,26 +19,13 @@ const state = () => ({ ohifDataSource: "dicom-web", customLogoUrl: null, hasCustomLogo: false, - requestedTagsForStudyList: [] + requestedTagsForStudyList: [], + hasExtendedFind: false, + hasExtendedChanges: false, }) ///////////////////////////// GETTERS const getters = { - hasExtendedFind: (state) => { - if ("Capabilities" in state.system){ - return state.system.Capabilities.HasExtendedFind; - } else { - return false; - } - }, - hasExtendedChanges: (state) => { - if ("Capabilities" in state.system){ - return state.system.Capabilities.HasExtendedChanges; - } else { - return false; - } - - } } ///////////////////////////// MUTATIONS @@ -82,6 +69,8 @@ const mutations = { }, setSystem(state, { system }) { state.system = system; + state.hasExtendedFind = "Capabilities" in state.system && state.system.Capabilities.HasExtendedFind; + state.hasExtendedChanges = "Capabilities" in state.system && state.system.Capabilities.HasExtendedChanges; }, setLoaded(state) { state.loaded = true; diff --git a/release-notes.md b/release-notes.md index 7f6d472..e73ab68 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,4 +1,4 @@ -Pending changes in the mainline +Pending changes in the mainline (upcoming 1.7.0) =============================== Changes: @@ -8,6 +8,11 @@ Changes: - Optimized loading of "most-recent" studies - Load the following studies when scrolling to the bottom of the current list. - New configuration "EnableLabelsCount" to enable/disable the display of the number of studies with each label. + - The "MaxStudiesDisplayed" configuration is not taken into account anymore for + the local study list since we have implemented "infinite-scroll". However, the option + is still used when performing remote DicomWEB queries. + - New configuration "PageLoadSize" that defines the number of items that are loaded when scrolling the study or instance list. + - Disable some UI components on ReadOnly systems. - The study list header is now sticking on top of the screen.