Commit d4563acd authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

limits number of pages #128 for gene list

parent 28675317
Pipeline #31601 passed with stages
in 3 minutes and 22 seconds
......@@ -240,7 +240,13 @@
@input="getGenes"
></v-pagination>
</div>
<v-subheader>{{count}} genes found</v-subheader>
<v-subheader>
{{count}} genes found
<v-spacer></v-spacer>
<span v-if="tooManyPages" class="font-italic font-weight-light">
Too many pages to be displayed (limited to {{maxNumberPages}}). You may want to apply filters to reduce pages number.
</span>
</v-subheader>
</v-card>
</v-flex>
</v-layout>
......
......@@ -12,6 +12,8 @@ export default {
rowsPerPage: 20,
},
pageNumber: 1,
maxNumberPages: 50000,
tooManyPages: false,
// Filters
// - Gene info
geneSource: 'all',
......@@ -91,10 +93,15 @@ export default {
return Object.keys(this.taxItems).sort();
},
pageTotalNumber() {
var numberPages = Math.floor(this.count/this.pagination.rowsPerPage);
if (numberPages > this.maxNumberPages) {
this.tooManyPages = true;
return this.maxNumberPages;
}
if ((this.count % this.pagination.rowsPerPage) > 0) {
return Math.floor(this.count/this.pagination.rowsPerPage) + 1;
return numberPages + 1;
}
return Math.floor(this.count/this.pagination.rowsPerPage);
return numberPages;
}
},
mounted() {
......@@ -188,6 +195,7 @@ export default {
},
runNewSearch() {
this.requestDone = false;
this.tooManyPages = false;
this.pageNumber = 1;
this.getGenes();
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment