Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
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
jumpserver
Commits
e69d283a
Commit
e69d283a
authored
Nov 14, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 增加过滤
parent
31f5b2c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
_user_profile.html
apps/templates/_user_profile.html
+28
-1
No files found.
apps/templates/_user_profile.html
View file @
e69d283a
...
...
@@ -19,7 +19,8 @@
</span>
<span
class=
"fa fa-sort-desc pull-right"
></span>
</a>
<ul
class=
"dropdown-menu"
style=
"min-width: 220px"
>
<ul
class=
"dropdown-menu"
style=
"min-width: 220px;max-width: 400px;max-height: 400px; overflow: auto"
>
<input
type=
"text"
id=
"left-side-org-filter"
placeholder=
"{% trans 'Search' %}"
class=
"form-control"
>
{% for org in ADMIN_OR_AUDIT_ORGS %}
<li>
<a
class=
"org-dropdown"
href=
"{% url 'orgs:org-switch' pk=org.id %}"
data-id=
"{{ org.id }}"
>
...
...
@@ -35,3 +36,29 @@
{% endif %}
{% endif %}
</li>
<script>
var
orgsRef
;
$
(
document
).
ready
(
function
()
{
orgsRef
=
$
(
".org-dropdown"
);
}).
on
(
'click'
,
'#left-side-org-filter'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
}).
on
(
'keyup'
,
'#left-side-org-filter'
,
function
()
{
var
input
=
$
(
"#left-side-org-filter"
).
val
();
if
(
!
input
)
{
orgsRef
.
show
();
return
}
orgsRef
.
each
(
function
(
i
,
v
)
{
var
itemRef
=
$
(
v
);
var
orgItemText
=
itemRef
.
text
().
trim
();
var
findIndex
=
orgItemText
.
indexOf
(
input
);
if
(
findIndex
===
-
1
)
{
itemRef
.
hide
();
}
else
{
itemRef
.
show
();
}
});
console
.
log
(
input
)
})
</script>
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