Skip to content
Snippets Groups Projects
Commit 33364c8a authored by Zheng Meyer's avatar Zheng Meyer
Browse files

render VO results properly

parent f13b4f5a
No related branches found
No related tags found
No related merge requests found
......@@ -17,17 +17,19 @@ export default function ASTRONVOResults({ catalog }) {
<InputGroup.Checkbox />
</InputGroup>
</th> */}
<th>Title</th>
<th>Collection</th>
<th>RA</th>
<th>Dec</th>
<th>fov</th>
<th>Data Product Type</th>
<th>Calibration Level</th>
<th>Size</th>
<th>Link to data</th>
</tr>
</thead>
<tbody>
{queryMap.get(catalog).results.query_results.map((result) => {
let size = Number((result.size / 1024).toFixed(1));
return (
<tr key={result.result}>
{/* <th>
......@@ -35,19 +37,16 @@ export default function ASTRONVOResults({ catalog }) {
<InputGroup.Checkbox />
</InputGroup>
</th> */}
<td>{result.title}</td>
<td>{result.obs_collection}</td>
<td>{result.ra}</td>
<td>{result.dec}</td>
<td>{result.fov}</td>
<td>{result.dataproduct_type}</td>
<td>{result.calibration_level}</td>
<td>{size} MB</td>
<td>
<a
href={result.url}
target="_blank"
rel="noopener noreferrer"
>
View data
<a href={result.url} rel="noopener noreferrer" download>
Download
</a>
</td>
</tr>
......
......@@ -25,54 +25,6 @@ export default function QueryCatalogs() {
let gui = config.query_schema.name;
const queries = parseQueryForm(gui, formData, catalogs);
// queries.forEach((query) => {
// let url =
// api_host + "query/create-query/?" + "archive_uri=" + query.catalog;
// axios.get(url).then((response) => {
// queryMap.set(query.catalog, {
// catalog: query.catalog,
// dataset_uri: response.data.query_input[0].dataset,
// access_url: response.data.query_input[0].service_url,
// catalogquery: response.data.query_input[0].query,
// status: "fetching",
// results: null,
// });
// console.log("CatalogQuery:", queryMap.get(query.catalog).catalogquery);
// let queryUrl =
// api_host +
// "query/run-query/?" +
// "dataset_uri=" +
// queryMap.get(query.catalog).dataset_uri +
// "&access_url=" +
// queryMap.get(query.catalog).access_url +
// "&query=" +
// queryMap.get(query.catalog).catalogquery;
// axios
// .get(queryUrl)
// .then((queryResponse) => {
// queryMap.set(query.catalog, {
// catalog: query.catalog,
// dataset_uri: response.data.query_input[0].dataset,
// access_url: response.data.query_input[0].service_url,
// catalogquery: response.data.query_input[0].query,
// status: "fetched",
// results: queryResponse.data,
// });
// })
// .catch(() => {
// queryMap.set(query.catalog, {
// catalog: query.catalog,
// dataset_uri: response.data.query_input[0].dataset,
// access_url: response.data.query_input[0].service_url,
// catalogquery: response.data.query_input[0].query,
// status: "error",
// results: null,
// });
// });
// });
// });
// Ideally query for each catalog is sent to ESAP API Gateway, and query results is returned
// This is under development in the backend at the moment
queries.forEach((query) => {
......@@ -135,6 +87,7 @@ export default function QueryCatalogs() {
></Form>
{Array.from(queryMap.keys()).map((catalog) => {
const details = queryMap.get(catalog);
console.log("Details:", details);
console.log("Results:", details.results);
return (
<div key={catalog} className="mt-3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment