Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geoviewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
documentation
geoviewer
Commits
fbba22a6
Commit
fbba22a6
authored
3 years ago
by
Arina
Browse files
Options
Downloads
Patches
Plain Diff
Embed an artifact model
parent
6d337891
Branches
Branches containing commit
No related tags found
1 merge request
!2
Draft: Resolve "Add artifacts viewer"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
artifacts/artifacts.js
+20
-8
20 additions, 8 deletions
artifacts/artifacts.js
artifacts/index.html
+21
-19
21 additions, 19 deletions
artifacts/index.html
with
41 additions
and
27 deletions
artifacts/artifacts.js
+
20
−
8
View file @
fbba22a6
class
Artifact
s
{
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
Artifact
s
(
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
Artifact
s
(
new
Artifact
(
"
file
"
,
// general file, just downloads if clicked
"
geo/athena.gdml
"
,
"
ATHENA full geometry in GDML
"
,
"
report
"
,
"
athena
"
,
),
new
Artifact
s
(
new
Artifact
(
"
georoot
"
,
// geometry in ROOT format (opens in Geometry Browser)
"
geo/detector_geo.root
"
,
"
ATHENA central detector in ROOT
"
,
"
report
"
,
"
athena
"
,
),
new
Artifact
s
(
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
Artifact
s
;
export
default
Artifact
;
This diff is collapsed.
Click to expand it.
artifacts/index.html
+
21
−
19
View file @
fbba22a6
...
...
@@ -84,8 +84,8 @@
<script
type=
"module"
>
$
(
'
#branches
'
).
select2
();
import
a
rtifact
s
from
'
./artifacts.js
'
;
console
.
log
(
a
rtifact
s
);
import
A
rtifact
from
'
./artifacts.js
'
;
console
.
log
(
A
rtifact
.
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>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment