mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-21 06:45:24 -06:00
let the API handle time conversion
This commit is contained in:
parent
6057dda980
commit
08a54d5d1d
2 changed files with 7 additions and 9 deletions
|
|
@ -12,7 +12,6 @@ import os
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import datetime
|
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
@ -556,7 +555,7 @@ class Burp(BUIbackend):
|
||||||
if reg:
|
if reg:
|
||||||
found = True
|
found = True
|
||||||
if key in ['start', 'end']:
|
if key in ['start', 'end']:
|
||||||
backup[key] = int(time.mktime(datetime.datetime.strptime(reg.group(1), '%Y-%m-%d %H:%M:%S').timetuple()))
|
backup[key] = int(reg.group(1))
|
||||||
elif key == 'duration':
|
elif key == 'duration':
|
||||||
tmp = reg.group(1).split(':')
|
tmp = reg.group(1).split(':')
|
||||||
tmp.reverse()
|
tmp.reverse()
|
||||||
|
|
@ -737,10 +736,10 @@ class Burp(BUIbackend):
|
||||||
cli['last'] = 'never'
|
cli['last'] = 'never'
|
||||||
elif re.match(r'^\d+\s\d+\s\d+$', infos):
|
elif re.match(r'^\d+\s\d+\s\d+$', infos):
|
||||||
spl = infos.split()
|
spl = infos.split()
|
||||||
cli['last'] = datetime.datetime.fromtimestamp(int(spl[2])).strftime('%Y-%m-%d %H:%M:%S')
|
cli['last'] = int(spl[2])
|
||||||
else:
|
else:
|
||||||
spl = infos.split('\t')
|
spl = infos.split('\t')
|
||||||
cli['last'] = datetime.datetime.fromtimestamp(int(spl[len(spl) - 2])).strftime('%Y-%m-%d %H:%M:%S')
|
cli['last'] = int(spl[len(spl) - 2])
|
||||||
res.append(cli)
|
res.append(cli)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
@ -765,7 +764,7 @@ class Burp(BUIbackend):
|
||||||
spl = backup.split()
|
spl = backup.split()
|
||||||
bkp['number'] = spl[0]
|
bkp['number'] = spl[0]
|
||||||
bkp['deletable'] = (spl[1] == '1')
|
bkp['deletable'] = (spl[1] == '1')
|
||||||
bkp['date'] = datetime.datetime.fromtimestamp(int(spl[2])).strftime('%Y-%m-%d %H:%M:%S')
|
bkp['date'] = int(spl[2])
|
||||||
log = self.get_backup_logs(spl[0], name)
|
log = self.get_backup_logs(spl[0], name)
|
||||||
bkp['encrypted'] = log['encrypted']
|
bkp['encrypted'] = log['encrypted']
|
||||||
bkp['received'] = log['received']
|
bkp['received'] = log['received']
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import datetime
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import codecs
|
import codecs
|
||||||
import sys
|
import sys
|
||||||
|
|
@ -614,7 +613,7 @@ class Burp(Burp1):
|
||||||
c['last'] = 'never'
|
c['last'] = 'never'
|
||||||
else:
|
else:
|
||||||
infos = infos[0]
|
infos = infos[0]
|
||||||
c['last'] = datetime.datetime.fromtimestamp(infos['timestamp']).strftime('%Y-%m-%d %H:%M:%S')
|
c['last'] = infos['timestamp']
|
||||||
j.append(c)
|
j.append(c)
|
||||||
return j
|
return j
|
||||||
|
|
||||||
|
|
@ -641,7 +640,7 @@ class Burp(Burp1):
|
||||||
ba['deletable'] = True
|
ba['deletable'] = True
|
||||||
else:
|
else:
|
||||||
ba['deletable'] = False
|
ba['deletable'] = False
|
||||||
ba['date'] = datetime.datetime.fromtimestamp(backup['timestamp']).strftime('%Y-%m-%d %H:%M:%S')
|
ba['date'] = backup['timestamp']
|
||||||
log = self.get_backup_logs(backup['number'], name)
|
log = self.get_backup_logs(backup['number'], name)
|
||||||
try:
|
try:
|
||||||
ba['encrypted'] = log['encrypted']
|
ba['encrypted'] = log['encrypted']
|
||||||
|
|
@ -697,7 +696,7 @@ class Burp(Burp1):
|
||||||
t['gid'] = entry['gid']
|
t['gid'] = entry['gid']
|
||||||
t['parent'] = top
|
t['parent'] = top
|
||||||
t['size'] = '{0:.1eM}'.format(_hr(entry['size']))
|
t['size'] = '{0:.1eM}'.format(_hr(entry['size']))
|
||||||
t['date'] = datetime.datetime.fromtimestamp(entry['mtime']).strftime('%Y-%m-%d %H:%M:%S')
|
t['date'] = entry['mtime']
|
||||||
r.append(t)
|
r.append(t)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue