[Bugfix] 修复了一些显示上的bug

pull/915/head
ibuler 7 years ago
parent b2b123b41e
commit 3223d3b74d

@ -93,7 +93,7 @@ class AssetBulkUpdateForm(forms.ModelForm):
model = Asset
fields = [
'assets', 'port', 'groups', "cluster",
'type', 'env', 'status',
'type', 'env',
]
widgets = {
'groups': forms.SelectMultiple(attrs={'class': 'select2', 'data-placeholder': _('Select asset groups')}),

@ -34,7 +34,7 @@
<div class="col-sm-8" style="padding-left: 0;">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span style="float: left">{% trans 'Asset list of ' %} <b>{{ admin_user.name }}</b> <span class="badge"> {{ total_amount }}</span> <span class="badge badge-danger">{{ unreachable_amount }}</span></span>
<span style="float: left">{% trans 'Asset list of ' %} <b>{{ admin_user.name }}</b></span>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>

@ -178,9 +178,15 @@ $(document).ready(function(){
var obj = {"pk": object_id, "is_active": false};
data.push(obj);
});
APIUpdateAttr({url: the_url, method: 'PATCH', body: JSON.stringify(data)});
$data_table.ajax.reload();
jumpserver.checked = false;
function success() {
location.reload()
}
APIUpdateAttr({
url: the_url,
method: 'PATCH',
body: JSON.stringify(data),
success: success
});
}
function doActive() {
var data = [];
@ -188,9 +194,15 @@ $(document).ready(function(){
var obj = {"pk": object_id, "is_active": true};
data.push(obj);
});
APIUpdateAttr({url: the_url, method: 'PATCH', body: JSON.stringify(data)});
$data_table.ajax.reload();
jumpserver.checked = false;
function success() {
location.reload();
}
APIUpdateAttr({
url: the_url,
method: 'PATCH',
body: JSON.stringify(data),
success: success
});
}
function doDelete() {
swal({

@ -28,7 +28,7 @@
<div class="col-sm-8" style="padding-left: 0;">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span style="float: left">{% trans 'Cluster assets' %} <b>{{ cluster.name }} </b><span class="badge">{{ cluster.assets.all.count }}</span></span>
<span style="float: left">{% trans 'Cluster assets' %} <b>{{ cluster.name }} </b></span>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>

@ -156,7 +156,7 @@ class UserBulkUpdateForm(forms.ModelForm):
class Meta:
model = User
fields = ['users', 'role', 'groups', 'date_expired', 'is_active']
fields = ['users', 'role', 'groups', 'date_expired']
widgets = {
"groups": forms.SelectMultiple(
attrs={
@ -172,6 +172,7 @@ class UserBulkUpdateForm(forms.ModelForm):
if self.data.get(field) is not None:
changed_fields.append(field)
print(changed_fields)
cleaned_data = {k: v for k, v in self.cleaned_data.items()
if k in changed_fields}
users = cleaned_data.pop('users', '')
@ -186,7 +187,7 @@ class UserBulkUpdateForm(forms.ModelForm):
class UserGroupForm(forms.ModelForm):
users = forms.ModelMultipleChoiceField(
queryset=User.objects.all(),
queryset=User.objects.exclude(role=User.ROLE_APP),
label=_("User"),
widget=forms.SelectMultiple(
attrs={

@ -161,18 +161,30 @@ $(document).ready(function(){
var body = $.each(id_list, function(index, user_object) {
user_object['is_active'] = false;
});
console.log(body);
APIUpdateAttr({url: the_url, method: 'PATCH', body: JSON.stringify(body)});
$data_table.ajax.reload();
jumpserver.checked = false;
function success() {
location.reload();
}
APIUpdateAttr({
url: the_url,
method: 'PATCH',
body: JSON.stringify(body),
success: success
});
location.reload();
}
function doActive() {
var body = $.each(id_list, function(index, user_object) {
user_object['is_active'] = true;
});
APIUpdateAttr({url: the_url, method: 'PATCH', body: JSON.stringify(body)});
$data_table.ajax.reload();
jumpserver.checked = false;
function success() {
location.reload();
}
APIUpdateAttr({
url: the_url,
method: 'PATCH',
body: JSON.stringify(body),
success: success
});
}
function doDelete() {
swal({

Loading…
Cancel
Save