Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
netvs-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
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
scc-net
netvs
netvs-core
Commits
1d65f8f0
Commit
1d65f8f0
authored
4 years ago
by
Janis Streib
Browse files
Options
Downloads
Patches
Plain Diff
ADD: search by vlan (closes
#157
)
parent
d333dde5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#274938
passed with warnings
4 years ago
Stage: build
Stage: lint
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/api-services/search.service.js
+12
-0
12 additions, 0 deletions
frontend/src/api-services/search.service.js
frontend/src/components/GlobalSearch.vue
+40
-2
40 additions, 2 deletions
frontend/src/components/GlobalSearch.vue
frontend/src/icons.js
+4
-2
4 additions, 2 deletions
frontend/src/icons.js
with
56 additions
and
4 deletions
frontend/src/api-services/search.service.js
+
12
−
0
View file @
1d65f8f0
...
...
@@ -65,6 +65,18 @@ export default {
]
return
TransactionService
.
execute
(
config
,
ta
)
},
searchVlan
(
config
,
term
)
{
const
ta
=
[
{
name
:
'
nd.vlan.list
'
,
old
:
apiutil
.
denullify_dict
({
id
:
term
,
fetch_limit
:
20
})
}
]
return
TransactionService
.
execute
(
config
,
ta
)
},
searchBCDSubnet
(
config
,
term
,
own
)
{
const
ta
=
[
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/GlobalSearch.vue
+
40
−
2
View file @
1d65f8f0
...
...
@@ -148,6 +148,7 @@ export default {
this
.
search_res
.
forEach
(
item
=>
{
let
index
=
-
1
let
record_composit
=
null
let
compiled_term
=
null
switch
(
item
.
type
.
toLowerCase
())
{
case
'
dns.record
'
:
record_composit
=
item
.
term
.
fqdn
+
'
IN
'
+
item
.
term
.
type
+
'
'
+
item
.
term
.
data
...
...
@@ -231,6 +232,35 @@ export default {
}
}
break
case
'
nd.vlan
'
:
compiled_term
=
item
.
term
.
name
+
'
(
'
+
item
.
term
.
id
+
'
@
'
+
item
.
term
.
net_instnc
+
'
)
'
if
(
isRegex
)
{
suggestions
.
push
({
name
:
[
''
,
compiled_term
,
''
],
type
:
item
.
type
,
url
:
'
/dnsvs/bcds/
'
+
item
.
term
.
bcd
})
}
else
{
index
=
compiled_term
.
toLowerCase
().
indexOf
(
search
.
toLowerCase
())
if
(
index
!==
-
1
)
{
suggestions
.
push
({
name
:
[
compiled_term
.
substring
(
0
,
index
),
compiled_term
.
substring
(
index
,
index
+
search
.
length
),
compiled_term
.
substring
(
index
+
search
.
length
)
],
type
:
item
.
type
,
url
:
'
/dnsvs/bcds/
'
+
item
.
term
.
bcd
})
}
}
break
}
})
return
suggestions
...
...
@@ -244,6 +274,9 @@ export default {
if
(
type
.
startsWith
(
'
dns.
'
))
{
return
'
map-signs
'
}
if
(
type
===
'
nd.vlan
'
)
{
return
'
ethernet
'
}
if
(
type
.
startsWith
(
'
nd.
'
))
{
return
'
network-wired
'
}
...
...
@@ -313,8 +346,11 @@ export default {
this
.
descriminator
=
this
.
getSearchDiscriminator
()
const
term
=
this
.
cutDescriminator
().
trim
()
const
termIsIP
=
ipaddress
.
isValid
(
term
.
split
(
'
/
'
)[
0
])
const
termIsNumeric
=
!
isNaN
(
parseInt
(
term
))
if
(
this
.
descriminator
==
null
)
{
// Nur is_own, ohne regex
if
(
termIsIP
)
{
if
(
termIsNumeric
)
{
this
.
dispatch_search
(
SearchService
.
searchVlan
(
this
.
$store
.
state
.
netdb_axios_config
,
parseInt
(
term
)),
'
nd.vlan
'
)
}
else
if
(
termIsIP
)
{
this
.
dispatch_search
(
SearchService
.
searchRRByIP
(
this
.
$store
.
state
.
netdb_axios_config
,
term
,
true
),
'
dns.record
'
)
this
.
dispatch_search
(
SearchService
.
searchBCDSubnet
(
this
.
$store
.
state
.
netdb_axios_config
,
term
,
true
),
'
nd.ip_subnet
'
)
}
else
{
...
...
@@ -322,7 +358,9 @@ export default {
this
.
dispatch_search
(
SearchService
.
searchRecordRegex
(
this
.
$store
.
state
.
netdb_axios_config
,
term
,
true
),
'
dns.record
'
)
}
}
else
if
(
this
.
descriminator
===
'
dnsvs
'
)
{
if
(
termIsIP
)
{
if
(
termIsNumeric
)
{
this
.
dispatch_search
(
SearchService
.
searchVlan
(
this
.
$store
.
state
.
netdb_axios_config
,
parseInt
(
term
)),
'
nd.vlan
'
)
}
else
if
(
termIsIP
)
{
this
.
dispatch_search
(
SearchService
.
searchRRByIP
(
this
.
$store
.
state
.
netdb_axios_config
,
term
,
null
),
'
dns.record
'
)
this
.
dispatch_search
(
SearchService
.
searchBCDSubnet
(
this
.
$store
.
state
.
netdb_axios_config
,
term
,
null
),
'
nd.ip_subnet
'
)
}
else
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/icons.js
+
4
−
2
View file @
1d65f8f0
...
...
@@ -46,7 +46,8 @@ import {
faRadiation
,
faMapSigns
,
faNetworkWired
,
faHistory
faHistory
,
faEthernet
}
from
'
@fortawesome/free-solid-svg-icons
'
import
{
...
...
@@ -113,5 +114,6 @@ library.add(
faRadiation
,
faMapSigns
,
faNetworkWired
,
faHistory
faHistory
,
faEthernet
)
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