parameters: (request)
return_statement: return HttpResponse('无日志记录!')
docstring: 命令历史记录
docstring_summary: 命令历史记录
docstring_tokens: 命令历史记录
function: def log_history(request):
      """ 命令历史记录 """
      log_id = request.GET.get('id', 0)
      log = Log.objects.filter(id=log_id)
      if log:
          log = log[0]
          tty_logs = log.ttylog_set.all()
  
          if tty_logs:
              content = ''
              for tty_log in tty_logs:
                  content += '%s: %s\n' % (tty_log.datetime.strftime('%Y-%m-%d %H:%M:%S'), tty_log.cmd)
              return HttpResponse(content)
  
      return HttpResponse('无日志记录!')
function_tokens: def log_history ( request ) : log_id = request . GET . get ( 'id' , 0 ) log = Log . objects . filter ( id = log_id ) if log : log = log [ 0 ] tty_logs = log . ttylog_set . all ( ) if tty_logs : content = '' for tty_log in tty_logs : content += '%s: %s\n' % ( tty_log . datetime . strftime ( '%Y-%m-%d %H:%M:%S' ) , tty_log . cmd ) return HttpResponse ( content ) return HttpResponse ( '无日志记录!')