\n"
@@ -95,7 +95,7 @@ msgstr "运行参数"
#: terminal/templates/terminal/command_list.html:66
#: terminal/templates/terminal/session_list.html:28
#: terminal/templates/terminal/session_list.html:72
-#: xpack/plugins/change_auth_plan/forms.py:64
+#: xpack/plugins/change_auth_plan/forms.py:73
#: xpack/plugins/change_auth_plan/models.py:412
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:46
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:54
@@ -112,7 +112,7 @@ msgstr "资产"
#: applications/templates/applications/remote_app_detail.html:53
#: applications/templates/applications/remote_app_list.html:20
#: applications/templates/applications/user_remote_app_list.html:16
-#: assets/forms/asset.py:21 assets/forms/domain.py:73 assets/forms/user.py:75
+#: assets/forms/asset.py:21 assets/forms/domain.py:77 assets/forms/user.py:75
#: assets/forms/user.py:95 assets/models/base.py:28 assets/models/cluster.py:18
#: assets/models/cmd_filter.py:21 assets/models/domain.py:20
#: assets/models/group.py:20 assets/models/label.py:18
@@ -151,7 +151,7 @@ msgstr "资产"
#: users/templates/users/user_list.html:35
#: users/templates/users/user_profile.html:51
#: users/templates/users/user_pubkey_update.html:57
-#: xpack/plugins/change_auth_plan/forms.py:47
+#: xpack/plugins/change_auth_plan/forms.py:56
#: xpack/plugins/change_auth_plan/models.py:63
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:61
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:12
@@ -322,6 +322,7 @@ msgstr "远程应用"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create_update.html:53
#: xpack/plugins/gathered_user/templates/gathered_user/task_create_update.html:44
#: xpack/plugins/interface/templates/interface/interface.html:72
+#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33
#: xpack/plugins/vault/templates/vault/vault_create.html:45
msgid "Reset"
msgstr "重置"
@@ -639,7 +640,7 @@ msgstr "网域"
#: perms/templates/perms/asset_permission_list.html:53
#: perms/templates/perms/asset_permission_list.html:74
#: perms/templates/perms/asset_permission_list.html:124
-#: xpack/plugins/change_auth_plan/forms.py:65
+#: xpack/plugins/change_auth_plan/forms.py:74
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:55
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:15
#: xpack/plugins/cloud/models.py:157
@@ -668,7 +669,7 @@ msgstr "如果有多个的互相隔离的网络,设置资产属于的网域,
#: assets/forms/asset.py:132 assets/forms/asset.py:136
#: assets/forms/domain.py:17 assets/forms/label.py:15
#: perms/templates/perms/asset_permission_asset.html:78
-#: xpack/plugins/change_auth_plan/forms.py:55
+#: xpack/plugins/change_auth_plan/forms.py:64
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:74
msgid "Select assets"
msgstr "选择资产"
@@ -677,15 +678,15 @@ msgstr "选择资产"
msgid "Content should not be contain: {}"
msgstr "内容不能包含: {}"
-#: assets/forms/domain.py:51
+#: assets/forms/domain.py:55
msgid "Password should not contain special characters"
msgstr "不能包含特殊字符"
-#: assets/forms/domain.py:70
+#: assets/forms/domain.py:74
msgid "SSH gateway support proxy SSH,RDP,VNC"
msgstr "SSH网关,支持代理SSH,RDP和VNC"
-#: assets/forms/domain.py:74 assets/forms/user.py:76 assets/forms/user.py:96
+#: assets/forms/domain.py:78 assets/forms/user.py:76 assets/forms/user.py:96
#: assets/models/base.py:29 assets/models/gathered_user.py:16
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
@@ -706,7 +707,7 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC"
#: users/templates/users/user_detail.html:67
#: users/templates/users/user_list.html:36
#: users/templates/users/user_profile.html:47
-#: xpack/plugins/change_auth_plan/forms.py:49
+#: xpack/plugins/change_auth_plan/forms.py:58
#: xpack/plugins/change_auth_plan/models.py:65
#: xpack/plugins/change_auth_plan/models.py:408
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:65
@@ -1451,7 +1452,7 @@ msgid "Update asset user auth"
msgstr "更新资产用户认证信息"
#: assets/templates/assets/_asset_user_auth_update_modal.html:23
-#: xpack/plugins/change_auth_plan/forms.py:51
+#: xpack/plugins/change_auth_plan/forms.py:60
msgid "Please input password"
msgstr "请输入密码"
@@ -1637,7 +1638,7 @@ msgstr "替换资产的管理员"
#: assets/templates/assets/admin_user_detail.html:91
#: perms/templates/perms/asset_permission_asset.html:103
-#: xpack/plugins/change_auth_plan/forms.py:59
+#: xpack/plugins/change_auth_plan/forms.py:68
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:99
#: xpack/plugins/gathered_user/forms.py:36
msgid "Select nodes"
@@ -1877,7 +1878,6 @@ msgstr "删除选择资产"
#: users/templates/users/user_group_list.html:118
#: users/templates/users/user_list.html:254
#: xpack/plugins/interface/templates/interface/interface.html:101
-#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33
msgid "Cancel"
msgstr "取消"
@@ -3394,33 +3394,33 @@ msgstr "远程应用授权用户列表"
msgid "RemoteApp permission RemoteApp list"
msgstr "远程应用授权远程应用列表"
-#: settings/api.py:27
+#: settings/api.py:28
msgid "Test mail sent to {}, please check"
msgstr "邮件已经发送{}, 请检查"
-#: settings/api.py:55
+#: settings/api.py:67
msgid "Test ldap success"
msgstr "连接LDAP成功"
-#: settings/api.py:92
+#: settings/api.py:104
msgid "Match {} s users"
msgstr "匹配 {} 个用户"
-#: settings/api.py:151
+#: settings/api.py:163
msgid "succeed: {} failed: {} total: {}"
msgstr "成功:{} 失败:{} 总数:{}"
-#: settings/api.py:173 settings/api.py:209
+#: settings/api.py:185 settings/api.py:221
msgid ""
"Error: Account invalid (Please make sure the information such as Access key "
"or Secret key is correct)"
msgstr "错误:账户无效 (请确保 Access key 或 Secret key 等信息正确)"
-#: settings/api.py:179 settings/api.py:215
+#: settings/api.py:191 settings/api.py:227
msgid "Create succeed"
msgstr "创建成功"
-#: settings/api.py:197 settings/api.py:235
+#: settings/api.py:209 settings/api.py:247
#: settings/templates/settings/terminal_setting.html:154
msgid "Delete succeed"
msgstr "删除成功"
@@ -4536,7 +4536,7 @@ msgid ""
"You should use your ssh client tools connect terminal: {} {}"
msgstr "你可以使用ssh客户端工具连接终端"
-#: users/api/user.py:176
+#: users/api/user.py:173
msgid "Could not reset self otp, use profile reset instead"
msgstr "不能再该页面重置MFA, 请去个人信息页面重置"
@@ -4874,7 +4874,7 @@ msgid "Always young, always with tears in my eyes. Stay foolish Stay hungry"
msgstr "永远年轻,永远热泪盈眶 stay foolish stay hungry"
#: users/templates/users/reset_password.html:46
-#: users/templates/users/user_detail.html:379 users/utils.py:84
+#: users/templates/users/user_detail.html:379 users/utils.py:83
msgid "Reset password"
msgstr "重置密码"
@@ -5190,61 +5190,57 @@ msgid ""
"corresponding private key."
msgstr "新的公钥已设置成功,请下载对应的私钥"
+# msgid "Update user"
+# msgstr "更新用户"
#: users/utils.py:24
#, python-format
msgid ""
"\n"
-" \n"
-" \n"
-" \n"
-" Username: %(username)s.\n"
-" \n"
-" \n"
-" click here to set your password \n"
-" \n"
-" \n"
-" This link is valid for 1 hour. After it expires, request new one \n"
-" \n"
-" \n"
+" \n"
+"
Your account has been created successfully
\n"
+"
\n"
+"
\n"
+"
\n"
" "
msgstr ""
"\n"
-" \n"
-" \n"
-" \n"
-" 用户名: %(username)s.\n"
-" \n"
-" \n"
-" "
-"请点击这里设置密码 \n"
-" \n"
-" \n"
-" 这个链接有效期1小时, 超过时间您可以 重新申请 \n"
-" \n"
-" \n"
-" ---登录页面 \n"
-" \n"
-"
\n"
-" "
+" \n"
+"
您的账户已创建成功
\n"
+"
\n"
+" 用户名: %(username)s\n"
+"
\n"
+" 密码:
请点击这里设置密码 (这个链接有效期1小时, 超过时"
+"间您可以
重新申请 )\n"
+"
\n"
+"
\n"
+"
---
\n"
+"
直接登录 \n"
+"
\n"
+"
\n"
+" "
-#: users/utils.py:59
+#: users/utils.py:58
msgid "Create account successfully"
msgstr "创建账户成功"
-#: users/utils.py:63
+#: users/utils.py:62
#, python-format
msgid "Hello %(name)s"
msgstr "您好 %(name)s"
-#: users/utils.py:86
+#: users/utils.py:85
#, python-format
msgid ""
"\n"
@@ -5288,11 +5284,11 @@ msgstr ""
" \n"
" "
-#: users/utils.py:117
+#: users/utils.py:116
msgid "Security notice"
msgstr "安全通知"
-#: users/utils.py:119
+#: users/utils.py:118
#, python-format
msgid ""
"\n"
@@ -5341,11 +5337,11 @@ msgstr ""
" \n"
" "
-#: users/utils.py:155
+#: users/utils.py:154
msgid "Expiration notice"
msgstr "过期通知"
-#: users/utils.py:157
+#: users/utils.py:156
#, python-format
msgid ""
"\n"
@@ -5367,11 +5363,11 @@ msgstr ""
" \n"
" "
-#: users/utils.py:176
+#: users/utils.py:175
msgid "SSH Key Reset"
msgstr "重置ssh密钥"
-#: users/utils.py:178
+#: users/utils.py:177
#, python-format
msgid ""
"\n"
@@ -5485,7 +5481,7 @@ msgstr "MFA 解绑成功,返回登录页面"
msgid "Password length"
msgstr "密码长度"
-#: xpack/plugins/change_auth_plan/forms.py:66
+#: xpack/plugins/change_auth_plan/forms.py:75
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:60
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:81
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:17
@@ -5499,7 +5495,7 @@ msgstr "密码长度"
msgid "Periodic perform"
msgstr "定时执行"
-#: xpack/plugins/change_auth_plan/forms.py:70
+#: xpack/plugins/change_auth_plan/forms.py:79
msgid ""
"Tips: The username of the user on the asset to be modified. if the user "
"exists, change the password; If the user does not exist, create the user."
@@ -5507,12 +5503,12 @@ msgstr ""
"提示:用户名为将要修改的资产上的用户的用户名。如果用户存在,则修改密码;如果"
"用户不存在,则创建用户。"
-#: xpack/plugins/change_auth_plan/forms.py:74 xpack/plugins/cloud/forms.py:90
+#: xpack/plugins/change_auth_plan/forms.py:83 xpack/plugins/cloud/forms.py:90
#: xpack/plugins/gathered_user/forms.py:44
msgid "Tips: (Units: hour)"
msgstr "提示:(单位: 时)"
-#: xpack/plugins/change_auth_plan/forms.py:75 xpack/plugins/cloud/forms.py:91
+#: xpack/plugins/change_auth_plan/forms.py:84 xpack/plugins/cloud/forms.py:91
#: xpack/plugins/gathered_user/forms.py:45
msgid ""
"eg: Every Sunday 03:05 run <5 3 * * 0> Tips: Using 5 digits linux "
@@ -6307,45 +6303,6 @@ msgstr "创建"
#~ msgid "Update user groups"
#~ msgstr "更新用户组"
-# msgid "Update user"
-# msgstr "更新用户"
-#~ msgid ""
-#~ "\n"
-#~ " \n"
-#~ " \n"
-#~ " \n"
-#~ " click here to set your password \n"
-#~ " \n"
-#~ " \n"
-#~ " This link is valid for 1 hour. After it expires, request new one \n"
-#~ " \n"
-#~ " \n"
-#~ " Login direct \n"
-#~ " \n"
-#~ "
\n"
-#~ " "
-#~ msgstr ""
-#~ "\n"
-#~ " \n"
-#~ " \n"
-#~ " \n"
-#~ " 请点击这里设置密码 \n"
-#~ " \n"
-#~ " \n"
-#~ " 这个链接有效期1小时, 超过时间您可以, 重新申请 \n"
-#~ " \n"
-#~ " \n"
-#~ " Login direct \n"
-#~ " \n"
-#~ "
\n"
-#~ " "
-
#~ msgid "Template"
#~ msgstr "模板"
diff --git a/apps/ops/templates/ops/celery_task_log.html b/apps/ops/templates/ops/celery_task_log.html
index 8e99c356d..455fc28d6 100644
--- a/apps/ops/templates/ops/celery_task_log.html
+++ b/apps/ops/templates/ops/celery_task_log.html
@@ -4,16 +4,39 @@
{% trans 'Task log' %}
+
+
@@ -35,12 +58,13 @@
cursorBlink: false,
screenKeys: false,
fontFamily: '"Monaco", "Consolas", "monospace"',
- fontSize: 12,
+ fontSize: 13,
+ lineHeight: 1.2,
rightClickSelectsWord: true,
disableStdin: true
});
term.open(document.getElementById('term'));
- term.resize(120, 30);
+ window.fit.fit(term);
ws = new WebSocket(wsURL);
ws.onmessage = function(e) {
@@ -61,5 +85,7 @@
term.write("Connect websocket server error")
}
}
+ }).on('resize', window, function () {
+ window.fit.fit(term);
});
diff --git a/apps/ops/templates/ops/command_execution_create.html b/apps/ops/templates/ops/command_execution_create.html
index f550c51d3..cd1867c74 100644
--- a/apps/ops/templates/ops/command_execution_create.html
+++ b/apps/ops/templates/ops/command_execution_create.html
@@ -34,6 +34,27 @@
.select2-container .select2-selection--single {
height: 34px;
}
+
+ .terminal .xterm-viewport {
+ background-color: #1f1b1b;
+ overflow: auto;
+ }
+
+ body ::-webkit-scrollbar-track {
+ -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
+ background-color: #272323;
+ border-radius: 6px;
+ }
+
+ body ::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ }
+
+ body ::-webkit-scrollbar-thumb {
+ background-color: #494141;
+ border-radius: 6px;
+ }
{% endblock %}
@@ -80,9 +101,7 @@
{% for s in system_users %}
- {% if s.protocol == 'ssh' and s.login_mode == 'auto' %}
- {{ s }}
- {% endif %}
+ {{ s }}
{% endfor %}
/assets//system-users/', api.UserGroupGrantedAssetSystemUsersApi.as_view(), name='user-group-asset-system-users'),
# 用户和资产授权变更
- path('asset-permissions//user/remove/', api.AssetPermissionRemoveUserApi.as_view(), name='asset-permission-remove-user'),
- path('asset-permissions//user/add/', api.AssetPermissionAddUserApi.as_view(), name='asset-permission-add-user'),
- path('asset-permissions//asset/remove/', api.AssetPermissionRemoveAssetApi.as_view(), name='asset-permission-remove-asset'),
- path('asset-permissions//asset/add/', api.AssetPermissionAddAssetApi.as_view(), name='asset-permission-add-asset'),
+ path('asset-permissions//users/remove/', api.AssetPermissionRemoveUserApi.as_view(), name='asset-permission-remove-user'),
+ path('asset-permissions//users/add/', api.AssetPermissionAddUserApi.as_view(), name='asset-permission-add-user'),
+ path('asset-permissions//assets/remove/', api.AssetPermissionRemoveAssetApi.as_view(), name='asset-permission-remove-asset'),
+ path('asset-permissions//assets/add/', api.AssetPermissionAddAssetApi.as_view(), name='asset-permission-add-asset'),
# 授权规则中授权的资产
path('asset-permissions//assets/', api.AssetPermissionAssetsApi.as_view(), name='asset-permission-assets'),
@@ -75,7 +75,7 @@ asset_permission_urlpatterns = [
path('asset-permissions/user/actions/', api.GetUserAssetPermissionActionsApi.as_view(), name='get-user-asset-permission-actions'),
# 刷新缓存
- path('asset-permissions/user/cache/refresh/', api.RefreshAssetPermissionCacheApi.as_view(), name='refresh-asset-permission-cache'),
+ path('asset-permissions/cache/refresh/', api.RefreshAssetPermissionCacheApi.as_view(), name='refresh-asset-permission-cache'),
]
@@ -99,10 +99,10 @@ remote_app_permission_urlpatterns = [
path('remote-app-permissions/user/validate/', api.ValidateUserRemoteAppPermissionApi.as_view(), name='validate-user-remote-app-permission'),
# 用户和RemoteApp变更
- path('remote-app-permissions//user/add/', api.RemoteAppPermissionAddUserApi.as_view(), name='remote-app-permission-add-user'),
- path('remote-app-permissions//user/remove/', api.RemoteAppPermissionRemoveUserApi.as_view(), name='remote-app-permission-remove-user'),
- path('remote-app-permissions//remote-app/remove/', api.RemoteAppPermissionRemoveRemoteAppApi.as_view(), name='remote-app-permission-remove-remote-app'),
- path('remote-app-permissions//remote-app/add/', api.RemoteAppPermissionAddRemoteAppApi.as_view(), name='remote-app-permission-add-remote-app'),
+ path('remote-app-permissions//users/add/', api.RemoteAppPermissionAddUserApi.as_view(), name='remote-app-permission-add-user'),
+ path('remote-app-permissions//users/remove/', api.RemoteAppPermissionRemoveUserApi.as_view(), name='remote-app-permission-remove-user'),
+ path('remote-app-permissions//remote-apps/remove/', api.RemoteAppPermissionRemoveRemoteAppApi.as_view(), name='remote-app-permission-remove-remote-app'),
+ path('remote-app-permissions//remote-apps/add/', api.RemoteAppPermissionAddRemoteAppApi.as_view(), name='remote-app-permission-add-remote-app'),
]
old_version_urlpatterns = [
diff --git a/apps/perms/utils/asset_permission.py b/apps/perms/utils/asset_permission.py
index 6754511d0..f71f83663 100644
--- a/apps/perms/utils/asset_permission.py
+++ b/apps/perms/utils/asset_permission.py
@@ -234,6 +234,9 @@ class AssetPermissionUtilV2(AssetPermissionUtilCacheMixin):
if user_tree.contains(key):
nodes_single_assets.pop(key)
+ if not nodes_single_assets:
+ return
+
# 如果要设置到ungroup中
if settings.PERM_SINGLE_ASSET_TO_UNGROUP_NODE:
node_key = Node.ungrouped_key
@@ -336,8 +339,8 @@ class AssetPermissionUtilV2(AssetPermissionUtilCacheMixin):
self.add_direct_nodes_to_user_tree(user_tree)
self.add_single_assets_node_to_user_tree(user_tree)
self.parse_user_tree_to_full_tree(user_tree)
- self.add_empty_node_if_need(user_tree)
self.add_favorite_node_if_need(user_tree)
+ self.add_empty_node_if_need(user_tree)
self.set_user_tree_to_cache_if_need(user_tree)
self.set_user_tree_to_local(user_tree)
return user_tree
@@ -487,6 +490,7 @@ class ParserNode:
'ip': asset.ip,
'protocols': asset.protocols_as_list,
'platform': asset.platform,
+ "org_name": asset.org_name,
},
}
}
diff --git a/apps/settings/api.py b/apps/settings/api.py
index d327bde17..22a295b68 100644
--- a/apps/settings/api.py
+++ b/apps/settings/api.py
@@ -5,6 +5,7 @@ import os
import json
import jms_storage
+from smtplib import SMTPSenderRefused
from rest_framework import generics
from rest_framework.views import Response, APIView
from django.conf import settings
@@ -41,9 +42,20 @@ class MailTestingAPI(APIView):
email_from = email_from or email_host_user
email_recipient = email_recipient or email_from
send_mail(subject, message, email_from, [email_recipient])
+ except SMTPSenderRefused as e:
+ resp = e.smtp_error
+ if isinstance(resp, bytes):
+ for coding in ('gbk', 'utf8'):
+ try:
+ resp = resp.decode(coding)
+ except UnicodeDecodeError:
+ continue
+ else:
+ break
+ return Response({"error": str(resp)}, status=401)
except Exception as e:
+ print(e)
return Response({"error": str(e)}, status=401)
-
return Response({"msg": self.success_message.format(email_recipient)})
else:
return Response({"error": str(serializer.errors)}, status=401)
diff --git a/apps/static/img/facio.ico b/apps/static/img/facio.ico
index c4ac53dc8..266c07166 100644
Binary files a/apps/static/img/facio.ico and b/apps/static/img/facio.ico differ
diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js
index acff49939..604aba01d 100644
--- a/apps/static/js/jumpserver.js
+++ b/apps/static/js/jumpserver.js
@@ -206,7 +206,7 @@ function formSubmit(props) {
var errors = jqXHR.responseJSON;
var noneFieldErrorRef = props.form.children('.alert-danger');
if (noneFieldErrorRef.length !== 1) {
- props.form.prepend('
');
+ props.form.prepend('
');
noneFieldErrorRef = props.form.children('.alert-danger');
}
var noneFieldErrorMsg = "";
@@ -252,6 +252,7 @@ function formSubmit(props) {
noneFieldErrorRef.css('display', 'block');
noneFieldErrorRef.html(noneFieldErrorMsg);
}
+ $('.has-error').get(0).scrollIntoView();
}
})
@@ -458,6 +459,7 @@ jumpserver.initDataTable = function (options) {
{
targets: 0,
orderable: false,
+ width: "20px",
createdCell: function (td, cellData) {
$(td).html(' '.replace('99991937', cellData));
}
@@ -555,6 +557,7 @@ jumpserver.initServerSideDataTable = function (options) {
{
targets: 0,
orderable: false,
+ width: "20px",
createdCell: function (td, cellData) {
$(td).html(' '.replace('99991937', cellData));
}
diff --git a/apps/users/templates/users/user_group_detail.html b/apps/users/templates/users/user_group_detail.html
index ebe12af84..8f5cccf29 100644
--- a/apps/users/templates/users/user_group_detail.html
+++ b/apps/users/templates/users/user_group_detail.html
@@ -84,9 +84,6 @@
- {% for user in users %}
- {{ user.name }}
- {% endfor %}
@@ -157,7 +154,8 @@ $(document).ready(function () {
}).on('select2:unselect', function(evt) {
var data = evt.params.data;
delete jumpserver.users_selected[data.id]
- })
+ });
+ usersSelect2Init('#slct_users')
}).on('click', '.btn_remove_user', function() {
var $this = $(this);
var $tr = $this.closest('tr');
diff --git a/apps/users/templates/users/user_group_list.html b/apps/users/templates/users/user_group_list.html
index c2fa87357..3eb70e319 100644
--- a/apps/users/templates/users/user_group_list.html
+++ b/apps/users/templates/users/user_group_list.html
@@ -82,7 +82,7 @@ function initTable() {
],
ajax_url: '{% url "api-users:user-group-list" %}?display=1',
columns: [{data: function(){return ""}}, {data: "name" }, {data: "users", orderable: false},
- {data: "comment"}, {data: "id", orderable: false }],
+ {data: "comment"}, {data: "id", orderable: false, width:"100px"}],
order: [],
op_html: $('#actions').html()
};
diff --git a/apps/users/templates/users/user_list.html b/apps/users/templates/users/user_list.html
index d992416d1..cd9273681 100644
--- a/apps/users/templates/users/user_list.html
+++ b/apps/users/templates/users/user_list.html
@@ -125,7 +125,7 @@ function initTable() {
{data: "groups_display", orderable: false},
{data: "source"},
{data: "is_valid", orderable: false},
- {data: "id", orderable: false}
+ {data: "id", orderable: false, width: "100px"}
],
op_html: $('#actions').html()
};
diff --git a/apps/users/utils.py b/apps/users/utils.py
index 59400694e..30868358c 100644
--- a/apps/users/utils.py
+++ b/apps/users/utils.py
@@ -22,21 +22,20 @@ logger = logging.getLogger('jumpserver')
def construct_user_created_email_body(user):
default_body = _("""
-
-
-
- Username: %(username)s.
-
-
- click here to set your password
-
-
- This link is valid for 1 hour. After it expires, request new one
-
-
+
+
Your account has been created successfully
+
+
+
""") % {
'username': user.username,
'rest_password_url': reverse('users:reset-password', external=True),
diff --git a/jms b/jms
index 1affac1d2..6331227fa 100755
--- a/jms
+++ b/jms
@@ -65,6 +65,7 @@ logging.basicConfig(
EXIT_EVENT = threading.Event()
LOCK = threading.Lock()
files_preserve = []
+STOP_TIMEOUT = 10
logger = logging.getLogger()
@@ -120,7 +121,7 @@ def check_pid(pid):
def get_pid_file_path(s):
- return os.path.join('/tmp', '{}.pid'.format(s))
+ return os.path.join(TMP_DIR, '{}.pid'.format(s))
def get_log_file_path(s):
@@ -433,9 +434,19 @@ def stop_service(srv, sig=15):
if not is_running(s):
show_service_status(s)
continue
- logging.info("Stop service: {}".format(s))
+ print("Stop service: {}".format(s), end='')
pid = get_pid(s)
os.kill(pid, sig)
+ for i in range(STOP_TIMEOUT):
+ if i == STOP_TIMEOUT - 1:
+ print("\033[31m Error\033[0m")
+ if not is_running(s):
+ print("\033[32m Ok\033[0m")
+ break
+ else:
+ time.sleep(1)
+ continue
+
with LOCK:
processes.pop(s, None)
@@ -472,9 +483,9 @@ def show_service_status(s):
for ns in services_set:
if is_running(ns):
pid = get_pid(ns)
- logging.info("{} is running: {}".format(ns, pid))
+ print("{} is running: {}".format(ns, pid))
else:
- logging.info("{} is stopped".format(ns))
+ print("{} is stopped".format(ns))
if __name__ == '__main__':
@@ -499,6 +510,7 @@ if __name__ == '__main__':
)
parser.add_argument('-d', '--daemon', nargs="?", const=1)
parser.add_argument('-w', '--worker', type=int, nargs="?", const=4)
+ parser.add_argument('-f', '--force', nargs="?", const=1)
args = parser.parse_args()
if args.daemon:
DAEMON = True
@@ -513,7 +525,10 @@ if __name__ == '__main__':
start_services_and_watch(srv)
os._exit(0)
elif action == "stop":
- stop_service(srv)
+ if args.force:
+ stop_service_force(srv)
+ else:
+ stop_service(srv)
elif action == "restart":
DAEMON = True
stop_service(srv)