mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-21 03:19:52 +00:00
[Update] 更新index view
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from rest_framework import serializers
|
||||
|
||||
from common.utils import timesince
|
||||
from . import models
|
||||
|
||||
|
||||
class ProxyLogSerializer(serializers.ModelSerializer):
|
||||
time = serializers.SerializerMethodField()
|
||||
command_length = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = models.ProxyLog
|
||||
fields = '__all__'
|
||||
|
||||
@staticmethod
|
||||
def get_time(obj):
|
||||
if not obj.is_finished:
|
||||
return ''
|
||||
else:
|
||||
return timesince(obj.date_start, since=obj.date_finished)
|
||||
|
||||
@staticmethod
|
||||
def get_command_length(obj):
|
||||
return 2
|
||||
|
Reference in New Issue
Block a user