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
5e5aab79
Commit
5e5aab79
authored
Dec 14, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix asset upload bug
parent
a8bdc377
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
user_api.py
juser/user_api.py
+1
-1
asset_add_batch.html
templates/jasset/asset_add_batch.html
+1
-1
No files found.
juser/user_api.py
View file @
5e5aab79
...
@@ -130,7 +130,7 @@ def gen_ssh_key(username, password='',
...
@@ -130,7 +130,7 @@ def gen_ssh_key(username, password='',
"""
"""
logger
.
debug
(
'生成ssh key, 并设置authorized_keys'
)
logger
.
debug
(
'生成ssh key, 并设置authorized_keys'
)
private_key_file
=
os
.
path
.
join
(
key_dir
,
username
+
'.pem'
)
private_key_file
=
os
.
path
.
join
(
key_dir
,
username
+
'.pem'
)
mkdir
(
key_dir
,
mode
=
07
00
)
mkdir
(
key_dir
,
mode
=
07
77
)
if
os
.
path
.
isfile
(
private_key_file
):
if
os
.
path
.
isfile
(
private_key_file
):
os
.
unlink
(
private_key_file
)
os
.
unlink
(
private_key_file
)
ret
=
bash
(
'echo -e "y
\n
"|ssh-keygen -t rsa -f
%
s -b
%
s -P "
%
s"'
%
(
private_key_file
,
length
,
password
))
ret
=
bash
(
'echo -e "y
\n
"|ssh-keygen -t rsa -f
%
s -b
%
s -P "
%
s"'
%
(
private_key_file
,
length
,
password
))
...
...
templates/jasset/asset_add_batch.html
View file @
5e5aab79
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
<div
class=
"alert alert-success text-center"
>
{{ smg }}
</div>
<div
class=
"alert alert-success text-center"
>
{{ smg }}
</div>
{% endif %}
{% endif %}
<p>
请下载Excel文件, 按照格式填写主机信息, 上传导入.
<a
href=
"/static/files/excels/asset.xlsx"
>
点击下载模板
</a></p>
<p>
请下载Excel文件, 按照格式填写主机信息, 上传导入.
<a
href=
"/static/files/excels/asset.xlsx"
>
点击下载模板
</a></p>
<form
action=
"
/jasset/upload/
"
method=
"POST"
enctype=
"multipart/form-data"
>
<form
action=
"
{% url 'asset_upload' %}
"
method=
"POST"
enctype=
"multipart/form-data"
>
<div
class=
"file-box"
>
<div
class=
"file-box"
>
<input
id=
'textfield'
/>
<input
id=
'textfield'
/>
<input
type=
"button"
class=
"btn btn-info btn-sm"
name=
"file_name"
value=
"点击选择文件"
>
<input
type=
"button"
class=
"btn btn-info btn-sm"
name=
"file_name"
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