Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3mon
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
Carlo Guidi
km3mon
Commits
39e83260
Commit
39e83260
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
First release version of top10
parent
77240223
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/routes.py
+10
-4
10 additions, 4 deletions
app/routes.py
app/static/css/main.css
+42
-0
42 additions, 0 deletions
app/static/css/main.css
app/templates/top10.html
+7
-0
7 additions, 0 deletions
app/templates/top10.html
with
59 additions
and
4 deletions
app/routes.py
+
10
−
4
View file @
39e83260
...
...
@@ -8,6 +8,7 @@ import toml
from
flask
import
render_template
,
send_from_directory
,
request
,
Response
from
app
import
app
import
km3pipe
as
kp
from
km3modules.common
import
LocalDBService
CONFIG_PATH
=
"
pipeline.toml
"
...
...
@@ -184,20 +185,25 @@ def top10():
"
FROM event_selection ORDER BY {cat} DESC LIMIT 10
"
.
format
(
cat
=
category
))
if
len
(
raw_data
)
>
0
:
print
(
raw_data
)
top10
[
category_names
[
category
]]
=
[{
"
plot_filename
"
:
r
[
0
],
"
meta
"
:
{
"
Number of h
its (triggered)
"
:
"
{} ({})
"
.
format
(
r
[
1
],
r
[
2
]),
"
H
its (triggered)
"
:
"
{} ({})
"
.
format
(
r
[
1
],
r
[
2
]),
"
Overlays
"
:
r
[
3
],
"
Detector ID
"
:
r
[
4
],
"
Run
"
:
r
[
5
],
"
Frame index
"
:
r
[
6
],
"
Trigger counter
"
:
r
[
7
],
"
Date
"
:
datetime
.
utcfromtimestamp
(
r
[
8
]).
strftime
(
"
%c
"
)
},
"
is_recent
"
:
(
time
.
time
()
-
r
[
8
])
<
60
*
60
*
24
"
is_recent
"
:
(
time
.
time
()
-
r
[
8
])
<
60
*
60
*
24
,
"
date
"
:
"
{} UTC
"
.
format
(
datetime
.
utcfromtimestamp
(
r
[
8
]).
strftime
(
"
%c
"
)),
"
irods_path
"
:
kp
.
tools
.
irods_filepath
(
r
[
4
],
r
[
5
]),
"
xrootd_path
"
:
kp
.
tools
.
xrootd_path
(
r
[
4
],
r
[
5
])
}
for
r
in
raw_data
]
return
render_template
(
'
top10.html
'
,
top10
=
top10
)
...
...
This diff is collapsed.
Click to expand it.
app/static/css/main.css
+
42
−
0
View file @
39e83260
...
...
@@ -37,3 +37,45 @@ img.plot {
#plot
img
{
margin
:
0
auto
}
#top10
h3
{
min-width
:
180px
;
}
#top10
h3
.rank
{
font-size
:
60px
;
font-weight
:
500
;
color
:
#438bd9
;
border-bottom
:
3px
dotted
#ddd
;
}
#top10
span
.recent
{
font-size
:
30px
;
/* color: red; */
font-style
:
italic
;
background
:
#FAAC00
;
background
:
-moz-linear-gradient
(
top
,
#FAAC00
0%
,
#FF2685
79%
,
#CC0A36
100%
);
background
:
-webkit-linear-gradient
(
top
,
#FAAC00
0%
,
#FF2685
79%
,
#CC0A36
100%
);
background
:
linear-gradient
(
to
bottom
,
#FAAC00
0%
,
#FF2685
79%
,
#CC0A36
100%
);
-webkit-background-clip
:
text
;
-webkit-text-fill-color
:
transparent
;
}
#top10
table
{
font-size
:
12px
;
min-width
:
180px
;
}
#top10
table
td
{
vertical-align
:
top
}
#top10
table
td
.meta-key
{
font-weight
:
bold
;
}
#top10
table
td
.meta-value
{
text-align
:
right
;
}
#top10
h4
.date
{
font-size
:
12px
;
}
#top10
.filepath
{
color
:
#999
;
font-size
:
10px
;
}
This diff is collapsed.
Click to expand it.
app/templates/top10.html
+
7
−
0
View file @
39e83260
...
...
@@ -14,6 +14,7 @@
<span
class=
"recent"
>
NEW!
</span>
{% endif %}
</h3>
<h4
class=
"date"
>
{{ event.date }}
</h4>
<table
class=
"top10"
>
{% for key, value in event.meta.items() %}
<tr>
...
...
@@ -34,6 +35,12 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12"
style=
"vertical-align: middle"
>
<p
class=
"filepath"
><b>
iRODS
</b>
: {{ event.irods_path }}
</p>
<p
class=
"filepath"
><b>
xrootd
</b>
: {{ event.xrootd_path }}
</p>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
...
...
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