|
|
@ -121,7 +121,10 @@ class CommandViewSet(JMSBulkModelViewSet):
|
|
|
|
qs = storage.get_command_queryset()
|
|
|
|
qs = storage.get_command_queryset()
|
|
|
|
commands = self.filter_queryset(qs)
|
|
|
|
commands = self.filter_queryset(qs)
|
|
|
|
merged_commands.extend(commands[:]) # ES 默认只取 10 条数据
|
|
|
|
merged_commands.extend(commands[:]) # ES 默认只取 10 条数据
|
|
|
|
|
|
|
|
order = self.request.query_params.get('order', None)
|
|
|
|
|
|
|
|
if order == 'timestamp':
|
|
|
|
|
|
|
|
merged_commands.sort(key=lambda command: command.timestamp)
|
|
|
|
|
|
|
|
else:
|
|
|
|
merged_commands.sort(key=lambda command: command.timestamp, reverse=True)
|
|
|
|
merged_commands.sort(key=lambda command: command.timestamp, reverse=True)
|
|
|
|
page = self.paginate_queryset(merged_commands)
|
|
|
|
page = self.paginate_queryset(merged_commands)
|
|
|
|
if page is not None:
|
|
|
|
if page is not None:
|
|
|
|