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
c2f78b11
Commit
c2f78b11
authored
Oct 21, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改jumpserver,支持url前缀
parent
9870d3aa
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
6 deletions
+13
-6
conf.py
apps/jumpserver/conf.py
+1
-0
context_processor.py
apps/jumpserver/context_processor.py
+1
-0
settings.py
apps/jumpserver/settings.py
+1
-0
jumpserver.js
apps/static/js/jumpserver.js
+9
-5
_foot_js.html
apps/templates/_foot_js.html
+1
-1
No files found.
apps/jumpserver/conf.py
View file @
c2f78b11
...
...
@@ -393,6 +393,7 @@ defaults = {
'FLOWER_URL'
:
"127.0.0.1:5555"
,
'DEFAULT_ORG_SHOW_ALL_USERS'
:
True
,
'PERIOD_TASK_ENABLED'
:
True
,
'FORCE_SCRIPT_NAME'
:
''
,
}
...
...
apps/jumpserver/context_processor.py
View file @
c2f78b11
...
...
@@ -18,6 +18,7 @@ def jumpserver_processor(request):
'COPYRIGHT'
:
'FIT2CLOUD 飞致云'
+
' © 2014-2019'
,
'SECURITY_COMMAND_EXECUTION'
:
settings
.
SECURITY_COMMAND_EXECUTION
,
'SECURITY_MFA_VERIFY_TTL'
:
settings
.
SECURITY_MFA_VERIFY_TTL
,
'FORCE_SCRIPT_NAME'
:
settings
.
FORCE_SCRIPT_NAME
,
}
return
context
...
...
apps/jumpserver/settings.py
View file @
c2f78b11
...
...
@@ -654,3 +654,4 @@ CHANNEL_LAYERS = {
# Enable internal period task
PERIOD_TASK_ENABLED
=
CONFIG
.
PERIOD_TASK_ENABLED
FORCE_SCRIPT_NAME
=
CONFIG
.
FORCE_SCRIPT_NAME
apps/static/js/jumpserver.js
View file @
c2f78b11
...
...
@@ -137,14 +137,18 @@ function setAjaxCSRFToken() {
});
}
function
activeNav
()
{
var
url_array
=
document
.
location
.
pathname
.
split
(
"/"
);
var
app
=
url_array
[
1
];
var
resource
=
url_array
[
2
];
function
activeNav
(
prefix
)
{
var
path
=
document
.
location
.
pathname
;
if
(
prefix
)
{
path
=
path
.
replace
(
prefix
,
''
);
}
var
urlArray
=
path
.
split
(
"/"
);
var
app
=
urlArray
[
1
];
var
resource
=
urlArray
[
2
];
if
(
app
===
''
)
{
$
(
'#index'
).
addClass
(
'active'
);
}
else
if
(
app
===
'xpack'
&&
resource
===
'cloud'
)
{
var
item
=
url
_a
rray
[
3
];
var
item
=
url
A
rray
[
3
];
$
(
"#"
+
app
).
addClass
(
'active'
);
$
(
'#'
+
app
+
' #'
+
resource
).
addClass
(
'active'
);
$
(
'#'
+
app
+
' #'
+
resource
+
' #'
+
item
+
' a'
).
css
(
'color'
,
'#ffffff'
);
...
...
apps/templates/_foot_js.html
View file @
c2f78b11
...
...
@@ -9,7 +9,7 @@
<script
type=
"text/javascript"
src=
"{% url 'javascript-catalog' %}"
></script>
<script
src=
"{% static "
js
/
jumpserver
.
js
"
%}?
v=
4"
></script>
<script>
activeNav
();
activeNav
(
"{{ FORCE_SCRIPT_NAME }}"
);
$
(
document
).
ready
(
function
(){
setAjaxCSRFToken
();
$
(
'textarea'
).
attr
(
'rows'
,
5
);
...
...
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