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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
documentation
geoviewer
Commits
6d337891
Commit
6d337891
authored
Aug 14, 2021
by
Arina
Browse files
Options
Downloads
Patches
Plain Diff
Creat an artifact model
parent
63c4558a
Branches
Branches containing commit
No related tags found
1 merge request
!2
Draft: Resolve "Add artifacts viewer"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
artifacts/artifacts.js
+48
-35
48 additions, 35 deletions
artifacts/artifacts.js
artifacts/index.html
+23
-22
23 additions, 22 deletions
artifacts/index.html
with
71 additions
and
57 deletions
artifacts/artifacts.js
+
48
−
35
View file @
6d337891
export
let
artifacts
=
[
class
Artifacts
{
{
constructor
(
type
,
path
,
desc
,
job
,
repo
,
imagePdf
=
null
,
imageCategory
=
null
,
imageTag
=
null
)
{
"
type
"
:
"
image
"
,
// type [image, gdml, root]
this
.
type
=
type
;
"
path
"
:
"
images/view01_top.png
"
,
// artifact path
this
.
path
=
path
;
"
desc
"
:
"
Top image of inclosure
"
,
// description of the artifact
this
.
desc
=
desc
;
"
job
"
:
"
report
"
,
// creator job name
this
.
job
=
job
;
"
repo
"
:
"
athena
"
,
// repository
this
.
repo
=
repo
;
//image specific fields:
//image specific fields:
"
imagePdf
"
:
"
images/view01_top.pdf
"
,
// PDF version of the image
this
.
imagePdf
=
imagePdf
;
"
imageCategory
"
:
"
main
"
,
// Category
this
.
imageCategory
=
imageCategory
;
"
imageTag
"
:
"
central-detector
"
// Tag
this
.
imageTag
=
imageTag
;
},
{
"
type
"
:
"
file
"
,
// general file, just downloads if clicked
"
path
"
:
"
geo/athena.gdml
"
,
"
desc
"
:
"
ATHENA full geometry in GDML
"
,
"
job
"
:
"
report
"
,
"
repo
"
:
"
athena
"
},
{
"
type
"
:
"
georoot
"
,
// geometry in ROOT format (opens in Geometry Browser)
"
path
"
:
"
geo/detector_geo.root
"
,
"
desc
"
:
"
ATHENA central detector in ROOT
"
,
"
job
"
:
"
report
"
,
"
repo
"
:
"
athena
"
},
{
"
type
"
:
"
constants
"
,
// File with constants listing (opens in constants browser (TODO in future))
"
path
"
:
"
doc/constants.out
"
,
"
desc
"
:
"
List of all calculated constants
"
,
"
job
"
:
"
report
"
,
"
repo
"
:
"
athena
"
}
}
static
list
=
[
new
Artifacts
(
"
image
"
,
// type [image, gdml, root]
"
images/view01_top.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
),
new
Artifacts
(
"
file
"
,
// general file, just downloads if clicked
"
geo/athena.gdml
"
,
"
ATHENA full geometry in GDML
"
,
"
report
"
,
"
athena
"
,
),
new
Artifacts
(
"
georoot
"
,
// geometry in ROOT format (opens in Geometry Browser)
"
geo/detector_geo.root
"
,
"
ATHENA central detector in ROOT
"
,
"
report
"
,
"
athena
"
,
),
new
Artifacts
(
"
constants
"
,
// File with constants listing (opens in constants browser (TODO in future))
"
doc/constants.out
"
,
"
List of all calculated constants
"
,
"
report
"
,
"
athena
"
)
]
];
}
\ No newline at end of file
export
default
Artifacts
;
This diff is collapsed.
Click to expand it.
artifacts/index.html
+
23
−
22
View file @
6d337891
...
@@ -11,13 +11,13 @@
...
@@ -11,13 +11,13 @@
<link
rel=
"canonical"
href=
"https://getbootstrap.su/docs/5.0/examples/album/"
>
<link
rel=
"canonical"
href=
"https://getbootstrap.su/docs/5.0/examples/album/"
>
<!-- Bootstrap core CSS -->
<!-- Bootstrap core CSS -->
<link
href=
"/docs/5.0/dist/css/bootstrap.min.css"
rel=
"stylesheet"
crossorigin=
"anonymous"
>
<!-- <link href="/docs/5.0/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> -->
<!-- <link rel="manifest" href="/docs/5.0/assets/img/favicons/manifest.json"> -->
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin=
"anonymous"
>
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin=
"anonymous"
>
<!-- Favicons -->
<!-- Favicons -->
<link
rel=
"apple-touch-icon"
href=
"/docs/5.0/assets/img/favicons/apple-touch-icon.png"
sizes=
"180x180"
>
<link
rel=
"apple-touch-icon"
href=
"/docs/5.0/assets/img/favicons/apple-touch-icon.png"
sizes=
"180x180"
>
<link
rel=
"icon"
href=
"/docs/5.0/assets/img/favicons/favicon-32x32.png"
sizes=
"32x32"
type=
"image/png"
>
<link
rel=
"icon"
href=
"/docs/5.0/assets/img/favicons/favicon-32x32.png"
sizes=
"32x32"
type=
"image/png"
>
<link
rel=
"icon"
href=
"/docs/5.0/assets/img/favicons/favicon-16x16.png"
sizes=
"16x16"
type=
"image/png"
>
<link
rel=
"icon"
href=
"/docs/5.0/assets/img/favicons/favicon-16x16.png"
sizes=
"16x16"
type=
"image/png"
>
<link
rel=
"manifest"
href=
"/docs/5.0/assets/img/favicons/manifest.json"
>
<link
rel=
"mask-icon"
href=
"/docs/5.0/assets/img/favicons/safari-pinned-tab.svg"
color=
"#7952b3"
>
<link
rel=
"mask-icon"
href=
"/docs/5.0/assets/img/favicons/safari-pinned-tab.svg"
color=
"#7952b3"
>
<link
rel=
"icon"
href=
"/docs/5.0/assets/img/favicons/favicon.ico"
>
<link
rel=
"icon"
href=
"/docs/5.0/assets/img/favicons/favicon.ico"
>
<link
href=
"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css"
rel=
"stylesheet"
/>
<link
href=
"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css"
rel=
"stylesheet"
/>
...
@@ -74,24 +74,25 @@
...
@@ -74,24 +74,25 @@
<p
class=
"mb-0"
><a
href=
"https://eicweb.phy.anl.gov/EIC/detectors/athena"
>
Athena
</a></p>
<p
class=
"mb-0"
><a
href=
"https://eicweb.phy.anl.gov/EIC/detectors/athena"
>
Athena
</a></p>
</div>
</div>
</footer>
</footer>
<!-- <script src="/docs/5.0/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> -->
<script
type=
"module"
src=
"artifacts.js"
></script>
<script
type=
"module"
src=
"artifacts.js"
></script>
<script>
// import artifacts from "./artifacts.js"
</script>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
integrity=
"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin=
"anonymous"
></script>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
integrity=
"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin=
"anonymous"
></script>
<script
src=
"/docs/5.0/dist/js/bootstrap.bundle.min.js"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity=
"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity=
"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
integrity=
"sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
integrity=
"sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"
integrity=
"sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"
integrity=
"sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"
></script>
<script>
<script
type=
"module"
>
$
(
'
#branches
'
).
select2
();
$
(
'
#branches
'
).
select2
();
import
artifacts
from
'
./artifacts.js
'
;
console
.
log
(
artifacts
);
//console.log(artifacts)
// $().load(()=>{
// $().load(()=>{
// ...
// ...
// });
// });
// $('').load('index.html', function() {
// alert('Load was performed.');
// });
function
setSelectedBranch
(
branchName
)
{
function
setSelectedBranch
(
branchName
)
{
...
@@ -116,16 +117,16 @@
...
@@ -116,16 +117,16 @@
let
imagesDiv
=
document
.
getElementById
(
"
images-id
"
);
let
imagesDiv
=
document
.
getElementById
(
"
images-id
"
);
let
imagesPNG
=
[
let
imagesPNG
=
[
"
view01_top.png
"
,
"
image/
view01_top.png
"
,
"
view02a.png
"
,
"
images/
view02a.png
"
,
"
view02b.png
"
,
"
images/
view02b.png
"
,
"
view02c.png
"
,
"
images/
view02c.png
"
,
];
];
let
imagesPDF
=
[
let
imagesPDF
=
[
"
view01_top.pdf
"
,
"
images/
view01_top.pdf
"
,
"
view02a.pdf
"
,
"
images/
view02a.pdf
"
,
"
view02b.pdf
"
,
"
images/
view02b.pdf
"
,
"
view02c.pdf
"
,
"
images/
view02c.pdf
"
,
];
];
let
branch
=
findGetParameter
(
"
br
"
);
let
branch
=
findGetParameter
(
"
br
"
);
...
@@ -133,7 +134,7 @@
...
@@ -133,7 +134,7 @@
async
function
fetchBranches
()
{
async
function
fetchBranches
()
{
console
.
log
(
'
fetching branches
'
);
console
.
log
(
'
fetching branches
'
);
let
response
=
await
fetch
(
"
https://eicweb.phy.anl.gov/api/v4/projects/473/repository/branches
"
);
let
response
=
await
fetch
(
"
https://eicweb.phy.anl.gov/api/v4/projects/473/repository/branches
?per_page=100
"
);
let
data
=
await
response
.
json
();
let
data
=
await
response
.
json
();
console
.
log
(
data
);
console
.
log
(
data
);
let
branchSelectElement
=
document
.
querySelector
(
`#branches`
);
let
branchSelectElement
=
document
.
querySelector
(
`#branches`
);
...
@@ -173,7 +174,7 @@
...
@@ -173,7 +174,7 @@
imagesDiv
.
innerHTML
+=
`
imagesDiv
.
innerHTML
+=
`
<div class="alert alert-warning d-flex align-items-center" role="alert">
<div class="alert alert-warning d-flex align-items-center" role="alert">
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Warning:"><use xlink:href="#exclamation-triangle-fill"/></svg>
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Warning:"><use xlink:href="#exclamation-triangle-fill"/></svg>
<div>
An example warning alert with an icon
</div>
<div>
No pipelines found for the branch
</div>
</div>`
</div>`
return
;
return
;
};
};
...
@@ -182,7 +183,7 @@
...
@@ -182,7 +183,7 @@
<div class="col">
<div class="col">
<div class="card shadow-sm">
<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">
<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/
images/
${
imagesPNG
[
i
]}
'/>
<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>
</svg>
<div class="card-body">
<div class="card-body">
<h1>
${
imagesPNG
[
i
]}
</h1>
<h1>
${
imagesPNG
[
i
]}
</h1>
...
@@ -190,7 +191,7 @@
...
@@ -190,7 +191,7 @@
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<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">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/
images/
${
imagesPDF
[
i
]}
'>pdf</a></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>
</div>
</div>
<small class="text-muted">9 mins</small>
<small class="text-muted">9 mins</small>
</div>
</div>
...
...
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