Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
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
coco
Commits
f98e6815
Unverified
Commit
f98e6815
authored
Dec 20, 2018
by
老广
Committed by
GitHub
Dec 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #147 from jumpserver/dev
[Bugfix] 修复无法输入多个id的bug
parents
d72a48d5
3387aa0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
interactive.py
coco/interactive.py
+6
-2
No files found.
coco/interactive.py
View file @
f98e6815
...
@@ -183,6 +183,11 @@ class InteractiveServer:
...
@@ -183,6 +183,11 @@ class InteractiveServer:
if
q
in
(
''
,
None
):
if
q
in
(
''
,
None
):
result
=
self
.
assets
result
=
self
.
assets
# 用户输入的是数字,可能想使用id唯一键搜索
elif
q
.
isdigit
()
and
self
.
results
and
\
len
(
self
.
results
)
>=
int
(
q
):
result
=
[
self
.
results
[
int
(
q
)
-
1
]]
# 全匹配到则直接返回全匹配的
# 全匹配到则直接返回全匹配的
if
len
(
result
)
==
0
:
if
len
(
result
)
==
0
:
_result
=
[
asset
for
asset
in
self
.
assets
if
is_obj_attr_eq
(
asset
,
q
)]
_result
=
[
asset
for
asset
in
self
.
assets
if
is_obj_attr_eq
(
asset
,
q
)]
...
@@ -281,8 +286,7 @@ class InteractiveServer:
...
@@ -281,8 +286,7 @@ class InteractiveServer:
self
.
client
.
send
(
wr
(
prompt
,
before
=
1
))
self
.
client
.
send
(
wr
(
prompt
,
before
=
1
))
def
get_user_action
(
self
):
def
get_user_action
(
self
):
opt
=
net_input
(
self
.
client
,
prompt
=
':'
,
only_one_char
=
True
)
opt
=
net_input
(
self
.
client
,
prompt
=
':'
)
print
(
opt
)
if
opt
in
(
'p'
,
'P'
):
if
opt
in
(
'p'
,
'P'
):
return
PAGE_UP
return
PAGE_UP
elif
opt
in
(
'b'
,
'q'
):
elif
opt
in
(
'b'
,
'q'
):
...
...
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