Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
eb26bc29
authored
Aug 24, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: separate latest blacklists table
parent
c5254b04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
network/templates/network/index.html
+22
-0
network/views.py
+3
-2
No files found.
network/templates/network/index.html
View file @
eb26bc29
...
...
@@ -26,6 +26,28 @@
{% endfor %}
</table>
<div
class=
"page-header"
>
<h1>
Latest blacklists
</h1>
</div>
<table
class=
"table table-striped table-bordered"
>
<tr>
<th>
IP
</th>
<th>
Reason
</th>
<th>
Type
</th>
<th>
Time elapsed
</th>
</tr>
{% for b in latest_blacklists %}
<tr>
<td><a
href=
"{{ b.get_absolute_url }}"
>
{{ b.ipv4 }}
</a></td>
<td>
{{ b.reason }}
</td>
<td>
{{ b.type }}
</td>
<td>
{{ b.modified_at|timesince }}
</td>
</tr>
{% endfor %}
</table>
<div
class=
"page-header"
>
<h1>
Dashboard
<small>
foo bar baz
</small></h1>
</div>
...
...
network/views.py
View file @
eb26bc29
...
...
@@ -37,8 +37,8 @@ class IndexView(TemplateView):
rules
=
Rule
.
objects
.
all
()
.
order_by
(
'-modified_at'
)[:
size
]
result_list
=
[]
for
i
in
(
sorted
(
chain
(
blacklists
,
domains
,
groups
,
host
s
,
records
,
vlans
,
vlangroups
,
rules
),
for
i
in
(
sorted
(
chain
(
domains
,
groups
,
hosts
,
records
,
vlan
s
,
vlangroups
,
rules
),
key
=
lambda
x
:
x
.
modified_at
,
reverse
=
True
)[:
size
]):
result_list
.
append
(
{
...
...
@@ -49,6 +49,7 @@ class IndexView(TemplateView):
'link'
:
i
.
get_absolute_url
()
})
context
[
'latest_blacklists'
]
=
blacklists
context
[
'latest'
]
=
result_list
return
context
...
...
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