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
90bd13c0
authored
Jun 03, 2014
by
Kálmán Viktor
Committed by
Bach Dániel
Jun 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: make certain portforwards links
parent
ad1519f3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
circle/dashboard/templates/dashboard/vm-detail/network.html
+3
-2
circle/dashboard/templatetags/__init__.py
+0
-0
circle/dashboard/templatetags/network_tags.py
+17
-0
No files found.
circle/dashboard/templates/dashboard/vm-detail/network.html
View file @
90bd13c0
{% load i18n %}
{% load i18n %}
{% load network_tags %}
<h2>
<h2>
<a
href=
"#"
id=
"vm-details-network-add"
class=
"btn btn-success pull-right no-js-hidden"
>
<a
href=
"#"
id=
"vm-details-network-add"
class=
"btn btn-success pull-right no-js-hidden"
>
<i
class=
"icon-plus"
></i>
{% trans "add interface" %}
<i
class=
"icon-plus"
></i>
{% trans "add interface" %}
...
@@ -91,7 +92,7 @@
...
@@ -91,7 +92,7 @@
{% if l.ipv4 %}
{% if l.ipv4 %}
<tr>
<tr>
<td>
<td>
{
{ l.ipv4.host }}:{{ l.ipv4.port }
}
{
% display_portforward l %
}
</td>
</td>
<td><i
class=
"icon-long-arrow-right"
></i></td>
<td><i
class=
"icon-long-arrow-right"
></i></td>
<td>
<td>
...
@@ -123,7 +124,7 @@
...
@@ -123,7 +124,7 @@
{% if l.ipv6 %}
{% if l.ipv6 %}
<tr>
<tr>
<td>
<td>
{
{ l.ipv6.host }}:{{ l.ipv6.port }
}
{
% display_portforward l %
}
</td>
</td>
<td><i
class=
"icon-long-arrow-right"
></i></td>
<td><i
class=
"icon-long-arrow-right"
></i></td>
<td>
<td>
...
...
circle/dashboard/templatetags/__init__.py
0 → 100644
View file @
90bd13c0
circle/dashboard/templatetags/network_tags.py
0 → 100644
View file @
90bd13c0
from
django
import
template
register
=
template
.
Library
()
LINKABLE_PORTS
=
[
80
,
8080
,
443
,
8010
]
@register.simple_tag
(
name
=
"display_portforward"
)
def
display_pf
(
ports
):
is_ipv6
=
"ipv6"
in
ports
data
=
ports
[
"ipv6"
if
is_ipv6
else
"ipv4"
]
if
ports
[
'private'
]
in
LINKABLE_PORTS
:
href
=
"
%
s:
%
d"
%
(
data
[
'host'
],
data
[
'port'
])
return
'<a href="http://
%
s">
%
s</a>'
%
(
href
,
href
)
return
"
%
s:
%
d"
%
(
data
[
'host'
],
data
[
'port'
])
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