Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7c17ba5d
authored
Mar 11, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: pretty stat
parent
9a207877
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
29 deletions
+27
-29
one/static/style/base.less
+1
-5
one/templates/base.html
+26
-24
No files found.
one/static/style/base.less
View file @
7c17ba5d
...
...
@@ -287,6 +287,7 @@ body > footer {
box-shadow:0 0 30px rgba(0,0,0,0.4);
margin:0;
background-color: white;
height: 30px;
}
#http-error {
...
...
@@ -302,8 +303,3 @@ body > footer {
.irasmu p {
margin-top: 20px;
}
.stat {
margin: 0 auto;
width: 900px;
}
one/templates/base.html
View file @
7c17ba5d
...
...
@@ -73,47 +73,53 @@
<div
class=
"clear"
></div>
</div>
<footer>
<p>
<div>
<div
style=
"float: left"
id=
"chart_cpu_div"
></div>
<a
href=
"/sites/legal/"
>
{% trans "Legal notice" %}
</a>
|
<a
href=
"/sites/policy/"
>
{% trans "Policy" %}
</a>
|
<a
href=
"/sites/help/"
>
{% trans "Help" %}
</a>
|
<a
href=
"/sites/support/"
>
{% trans "Support" %}
</a>
</p>
<div
style=
"float: right"
id=
"chart_mem_div"
></div>
</div>
{% if cloud_stat %}
<style
type=
"text/css"
>
#content
{
padding-bottom
:
150px
;}
</style>
<script
type=
"text/javascript"
>
google
.
setOnLoadCallback
(
drawChart
);
function
drawChart
()
{
var
data_cpu
=
new
google
.
visualization
.
DataTable
();
data_cpu
.
addColumn
(
'string'
,
'Topping'
);
data_cpu
.
addColumn
(
'number'
,
'Free'
);
data_cpu
.
addColumn
(
'number'
,
'Allocated'
);
data_cpu
.
addColumn
(
'number'
,
'Used'
);
data_cpu
.
addColumn
(
'number'
,
'Allocated'
);
data_cpu
.
addColumn
(
'number'
,
'Free'
);
data_cpu
.
addRows
([
[
'CPU %'
,
{{
cloud_stat
.
CPU
.
FREE_CPU
}},{{
cloud_stat
.
CPU
.
ALLOC_CPU
}},{{
cloud_stat
.
CPU
.
USED_CPU
}}],
[
'CPU'
,
{{
cloud_stat
.
CPU
.
USED_CPU
}},
{{
cloud_stat
.
CPU
.
ALLOC_CPU
}},
{{
cloud_stat
.
CPU
.
FREE_CPU
}},]
]);
var
cpu_options
=
{
'title'
:
'Cloud CPU usage percent (100/CPU)'
,
'width'
:
900
,
'height'
:
50
,
isStacked
:
true
'width'
:
400
,
'height'
:
20
,
isStacked
:
true
,
enableInteractivity
:
false
,
colors
:
[
'red'
,
'orange'
,
'blue'
]
};
var
data_mem
=
new
google
.
visualization
.
DataTable
();
data_mem
.
addColumn
(
'string'
,
'Topping'
);
data_mem
.
addColumn
(
'number'
,
'Free'
);
data_mem
.
addColumn
(
'number'
,
'Allocated'
);
data_mem
.
addColumn
(
'number'
,
'Used'
);
data_mem
.
addColumn
(
'number'
,
'Allocated'
);
data_mem
.
addColumn
(
'number'
,
'Free'
);
data_mem
.
addRows
([
[
'
Memory in {{cloud_stat.DIMENSION}}
'
,
{{
cloud_stat
.
MEM
.
FREE
_MEM
|
unlocalize
}},
[
'
RAM
'
,
{{
cloud_stat
.
MEM
.
USED
_MEM
|
unlocalize
}},
{{
cloud_stat
.
MEM
.
ALLOC_MEM
|
unlocalize
}},
{{
cloud_stat
.
MEM
.
USED_MEM
|
unlocalize
}}],
{{
cloud_stat
.
MEM
.
FREE_MEM
|
unlocalize
}},]
]);
var
mem_options
=
{
'title'
:
'Memory in {{cloud_stat.DIMENSION}}'
,
'width'
:
900
,
'height'
:
50
,
isStacked
:
true
'width'
:
400
,
'height'
:
20
,
isStacked
:
true
,
enableInteractivity
:
false
,
colors
:
[
'red'
,
'orange'
,
'blue'
]
};
var
chart
=
new
google
.
visualization
.
BarChart
(
document
.
getElementById
(
'chart_cpu_div'
));
chart
.
draw
(
data_cpu
,
cpu_options
);
...
...
@@ -122,14 +128,10 @@
}
</script>
{% endif %}
<div
class=
"stat"
id=
"chart_cpu_div"
></div>
<div
class=
"stat"
id=
"chart_mem_div"
></div>
</footer>
<div
id=
"modal"
style=
"display: none"
>
<div
id=
"shadow"
></div>
<div
id=
"modal-container"
>
</div>
<div
id=
"modal-container"
></div>
</div>
<script
type=
"text/javascript"
>
var
_gaq
=
_gaq
||
[];
...
...
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