diff options
author | Pjotr Prins | 2020-05-06 09:03:08 -0500 |
---|---|---|
committer | Pjotr Prins | 2020-05-06 09:03:08 -0500 |
commit | 0031e778ee1ad8b934411da5082fcb3115646e67 (patch) | |
tree | be17fb9aff6351e967a9210cd4c58a60ad55a382 /bh20simplewebuploader/static/main.js | |
parent | 7d7af6cde75d09da7a05cf5bc05ef2556c3aea92 (diff) | |
parent | b6d846b5de6c67b28adab1fa520953115a1a1e30 (diff) | |
download | bh20-seq-resource-0031e778ee1ad8b934411da5082fcb3115646e67.tar.gz bh20-seq-resource-0031e778ee1ad8b934411da5082fcb3115646e67.tar.lz bh20-seq-resource-0031e778ee1ad8b934411da5082fcb3115646e67.zip |
Merge branch 'master' of github.com:arvados/bh20-seq-resource
Diffstat (limited to 'bh20simplewebuploader/static/main.js')
-rw-r--r-- | bh20simplewebuploader/static/main.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js new file mode 100644 index 0000000..96199a0 --- /dev/null +++ b/bh20simplewebuploader/static/main.js @@ -0,0 +1,47 @@ +function fetchAPI(apiEndPoint) { + fetch(scriptRoot + apiEndPoint) + .then(response => { + return response.json(); + }) + .then(data => { + document.getElementById("json").textContent = JSON.stringify(data, undefined, 2); + document.getElementById("results").classList.remove("invisible"); + document.getElementById("loader").classList.add("invisible"); + }); + document.getElementById("results").classList.add("invisible"); + document.getElementById("loader").classList.remove("invisible"); + +} + +let search = () => { + let m = document.getElementById('search-input').value; + fetchAPI(scriptRoot + "/api/getDetailsForSeq?seq=" + encodeURIComponent(m)); +} + +let fetchSEQBySpecimen = () => { + fetchAPI("/api/getSEQCountbySpecimenSource"); +} + +let fetchSEQByLocation = () => { + fetchAPI("/api/getSEQCountbyLocation"); +} + +let fetchSEQByTech = () => { + fetchAPI("/api/getSEQCountbytech"); +} + +let fetchAllaccessions = () => { + fetchAPI("/api/getAllaccessions"); +}; + +/** + * Show form if checked + */ +let fillFormSpot = document.getElementById('metadata_fill_form_spot'); +function displayForm() { + if (document.getElementById('metadata_form').checked) { + fillFormSpot.classList.remove("invisible"); + return; + } + fillFormSpot.classList.add("invisible"); +} |