Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
9e037cf2
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: properly make https/ftp links
parent
90bd13c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
circle/dashboard/templatetags/network_tags.py
+4
-3
No files found.
circle/dashboard/templatetags/network_tags.py
View file @
9e037cf2
...
@@ -3,7 +3,7 @@ from django import template
...
@@ -3,7 +3,7 @@ from django import template
register
=
template
.
Library
()
register
=
template
.
Library
()
LINKABLE_PORTS
=
[
80
,
8080
,
443
,
8010
]
LINKABLE_PORTS
=
{
80
:
"http"
,
8080
:
"http"
,
443
:
"https"
,
21
:
"ftp"
}
@register.simple_tag
(
name
=
"display_portforward"
)
@register.simple_tag
(
name
=
"display_portforward"
)
...
@@ -11,7 +11,8 @@ def display_pf(ports):
...
@@ -11,7 +11,8 @@ def display_pf(ports):
is_ipv6
=
"ipv6"
in
ports
is_ipv6
=
"ipv6"
in
ports
data
=
ports
[
"ipv6"
if
is_ipv6
else
"ipv4"
]
data
=
ports
[
"ipv6"
if
is_ipv6
else
"ipv4"
]
if
ports
[
'private'
]
in
LINKABLE_PORTS
:
if
ports
[
'private'
]
in
LINKABLE_PORTS
.
keys
()
:
href
=
"
%
s:
%
d"
%
(
data
[
'host'
],
data
[
'port'
])
href
=
"
%
s:
%
d"
%
(
data
[
'host'
],
data
[
'port'
])
return
'<a href="http://
%
s">
%
s</a>'
%
(
href
,
href
)
return
'<a href="
%
s://
%
s">
%
s</a>'
%
(
LINKABLE_PORTS
.
get
(
ports
[
'private'
]),
href
,
href
)
return
"
%
s:
%
d"
%
(
data
[
'host'
],
data
[
'port'
])
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