mirror of https://github.com/jumpserver/jumpserver
ÐÞ¸Ägroup edit
parent
08d42f1c2c
commit
d2669c2de0
|
@ -192,7 +192,13 @@ def group_edit(request):
|
||||||
|
|
||||||
return render_to_response('juser/group_add.html', locals())
|
return render_to_response('juser/group_add.html', locals())
|
||||||
else:
|
else:
|
||||||
pass
|
group_id = request.POST.get('id', None)
|
||||||
|
group_name = request.POST.get('group_name', None)
|
||||||
|
comment = request.POST.get('comment', '')
|
||||||
|
group = UserGroup.objects.filter(id=group_id)
|
||||||
|
group.update(name=group_name, comment=comment)
|
||||||
|
|
||||||
|
return HttpResponseRedirect('/juser/group_list/')
|
||||||
|
|
||||||
|
|
||||||
def user_list(request):
|
def user_list(request):
|
||||||
|
@ -234,10 +240,10 @@ def user_edit(request):
|
||||||
header_title, path1, path2 = '编辑用户 | Edit User', 'juser', 'user_edit'
|
header_title, path1, path2 = '编辑用户 | Edit User', 'juser', 'user_edit'
|
||||||
readonly = "readonly"
|
readonly = "readonly"
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
username = request.GET.get('username', None)
|
user_id = request.GET.get('id', None)
|
||||||
if not username:
|
if not user_id:
|
||||||
return HttpResponseRedirect('/')
|
return HttpResponseRedirect('/')
|
||||||
user = User.objects.get(username=username)
|
user = User.objects.get(id=user_id)
|
||||||
username = user.username
|
username = user.username
|
||||||
password = user.password
|
password = user.password
|
||||||
ssh_key_pwd1 = user.ssh_key_pwd1
|
ssh_key_pwd1 = user.ssh_key_pwd1
|
||||||
|
|
|
@ -37,20 +37,20 @@
|
||||||
<div class="form-group hidden">
|
<div class="form-group hidden">
|
||||||
<label for="group_id" class="col-sm-2 control-label">ID<span class="red-fonts">*</span></label>
|
<label for="group_id" class="col-sm-2 control-label">ID<span class="red-fonts">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="group_name" name="group_name" placeholder="Group name" type="text" class="form-control">
|
<input id="group_id" name="group_id" placeholder="Group name" type="text" class="form-control" value="{{ group_id }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="group_name" class="col-sm-2 control-label">组å<span class="red-fonts">*</span></label>
|
<label for="group_name" class="col-sm-2 control-label">组å<span class="red-fonts">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="group_name" name="group_name" placeholder="Group name" type="text" class="form-control">
|
<input id="group_name" name="group_name" placeholder="Group name" type="text" class="form-control" value="{{ group_name }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="comment" class="col-sm-2 control-label">备注</label>
|
<label for="comment" class="col-sm-2 control-label">备注</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="comment" name="comment" placeholder="Comment" type="text" class="form-control">
|
<input id="comment" name="comment" placeholder="Comment" type="text" class="form-control" value="{{ comment }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@
|
||||||
<td class="text-center">{{ user.email }}</td>
|
<td class="text-center">{{ user.email }}</td>
|
||||||
<td class="text-center">{{ user.is_active|bool2str }}</td>
|
<td class="text-center">{{ user.is_active|bool2str }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="../user_detail/?username={{ user.username }}" class="iframe btn btn-xs btn-primary">详情</a>
|
<a href="../user_detail/?id={{ user.id }}" class="iframe btn btn-xs btn-primary">详情</a>
|
||||||
<a href="../user_edit/?username={{ user.username }}" class="btn btn-xs btn-info">编辑</a>
|
<a href="../user_edit/?id={{ user.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||||
<a href="../user_del/?username={{ user.username }}" class="btn btn-xs btn-danger">åˆ é™¤</a>
|
<a href="../user_del/?id={{ user.id }}" class="btn btn-xs btn-danger">åˆ é™¤</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue