mirror of https://github.com/jumpserver/jumpserver
fix asset upload bug
parent
a8bdc37780
commit
5e5aab7962
|
@ -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=0700)
|
mkdir(key_dir, mode=0777)
|
||||||
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))
|
||||||
|
|
|
@ -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="点击选择文件">
|
||||||
|
|
Loading…
Reference in New Issue