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
19dcf171
Commit
19dcf171
authored
Nov 26, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
弹窗title修改
parent
02c3bc75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
28 deletions
+49
-28
asset_list.html
templates/jasset/asset_list.html
+16
-13
log_offline.html
templates/jlog/log_offline.html
+33
-15
No files found.
templates/jasset/asset_list.html
View file @
19dcf171
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
<td
class=
"text-center"
name=
"id"
value=
"{{ asset.id }}"
data-editable=
'false'
>
<td
class=
"text-center"
name=
"id"
value=
"{{ asset.id }}"
data-editable=
'false'
>
<input
name=
"id"
value=
"{{ asset.id }}"
type=
"checkbox"
class=
"i-checks"
>
<input
name=
"id"
value=
"{{ asset.id }}"
type=
"checkbox"
class=
"i-checks"
>
</td>
</td>
<td
class=
"text-center"
>
{{ asset.hostname|default_if_none:"" }}
</td>
<td
class=
"text-center
hostname
"
>
{{ asset.hostname|default_if_none:"" }}
</td>
<td
class=
"text-center"
>
{{ asset.ip|default_if_none:"" }}
</td>
<td
class=
"text-center"
>
{{ asset.ip|default_if_none:"" }}
</td>
<td
class=
"text-center"
>
{{ asset.idc.name|default_if_none:"" }}
</td>
<td
class=
"text-center"
>
{{ asset.idc.name|default_if_none:"" }}
</td>
<td
class=
"text-center"
>
{{ asset.group.all|group_str2 }}
</td>
<td
class=
"text-center"
>
{{ asset.group.all|group_str2 }}
</td>
...
@@ -175,6 +175,7 @@
...
@@ -175,6 +175,7 @@
var
url
=
'/jlog/get_role_name/?id='
+
$
(
this
).
attr
(
'value'
);
var
url
=
'/jlog/get_role_name/?id='
+
$
(
this
).
attr
(
'value'
);
var
href
=
$
(
this
).
attr
(
'href'
);
var
href
=
$
(
this
).
attr
(
'href'
);
var
new_url
=
'/jlog/web_terminal/?id='
+
$
(
this
).
attr
(
'value'
)
+
'&role='
;
var
new_url
=
'/jlog/web_terminal/?id='
+
$
(
this
).
attr
(
'value'
)
+
'&role='
;
var
hostname
=
$
(
this
).
closest
(
'tr'
).
find
(
'.hostname'
)[
0
].
innerHTML
;
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
url
:
url
,
url
:
url
,
...
@@ -182,21 +183,22 @@
...
@@ -182,21 +183,22 @@
success
:
function
(
data
){
success
:
function
(
data
){
var
dataArray
=
data
.
split
(
','
);
var
dataArray
=
data
.
split
(
','
);
if
(
dataArray
.
length
==
1
&&
data
!=
'error'
){
if
(
dataArray
.
length
==
1
&&
data
!=
'error'
){
var
title
=
'Jumpserver Web Terminal'
+
'<span class="text-info"> '
+
hostname
+
'</span>'
;
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
title
:
'Jumpserver Web Terminal'
,
title
:
title
,
maxmin
:
true
,
maxmin
:
true
,
shade
:
false
,
shade
:
false
,
area
:
[
'628px'
,
'452px'
],
area
:
[
'628px'
,
'452px'
],
content
:
new_url
content
:
new_url
});
});
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no');
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no');
}
else
if
(
dataArray
.
length
==
'1'
&&
data
==
'error'
){
}
else
if
(
dataArray
.
length
==
'1'
&&
data
==
'error'
){
layer
.
alert
(
'没有授权角色'
)
layer
.
alert
(
'没有授权角色'
)
}
else
{
}
else
{
aUrl
=
''
;
aUrl
=
''
;
$
.
each
(
dataArray
,
function
(
index
,
value
){
$
.
each
(
dataArray
,
function
(
index
,
value
){
aUrl
+=
'<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href='
+
new_url
+
value
+
'>'
+
value
+
'</a> '
aUrl
+=
'<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href='
+
new_url
+
value
+
' value='
+
hostname
+
'>'
+
value
+
'</a> '
});
});
layer
.
alert
(
aUrl
,
{
layer
.
alert
(
aUrl
,
{
skin
:
'layui-layer-molv'
,
skin
:
'layui-layer-molv'
,
...
@@ -211,11 +213,13 @@
...
@@ -211,11 +213,13 @@
});
});
});
});
function
windowOpen
(
aTab
){
function
windowOpen
(
a
){
var
new_url
=
aTab
.
href
;
var
new_url
=
$
(
a
).
attr
(
'href'
);
var
hostname
=
$
(
a
).
attr
(
'value'
);
var
title
=
'Jumpserver Web Terminal - '
+
'<span class="text-info"> '
+
hostname
+
'</span>'
;
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
title
:
'Jumpserver Web Terminal'
,
title
:
title
,
maxmin
:
true
,
maxmin
:
true
,
area
:
[
'628px'
,
'452px'
],
area
:
[
'628px'
,
'452px'
],
shade
:
false
,
shade
:
false
,
...
@@ -261,7 +265,6 @@
...
@@ -261,7 +265,6 @@
});
});
$
(
'#asset_del'
).
click
(
function
()
{
$
(
'#asset_del'
).
click
(
function
()
{
var
asset_id_all
=
getIDall
();
var
asset_id_all
=
getIDall
();
if
(
asset_id_all
==
''
){
if
(
asset_id_all
==
''
){
...
...
templates/jlog/log_offline.html
View file @
19dcf171
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<table
class=
"table table-striped table-bordered table-hover "
>
<table
class=
"table table-striped table-bordered table-hover "
>
<thead>
<thead>
<tr>
<tr>
<th
class=
"text-center"
>
ID
</th>
<th
class=
"text-center"
>
用户名
</th>
<th
class=
"text-center"
>
用户名
</th>
<th
class=
"text-center"
>
登录主机
</th>
<th
class=
"text-center"
>
登录主机
</th>
<th
class=
"text-center"
>
来源IP
</th>
<th
class=
"text-center"
>
来源IP
</th>
...
@@ -114,15 +115,16 @@
...
@@ -114,15 +115,16 @@
{% for post in contacts.object_list %}
{% for post in contacts.object_list %}
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
id=
"username"
>
{{ post.user }}
</td>
<td
class=
"text-center username"
>
{{ post.id }}
</td>
<td
class=
"text-center"
id=
"ip"
>
{{ post.host }}
</td>
<td
class=
"text-center username"
>
{{ post.user }}
</td>
<td
class=
"text-center"
id=
"remote_ip"
>
{{ post.remote_ip }}
</td>
<td
class=
"text-center ip"
>
{{ post.host }}
</td>
<td
class=
"text-center remote_ip"
>
{{ post.remote_ip }}
</td>
{% ifnotequal session_role_id 0 %}
{% ifnotequal session_role_id 0 %}
<td
class=
"text-center"
><a
href=
"/jlog/history/?id={{ post.id }}"
class=
"log_command"
>
命令统计
</a></td>
<td
class=
"text-center"
><a
href=
"/jlog/history/?id={{ post.id }}"
class=
"log_command"
>
命令统计
</a></td>
{% endifnotequal %}
{% endifnotequal %}
<td
class=
"text-center"
><a
value=
"/jlog/record/?id={{ post.id }}"
class=
"log_record"
>
回放
</a></td>
<td
class=
"text-center"
><a
value=
"/jlog/record/?id={{ post.id }}"
class=
"log_record"
>
回放
</a></td>
<td
class=
"text-center
"
id=
"
start_time"
>
{{ post.start_time|date:"Y-m-d H:i:s"}}
</td>
<td
class=
"text-center
start_time"
>
{{ post.start_time|date:"Y-m-d H:i:s"}}
</td>
<td
class=
"text-center
"
id=
"
end_time"
>
{{ post.end_time|date:"Y-m-d H:i:s" }}
</td>
<td
class=
"text-center
end_time"
>
{{ post.end_time|date:"Y-m-d H:i:s" }}
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</tbody>
...
@@ -142,20 +144,36 @@
...
@@ -142,20 +144,36 @@
<script>
<script>
$
(
'.log_record'
).
click
(
function
(){
$
(
'.log_record'
).
click
(
function
(){
var
url
=
$
(
this
).
attr
(
'value'
);
var
url
=
$
(
this
).
attr
(
'value'
);
window
.
open
(
url
,
'播放'
,
'height=500, width=910, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no'
);
//window.open(url, '播放', 'height=500, width=910, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
var
username
=
$
(
this
).
closest
(
'tr'
).
find
(
'.username'
)[
0
].
innerHTML
;
var
ip
=
$
(
this
).
closest
(
'tr'
).
find
(
'.ip'
)[
0
].
innerHTML
;
var
start_time
=
$
(
this
).
closest
(
'tr'
).
find
(
'.start_time'
)[
0
].
innerHTML
;
var
end_time
=
$
(
this
).
closest
(
'tr'
).
find
(
'.end_time'
)[
0
].
innerHTML
;
var
div_username
=
' 用户名: '
+
'<span class="text-info">'
+
username
+
''
+
'</span>'
;
var
div_ip
=
' 主机: '
+
'<span class="text-info">'
+
ip
+
'</span>'
;
var
div_time
=
' 时间: '
+
'<span class="text-info">'
+
start_time
+
'</span>'
+
' - <span class="text-info">'
+
end_time
+
'</span>'
;
var
title
=
'JumpServer录像回放 '
+
div_username
+
div_ip
+
div_time
;
layer
.
open
({
type
:
2
,
title
:
title
,
maxmin
:
true
,
shade
:
false
,
area
:
[
'800px'
,
'520px'
],
content
:
url
});
return
false
;
return
false
;
});
});
$
(
'.log_command'
).
on
(
'click'
,
function
(){
$
(
'.log_command'
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
'href'
);
var
url
=
$
(
this
).
attr
(
'href'
);
var
username
=
$
(
'#username'
)[
0
].
innerText
;
var
username
=
$
(
this
).
closest
(
'tr'
).
find
(
'.username'
)[
0
].
innerHTML
;
var
ip
=
$
(
'#ip'
)[
0
].
innerText
;
var
ip
=
$
(
this
).
closest
(
'tr'
).
find
(
'.ip'
)[
0
].
innerHTML
;
var
start_time
=
$
(
'#start_time'
)[
0
].
innerText
;
var
start_time
=
$
(
this
).
closest
(
'tr'
).
find
(
'.start_time'
)[
0
].
innerHTML
;
var
end_time
=
$
(
'#end_time'
)[
0
].
innerText
;
var
end_time
=
$
(
this
).
closest
(
'tr'
).
find
(
'.end_time'
)[
0
].
innerHTML
;
var
div_username
=
' 用户名: '
+
'<span class="text-info">'
+
username
+
''
+
'</span>'
;
var
div_username
=
' 用户名: '
+
'<span class="text-info">'
+
username
+
''
+
'</span>'
;
var
div_ip
=
' 主机: '
+
'<span class="text-info">'
+
ip
+
'</span>'
;
var
div_ip
=
' 主机: '
+
'<span class="text-info">'
+
ip
+
'</span>'
;
var
div_time
=
' 开始时间: '
+
'<span class="text-info">'
+
start_time
+
'</span>'
+
' 结束时间: '
+
'<span class="text-info">'
+
end_time
+
'</span>'
;
var
div_time
=
' 开始时间: '
+
'<span class="text-info">'
+
start_time
+
'</span>'
+
' 结束时间: '
+
'<span class="text-info">'
+
end_time
+
'</span>'
;
var
title
=
'JumpServer命令统计 '
+
div_username
+
div_ip
+
div_time
;
var
title
=
'JumpServer命令统计 '
+
div_username
+
div_ip
+
div_time
;
$
.
ajax
({
url
:
url
,
$
.
ajax
({
url
:
url
,
success
:
function
(
data
){
success
:
function
(
data
){
var
tag
=
$
(
'<div style="height: 500px;overflow: auto;background-color: rgba(0, 0, 0, 0);"></div>'
).
html
(
data
.
replace
(
/
\n
/g
,
"<br />"
));
var
tag
=
$
(
'<div style="height: 500px;overflow: auto;background-color: rgba(0, 0, 0, 0);"></div>'
).
html
(
data
.
replace
(
/
\n
/g
,
"<br />"
));
...
...
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