Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CD-CODE Web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CD-CODE team
CD-CODE Web
Commits
3da9a340
Commit
3da9a340
authored
3 years ago
by
HongKee Moon
Browse files
Options
Downloads
Patches
Plain Diff
Close
#26
: Added drop-down list
parent
4c1b6b28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/src/components/DataTable.vue
+38
-1
38 additions, 1 deletion
web/src/components/DataTable.vue
web/src/components/Search.vue
+5
-4
5 additions, 4 deletions
web/src/components/Search.vue
with
43 additions
and
5 deletions
web/src/components/DataTable.vue
+
38
−
1
View file @
3da9a340
...
...
@@ -200,6 +200,8 @@
// console.log(columns)
const
doms
=
vm
.
category
===
"
protein
"
?
'
<"row"<"col-sm-3"f><"#function_filter.col-sm-3"><"col-sm-6"p>><"row"t><"row"<"col-sm-4"i><"col-sm-8"p>>
'
:
'
<"row"<"col-sm-3"f><"col-sm-9"p>><"row"t><"row"<"col-sm-4"i><"col-sm-8"p>>
'
;
const
nTableOptions
=
{
columns
,
// aaSorting: [[ 0, 'asc' ]],
...
...
@@ -212,7 +214,36 @@
oLanguage
:
{
sSearch
:
"
Filter
"
,
},
dom
:
'
<"row"<"col-sm-2"f><"col-sm-10"p>><"row"t><"row"<"col-sm-4"i><"col-sm-8"p>>
'
dom
:
doms
,
initComplete
:
function
()
{
if
(
vm
.
category
===
"
protein
"
)
{
this
.
api
().
columns
([
2
]).
every
(
function
()
{
// console.log(this);
let
column
=
this
;
let
select
=
$
(
'
<select class="form-control input-sm"><option value=""></option></select>
'
)
.
appendTo
(
$
(
'
#function_filter
'
).
empty
()
)
.
on
(
'
change
'
,
function
()
{
var
val
=
$
.
fn
.
dataTable
.
util
.
escapeRegex
(
$
(
this
).
val
()
);
column
.
search
(
val
?
val
===
'
null
'
?
'
^
\\
s*$
'
:
'
^
'
+
val
+
'
$
'
:
''
,
true
,
false
)
.
draw
();
}
);
$
(
"
<label>Functional Type</label>
"
).
prependTo
(
'
#function_filter
'
);
column
.
data
().
unique
().
sort
().
each
(
function
(
d
,
j
)
{
if
(
d
===
null
)
{
select
.
append
(
'
<option value="
'
+
d
+
'
">unknown</option>
'
)
}
else
{
select
.
append
(
'
<option value="
'
+
d
+
'
">
'
+
d
+
'
</option>
'
)
}
}
);
}
);
}
},
};
const
tableId
=
`#
${
id
}
`
;
...
...
@@ -446,4 +477,10 @@
text-decoration
:
underline
;
font-style
:
oblique
;
}
div
#function_filter
label
{
font-weight
:
normal
;
text-align
:
left
;
margin-right
:
10px
;
}
</
style
>
This diff is collapsed.
Click to expand it.
web/src/components/Search.vue
+
5
−
4
View file @
3da9a340
...
...
@@ -54,8 +54,8 @@
},
10
);
});
}
else
{
url
=
taxId
===
'
all
'
?
`
${
host
}
/proteins?size=100000`
:
`
${
host
}
/proteins?species_tax_id=
${
taxId
}
&size=100000`
;
url
=
taxId
===
'
all
'
?
`
${
host
}
/proteins?
fields=ensembl_gene_id,ensembl_id,functional_type,gene_name,name,species_name,species_tax_id,uniprot_id,uniprot_readable_id&
size=100000`
:
`
${
host
}
/proteins?species_tax_id=
${
taxId
}
&
fields=ensembl_gene_id,ensembl_id,functional_type,gene_name,name,species_name,species_tax_id,uniprot_id,uniprot_readable_id&
size=100000`
;
fetch
(
url
)
.
then
(
response
=>
response
.
json
())
...
...
@@ -88,6 +88,7 @@
}
// let url = `http://${host}/condensates?query=${keyword}&species_tax_id=${taxId}&page=${page}`;
// fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms
let
url
=
taxId
===
'
all
'
?
`
${
host
}
/condensates?query=
${
keyword
}
&size=10000`
:
`
${
host
}
/condensates?query=
${
keyword
}
&species_tax_id=
${
taxId
}
&size=10000`
;
...
...
@@ -113,8 +114,8 @@
},
10
);
});
}
else
{
url
=
taxId
===
'
all
'
?
`
${
host
}
/condensates?size=10000`
:
`
${
host
}
/condensates?species_tax_id=
${
taxId
}
&size=10000`
;
url
=
taxId
===
'
all
'
?
`
${
host
}
/condensates?
fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms&
size=10000`
:
`
${
host
}
/condensates?species_tax_id=
${
taxId
}
&
fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms&
size=10000`
;
fetch
(
url
)
.
then
(
response
=>
response
.
json
())
.
then
((
response
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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