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

change loading for gene table

parent d4563acd
Pipeline #31608 passed with stages
in 3 minutes and 23 seconds
......@@ -189,64 +189,65 @@
</v-expansion-panel-content>
</v-expansion-panel>
<!-- Table -->
<v-list v-if="!loadTable">
<v-data-table
:rows-per-page-items="rowsPerPageItems"
:pagination.sync="pagination"
:headers="headers"
:items="genes"
hide-actions
>
<template v-slot:items="props">
<td>
<router-link :to="/gene-detail/ + props.item.gene_id">{{ props.item.gene_id }}</router-link>
</td>
<td>{{ props.item.name }}</td>
<td class="text-xs">{{ props.item.length }}</td>
<td class="text-xs">
{{ props.item.taxonomy }}
<v-btn :href="props.item.tax_url" icon flat small target="_blank" class="taxonomy--text mt-1 ml-0" v-if="props.item.taxonomy">
<v-icon small>
open_in_new
</v-icon>
</v-btn>
</td>
<td class="text-xs">
{{ props.item.kegg }}
<v-btn :href="props.item.kegg_url" icon flat small target="_blank" class="kegg--text mt-1 ml-0" v-if="props.item.kegg">
<v-icon small>
open_in_new
</v-icon>
</v-btn>
</td>
<td class="text-xs">{{ props.item.eggnog }}</td>
<td class="text-xs">{{ props.item.source }}</td>
</template>
</v-data-table>
</v-list>
<!-- Loading bar -->
<v-card class="text-xs-center" v-if="!requestDone">
<v-progress-circular
indeterminate
color="secondary"
class="ma-2"
></v-progress-circular>
<v-progress-linear
indeterminate
height="4"
color="secondary"
></v-progress-linear>
</v-card>
<v-list v-else>
<v-data-table
:rows-per-page-items="rowsPerPageItems"
:pagination.sync="pagination"
:headers="headers"
:items="genes"
hide-actions
>
<template v-slot:items="props">
<td>
<router-link :to="/gene-detail/ + props.item.gene_id">{{ props.item.gene_id }}</router-link>
</td>
<td>{{ props.item.name }}</td>
<td class="text-xs">{{ props.item.length }}</td>
<td class="text-xs">
{{ props.item.taxonomy }}
<v-btn :href="props.item.tax_url" icon flat small target="_blank" class="taxonomy--text mt-1 ml-0" v-if="props.item.taxonomy">
<v-icon small>
open_in_new
</v-icon>
</v-btn>
</td>
<td class="text-xs">
{{ props.item.kegg }}
<v-btn :href="props.item.kegg_url" icon flat small target="_blank" class="kegg--text mt-1 ml-0" v-if="props.item.kegg">
<v-icon small>
open_in_new
</v-icon>
</v-btn>
</td>
<td class="text-xs">{{ props.item.eggnog }}</td>
<td class="text-xs">{{ props.item.source }}</td>
</template>
</v-data-table>
</v-list>
<v-card flat>
<div class="text-xs-center" v-if="count">
<v-pagination
v-model="pageNumber"
:length="pageTotalNumber"
:total-visible="7"
@input="getGenes"
></v-pagination>
</div>
<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>
<div class="text-xs-center" v-if="count">
<v-pagination
v-model="pageNumber"
:length="pageTotalNumber"
:total-visible="7"
@input="getGenes"
></v-pagination>
</div>
<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>
......
......@@ -26,6 +26,8 @@ export default {
taxChoice: null,
// - Function
functionID: null,
// Information about request
loadTable: true,
requestDone: false,
};
},
......@@ -119,6 +121,7 @@ export default {
return taxLevelsFormatted;
},
getGenes() {
this.requestDone = false;
axios.get('/api/catalog/v1/genes', {
params: this.qParams,
headers: {
......@@ -149,6 +152,7 @@ export default {
this.genes = genes;
this.count = response.data.count;
this.requestDone = true;
this.loadTable = false;
})
.catch((error) => {
console.error(error);
......@@ -194,7 +198,7 @@ export default {
this.getTaxoPresence();
},
runNewSearch() {
this.requestDone = false;
this.loadTable = true;
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