mirror of https://github.com/jumpserver/jumpserver
commit
16db2abca5
|
@ -199,6 +199,8 @@ class LogTailApi(generics.RetrieveAPIView):
|
||||||
buff_size = 1024 * 10
|
buff_size = 1024 * 10
|
||||||
serializer_class = OutputSerializer
|
serializer_class = OutputSerializer
|
||||||
end = False
|
end = False
|
||||||
|
mark = ''
|
||||||
|
log_path = ''
|
||||||
|
|
||||||
def is_file_finish_write(self):
|
def is_file_finish_write(self):
|
||||||
return True
|
return True
|
||||||
|
@ -206,6 +208,9 @@ class LogTailApi(generics.RetrieveAPIView):
|
||||||
def get_log_path(self):
|
def get_log_path(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def get_no_file_message(self, request):
|
||||||
|
return 'Not found the log'
|
||||||
|
|
||||||
def filter_line(self, line):
|
def filter_line(self, line):
|
||||||
"""
|
"""
|
||||||
过滤行,可能替换一些信息
|
过滤行,可能替换一些信息
|
||||||
|
@ -214,27 +219,14 @@ class LogTailApi(generics.RetrieveAPIView):
|
||||||
"""
|
"""
|
||||||
return line
|
return line
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def read_from_file(self):
|
||||||
mark = request.query_params.get("mark") or str(uuid.uuid4())
|
with open(self.log_path, 'r') as f:
|
||||||
log_path = self.get_log_path()
|
offset = cache.get(self.mark, 0)
|
||||||
|
|
||||||
if not log_path or not os.path.isfile(log_path):
|
|
||||||
if self.is_file_finish_write():
|
|
||||||
return Response({
|
|
||||||
"data": 'Not found the log',
|
|
||||||
'end': True,
|
|
||||||
'mark': mark
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
return Response({"data": "Waiting...\r\n"}, status=200)
|
|
||||||
|
|
||||||
with open(log_path, 'r') as f:
|
|
||||||
offset = cache.get(mark, 0)
|
|
||||||
f.seek(offset)
|
f.seek(offset)
|
||||||
data = f.read(self.buff_size).replace('\n', '\r\n')
|
data = f.read(self.buff_size).replace('\n', '\r\n')
|
||||||
|
|
||||||
mark = str(uuid.uuid4())
|
new_mark = str(uuid.uuid4())
|
||||||
cache.set(mark, f.tell(), 5)
|
cache.set(new_mark, f.tell(), 5)
|
||||||
|
|
||||||
if data == '' and self.is_file_finish_write():
|
if data == '' and self.is_file_finish_write():
|
||||||
self.end = True
|
self.end = True
|
||||||
|
@ -244,4 +236,15 @@ class LogTailApi(generics.RetrieveAPIView):
|
||||||
if line == '':
|
if line == '':
|
||||||
continue
|
continue
|
||||||
_data += new_line + '\r\n'
|
_data += new_line + '\r\n'
|
||||||
return Response({"data": _data, 'end': self.end, 'mark': mark})
|
return _data, self.end, new_mark
|
||||||
|
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
self.mark = request.query_params.get("mark") or str(uuid.uuid4())
|
||||||
|
self.log_path = self.get_log_path()
|
||||||
|
|
||||||
|
if not self.log_path or not os.path.isfile(self.log_path):
|
||||||
|
msg = self.get_no_file_message(self.request)
|
||||||
|
return Response({"data": msg}, status=200)
|
||||||
|
|
||||||
|
data, end, new_mark = self.read_from_file()
|
||||||
|
return Response({"data": data, 'end': end, 'mark': new_mark})
|
||||||
|
|
|
@ -159,6 +159,10 @@ class TerminalSettingForm(BaseForm):
|
||||||
help_text=_("Units: days, Session, record, command will be delete "
|
help_text=_("Units: days, Session, record, command will be delete "
|
||||||
"if more than duration, only in database")
|
"if more than duration, only in database")
|
||||||
)
|
)
|
||||||
|
TERMINAL_TELNET_REGEX = forms.CharField(
|
||||||
|
required=False, label=_("Telnet login regex"),
|
||||||
|
help_text=_("ex: Last\s*login|success|成功")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TerminalCommandStorage(BaseForm):
|
class TerminalCommandStorage(BaseForm):
|
||||||
|
|
|
@ -330,6 +330,7 @@ defaults = {
|
||||||
'TERMINAL_ASSET_LIST_PAGE_SIZE': 'auto',
|
'TERMINAL_ASSET_LIST_PAGE_SIZE': 'auto',
|
||||||
'TERMINAL_SESSION_KEEP_DURATION': 9999,
|
'TERMINAL_SESSION_KEEP_DURATION': 9999,
|
||||||
'TERMINAL_HOST_KEY': '',
|
'TERMINAL_HOST_KEY': '',
|
||||||
|
'TERMINAL_TELNET_REGEX': '',
|
||||||
'SECURITY_MFA_AUTH': False,
|
'SECURITY_MFA_AUTH': False,
|
||||||
'SECURITY_LOGIN_LIMIT_COUNT': 7,
|
'SECURITY_LOGIN_LIMIT_COUNT': 7,
|
||||||
'SECURITY_LOGIN_LIMIT_TIME': 30,
|
'SECURITY_LOGIN_LIMIT_TIME': 30,
|
||||||
|
|
|
@ -555,3 +555,4 @@ SWAGGER_SETTINGS = {
|
||||||
|
|
||||||
# Default email suffix
|
# Default email suffix
|
||||||
EMAIL_SUFFIX = CONFIG.EMAIL_SUFFIX
|
EMAIL_SUFFIX = CONFIG.EMAIL_SUFFIX
|
||||||
|
TERMINAL_TELNET_REGEX = CONFIG.TERMINAL_TELNET_REGEX
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Jumpserver 0.3.3\n"
|
"Project-Id-Version: Jumpserver 0.3.3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-01-28 12:56+0800\n"
|
"POT-Creation-Date: 2019-02-20 18:56+0800\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||||
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
|
||||||
|
@ -21,11 +21,11 @@ msgstr ""
|
||||||
msgid "You can't update the root node name"
|
msgid "You can't update the root node name"
|
||||||
msgstr "不能修改根节点名称"
|
msgstr "不能修改根节点名称"
|
||||||
|
|
||||||
#: assets/api/node.py:281
|
#: assets/api/node.py:282
|
||||||
msgid "Update node asset hardware information: {}"
|
msgid "Update node asset hardware information: {}"
|
||||||
msgstr "更新节点资产硬件信息: {}"
|
msgstr "更新节点资产硬件信息: {}"
|
||||||
|
|
||||||
#: assets/api/node.py:295
|
#: assets/api/node.py:296
|
||||||
msgid "Test if the assets under the node are connectable: {}"
|
msgid "Test if the assets under the node are connectable: {}"
|
||||||
msgstr "测试节点下资产是否可连接: {}"
|
msgstr "测试节点下资产是否可连接: {}"
|
||||||
|
|
||||||
|
@ -764,48 +764,48 @@ msgstr "获取资产信息失败:{}"
|
||||||
msgid "Update some assets hardware info"
|
msgid "Update some assets hardware info"
|
||||||
msgstr "更新资产硬件信息"
|
msgstr "更新资产硬件信息"
|
||||||
|
|
||||||
#: assets/tasks.py:136
|
#: assets/tasks.py:134
|
||||||
msgid "Update asset hardware info: {}"
|
msgid "Update asset hardware info: {}"
|
||||||
msgstr "更新资产硬件信息: {}"
|
msgstr "更新资产硬件信息: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:161
|
#: assets/tasks.py:159
|
||||||
msgid "Test assets connectivity"
|
msgid "Test assets connectivity"
|
||||||
msgstr "测试资产可连接性"
|
msgstr "测试资产可连接性"
|
||||||
|
|
||||||
#: assets/tasks.py:185
|
#: assets/tasks.py:183
|
||||||
msgid "Test assets connectivity: {}"
|
msgid "Test assets connectivity: {}"
|
||||||
msgstr "测试资产可连接性: {}"
|
msgstr "测试资产可连接性: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:224
|
#: assets/tasks.py:225
|
||||||
msgid "Test admin user connectivity period: {}"
|
msgid "Test admin user connectivity period: {}"
|
||||||
msgstr "定期测试管理账号可连接性: {}"
|
msgstr "定期测试管理账号可连接性: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:231
|
#: assets/tasks.py:232
|
||||||
msgid "Test admin user connectivity: {}"
|
msgid "Test admin user connectivity: {}"
|
||||||
msgstr "测试管理行号可连接性: {}"
|
msgstr "测试管理行号可连接性: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:270
|
#: assets/tasks.py:271
|
||||||
msgid "Test system user connectivity: {}"
|
msgid "Test system user connectivity: {}"
|
||||||
msgstr "测试系统用户可连接性: {}"
|
msgstr "测试系统用户可连接性: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:277
|
#: assets/tasks.py:278
|
||||||
msgid "Test system user connectivity: {} => {}"
|
msgid "Test system user connectivity: {} => {}"
|
||||||
msgstr "测试系统用户可连接性: {} => {}"
|
msgstr "测试系统用户可连接性: {} => {}"
|
||||||
|
|
||||||
#: assets/tasks.py:290
|
#: assets/tasks.py:291
|
||||||
msgid "Test system user connectivity period: {}"
|
msgid "Test system user connectivity period: {}"
|
||||||
msgstr "定期测试系统用户可连接性: {}"
|
msgstr "定期测试系统用户可连接性: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:362
|
#: assets/tasks.py:363
|
||||||
msgid ""
|
msgid ""
|
||||||
"Push system user task skip, auto push not enable or protocol is not ssh: {}"
|
"Push system user task skip, auto push not enable or protocol is not ssh: {}"
|
||||||
msgstr "推送系统用户任务跳过,自动推送没有打开,或协议不是ssh: {}"
|
msgstr "推送系统用户任务跳过,自动推送没有打开,或协议不是ssh: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:382 assets/tasks.py:396
|
#: assets/tasks.py:383 assets/tasks.py:397
|
||||||
msgid "Push system users to assets: {}"
|
msgid "Push system users to assets: {}"
|
||||||
msgstr "推送系统用户到入资产: {}"
|
msgstr "推送系统用户到入资产: {}"
|
||||||
|
|
||||||
#: assets/tasks.py:388
|
#: assets/tasks.py:389
|
||||||
msgid "Push system users to asset: {} => {}"
|
msgid "Push system users to asset: {} => {}"
|
||||||
msgstr "推送系统用户到入资产: {} => {}"
|
msgstr "推送系统用户到入资产: {} => {}"
|
||||||
|
|
||||||
|
@ -1092,7 +1092,7 @@ msgstr "选择节点"
|
||||||
|
|
||||||
#: assets/templates/assets/admin_user_detail.html:100
|
#: assets/templates/assets/admin_user_detail.html:100
|
||||||
#: assets/templates/assets/asset_detail.html:208
|
#: assets/templates/assets/asset_detail.html:208
|
||||||
#: assets/templates/assets/asset_list.html:635
|
#: assets/templates/assets/asset_list.html:636
|
||||||
#: assets/templates/assets/cmd_filter_detail.html:106
|
#: assets/templates/assets/cmd_filter_detail.html:106
|
||||||
#: assets/templates/assets/system_user_asset.html:112
|
#: assets/templates/assets/system_user_asset.html:112
|
||||||
#: assets/templates/assets/system_user_detail.html:182
|
#: assets/templates/assets/system_user_detail.html:182
|
||||||
|
@ -1312,7 +1312,7 @@ msgstr "重命名成功"
|
||||||
msgid "Rename failed, do not change the root node name"
|
msgid "Rename failed, do not change the root node name"
|
||||||
msgstr "重命名失败,不能更改root节点的名称"
|
msgstr "重命名失败,不能更改root节点的名称"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_list.html:629
|
#: assets/templates/assets/asset_list.html:630
|
||||||
#: assets/templates/assets/system_user_list.html:137
|
#: assets/templates/assets/system_user_list.html:137
|
||||||
#: users/templates/users/user_detail.html:382
|
#: users/templates/users/user_detail.html:382
|
||||||
#: users/templates/users/user_detail.html:408
|
#: users/templates/users/user_detail.html:408
|
||||||
|
@ -1322,11 +1322,11 @@ msgstr "重命名失败,不能更改root节点的名称"
|
||||||
msgid "Are you sure?"
|
msgid "Are you sure?"
|
||||||
msgstr "你确认吗?"
|
msgstr "你确认吗?"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_list.html:630
|
#: assets/templates/assets/asset_list.html:631
|
||||||
msgid "This will delete the selected assets !!!"
|
msgid "This will delete the selected assets !!!"
|
||||||
msgstr "删除选择资产"
|
msgstr "删除选择资产"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_list.html:633
|
#: assets/templates/assets/asset_list.html:634
|
||||||
#: assets/templates/assets/system_user_list.html:141
|
#: assets/templates/assets/system_user_list.html:141
|
||||||
#: common/templates/common/terminal_setting.html:163
|
#: common/templates/common/terminal_setting.html:163
|
||||||
#: users/templates/users/user_detail.html:386
|
#: users/templates/users/user_detail.html:386
|
||||||
|
@ -1339,16 +1339,16 @@ msgstr "删除选择资产"
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr "取消"
|
msgstr "取消"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_list.html:639
|
#: assets/templates/assets/asset_list.html:640
|
||||||
msgid "Asset Deleted."
|
msgid "Asset Deleted."
|
||||||
msgstr "已被删除"
|
msgstr "已被删除"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_list.html:640
|
#: assets/templates/assets/asset_list.html:641
|
||||||
#: assets/templates/assets/asset_list.html:645
|
#: assets/templates/assets/asset_list.html:646
|
||||||
msgid "Asset Delete"
|
msgid "Asset Delete"
|
||||||
msgstr "删除"
|
msgstr "删除"
|
||||||
|
|
||||||
#: assets/templates/assets/asset_list.html:644
|
#: assets/templates/assets/asset_list.html:645
|
||||||
msgid "Asset Deleting failed."
|
msgid "Asset Deleting failed."
|
||||||
msgstr "删除失败"
|
msgstr "删除失败"
|
||||||
|
|
||||||
|
@ -2003,45 +2003,54 @@ msgstr ""
|
||||||
"单位:天。 会话、录像、命令记录超过该时长将会被删除(仅影响数据库存储, oss等不"
|
"单位:天。 会话、录像、命令记录超过该时长将会被删除(仅影响数据库存储, oss等不"
|
||||||
"受影响)"
|
"受影响)"
|
||||||
|
|
||||||
#: common/forms.py:171
|
#: common/forms.py:163
|
||||||
|
msgid "Telnet login regex"
|
||||||
|
msgstr "Telnet 成功正则表达式"
|
||||||
|
|
||||||
|
#: common/forms.py:164
|
||||||
|
msgid "ex: Last\\s*login|success|成功"
|
||||||
|
msgstr ""
|
||||||
|
"登录telnet服务器成功后的提示正则表达式,如: Last\\s*login|success|成功 "
|
||||||
|
|
||||||
|
#: common/forms.py:175
|
||||||
msgid "MFA Secondary certification"
|
msgid "MFA Secondary certification"
|
||||||
msgstr "MFA 二次认证"
|
msgstr "MFA 二次认证"
|
||||||
|
|
||||||
#: common/forms.py:173
|
#: common/forms.py:177
|
||||||
msgid ""
|
msgid ""
|
||||||
"After opening, the user login must use MFA secondary authentication (valid "
|
"After opening, the user login must use MFA secondary authentication (valid "
|
||||||
"for all users, including administrators)"
|
"for all users, including administrators)"
|
||||||
msgstr "开启后,用户登录必须使用MFA二次认证(对所有用户有效,包括管理员)"
|
msgstr "开启后,用户登录必须使用MFA二次认证(对所有用户有效,包括管理员)"
|
||||||
|
|
||||||
#: common/forms.py:179
|
#: common/forms.py:183
|
||||||
msgid "Limit the number of login failures"
|
msgid "Limit the number of login failures"
|
||||||
msgstr "限制登录失败次数"
|
msgstr "限制登录失败次数"
|
||||||
|
|
||||||
#: common/forms.py:183
|
#: common/forms.py:187
|
||||||
msgid "No logon interval"
|
msgid "No logon interval"
|
||||||
msgstr "禁止登录时间间隔"
|
msgstr "禁止登录时间间隔"
|
||||||
|
|
||||||
#: common/forms.py:185
|
#: common/forms.py:189
|
||||||
msgid ""
|
msgid ""
|
||||||
"Tip: (unit/minute) if the user has failed to log in for a limited number of "
|
"Tip: (unit/minute) if the user has failed to log in for a limited number of "
|
||||||
"times, no login is allowed during this time interval."
|
"times, no login is allowed during this time interval."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"提示:(单位:分)当用户登录失败次数达到限制后,那么在此时间间隔内禁止登录"
|
"提示:(单位:分)当用户登录失败次数达到限制后,那么在此时间间隔内禁止登录"
|
||||||
|
|
||||||
#: common/forms.py:191
|
#: common/forms.py:195
|
||||||
msgid "Connection max idle time"
|
msgid "Connection max idle time"
|
||||||
msgstr "SSH最大空闲时间"
|
msgstr "SSH最大空闲时间"
|
||||||
|
|
||||||
#: common/forms.py:193
|
#: common/forms.py:197
|
||||||
msgid ""
|
msgid ""
|
||||||
"If idle time more than it, disconnect connection(only ssh now) Unit: minute"
|
"If idle time more than it, disconnect connection(only ssh now) Unit: minute"
|
||||||
msgstr "提示:(单位:分)如果超过该配置没有操作,连接会被断开(仅ssh)"
|
msgstr "提示:(单位:分)如果超过该配置没有操作,连接会被断开(仅ssh)"
|
||||||
|
|
||||||
#: common/forms.py:199
|
#: common/forms.py:203
|
||||||
msgid "Password expiration time"
|
msgid "Password expiration time"
|
||||||
msgstr "密码过期时间"
|
msgstr "密码过期时间"
|
||||||
|
|
||||||
#: common/forms.py:202
|
#: common/forms.py:206
|
||||||
msgid ""
|
msgid ""
|
||||||
"Tip: (unit: day) If the user does not update the password during the time, "
|
"Tip: (unit: day) If the user does not update the password during the time, "
|
||||||
"the user password will expire failure;The password expiration reminder mail "
|
"the user password will expire failure;The password expiration reminder mail "
|
||||||
|
@ -2051,45 +2060,45 @@ msgstr ""
|
||||||
"提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期"
|
"提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期"
|
||||||
"提醒邮件将在密码过期前5天内由系统(每天)自动发送给用户"
|
"提醒邮件将在密码过期前5天内由系统(每天)自动发送给用户"
|
||||||
|
|
||||||
#: common/forms.py:211
|
#: common/forms.py:215
|
||||||
msgid "Password minimum length"
|
msgid "Password minimum length"
|
||||||
msgstr "密码最小长度 "
|
msgstr "密码最小长度 "
|
||||||
|
|
||||||
#: common/forms.py:215
|
#: common/forms.py:219
|
||||||
msgid "Must contain capital letters"
|
msgid "Must contain capital letters"
|
||||||
msgstr "必须包含大写字母"
|
msgstr "必须包含大写字母"
|
||||||
|
|
||||||
#: common/forms.py:217
|
#: common/forms.py:221
|
||||||
msgid ""
|
msgid ""
|
||||||
"After opening, the user password changes and resets must contain uppercase "
|
"After opening, the user password changes and resets must contain uppercase "
|
||||||
"letters"
|
"letters"
|
||||||
msgstr "开启后,用户密码修改、重置必须包含大写字母"
|
msgstr "开启后,用户密码修改、重置必须包含大写字母"
|
||||||
|
|
||||||
#: common/forms.py:222
|
#: common/forms.py:226
|
||||||
msgid "Must contain lowercase letters"
|
msgid "Must contain lowercase letters"
|
||||||
msgstr "必须包含小写字母"
|
msgstr "必须包含小写字母"
|
||||||
|
|
||||||
#: common/forms.py:223
|
#: common/forms.py:227
|
||||||
msgid ""
|
msgid ""
|
||||||
"After opening, the user password changes and resets must contain lowercase "
|
"After opening, the user password changes and resets must contain lowercase "
|
||||||
"letters"
|
"letters"
|
||||||
msgstr "开启后,用户密码修改、重置必须包含小写字母"
|
msgstr "开启后,用户密码修改、重置必须包含小写字母"
|
||||||
|
|
||||||
#: common/forms.py:228
|
#: common/forms.py:232
|
||||||
msgid "Must contain numeric characters"
|
msgid "Must contain numeric characters"
|
||||||
msgstr "必须包含数字字符"
|
msgstr "必须包含数字字符"
|
||||||
|
|
||||||
#: common/forms.py:229
|
#: common/forms.py:233
|
||||||
msgid ""
|
msgid ""
|
||||||
"After opening, the user password changes and resets must contain numeric "
|
"After opening, the user password changes and resets must contain numeric "
|
||||||
"characters"
|
"characters"
|
||||||
msgstr "开启后,用户密码修改、重置必须包含数字字符"
|
msgstr "开启后,用户密码修改、重置必须包含数字字符"
|
||||||
|
|
||||||
#: common/forms.py:234
|
#: common/forms.py:238
|
||||||
msgid "Must contain special characters"
|
msgid "Must contain special characters"
|
||||||
msgstr "必须包含特殊字符"
|
msgstr "必须包含特殊字符"
|
||||||
|
|
||||||
#: common/forms.py:235
|
#: common/forms.py:239
|
||||||
msgid ""
|
msgid ""
|
||||||
"After opening, the user password changes and resets must contain special "
|
"After opening, the user password changes and resets must contain special "
|
||||||
"characters"
|
"characters"
|
||||||
|
@ -2315,6 +2324,10 @@ msgstr ""
|
||||||
"div><div>如果你看到了这个页面,证明你访问的不是nginx监听的端口,祝你好运</"
|
"div><div>如果你看到了这个页面,证明你访问的不是nginx监听的端口,祝你好运</"
|
||||||
"div>"
|
"div>"
|
||||||
|
|
||||||
|
#: ops/api/celery.py:54
|
||||||
|
msgid "Waiting task start"
|
||||||
|
msgstr "等待任务开始"
|
||||||
|
|
||||||
#: ops/models/adhoc.py:38
|
#: ops/models/adhoc.py:38
|
||||||
msgid "Interval"
|
msgid "Interval"
|
||||||
msgstr "间隔"
|
msgstr "间隔"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
from celery.result import AsyncResult
|
from celery.result import AsyncResult
|
||||||
from rest_framework import generics
|
from rest_framework import generics
|
||||||
|
|
||||||
|
@ -46,6 +47,12 @@ class CeleryTaskLogApi(LogTailApi):
|
||||||
def is_file_finish_write(self):
|
def is_file_finish_write(self):
|
||||||
return self.task.ready()
|
return self.task.ready()
|
||||||
|
|
||||||
|
def get_no_file_message(self, request):
|
||||||
|
if self.mark == 'undefined':
|
||||||
|
return '.'
|
||||||
|
else:
|
||||||
|
return _('Waiting task start')
|
||||||
|
|
||||||
|
|
||||||
class CeleryResultApi(generics.RetrieveAPIView):
|
class CeleryResultApi(generics.RetrieveAPIView):
|
||||||
permission_classes = (IsValidUser,)
|
permission_classes = (IsValidUser,)
|
||||||
|
|
Loading…
Reference in New Issue