Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
metagenedb
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Metagenomics
metagenedb
Commits
27c8106e
Commit
27c8106e
authored
5 years ago
by
Kenzo-Hugo Hillion
Browse files
Options
Downloads
Patches
Plain Diff
Use axios for requests from frontend
parent
d60a3502
No related branches found
Branches containing commit
No related tags found
2 merge requests
!59
Prod
,
!13
Use axios
Pipeline
#14570
passed with stages
Stage:
Stage:
in 2 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/views/Genes.vue
+11
-13
11 additions, 13 deletions
frontend/src/views/Genes.vue
frontend/src/views/Stats.vue
+14
-12
14 additions, 12 deletions
frontend/src/views/Stats.vue
with
25 additions
and
25 deletions
frontend/src/views/Genes.vue
+
11
−
13
View file @
27c8106e
...
...
@@ -64,25 +64,23 @@ export default {
};
},
mounted
()
{
this
.
f
et
ch
Genes
();
this
.
g
etGenes
();
},
methods
:
{
f
et
ch
Genes
()
{
axios
.
get
(
'
/api/catalog/v1/
gene
s/
'
,
{
g
etGenes
()
{
axios
.
get
(
'
/api/catalog/v1/
function
s/
'
,
{
headers
:
{
Accept
:
'
application/json
'
,
},
})
.
then
((
response
)
=>
{
console
.
log
(
response
);
if
(
response
.
ok
)
{
response
.
json
().
then
((
json
)
=>
{
this
.
genes
=
json
.
results
;
this
.
count
=
json
.
count
;
});
}
});
},
.
then
((
response
)
=>
{
this
.
genes
=
response
.
data
.
results
;
this
.
count
=
response
.
data
.
count
;
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
});
}
},
};
</
script
>
This diff is collapsed.
Click to expand it.
frontend/src/views/Stats.vue
+
14
−
12
View file @
27c8106e
...
...
@@ -15,7 +15,7 @@
<histogram
v-bind:geneLengthData=
"geneLengthData"
></histogram>
<!--
<label
for=
"geneLengthWindowSize"
>
Gene size window
</label>
<input
type=
"range"
class=
"custom-range"
min=
"200"
max=
"10000"
step=
"200"
v-model=
"geneLengthWindowSize"
v-on:input=
"
f
et
ch
GeneLength(geneLengthWindowSize)"
v-model=
"geneLengthWindowSize"
v-on:input=
"
g
etGeneLength(geneLengthWindowSize)"
debounce=
"500"
>
{{
geneLengthWindowSize
}}
-->
</div>
...
...
@@ -27,6 +27,7 @@
</
template
>
<
script
>
import
axios
from
'
axios
'
;
import
Histogram
from
'
@/components/Histogram.vue
'
;
export
default
{
...
...
@@ -38,23 +39,24 @@ export default {
};
},
mounted
()
{
this
.
f
et
ch
GeneLength
(
this
.
geneLengthWindowSize
);
this
.
g
etGeneLength
(
this
.
geneLengthWindowSize
);
},
methods
:
{
fetchGeneLength
(
geneLengthWindowSize
)
{
fetch
(
'
/api/catalog/v1/genes/gene_length?window_size=
'
.
concat
(
geneLengthWindowSize
),
{
method
:
'
GET
'
,
getGeneLength
(
geneLengthWindowSize
)
{
axios
.
get
(
'
/api/catalog/v1/genes/gene_length
'
,
{
params
:
{
'
window_size
'
:
geneLengthWindowSize
,
},
headers
:
{
Accept
:
'
application/json
'
,
},
})
.
then
((
response
)
=>
{
if
(
response
.
ok
)
{
response
.
json
().
then
((
json
)
=>
{
this
.
geneLengthData
=
json
.
results
;
});
}
});
.
then
((
response
)
=>
{
this
.
geneLengthData
=
response
.
data
.
results
;
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
})
},
},
components
:
{
histogram
:
Histogram
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment