Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
009bfb2b
Commit
009bfb2b
authored
6 years ago
by
David Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
new rule concept: work on ui edit for rules with multiple source prefixes
parent
7356da6b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flowspec/viewsets.py
+2
-1
2 additions, 1 deletion
flowspec/viewsets.py
poller/views.py
+8
-0
8 additions, 0 deletions
poller/views.py
templates/user_routes.html
+1
-1
1 addition, 1 deletion
templates/user_routes.html
with
11 additions
and
2 deletions
flowspec/viewsets.py
+
2
−
1
View file @
009bfb2b
...
@@ -388,7 +388,8 @@ class MatchDscpViewSet(viewsets.ModelViewSet):
...
@@ -388,7 +388,8 @@ class MatchDscpViewSet(viewsets.ModelViewSet):
# class1's attribute 'id' should be existing and by primary key
# class1's attribute 'id' should be existing and by primary key
def
convert_container_to_queryset
(
list1
,
class1
):
def
convert_container_to_queryset
(
list1
,
class1
):
temp1_ids
=
[
obj
.
id
for
obj
in
list1
]
#temp1_ids = [obj.id for obj in list1]
temp1_ids
=
[
obj
.
id
for
obj
in
list1
if
obj
!=
None
]
temp2_ids
=
set
(
temp1_ids
)
temp2_ids
=
set
(
temp1_ids
)
return
class1
.
objects
.
filter
(
id__in
=
temp2_ids
)
return
class1
.
objects
.
filter
(
id__in
=
temp2_ids
)
...
...
This diff is collapsed.
Click to expand it.
poller/views.py
+
8
−
0
View file @
009bfb2b
...
@@ -127,6 +127,7 @@ class Msgs(object):
...
@@ -127,6 +127,7 @@ class Msgs(object):
return
json_response
(
msg
)
return
json_response
(
msg
)
def
message_updates
(
self
,
request
,
peer_id
):
def
message_updates
(
self
,
request
,
peer_id
):
logger
.
info
(
"
poller::views::Msgs::message_updates(): called peer_id=
"
+
str
(
peer_id
))
if
request
.
is_ajax
():
if
request
.
is_ajax
():
cursor
=
{}
cursor
=
{}
try
:
try
:
...
@@ -144,16 +145,23 @@ class Msgs(object):
...
@@ -144,16 +145,23 @@ class Msgs(object):
self
.
user_cache
[
user
]
=
[]
self
.
user_cache
[
user
]
=
[]
except
:
except
:
self
.
user_cache
[
user
]
=
[]
self
.
user_cache
[
user
]
=
[]
logger
.
info
(
"
poller::views::Msgs::message_updates(): before test on waiting peer_id=
"
+
str
(
peer_id
))
if
not
self
.
user_cache
[
user
]
or
cursor
[
user
]
==
self
.
user_cache
[
user
][
-
1
][
'
id
'
]:
if
not
self
.
user_cache
[
user
]
or
cursor
[
user
]
==
self
.
user_cache
[
user
][
-
1
][
'
id
'
]:
logger
.
info
(
"
poller::views::Msgs::message_updates(): before waiting peer_id=
"
+
str
(
peer_id
))
self
.
new_message_user_event
[
user
].
wait
(
settings
.
POLL_SESSION_UPDATE
)
self
.
new_message_user_event
[
user
].
wait
(
settings
.
POLL_SESSION_UPDATE
)
logger
.
info
(
"
poller::views::Msgs::message_updates(): after test on waiting peer_id=
"
+
str
(
peer_id
))
try
:
try
:
for
index
,
m
in
enumerate
(
self
.
user_cache
[
user
]):
for
index
,
m
in
enumerate
(
self
.
user_cache
[
user
]):
if
m
[
'
id
'
]
==
cursor
[
user
]:
if
m
[
'
id
'
]
==
cursor
[
user
]:
logger
.
info
(
"
poller::views::Msgs::message_updates(): peer_id=
"
+
str
(
peer_id
)
+
"
before return in loop inner
"
)
return
json_response
({
'
messages
'
:
self
.
user_cache
[
user
][
index
+
1
:]})
return
json_response
({
'
messages
'
:
self
.
user_cache
[
user
][
index
+
1
:]})
logger
.
info
(
"
poller::views::Msgs::message_updates(): peer_id=
"
+
str
(
peer_id
)
+
"
before return in loop
"
)
return
json_response
({
'
messages
'
:
self
.
user_cache
[
user
]})
return
json_response
({
'
messages
'
:
self
.
user_cache
[
user
]})
finally
:
finally
:
if
self
.
user_cache
[
user
]:
if
self
.
user_cache
[
user
]:
self
.
user_cursor
[
user
]
=
self
.
user_cache
[
user
][
-
1
][
'
id
'
]
self
.
user_cursor
[
user
]
=
self
.
user_cache
[
user
][
-
1
][
'
id
'
]
logger
.
info
(
"
poller::views::Msgs::message_updates(): peer_id=
"
+
str
(
peer_id
)
+
"
before return end
"
)
return
HttpResponseRedirect
(
reverse
(
'
group-routes
'
))
return
HttpResponseRedirect
(
reverse
(
'
group-routes
'
))
def
monitor_polls
(
self
):
def
monitor_polls
(
self
):
...
...
This diff is collapsed.
Click to expand it.
templates/user_routes.html
+
1
−
1
View file @
009bfb2b
...
@@ -408,7 +408,7 @@ var update_size = function() {
...
@@ -408,7 +408,7 @@ var update_size = function() {
a
{
a
{
word-wrap
:
break-word
;
word-wrap
:
break-word
;
display
:
block
;
display
:
block
;
width
:
200px
;
max-
width
:
200px
;
}
}
.dl-horizontal
dt
{
.dl-horizontal
dt
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment