mirror of https://github.com/jumpserver/jumpserver
fix: 修复批量命令的bug
parent
26b3c60e5c
commit
a3cddd5d34
|
@ -132,7 +132,8 @@ class CommandExecutionHostRelationViewSet(OrgRelationMixin, OrgBulkModelViewSet)
|
|||
search_fields = ('asset__hostname', )
|
||||
http_method_names = ['options', 'get']
|
||||
rbac_perms = {
|
||||
'GET': 'ops.view_commandexecution'
|
||||
'GET': 'ops.view_commandexecution',
|
||||
'list': 'ops.view_commandexecution',
|
||||
}
|
||||
|
||||
def get_queryset(self):
|
||||
|
|
|
@ -55,6 +55,10 @@ class CommandExecution(OrgModelMixin):
|
|||
def user_display(self):
|
||||
return str(self.user)
|
||||
|
||||
@lazyproperty
|
||||
def hosts_display(self):
|
||||
return ','.join(self.hosts.all().values_list('hostname', flat=True))
|
||||
|
||||
@property
|
||||
def result(self):
|
||||
if self._result:
|
||||
|
|
|
@ -136,8 +136,7 @@ class CommandExecutionSerializer(serializers.ModelSerializer):
|
|||
fields_mini = ['id']
|
||||
fields_small = fields_mini + [
|
||||
'command', 'result', 'log_url',
|
||||
'is_finished',
|
||||
'date_created', 'date_finished'
|
||||
'is_finished', 'date_created', 'date_finished'
|
||||
]
|
||||
fields_fk = ['run_as']
|
||||
fields_m2m = ['hosts']
|
||||
|
|
Loading…
Reference in New Issue