Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
e0b4c5ca
Verified
Commit
e0b4c5ca
authored
May 02, 2022
by
Andrey Vertiprahov
Browse files
Add migrate is_regex to is_matching field in Label.
parent
8e7bda32
Pipeline
#36153
passed with stages
in 17 minutes and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
main/migrations/0064_migrate_is_matching_labels.py
0 → 100644
View file @
e0b4c5ca
# ----------------------------------------------------------------------
# Migrate is_regex to is_matching field
# ----------------------------------------------------------------------
# Copyright (C) 2007-2022 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC modules
from
noc.core.migration.base
import
BaseMigration
class
Migration
(
BaseMigration
):
depends_on
=
[(
"main"
,
"0063_migrate_filter_labels"
)]
def
migrate
(
self
):
self
.
mongo_db
[
"labels"
].
update_many
({
"is_regex"
:
True
},
{
"$set"
:
{
"is_matching"
:
True
}})
main/models/label.py
View file @
e0b4c5ca
...
...
@@ -1176,7 +1176,7 @@ class Label(Document):
"""
rxs
=
[]
for
ll
in
Label
.
objects
.
filter
(
__raw__
=
{
"is_
regex
"
:
True
,
"match_regex"
:
{
"$elemMatch"
:
{
"scope"
:
scope
}}}
__raw__
=
{
"is_
matching
"
:
True
,
"match_regex"
:
{
"$elemMatch"
:
{
"scope"
:
scope
}}}
):
for
rx
in
ll
.
match_regex
:
if
rx
.
scope
==
scope
:
...
...
ui/web/main/label/Application.js
View file @
e0b4c5ca
...
...
@@ -280,7 +280,7 @@ Ext.define("NOC.main.label.Application", {
value
:
"
{is_matching}
"
,
disabled
:
"
{isEnableDisableRx}
"
},
boxLabel
:
__
(
"
Regexp
Label
"
),
boxLabel
:
__
(
"
Is Matching
Label
"
),
},
{
name
:
"
match_regex
"
,
...
...
Andrey Vertiprahov
@aversant
mentioned in commit
75a37883
·
May 02, 2022
mentioned in commit
75a37883
mentioned in commit 75a3788316bb19f11541e6e6d8d54e769b63b483
Toggle commit list
Andrey Vertiprahov
@aversant
mentioned in merge request
!6273 (merged)
·
May 02, 2022
mentioned in merge request
!6273 (merged)
mentioned in merge request !6273
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment