Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9ffd1dbd
authored
Sep 22, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: i18n for graphs
parent
ccbce20a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
circle/dashboard/views/graph.py
+12
-11
circle/dashboard/views/util.py
+1
-1
No files found.
circle/dashboard/views/graph.py
View file @
9ffd1dbd
...
...
@@ -23,6 +23,7 @@ import requests
from
django.conf
import
settings
from
django.core.exceptions
import
PermissionDenied
,
SuspiciousOperation
from
django.http
import
HttpResponse
,
Http404
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.views.generic
import
View
from
braces.views
import
LoginRequiredMixin
,
SuperuserRequiredMixin
...
...
@@ -162,8 +163,8 @@ class NodeListGraphView(SuperuserRequiredMixin, GraphViewBase):
class
Ram
(
object
):
metric_name
=
"memory.usage"
title
=
"RAM usage (
%
)"
label
=
"RAM usage (
%
)"
title
=
_
(
"RAM usage (
%
)"
)
label
=
_
(
"RAM usage (
%
)"
)
def
get_minmax
(
self
):
return
(
0
,
105
)
...
...
@@ -174,8 +175,8 @@ register_graph(Ram, 'memory', NodeGraphView)
class
Cpu
(
object
):
metric_name
=
"cpu.percent"
title
=
"CPU usage (
%
)"
label
=
"CPU usage (
%
)"
title
=
_
(
"CPU usage (
%
)"
)
label
=
_
(
"CPU usage (
%
)"
)
def
get_minmax
(
self
):
if
isinstance
(
self
.
obj
,
Node
):
...
...
@@ -188,7 +189,7 @@ register_graph(Cpu, 'cpu', NodeGraphView)
class
VmNetwork
(
object
):
title
=
"Network"
title
=
_
(
"Network"
)
def
get_minmax
(
self
):
return
(
0
,
None
)
...
...
@@ -211,7 +212,7 @@ register_graph(VmNetwork, 'network', VmGraphView)
class
NodeNetwork
(
object
):
title
=
"Network"
title
=
_
(
"Network"
)
def
get_minmax
(
self
):
return
(
0
,
None
)
...
...
@@ -227,8 +228,8 @@ register_graph(NodeNetwork, 'network', NodeGraphView)
class
NodeVms
(
object
):
metric_name
=
"vmcount"
title
=
"Instance count"
label
=
"instance count"
title
=
_
(
"Instance count"
)
label
=
_
(
"instance count"
)
def
get_minmax
(
self
):
return
(
0
,
None
)
...
...
@@ -237,7 +238,7 @@ register_graph(NodeVms, 'vm', NodeGraphView)
class
NodeAllocated
(
object
):
title
=
"Allocated memory (bytes)"
title
=
_
(
"Allocated memory (bytes)"
)
def
get_target
(
self
):
prefix
=
self
.
obj
.
metric_prefix
...
...
@@ -257,7 +258,7 @@ register_graph(NodeAllocated, 'alloc', NodeGraphView)
class
NodeListAllocated
(
object
):
title
=
"Allocated memory (bytes)"
title
=
_
(
"Allocated memory (bytes)"
)
def
get_target
(
self
):
nodes
=
self
.
obj
...
...
@@ -277,7 +278,7 @@ register_graph(NodeListAllocated, 'alloc', NodeListGraphView)
class
NodeListVms
(
object
):
title
=
"Instance count"
title
=
_
(
"Instance count"
)
def
get_target
(
self
):
vmcount
=
','
.
join
(
'
%
s.vmcount'
%
n
.
metric_prefix
for
n
in
self
.
obj
)
...
...
circle/dashboard/views/util.py
View file @
9ffd1dbd
...
...
@@ -31,7 +31,7 @@ from django.contrib.auth.views import redirect_to_login
from
django.db.models
import
Q
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
django.shortcuts
import
redirect
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
_lazy
as
_
from
django.views.generic
import
DetailView
,
View
from
django.views.generic.detail
import
SingleObjectMixin
...
...
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