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
72b8ac2a
Commit
72b8ac2a
authored
9 years ago
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bug' into dev
parents
d3153e9b
5045d66c
master
auditor_jym
audits
dev
dev_beta
dev_beta_db
gengmei
lagacy-0.4.0
node_service
password
rbac
restrict_access
test
v52
wph
1.5.2
1.5.1
1.5.0
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
0.3.3
0.3.2
0.3.2-rc2
0.3.1
0.3.0-beta
v1.4.10
v1.4.7
v1.4.4
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
39 deletions
+29
-39
connect.py
connect.py
+1
-0
log_api.py
jlog/log_api.py
+4
-2
jumpserver.conf
jumpserver.conf
+1
-1
run_websocket.py
run_websocket.py
+4
-0
asset_list.html
templates/jasset/asset_list.html
+19
-4
perm_rule_add.html
templates/jperm/perm_rule_add.html
+0
-32
No files found.
connect.py
View file @
72b8ac2a
...
@@ -437,6 +437,7 @@ class SshTty(Tty):
...
@@ -437,6 +437,7 @@ class SshTty(Tty):
termios
.
tcsetattr
(
sys
.
stdin
,
termios
.
TCSADRAIN
,
old_tty
)
termios
.
tcsetattr
(
sys
.
stdin
,
termios
.
TCSADRAIN
,
old_tty
)
log_file_f
.
write
(
'End time is
%
s'
%
datetime
.
datetime
.
now
())
log_file_f
.
write
(
'End time is
%
s'
%
datetime
.
datetime
.
now
())
log_file_f
.
close
()
log_file_f
.
close
()
log_time_f
.
close
()
log
.
is_finished
=
True
log
.
is_finished
=
True
log
.
end_time
=
datetime
.
datetime
.
now
()
log
.
end_time
=
datetime
.
datetime
.
now
()
log
.
save
()
log
.
save
()
...
...
This diff is collapsed.
Click to expand it.
jlog/log_api.py
View file @
72b8ac2a
...
@@ -43,14 +43,16 @@ def scriptToJSON(scriptf, timing=None):
...
@@ -43,14 +43,16 @@ def scriptToJSON(scriptf, timing=None):
scriptf
.
readline
()
# ignore first header line from script file
scriptf
.
readline
()
# ignore first header line from script file
offset
=
0
offset
=
0
for
t
in
timing
:
for
t
in
timing
:
data
=
escapeString
(
scriptf
.
read
(
t
[
1
]))
dt
=
scriptf
.
read
(
t
[
1
])
data
=
escapeString
(
dt
)
offset
+=
t
[
0
]
offset
+=
t
[
0
]
ret
.
append
((
data
,
offset
))
ret
.
append
((
data
,
offset
))
return
dumps
(
ret
)
return
dumps
(
ret
)
def
renderTemplate
(
script_path
,
time_file_path
,
dimensions
=
(
24
,
80
),
templatename
=
DEFAULT_TEMPLATE
):
def
renderTemplate
(
script_path
,
time_file_path
,
dimensions
=
(
24
,
80
),
templatename
=
DEFAULT_TEMPLATE
):
with
copen
(
script_path
,
encoding
=
'utf-8'
,
errors
=
'replace'
)
as
scriptf
:
#with copen(script_path, encoding='utf-8', errors='replace') as scriptf:
with
open
(
script_path
)
as
scriptf
:
with
open
(
time_file_path
)
as
timef
:
with
open
(
time_file_path
)
as
timef
:
timing
=
getTiming
(
timef
)
timing
=
getTiming
(
timef
)
json
=
scriptToJSON
(
scriptf
,
timing
)
json
=
scriptToJSON
(
scriptf
,
timing
)
...
...
This diff is collapsed.
Click to expand it.
jumpserver.conf
View file @
72b8ac2a
...
@@ -13,7 +13,7 @@ password = mysql234
...
@@ -13,7 +13,7 @@ password = mysql234
database
=
jumpserver
database
=
jumpserver
[
websocket
]
[
websocket
]
web_socket_host
=
j
s
:
3000
web_socket_host
=
j
:
3000
[
mail
]
[
mail
]
mail_enable
=
1
mail_enable
=
1
...
...
This diff is collapsed.
Click to expand it.
run_websocket.py
View file @
72b8ac2a
...
@@ -275,8 +275,11 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
...
@@ -275,8 +275,11 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
for
t
in
WebTerminalHandler
.
tasks
:
for
t
in
WebTerminalHandler
.
tasks
:
if
t
.
is_alive
():
if
t
.
is_alive
():
continue
continue
try
:
t
.
setDaemon
(
True
)
t
.
setDaemon
(
True
)
t
.
start
()
t
.
start
()
except
RuntimeError
:
pass
def
on_message
(
self
,
message
):
def
on_message
(
self
,
message
):
data
=
json
.
loads
(
message
)
data
=
json
.
loads
(
message
)
...
@@ -309,6 +312,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
...
@@ -309,6 +312,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
self
.
log
.
is_finished
=
True
self
.
log
.
is_finished
=
True
self
.
log
.
end_time
=
datetime
.
datetime
.
now
()
self
.
log
.
end_time
=
datetime
.
datetime
.
now
()
self
.
log
.
save
()
self
.
log
.
save
()
self
.
log_time_f
.
close
()
self
.
close
()
self
.
close
()
except
AttributeError
:
except
AttributeError
:
pass
pass
...
...
This diff is collapsed.
Click to expand it.
templates/jasset/asset_list.html
View file @
72b8ac2a
...
@@ -182,8 +182,15 @@
...
@@ -182,8 +182,15 @@
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'
){
console
.
log
(
'one'
);
layer
.
open
({
window
.
open
(
new_url
+
data
,
''
,
'height=400, width=600, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no'
);
type
:
2
,
title
:
'Jumpserver Web Terminal'
,
maxmin
:
true
,
shade
:
false
,
area
:
[
'628px'
,
'452px'
],
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');
}
else
if
(
dataArray
.
length
==
'1'
&&
data
==
'error'
){
}
else
if
(
dataArray
.
length
==
'1'
&&
data
==
'error'
){
layer
.
alert
(
'没有授权角色'
)
layer
.
alert
(
'没有授权角色'
)
}
else
{
}
else
{
...
@@ -194,6 +201,7 @@
...
@@ -194,6 +201,7 @@
layer
.
alert
(
aUrl
,
{
layer
.
alert
(
aUrl
,
{
skin
:
'layui-layer-molv'
,
skin
:
'layui-layer-molv'
,
title
:
'多个角色,请选择一个连接'
,
title
:
'多个角色,请选择一个连接'
,
shade
:
false
,
closeBtn
:
0
closeBtn
:
0
})
})
}
}
...
@@ -205,7 +213,15 @@
...
@@ -205,7 +213,15 @@
function
windowOpen
(
aTab
){
function
windowOpen
(
aTab
){
var
new_url
=
aTab
.
href
;
var
new_url
=
aTab
.
href
;
window
.
open
(
new_url
,
''
,
'height=400, width=600, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no'
);
layer
.
open
({
type
:
2
,
title
:
'Jumpserver Web Terminal'
,
maxmin
:
true
,
area
:
[
'628px'
,
'452px'
],
shade
:
false
,
content
:
new_url
});
//window.open(new_url, '', 'height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
return
false
return
false
}
}
...
@@ -224,7 +240,6 @@
...
@@ -224,7 +240,6 @@
border
:
[
2
,
0.3
,
'#1AB394'
],
border
:
[
2
,
0.3
,
'#1AB394'
],
shade
:
[
0.5
,
'#000000'
],
shade
:
[
0.5
,
'#000000'
],
shadeClose
:
true
,
shadeClose
:
true
,
area
:
[
'800px'
,
'600px'
],
content
:
url
,
content
:
url
,
cancel
:
function
(){
cancel
:
function
(){
location
.
replace
(
location
.
href
);
location
.
replace
(
location
.
href
);
...
...
This diff is collapsed.
Click to expand it.
templates/jperm/perm_rule_add.html
View file @
72b8ac2a
...
@@ -163,38 +163,6 @@ $('#ruleForm').validator({
...
@@ -163,38 +163,6 @@ $('#ruleForm').validator({
});
});
$
(
document
).
ready
(
function
(){
$
(
"input.role"
).
click
(
function
(){
if
(
$
(
"input.role[value=GA]"
).
is
(
":checked"
)){
$
(
"#admin_groups"
).
css
(
"display"
,
'none'
);
}
else
{
$
(
"#admin_groups"
).
css
(
"display"
,
'block'
);
}
});
$
(
'#use_password'
).
click
(
function
(){
if
(
$
(
this
).
is
(
':checked'
)){
$
(
'#admin_account_password'
).
css
(
'display'
,
'block'
)
}
else
{
$
(
'#admin_account_password'
).
css
(
'display'
,
'none'
)
}
});
$
(
'#use_publicKey'
).
click
(
function
(){
if
(
$
(
this
).
is
(
':checked'
)){
$
(
'#admin_account_publicKey'
).
css
(
'display'
,
'block'
)
}
else
{
$
(
'#admin_account_publicKey'
).
css
(
'display'
,
'none'
)
}
});
});
var
config
=
{
var
config
=
{
'.chosen-select'
:
{},
'.chosen-select'
:
{},
'.chosen-select-deselect'
:
{
allow_single_deselect
:
true
},
'.chosen-select-deselect'
:
{
allow_single_deselect
:
true
},
...
...
This diff is collapsed.
Click to expand it.
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