Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
efeebc64
Commit
efeebc64
authored
Sep 08, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build line chart for packages by day
parent
1f1031d1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
9 deletions
+57
-9
debomatic-webui/public/javascripts/page_history.js
debomatic-webui/public/javascripts/page_history.js
+52
-4
debomatic-webui/public/stylesheets/style.css
debomatic-webui/public/stylesheets/style.css
+4
-5
debomatic-webui/views/history.ejs
debomatic-webui/views/history.ejs
+1
-0
No files found.
debomatic-webui/public/javascripts/page_history.js
View file @
efeebc64
...
@@ -9,13 +9,37 @@
...
@@ -9,13 +9,37 @@
function
Page_History
()
{
function
Page_History
()
{
var
distributions_counter
=
{};
var
distributions_counter
=
{};
var
days_counter
=
{};
var
all_days
=
{};
// init table
function
_get_short_day
(
timestamp
)
{
var
date
=
new
Date
(
timestamp
*
1000
);
var
locale
=
navigator
.
language
||
'
en-US
'
;
var
options
=
{
month
:
"
numeric
"
,
day
:
"
numeric
"
,
};
return
date
.
toLocaleDateString
(
locale
,
options
);
}
// init table and some objects
for
(
var
i
=
0
;
i
<
dom_history
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
dom_history
.
length
;
i
++
)
{
var
p
=
dom_history
[
i
];
var
p
=
dom_history
[
i
];
var
day
=
_get_short_day
(
p
.
start
);
// count total packages by distributions
if
(
distributions_counter
.
hasOwnProperty
(
p
.
distribution
))
if
(
distributions_counter
.
hasOwnProperty
(
p
.
distribution
))
distributions_counter
[
p
.
distribution
]
++
;
distributions_counter
[
p
.
distribution
]
++
;
else
distributions_counter
[
p
.
distribution
]
=
1
;
else
distributions_counter
[
p
.
distribution
]
=
1
;
if
(
days_counter
.
hasOwnProperty
(
p
.
distribution
))
{
if
(
days_counter
[
p
.
distribution
].
hasOwnProperty
(
day
))
days_counter
[
p
.
distribution
][
day
]
++
;
else
days_counter
[
p
.
distribution
][
day
]
=
1
;
}
else
{
days_counter
[
p
.
distribution
]
=
{};
days_counter
[
p
.
distribution
][
day
]
=
1
;
}
all_days
[
day
]
=
0
;
var
info
=
Utils
.
get_status_icon_and_class
(
p
);
var
info
=
Utils
.
get_status_icon_and_class
(
p
);
var
label
=
info
.
label
||
'
building
'
;
var
label
=
info
.
label
||
'
building
'
;
var
distribution_url
=
Utils
.
get_url_to_package
({
var
distribution_url
=
Utils
.
get_url_to_package
({
...
@@ -58,22 +82,46 @@ function Page_History() {
...
@@ -58,22 +82,46 @@ function Page_History() {
$
(
"
table input
"
).
addClass
(
'
form-control
'
);
$
(
"
table input
"
).
addClass
(
'
form-control
'
);
$
(
"
table select
"
).
addClass
(
'
form-control
'
);
$
(
"
table select
"
).
addClass
(
'
form-control
'
);
// build the
graphs
// build the
distribution Pie graph
var
distributions_data
=
{
var
distributions_data
=
{
series
:
[],
series
:
[],
labels
:
[]
labels
:
[]
};
};
var
all_distibutions
=
[];
for
(
var
distro
in
distributions_counter
)
{
for
(
var
distro
in
distributions_counter
)
{
if
(
distributions_counter
.
hasOwnProperty
(
distro
))
{
if
(
distributions_counter
.
hasOwnProperty
(
distro
))
{
distributions_data
.
series
.
push
(
distributions_counter
[
distro
]);
distributions_data
.
series
.
push
(
distributions_counter
[
distro
]);
distributions_data
.
labels
.
push
(
distro
+
"
(
"
+
distributions_counter
[
distro
]
+
"
)
"
);
distributions_data
.
labels
.
push
(
distro
+
"
(
"
+
distributions_counter
[
distro
]
+
"
)
"
);
all_distibutions
.
push
(
distro
);
}
}
}
}
Chartist
.
Pie
(
'
#distributions-chart
'
,
distributions_data
,
{
Chartist
.
Pie
(
'
#distributions-chart
'
,
distributions_data
,
{
donut
:
true
,
donut
:
true
,
donutWidth
:
20
,
donutWidth
:
15
,
});
});
// build the days Line graph
var
days_data
=
{
series
:
[],
labels
:
[]
};
for
(
var
day
in
all_days
)
{
if
(
all_days
.
hasOwnProperty
(
day
))
days_data
.
labels
.
push
(
day
);
}
for
(
var
i
=
0
;
i
<
all_distibutions
.
length
;
i
++
)
{
var
info
=
[];
var
distro
=
all_distibutions
[
i
];
for
(
var
day
in
all_days
)
{
if
(
!
all_days
.
hasOwnProperty
(
day
))
continue
;
if
(
days_counter
[
distro
].
hasOwnProperty
(
day
))
info
.
push
(
days_counter
[
distro
][
day
]);
else
info
.
push
(
0
);
}
days_data
.
series
.
push
(
info
);
}
Chartist
.
Line
(
'
#days-chart
'
,
days_data
);
}
}
debomatic-webui/public/stylesheets/style.css
View file @
efeebc64
...
@@ -258,12 +258,11 @@ footer .info {
...
@@ -258,12 +258,11 @@ footer .info {
cursor
:
pointer
;
cursor
:
pointer
;
}
}
#charts
{
margin-bottom
:
30px
;
}
.ct-chart
{
.ct-chart
{
height
:
150px
;
height
:
180px
;
width
:
45%
;
float
:
left
;
margin-bottom
:
30px
;
}
}
.ct-chart
.ct-label
{
.ct-chart
.ct-label
{
...
...
debomatic-webui/views/history.ejs
View file @
efeebc64
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
</p>
</p>
<script> var dom_history = <%- JSON.stringify(history) %> </script>
<script> var dom_history = <%- JSON.stringify(history) %> </script>
<div id="charts">
<div id="charts">
<div id="days-chart" class="ct-chart"></div>
<div id="distributions-chart" class="ct-chart"></div>
<div id="distributions-chart" class="ct-chart"></div>
</div>
</div>
<table id="history" class="tablesorter">
<table id="history" class="tablesorter">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment