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 }) { ...@@ -17,17 +17,19 @@ export default function ASTRONVOResults({ catalog }) {
<InputGroup.Checkbox /> <InputGroup.Checkbox />
</InputGroup> </InputGroup>
</th> */} </th> */}
<th>Title</th> <th>Collection</th>
<th>RA</th> <th>RA</th>
<th>Dec</th> <th>Dec</th>
<th>fov</th> <th>fov</th>
<th>Data Product Type</th> <th>Data Product Type</th>
<th>Calibration Level</th> <th>Calibration Level</th>
<th>Size</th>
<th>Link to data</th> <th>Link to data</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{queryMap.get(catalog).results.query_results.map((result) => { {queryMap.get(catalog).results.query_results.map((result) => {
let size = Number((result.size / 1024).toFixed(1));
return ( return (
<tr key={result.result}> <tr key={result.result}>
{/* <th> {/* <th>
...@@ -35,19 +37,16 @@ export default function ASTRONVOResults({ catalog }) { ...@@ -35,19 +37,16 @@ export default function ASTRONVOResults({ catalog }) {
<InputGroup.Checkbox /> <InputGroup.Checkbox />
</InputGroup> </InputGroup>
</th> */} </th> */}
<td>{result.title}</td> <td>{result.obs_collection}</td>
<td>{result.ra}</td> <td>{result.ra}</td>
<td>{result.dec}</td> <td>{result.dec}</td>
<td>{result.fov}</td> <td>{result.fov}</td>
<td>{result.dataproduct_type}</td> <td>{result.dataproduct_type}</td>
<td>{result.calibration_level}</td> <td>{result.calibration_level}</td>
<td>{size} MB</td>
<td> <td>
<a <a href={result.url} rel="noopener noreferrer" download>
href={result.url} Download
target="_blank"
rel="noopener noreferrer"
>
View data
</a> </a>
</td> </td>
</tr> </tr>
......
...@@ -25,54 +25,6 @@ export default function QueryCatalogs() { ...@@ -25,54 +25,6 @@ export default function QueryCatalogs() {
let gui = config.query_schema.name; let gui = config.query_schema.name;
const queries = parseQueryForm(gui, formData, catalogs); 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 // 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 // This is under development in the backend at the moment
queries.forEach((query) => { queries.forEach((query) => {
...@@ -135,6 +87,7 @@ export default function QueryCatalogs() { ...@@ -135,6 +87,7 @@ export default function QueryCatalogs() {
></Form> ></Form>
{Array.from(queryMap.keys()).map((catalog) => { {Array.from(queryMap.keys()).map((catalog) => {
const details = queryMap.get(catalog); const details = queryMap.get(catalog);
console.log("Details:", details);
console.log("Results:", details.results); console.log("Results:", details.results);
return ( return (
<div key={catalog} className="mt-3"> <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