Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
luna
Commits
ea81846b
Unverified
Commit
ea81846b
authored
Sep 10, 2019
by
老广
Committed by
GitHub
Sep 10, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #105 from jumpserver/dev_beta
[Update] 修改pipe
parents
ee0f3c22
989b0fd8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
18 deletions
+19
-18
Dockerfile
Dockerfile
+1
-1
tree-filter.component.ts
src/app/elements/tree-filter/tree-filter.component.ts
+1
-16
pipes.ts
src/app/pipes/pipes.ts
+1
-1
search.pipe.ts
src/app/pipes/search.pipe.ts
+16
-0
No files found.
Dockerfile
View file @
ea81846b
...
...
@@ -8,6 +8,6 @@ RUN npm run-script build
FROM
nginx:alpine
COPY
--from=stage-build /data/lu
an
/opt/luna/
COPY
--from=stage-build /data/lu
na
/opt/luna/
COPY
./src/assets/i18n /opt/luna/i18n
COPY
nginx.conf /etc/nginx/conf.d/default.conf
src/app/elements/tree-filter/tree-filter.component.ts
View file @
ea81846b
import
{
Component
,
OnInit
,
Pipe
,
PipeTransform
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormControl
}
from
'@angular/forms'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
import
{
LogService
,
TreeFilterService
}
from
'@app/app.service'
;
@
Pipe
({
name
:
'SearchFilter'
})
export
class
SearchFilter
implements
PipeTransform
{
transform
(
value
:
any
,
input
:
string
)
{
if
(
input
)
{
input
=
input
.
toLowerCase
();
return
value
.
filter
(
function
(
el
:
any
)
{
// ToDo: search with a simple SQL like language, and a bug search a group's hosts
return
JSON
.
stringify
(
el
).
toLowerCase
().
indexOf
(
input
)
>
-
1
;
});
}
return
value
;
}
}
@
Component
({
selector
:
'elements-tree-filter'
,
templateUrl
:
'./tree-filter.component.html'
,
styleUrls
:
[
'./tree-filter.component.css'
],
providers
:
[
SearchFilter
],
})
export
class
ElementTreeFilterComponent
implements
OnInit
{
searchControl
:
FormControl
;
...
...
src/app/pipes/pipes.ts
View file @
ea81846b
import
{
TransPipe
}
from
'./trans.pipe'
;
import
{
UtcDatePipe
}
from
'./date.pipe'
;
import
{
TruncatecharsPipe
}
from
'./truncatechars.pipe'
;
import
{
SearchFilter
}
from
'
@app/elements/tree-filter/tree-filter.component
'
;
import
{
SearchFilter
}
from
'
./search.pipe
'
;
export
const
Pipes
=
[
UtcDatePipe
,
...
...
src/app/pipes/search.pipe.ts
0 → 100644
View file @
ea81846b
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
@
Pipe
({
name
:
'SearchFilter'
})
export
class
SearchFilter
implements
PipeTransform
{
transform
(
value
:
any
,
input
:
string
)
{
if
(
input
)
{
input
=
input
.
toLowerCase
();
return
value
.
filter
(
function
(
el
:
any
)
{
// ToDo: search with a simple SQL like language, and a bug search a group's hosts
return
JSON
.
stringify
(
el
).
toLowerCase
().
indexOf
(
input
)
>
-
1
;
});
}
return
value
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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