Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
9242be55
Commit
9242be55
authored
Oct 25, 2012
by
Olga Brani
Browse files
Resources statistic page
parent
1df36221
Changes
9
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/static/im/css/modules.css
View file @
9242be55
...
...
@@ -350,12 +350,12 @@ table.alt-style tr td a.more-info:hover { background-image:url(../images/plus-
table
.alt-style
tr
td
a
.open
{
background-position
:
-16px
0
}
.projects
.details
a
.edit
{
float
:
right
;
margin-left
:
20px
;
}
.projects
.details
.data
{
overflow
:
hidden
;
}
<<<<<<<
HEAD
.projects
.details
.data
{
overflow
:
hidden
;
}
.projects
.editable
form
textarea
{
width
:
70%
;
height
:
50px
;
max-width
:
70%
;
width
:
270px
;
height
:
120px
;}
/* quotas-form */
.quotas-form
fieldset
{
background
:
url(../images/dots.jpg)
repeat-x
scroll
center
bottom
transparent
;
margin-bottom
:
3em
;
padding-bottom
:
3em
;
position
:
relative
;
}
.quotas-form
fieldset
legend
{
color
:
#55B577
;
font-size
:
1.308em
;
margin-bottom
:
2em
;
}
.quotas-form
.with-checkbox
.checkbox-widget
{
margin-top
:
14px
;
}
...
...
@@ -366,16 +366,24 @@ table.alt-style tr td a.open { background-position:-16px 0}
.quotas-form
input
[
type
=
"submit"
]
:focus
{
border-color
:
#B3B3B3
}
.quotas-form
input
[
type
=
"submit"
]
:focus:hover
{
border-color
:
#55B577
}
.quotas-form
fieldset
ul
{
padding
:
0
;
margin
:
0
0
1em
;
}
.quotas-form
fieldset
ul
li
{
list-style
:
none
outside
none
;
float
:
left
;
padding
:
0
0
0
59
px
;
margin
:
0
;
}
.quotas-form
fieldset
ul
li
{
list-style
:
none
outside
none
;
float
:
left
;
padding
:
0
0
0
60
px
;
margin
:
0
;
}
.quotas-form
fieldset
ul
li
:first-child
{
padding-left
:
0
;
}
.quotas-form
fieldset
ul
li
a
{
display
:
block
;
border
:
1px
solid
#222
;
color
:
#222
;
padding
:
10px
20px
;
}
.quotas-form
fieldset
ul
li
a
:hover
{
text-decoration
:
none
;
border-color
:
#55B577
;
color
:
#55B577
;
}
.quotas-form
fieldset
ul
li
a
.selected
{
background
:
#55B577
;
color
:
#fff
;
border-color
:
#55B577
;
}
.quotas-form
fieldset
ul
li
a
{
display
:
block
;
width
:
82px
;
height
:
82px
;
overflow
:
hidden
;
}
.quotas-form
fieldset
ul
li
a
:hover
img
{
margin-top
:
-151px
;
}
.quotas-form
fieldset
ul
li
a
.selected
img
{
margin-top
:
-313px
;
}
.quotas-form
p
.msg
{
color
:
#B3B3B3
;
}
.quotas-form
fieldset
legend
{
margin-bottom
:
1em
;
font-size
:
1.154em
}
.quotas-form
a
.delete
{
position
:
absolute
;
right
:
0
;
top
:
0
;
color
:
#B3B3B3
;
}
.quotas-form
.quota
{
display
:
none
;
}
.quotas-form
fieldset
ul
li
.rel
+
li
.rel
{
background
:
url(../images/quota-related-bg.png)
no-repeat
left
center
;
}
.quotas-form
.quota
.with-checkbox
input
[
type
=
"text"
]
{
width
:
100px
;
margin
:
10px
0
0
;
float
:
left
;}
.quotas-form
.quota
.with-checkbox
label
{
position
:
absolute
;
left
:
0
;
top
:
0
;
}
.quotas-form
.quota
.with-checkbox
p
{
padding-left
:
224px
;
float
:
left
;
}
.quotas-form
.quota
.double-checkbox
{
float
:
left
;
}
.quotas-form
.quota
.double-checkbox
+
.double-checkbox
label
{
display
:
none
;
}
.quotas-form
.quota
.double-checkbox
+
.double-checkbox
p
{
padding-left
:
20px
;
}
.quotas-form
.quota
.double-checkbox
.checkbox-widget
{
position
:
static
;
}
/* stats */
.stats
ul
{
margin
:
0
;
padding
:
0
;
list-style
:
none
outside
none
;
}
...
...
@@ -389,14 +397,15 @@ table.alt-style tr td a.open { background-position:-16px 0}
.stats
.img-wrap
{
float
:
left
;
width
:
100px
;
background
:
url(../images/statistics_icons.png)
no-repeat
center
center
;
padding
:
30px
0
;
}
.stats
.info
{
margin
:
0
25px
;
width
:
320px
;
float
:
left
;
}
.stats
.info
p
{
color
:
#999
;
margin
:
0
;
}
.stats
.info
h3
{
font-size
:
1.231em
;
}
.stats
.red.vm
.img-wrap
{
background-position
:
15px
7px
;
}
.stats
.yellow.vm
.img-wrap
{
background-position
:
-124px
7px
;
}
.stats
.green.vm
.img-wrap
{
background-position
:
-263px
7px
;
}
.stats
.red.ram
.img-wrap
{
background-position
:
15px
-125px
;
}
.stats
.yellow.ram
.img-wrap
{
background-position
:
-124px
-125px
;
}
.stats
.green.ram
.img-wrap
{
background-position
:
-263px
-125px
;}
.stats
.red.disks
.img-wrap
{
background-position
:
15px
-248px
;
}
.stats
.yellow.disks
.img-wrap
{
background-position
:
-124px
-248px
;
}
.stats
.green.disks
.img-wrap
{
background-position
:
-263px
-248px
;}
.stats
.info
h3
{
font-size
:
1.231em
;
color
:
#222222
}
.stats
.vm
.img-wrap
{
background-image
:
url(../images/vm-stats.png)
}
.stats
.ram
.img-wrap
{
background-image
:
url(../images/ram-stats.png)
}
.stats
.network
.img-wrap
{
background-image
:
url(../images/network-stats.png)
}
.stats
.disk
.img-wrap
{
background-image
:
url(../images/disk-stats.png)
}
.stats
.storage
.img-wrap
{
background-image
:
url(../images/storage-stats.png)
}
.stats
.bandwidth
.img-wrap
{
background-image
:
url(../images/bandwidth-stats.png)
}
.stats
.red
.img-wrap
{
background-position
:
15px
7px
;
}
.stats
.yellow
.img-wrap
{
background-position
:
-124px
7px
;
}
.stats
.green
.img-wrap
{
background-position
:
-263px
7px
;
}
.projects
.editable
form
textarea
{
width
:
70%
;
height
:
50px
;
max-width
:
70%
;
width
:
270px
;
height
:
120px
;}
\ No newline at end of file
snf-astakos-app/astakos/im/static/im/images/disk-stats.png
0 → 100644
View file @
9242be55
6.15 KB
snf-astakos-app/astakos/im/static/im/images/network-stats.png
0 → 100644
View file @
9242be55
5.63 KB
snf-astakos-app/astakos/im/static/im/images/ram-stats.png
0 → 100644
View file @
9242be55
1.07 KB
snf-astakos-app/astakos/im/static/im/images/red-stats-vm.png
0 → 100644
View file @
9242be55
467 Bytes
snf-astakos-app/astakos/im/static/im/images/storage-stats.png
0 → 100644
View file @
9242be55
4.09 KB
snf-astakos-app/astakos/im/static/im/images/vm-stats.png
0 → 100644
View file @
9242be55
1.23 KB
snf-astakos-app/astakos/im/templates/im/astakosuserquota_list.html
View file @
9242be55
...
...
@@ -5,46 +5,23 @@
{% block page.body %}
<div
class=
"maincol {% block innerpage.class %}{% endblock %}"
>
<div
class=
"stats clearfix"
>
<ul>
<li
class=
"clearfix red vm"
>
<ul>
{% for r in data.resources %}
<li
class=
"clearfix {{ r.load_class }} {{ r.name}}"
>
<div
class=
"img-wrap"
>
</div>
<div
class=
"info"
>
<h3>
Number of Vms
</h3>
<h3>
{{ r.description }}
</h3>
<p>
XX
% Used
<br>
That is XXX of your XXX MB of virtual RAM
- Aouch!
{{ r.ratio|floatformat }}
% Used
<br>
You are using {{ r.currValue }} {{ r.unit }} out of your {{ r.maxValue }}{{ r.unit }} {{ r.plural|capfirst }}
- Aouch!
</p>
</div>
<div
class=
"bar"
>
<div><span
style=
"width:89%;"
>
89%
</span></div>
</div>
</li>
<li
class=
"clearfix yellow ram"
>
<div
class=
"img-wrap"
>
</div>
<div
class=
"info"
>
<h3>
Number of RAMs
</h3>
<p>
XX% Used
<br>
That is XXX of your XXX MB of virtual RAM - Aouch!
</p>
</div>
<div
class=
"bar"
>
<div><span
style=
"width:30%;"
>
30%
</span></div>
</div>
</li>
<li
class=
"clearfix green disks"
>
<div
class=
"img-wrap"
>
</div>
<div
class=
"info"
>
<h3>
Number of Vms
</h3>
<p>
XX% Used
<br>
That is XXX of your XXX MB of virtual RAM - Aouch!
</p>
</div>
<div
class=
"bar"
>
<div><span
style=
"width:60%;"
>
30%
</span></div>
<div><span
style=
"width:{{ r.ratio|floatformat }}%;"
>
{{ r.ratio|floatformat }}%
</span></div>
</div>
</li>
{% endfor %}
</ul>
</div>
<!--
...
...
@@ -83,7 +60,7 @@
</tbody>
</table>
{% endfor %}
</div>
-->
</div>
<form action="" method="post"
class="withlabels">{% csrf_token %}
{% include "im/form_render.html" %}
...
...
@@ -112,7 +89,7 @@
{% endif %}
{% endwith %}
{% endif %}
</table>
</table>
-->
</div>
</div>
{% endblock %}
snf-astakos-app/astakos/im/views.py
View file @
9242be55
...
...
@@ -1044,9 +1044,73 @@ def resource_list(request):
else
:
form
=
PickResourceForm
()
q
=
AstakosGroupQuota
.
objects
.
none
()
data
=
{
'resources'
:[{
'name'
:
'vm'
,
'description'
:
'Number Of Vms'
,
'unit'
:
''
,
'maxValue'
:
'100'
,
'currValue'
:
'50'
},{
'name'
:
'ram'
,
'description'
:
'Total Ram Usage'
,
'unit'
:
'GB'
,
'maxValue'
:
'4'
,
'currValue'
:
'1'
},{
'name'
:
'storage'
,
'description'
:
'Total Disk Space Used'
,
'unit'
:
'GB'
,
'maxValue'
:
'200'
,
'currValue'
:
'180'
},{
'name'
:
'disk'
,
'description'
:
'Disks Used'
,
'unit'
:
'GB'
,
'maxValue'
:
'16'
,
'currValue'
:
'16'
},{
'name'
:
'network'
,
'description'
:
'Private Networks Used'
,
'unit'
:
''
,
'maxValue'
:
'2'
,
'currValue'
:
'1'
},{
'name'
:
'bandwidth'
,
'description'
:
'Bandwidth Monitoring Device'
,
'unit'
:
'Gbps'
,
'maxValue'
:
'200'
,
'currValue'
:
'50'
}]
}
def
with_class
(
entry
):
entry
[
'load_class'
]
=
'red'
max_value
=
float
(
entry
[
'maxValue'
])
curr_value
=
float
(
entry
[
'currValue'
])
entry
[
'ratio'
]
=
(
curr_value
/
max_value
)
*
100
if
entry
[
'ratio'
]
<
66
:
entry
[
'load_class'
]
=
'yellow'
if
entry
[
'ratio'
]
<
33
:
entry
[
'load_class'
]
=
'green'
return
entry
def
pluralize
(
entry
):
if
entry
[
'unit'
]
==
''
:
entry
[
'plural'
]
=
entry
[
'name'
]
+
's'
else
:
entry
[
'plural'
]
=
entry
[
'name'
]
return
entry
data
[
'resources'
]
=
map
(
with_class
,
data
[
'resources'
])
data
[
'resources'
]
=
map
(
pluralize
,
data
[
'resources'
])
return
object_list
(
request
,
q
,
template_name
=
'im/astakosuserquota_list.html'
,
extra_context
=
{
'form'
:
form
})
extra_context
=
{
'form'
:
form
,
'data'
:
data
})
def
group_create_list
(
request
):
...
...
@@ -1062,7 +1126,7 @@ def billing(request):
today
=
datetime
.
today
()
month_last_day
=
calendar
.
monthrange
(
today
.
year
,
today
.
month
)[
1
]
data
[
'resources'
]
=
map
(
with_class
,
data
[
'resources'
])
start
=
request
.
POST
.
get
(
'datefrom'
,
None
)
if
start
:
today
=
datetime
.
fromtimestamp
(
int
(
start
))
...
...
@@ -1150,4 +1214,4 @@ def timeline(request):
form
=
form
,
timeline_header
=
timeline_header
,
timeline_body
=
timeline_body
)
return
data
\ No newline at end of file
return
data
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