Skip to content
Snippets Groups Projects
Commit fbba22a6 authored by Arina's avatar Arina
Browse files

Embed an artifact model

parent 6d337891
Branches
No related tags found
1 merge request!2Draft: Resolve "Add artifacts viewer"
class Artifacts {
class Artifact {
constructor(type, path, desc, job, repo, imagePdf = null, imageCategory = null, imageTag= null) {
this.type = type;
this.path = path;
......@@ -11,9 +11,11 @@ class Artifacts {
this.imageCategory = imageCategory;
this.imageTag = imageTag;
}
/** @type {List<Artifact>} Список артефактов */
static list = [
new Artifacts(
new Artifact(
"image", // type [image, gdml, root]
"images/view01_top.png ", // artifact path
"Top image of inclosure ", // description of the artifact
......@@ -23,28 +25,38 @@ class Artifacts {
"main", // Category
"central-detector ", // Tag
),
new Artifacts(
new Artifact(
"file", // general file, just downloads if clicked
"geo/athena.gdml",
"ATHENA full geometry in GDML",
"report",
"athena",
),
new Artifacts(
new Artifact(
"georoot", // geometry in ROOT format (opens in Geometry Browser)
"geo/detector_geo.root",
"ATHENA central detector in ROOT",
"report",
"athena",
),
new Artifacts(
new Artifact(
"constants", // File with constants listing (opens in constants browser (TODO in future))
"doc/constants.out",
"List of all calculated constants",
"report",
"athena"
)
),
new Artifact(
"image", // type [image, gdml, root]
"images/view02a.png", // artifact path
"Top image of inclosure ", // description of the artifact
"report", // creator job name
"athena", // repository
"images/view01_top.pdf ", // PDF version of the image
"main", // Category
"central-detector ", // Tag
),
]
}
export default Artifacts;
export default Artifact;
......@@ -84,8 +84,8 @@
<script type="module">
$('#branches').select2();
import artifacts from './artifacts.js';
console.log(artifacts);
import Artifact from './artifacts.js';
console.log(Artifact.list);
// $().load(()=>{
// ...
......@@ -178,27 +178,29 @@
</div>`
return;
};
for (let i=0; i < imagesPNG.length; i++) {
imagesDiv.innerHTML +=`
<div class="col">
<div class="card shadow-sm">
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Эскиз" preserveAspectRatio="xMidYMid slice" focusable="false">
<image x="0" y="0" width="100%" height="100%" href='https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${jobId}/artifacts/raw/${imagesPNG[i]}'/>
</svg>
<div class="card-body">
<h1>${imagesPNG[i]}</h1>
<p class="card-text">${jobId}/artifacts/raw/images/${imagesPNG[i]}</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" class="btn btn-sm btn-outline-secondary">watch</button>
<button type="button" class="btn btn-sm btn-outline-secondary"><a href='https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${jobId}/artifacts/raw/${imagesPDF[i]}'>pdf</a></button>
for (let i=0; i < Artifact.list.length; i++) {
if(Artifact.list[i].type == "image") {
imagesDiv.innerHTML +=`
<div class="col">
<div class="card shadow-sm">
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Эскиз" preserveAspectRatio="xMidYMid slice" focusable="false">
<image x="0" y="0" width="100%" height="100%" href='https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${jobId}/artifacts/raw/${Artifact.list[i].path}'/>
</svg>
<div class="card-body">
<h1>${imagesPNG[i]}</h1>
<p class="card-text">${jobId}/artifacts/raw/images/${imagesPNG[i]}</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" class="btn btn-sm btn-outline-secondary">watch</button>
<button type="button" class="btn btn-sm btn-outline-secondary"><a href='https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${jobId}/artifacts/raw/${Artifact.list[i].path}'>pdf</a></button>
</div>
<small class="text-muted">9 mins</small>
</div>
<small class="text-muted">9 mins</small>
</div>
</div>
</div>
</div>
`;
`;
}
}
});
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment