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
1f502e02
Commit
1f502e02
authored
Oct 24, 2018
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改settings为common_settings
parent
cdf83981
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
29 deletions
+9
-29
tasks.py
apps/common/tasks.py
+2
-1
basic_setting.html
apps/common/templates/common/basic_setting.html
+0
-26
utils.py
apps/common/utils.py
+2
-1
jumpserver.js
apps/static/js/jumpserver.js
+3
-0
login.py
apps/users/views/login.py
+2
-1
No files found.
apps/common/tasks.py
View file @
1f502e02
...
...
@@ -3,6 +3,7 @@ from django.conf import settings
from
celery
import
shared_task
from
.utils
import
get_logger
from
.models
import
Setting
from
common.models
import
common_settings
logger
=
get_logger
(
__file__
)
...
...
@@ -28,7 +29,7 @@ def send_mail_async(*args, **kwargs):
if
len
(
args
)
==
3
:
args
=
list
(
args
)
args
[
0
]
=
settings
.
EMAIL_SUBJECT_PREFIX
+
args
[
0
]
args
[
0
]
=
common_
settings
.
EMAIL_SUBJECT_PREFIX
+
args
[
0
]
args
.
insert
(
2
,
settings
.
EMAIL_HOST_USER
)
args
=
tuple
(
args
)
...
...
apps/common/templates/common/basic_setting.html
View file @
1f502e02
...
...
@@ -75,32 +75,6 @@
{% block custom_foot_js %}
<script>
$
(
document
).
ready
(
function
()
{
})
.
on
(
"click"
,
".btn-test"
,
function
()
{
var
data
=
{};
var
form
=
$
(
"form"
).
serializeArray
();
$
.
each
(
form
,
function
(
i
,
field
)
{
data
[
field
.
name
]
=
field
.
value
;
});
var
the_url
=
"{% url 'api-common:mail-testing' %}"
;
function
error
(
message
)
{
toastr
.
error
(
message
)
}
function
success
(
message
)
{
toastr
.
success
(
message
.
msg
)
}
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
data
),
method
:
"POST"
,
flash_message
:
false
,
success
:
success
,
error
:
error
});
})
</script>
{% endblock %}
apps/common/utils.py
View file @
1f502e02
...
...
@@ -37,7 +37,8 @@ def reverse(view_name, urlconf=None, args=None, kwargs=None,
kwargs
=
kwargs
,
current_app
=
current_app
)
if
external
:
url
=
settings
.
SITE_URL
.
strip
(
'/'
)
+
url
from
common.models
import
common_settings
url
=
common_settings
.
SITE_URL
.
strip
(
'/'
)
+
url
return
url
...
...
apps/static/js/jumpserver.js
View file @
1f502e02
...
...
@@ -152,6 +152,9 @@ function activeNav() {
$
(
'#'
+
app
+
' #'
+
resource
).
addClass
(
'active'
);
$
(
'#'
+
app
+
' #'
+
resource
+
' #'
+
item
+
' a'
).
css
(
'color'
,
'#ffffff'
);
}
else
if
(
app
===
'settings'
){
$
(
"#"
+
app
).
addClass
(
'active'
);
}
else
{
$
(
"#"
+
app
).
addClass
(
'active'
);
$
(
'#'
+
app
+
' #'
+
resource
).
addClass
(
'active'
);
...
...
apps/users/views/login.py
View file @
1f502e02
...
...
@@ -21,6 +21,7 @@ from formtools.wizard.views import SessionWizardView
from
django.conf
import
settings
from
common.utils
import
get_object_or_none
,
get_request_ip
from
common.models
import
common_settings
from
..models
import
User
,
LoginLog
from
..utils
import
send_reset_password_mail
,
check_otp_code
,
\
redirect_user_first_login_or_index
,
get_user_or_tmp_user
,
\
...
...
@@ -318,7 +319,7 @@ class UserFirstLoginView(LoginRequiredMixin, SessionWizardView):
user
.
is_public_key_valid
=
True
user
.
save
()
context
=
{
'user_guide_url'
:
settings
.
USER_GUIDE_URL
'user_guide_url'
:
common_
settings
.
USER_GUIDE_URL
}
return
render
(
self
.
request
,
'users/first_login_done.html'
,
context
)
...
...
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