mirror of https://github.com/jumpserver/jumpserver
bugs
parent
bb94cfc7a1
commit
d28d72c42d
|
@ -422,7 +422,7 @@ def list_idc(request):
|
||||||
if keyword:
|
if keyword:
|
||||||
posts = IDC.objects.filter(Q(name__contains=keyword) | Q(comment__contains=keyword))
|
posts = IDC.objects.filter(Q(name__contains=keyword) | Q(comment__contains=keyword))
|
||||||
else:
|
else:
|
||||||
posts = IDC.objects.all().order_by('id')
|
posts = IDC.objects.exclude(name='ALL').order_by('id')
|
||||||
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
||||||
return render_to_response('jasset/idc_list.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('jasset/idc_list.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ urlpatterns = patterns('',
|
||||||
# Examples:
|
# Examples:
|
||||||
# url(r'^$', 'jumpserver.views.home', name='home'),
|
# url(r'^$', 'jumpserver.views.home', name='home'),
|
||||||
# url(r'^blog/', include('blog.urls')),
|
# url(r'^blog/', include('blog.urls')),
|
||||||
(r'^$', view_splitter, {'su': index, 'adm': admin_index}),
|
# (r'^$', view_splitter, {'su': index, 'adm': admin_index}),
|
||||||
|
(r'^$', 'jumpserver.views.index'),
|
||||||
(r'^api/user/$', 'jumpserver.api.api_user'),
|
(r'^api/user/$', 'jumpserver.api.api_user'),
|
||||||
(r'^skin_config/$', 'jumpserver.views.skin_config'),
|
(r'^skin_config/$', 'jumpserver.views.skin_config'),
|
||||||
(r'^install/$', 'jumpserver.views.install'),
|
(r'^install/$', 'jumpserver.views.install'),
|
||||||
|
|
|
@ -45,7 +45,7 @@ def get_data(data, items, option):
|
||||||
return dic
|
return dic
|
||||||
|
|
||||||
|
|
||||||
@require_super_user
|
@require_login
|
||||||
def index(request):
|
def index(request):
|
||||||
users = User.objects.all()
|
users = User.objects.all()
|
||||||
hosts = Asset.objects.all()
|
hosts = Asset.objects.all()
|
||||||
|
|
|
@ -184,40 +184,22 @@ $('#assetForm').validator({
|
||||||
msg: {required: "必须填写!"}
|
msg: {required: "必须填写!"}
|
||||||
},
|
},
|
||||||
"j_group": {
|
"j_group": {
|
||||||
rule: "checked",
|
rule: "required",
|
||||||
tip: "选择业务组",
|
tip: "选择主机组",
|
||||||
ok: "",
|
ok: "",
|
||||||
msg: {checked: "至少选择一个组"}
|
msg: {checked: "至少选择一个组"}
|
||||||
},
|
},
|
||||||
"j_usergroup": {
|
"j_idc": {
|
||||||
rule: "checked",
|
rule: "required",
|
||||||
tip: "选择用户组",
|
tip: "选择IDC",
|
||||||
ok: "",
|
ok: "",
|
||||||
msg: {checked: "至少选择一个组"}
|
msg: {checked: "必须填写!"}
|
||||||
},
|
},
|
||||||
"j_user": {
|
"j_dept": {
|
||||||
rule: "required(type_m)",
|
rule: "required",
|
||||||
tip: "普通用户名",
|
tip: "选择部门",
|
||||||
ok: "",
|
ok: "",
|
||||||
msg: {required: "请填写用户名"}
|
msg: {checked: "至少选择一个部门"}
|
||||||
},
|
|
||||||
"j_password": {
|
|
||||||
rule: "required(type_m);length[6~16]",
|
|
||||||
tip: "密码6-16位",
|
|
||||||
ok: "",
|
|
||||||
msg: {required: "6-16位"}
|
|
||||||
},
|
|
||||||
"j_root": {
|
|
||||||
rule: "required(type_m)",
|
|
||||||
tip: "超管用户名",
|
|
||||||
ok: "",
|
|
||||||
msg: {required: "请填写用户名"}
|
|
||||||
},
|
|
||||||
"j_passwd": {
|
|
||||||
rule: "required(type_m);length[6~16]",
|
|
||||||
tip: "密码6-16位",
|
|
||||||
ok: "",
|
|
||||||
msg: {required: "6-16位"}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
valid: function(form) {
|
valid: function(form) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<div class="alert alert-success text-center">{{ smg }}</div>
|
<div class="alert alert-success text-center">{{ smg }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form id="assetForm" method="post" class="form-horizontal">
|
<form id="assetForm" method="post" class="form-horizontal">
|
||||||
<div class="form-group"><label class="col-sm-2 control-label"> IDC名 </label>
|
<div class="form-group"><label class="col-sm-2 control-label"> IDC名 <span class="red-fonts">*</span></label>
|
||||||
<div class="col-sm-8"><input type="text" value="{{ j_idc.name }}" placeholder="北京联通" name="j_idc" class="form-control"></div>
|
<div class="col-sm-8"><input type="text" value="{{ j_idc.name }}" placeholder="北京联通" name="j_idc" class="form-control"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue