Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
arthur-zzz
noc
Commits
1a3fbf20
Commit
1a3fbf20
authored
Nov 24, 2021
by
Dmitry Volodin
Browse files
Merge branch 'patch-avs-add-ip-param-confdb' into 'master'
Add IP type to ConfDB Query params. See merge request
noc/noc!5890
parents
f72095e7
c5f12ddf
Changes
2
Hide whitespace changes
Inline
Side-by-side
cm/models/confdbquery.py
View file @
1a3fbf20
# ----------------------------------------------------------------------
# ConfDBQuery model
# ----------------------------------------------------------------------
# Copyright (C) 2007-202
0
The NOC Project
# Copyright (C) 2007-202
1
The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
...
...
@@ -22,19 +22,31 @@ from mongoengine.fields import (
import
cachetools
# NOC modules
from
noc.core.ip
import
IP
from
noc.core.prettyjson
import
to_json
from
noc.core.text
import
quote_safe_path
from
noc.core.model.decorator
import
on_delete_check
from
noc.sa.interfaces.base
import
StringParameter
,
IntParameter
,
BooleanParameter
class
IPParameter
(
object
):
def
clean
(
self
,
value
):
return
IP
.
prefix
(
value
)
id_lock
=
threading
.
Lock
()
TYPE_MAP
=
{
"str"
:
StringParameter
(),
"int"
:
IntParameter
(),
"bool"
:
BooleanParameter
()}
TYPE_MAP
=
{
"str"
:
StringParameter
(),
"int"
:
IntParameter
(),
"bool"
:
BooleanParameter
(),
"ip"
:
IPParameter
(),
}
class
ConfDBQueryParam
(
EmbeddedDocument
):
meta
=
{
"strict"
:
False
}
name
=
StringField
()
type
=
StringField
(
choices
=
[
"str"
,
"int"
,
"bool"
])
type
=
StringField
(
choices
=
[
"str"
,
"int"
,
"bool"
,
"ip"
])
default
=
StringField
()
description
=
StringField
()
...
...
ui/web/cm/confdbquery/Application.js
View file @
1a3fbf20
...
...
@@ -81,7 +81,8 @@ Ext.define("NOC.cm.confdbquery.Application", {
store
:
[
[
"
str
"
,
"
str
"
],
[
"
int
"
,
"
int
"
],
[
"
bool
"
,
"
bool
"
]
[
"
bool
"
,
"
bool
"
],
[
"
ip
"
,
"
IP
"
]
]
}
},
...
...
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