mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-21 03:19:52 +00:00
add command log modal
This commit is contained in:
@@ -54,6 +54,17 @@ class ProxyLog(models.Model):
|
||||
def __unicode__(self):
|
||||
return '%s-%s-%s-%s' % (self.username, self.hostname, self.system_user, self.id)
|
||||
|
||||
@property
|
||||
def commands_dict(self):
|
||||
commands = self.command_log.all()
|
||||
return [
|
||||
{
|
||||
"command_no": command.command_no,
|
||||
"command": command.command,
|
||||
"output": command.output_decode,
|
||||
"datetime": command.datetime,
|
||||
} for command in commands]
|
||||
|
||||
class Meta:
|
||||
db_table = 'proxy_log'
|
||||
ordering = ['-date_start', 'username']
|
||||
|
Reference in New Issue
Block a user