24 lines
641 B
JavaScript
24 lines
641 B
JavaScript
'use strict';
|
|
|
|
import DataSpace from "../ds.js";
|
|
|
|
document.addEventListener('readystatechange', async () => {
|
|
DataSpace.printReport();
|
|
// Show modal
|
|
document.querySelector('.modal').classList.add('active');
|
|
|
|
const resId = location.search.replace("?id=", '');
|
|
const report = await DataSpace.fetchReport(resId);
|
|
const archesJson = await DataSpace.fetchReport(
|
|
resId,
|
|
'arches-json'
|
|
);
|
|
const images = DataSpace.getImagesSrc(archesJson);
|
|
|
|
// Close modal
|
|
document.querySelector('.modal').classList.remove('active');
|
|
|
|
// Create report HTML
|
|
DataSpace.renderReport(report, images);
|
|
});
|