Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
92251f2a
Commit
92251f2a
authored
Oct 28, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge with master
parent
374dfbda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
20 deletions
+8
-20
models.py
apps/assets/models.py
+2
-2
asset_list.html
apps/assets/templates/assets/asset_list.html
+0
-17
models.py
apps/audits/models.py
+4
-1
command_log_list.html
apps/audits/templates/audits/command_log_list.html
+2
-0
No files found.
apps/assets/models.py
View file @
92251f2a
...
...
@@ -289,10 +289,10 @@ def get_default_idc():
class
Asset
(
models
.
Model
):
ip
=
models
.
GenericIPAddressField
(
max_length
=
32
,
verbose_name
=
_
(
'IP'
))
ip
=
models
.
GenericIPAddressField
(
max_length
=
32
,
verbose_name
=
_
(
'IP'
)
,
db_index
=
True
)
other_ip
=
models
.
CharField
(
max_length
=
255
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'Other IP'
))
remote_card_ip
=
models
.
CharField
(
max_length
=
16
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'Remote card IP'
))
hostname
=
models
.
CharField
(
max_length
=
128
,
blank
=
True
,
verbose_name
=
_
(
'Hostname'
))
hostname
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
'Hostname'
))
port
=
models
.
IntegerField
(
default
=
22
,
verbose_name
=
_
(
'Port'
))
groups
=
models
.
ManyToManyField
(
AssetGroup
,
blank
=
True
,
related_name
=
'assets'
,
verbose_name
=
_
(
'Asset groups'
))
admin_user
=
models
.
ForeignKey
(
AdminUser
,
null
=
True
,
blank
=
True
,
related_name
=
'assets'
,
...
...
apps/assets/templates/assets/asset_list.html
View file @
92251f2a
...
...
@@ -132,7 +132,6 @@ div.dataTables_wrapper div.dataTables_filter,
};
//onload;
$
(
document
).
ready
(
function
(){
<<<<<<<
HEAD
$
(
'#modal'
).
modal
({
show
:
false
,
backdrop
:
'static'
,
...
...
@@ -169,22 +168,6 @@ div.dataTables_wrapper div.dataTables_filter,
$
(
'#editable_length'
).
before
(
"<a href=
\"
{% url 'assets:asset-create' %}
\"
class=
\"
btn btn-sm btn-primary custom
\"
> {% trans 'Create asset' %} </a> <button class='btn btn-sm btn-primary custom' id='zksx' onclick='tagShow()'>标签</button>"
);
$
(
'#editable'
).
before
(
oTags
);
},
=======
var
oTags
=
document
.
getElementById
(
"ydxbd"
);
var
table
=
$
(
'#editable'
).
DataTable
({
"aLengthMenu"
:
[[
10
,
25
,
50
,
-
1
],
[
"10"
,
"25"
,
"50"
,
"all"
]],
"iDisplayLength"
:
25
,
"aaSorting"
:
[[
7
,
"asc"
]],
"aoColumnDefs"
:
[
{
"bSortable"
:
false
,
"aTargets"
:
[
0
]
}],
"bAutoWidth"
:
false
,
"language"
:
{
"url"
:
"/static/js/plugins/dataTables/i18n/zh-hans.json"
},
"dom"
:
'<"custom">lftip'
,
"initComplete"
:
function
()
{
//alert( 'DataTables has finished its initialisation.' );
$
(
'#editable_length'
).
before
(
"<a href=
\"
{% url 'assets:asset-create' %}
\"
class=
\"
btn btn-sm btn-primary custom
\"
> {% trans 'Create asset' %} </a> <button class='btn btn-sm btn-primary custom' id='zksx' onclick='tagShow()'>标签</button>"
);
$
(
'#editable'
).
before
(
oTags
);
},
>>>>>>>
534321
d1aa42f0853083876b807d0258dafc0b0c
columns
:
[
{
data
:
"checkbox"
},
{
data
:
"id"
},
...
...
apps/audits/models.py
View file @
92251f2a
...
...
@@ -82,7 +82,10 @@ class CommandLog(models.Model):
@property
def
output_decode
(
self
):
return
base64
.
b64decode
(
self
.
output
)
.
replace
(
'
\n
'
,
'<br />'
)
try
:
return
base64
.
b64decode
(
self
.
output
)
.
replace
(
'
\n
'
,
'<br />'
)
except
UnicodeDecodeError
:
return
'UnicodeDecodeError'
class
Meta
:
db_table
=
'command_log'
...
...
apps/audits/templates/audits/command_log_list.html
View file @
92251f2a
...
...
@@ -15,6 +15,7 @@
<th>
Command
</th>
<th>
Username
</th>
<th>
IP
</th>
<th>
System user
</th>
<th>
Datetime
</th>
<th
data-hide=
"all"
>
Output
</th>
</tr>
...
...
@@ -26,6 +27,7 @@
<td>
{{ command.command }}
</td>
<td>
{{ command.proxy_log.username }}
</td>
<td>
{{ command.proxy_log.ip }}
</td>
<td>
{{ command.proxy_log.system_user }}
</td>
<td>
{{ command.datetime }}
</td>
<td>
{{ command.output_decode |safe }}
</td>
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment