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
2cd42a7a
Commit
2cd42a7a
authored
Jul 02, 2022
by
Andrey Vertiprahov
Browse files
Merge branch 'cherry-pick-
0233985f
' into 'release-22.1'
release-22.1:Backport!6427 See merge request
!6430
parents
13c1839b
0f1bb3ea
Changes
7
Hide whitespace changes
Inline
Side-by-side
ui/web/core/label/LabelField.js
View file @
2cd42a7a
...
...
@@ -23,6 +23,7 @@ Ext.define("NOC.core.label.LabelField", {
queryMode
:
"
remote
"
,
autoLoadOnValue
:
true
,
filterPickList
:
true
,
filterProtected
:
true
,
forceSelection
:
true
,
createNewOnEnter
:
false
,
isTree
:
false
,
...
...
@@ -123,7 +124,7 @@ Ext.define("NOC.core.label.LabelField", {
},
filterPicked
:
function
(
rec
)
{
return
!
this
.
valueCollection
.
contains
(
rec
)
&&
!
rec
.
get
(
"
is_protected
"
);
return
!
this
.
valueCollection
.
contains
(
rec
)
&&
!
(
rec
.
get
(
"
is_protected
"
)
&&
this
.
filterProtected
)
;
},
onKeyDown
:
function
(
e
)
{
...
...
@@ -149,10 +150,10 @@ Ext.define("NOC.core.label.LabelField", {
lastSelectionIndex
=
-
1
;
}
valueCollection
.
remove
(
Ext
.
Array
.
filter
(
selModel
.
getSelection
(),
function
(
el
)
{
return
!
el
.
get
(
"
is_protected
"
)
return
!
el
.
get
(
"
is_protected
"
)
&&
me
.
filterProtected
}));
}
else
{
if
(
!
valueCollection
.
last
().
get
(
"
is_protected
"
))
{
if
(
!
valueCollection
.
last
().
get
(
"
is_protected
"
)
&&
me
.
filterProtected
)
{
valueCollection
.
remove
(
valueCollection
.
last
());
}
}
...
...
@@ -231,14 +232,14 @@ Ext.define("NOC.core.label.LabelField", {
'
%}
'
,
me
.
tipTpl
?
'
" data-qtip="{[this.getTip(values)]}">
'
:
'
">
'
,
'
<div class="
'
+
me
.
tagItemTextCls
+
'
">{[this.getItemLabel(values)]}</div>
'
,
'
<tpl if="!is_protected">
'
,
'
<tpl if="!is_protected
|| !this.filter_protected
">
'
,
'
<div class="
'
+
me
.
tagItemCloseCls
+
childElCls
+
'
"></div>
'
,
'
</tpl>
'
,
'
</li>
'
,
'
</tpl>
'
,
{
isProtected
:
function
(
rec
)
{
return
rec
.
get
(
"
is_protected
"
);
return
rec
.
get
(
"
is_protected
"
)
&&
me
.
filterProtected
;
},
isSelected
:
function
(
rec
)
{
return
me
.
selectionModel
.
isSelected
(
rec
);
...
...
@@ -250,6 +251,7 @@ Ext.define("NOC.core.label.LabelField", {
getTip
:
function
(
values
)
{
return
Ext
.
String
.
htmlEncode
(
me
.
tipTpl
.
apply
(
values
));
},
filter_protected
:
me
.
filterProtected
,
strict
:
true
}
]);
...
...
ui/web/core/modelfilter/Label.js
View file @
2cd42a7a
...
...
@@ -29,6 +29,7 @@ Ext.define("NOC.core.modelfilter.Label", {
width
:
me
.
width
,
query
:
me
.
query_filter
,
isTree
:
me
.
isTree
,
filterProtected
:
me
.
filterProtected
,
treePickerWidth
:
me
.
treePickerWidth
,
listeners
:
{
select
:
{
...
...
ui/web/fm/alarmrule/Application.js
View file @
2cd42a7a
...
...
@@ -200,6 +200,7 @@ Ext.define("NOC.fm.alarmrule.Application", {
fieldLabel
:
__
(
"
Match Labels
"
),
allowBlank
:
true
,
isTree
:
true
,
filterProtected
:
false
,
pickerPosition
:
"
down
"
,
uiStyle
:
"
extra
"
,
query
:
{
...
...
@@ -212,6 +213,7 @@ Ext.define("NOC.fm.alarmrule.Application", {
fieldLabel
:
__
(
"
Exclude Match Labels
"
),
allowBlank
:
true
,
isTree
:
true
,
filterProtected
:
false
,
pickerPosition
:
"
down
"
,
uiStyle
:
"
extra
"
,
query
:
{
...
...
ui/web/inv/interfaceprofile/Application.js
View file @
2cd42a7a
...
...
@@ -470,6 +470,7 @@ Ext.define("NOC.inv.interfaceprofile.Application", {
fieldLabel
:
__
(
"
Match Labels
"
),
allowBlank
:
false
,
isTree
:
true
,
filterProtected
:
false
,
pickerPosition
:
"
down
"
,
uiStyle
:
"
extra
"
,
query
:
{
...
...
@@ -505,6 +506,7 @@ Ext.define("NOC.inv.interfaceprofile.Application", {
lookup
:
"
main.handler.LookupField
"
,
pickerPosition
:
"
left
"
,
isTree
:
true
,
filterProtected
:
false
,
treePickerWidth
:
400
,
query_filter
:
{
"
allow_matched
"
:
true
...
...
ui/web/inv/sensorprofile/Application.js
View file @
2cd42a7a
...
...
@@ -139,6 +139,7 @@ Ext.define("NOC.inv.sensorprofile.Application", {
fieldLabel
:
__
(
"
Match Labels
"
),
allowBlank
:
false
,
isTree
:
true
,
filterProtected
:
false
,
pickerPosition
:
"
down
"
,
uiStyle
:
"
extra
"
,
query
:
{
...
...
ui/web/sa/managedobject/Application.js
View file @
2cd42a7a
...
...
@@ -1681,7 +1681,8 @@ Ext.define("NOC.sa.managedobject.Application", {
{
title
:
__
(
"
By Labels
"
),
name
:
"
labels
"
,
ftype
:
"
label
"
ftype
:
"
label
"
,
filterProtected
:
false
}
],
inlines
:
...
...
ui/web/sa/managedobjectprofile/Application.js
View file @
2cd42a7a
...
...
@@ -427,6 +427,7 @@ Ext.define("NOC.sa.managedobjectprofile.Application", {
fieldLabel
:
__
(
"
Match Labels
"
),
allowBlank
:
false
,
isTree
:
true
,
filterProtected
:
false
,
pickerPosition
:
"
down
"
,
uiStyle
:
"
extra
"
,
query
:
{
...
...
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