Commit 178055eb authored by ibuler's avatar ibuler

[Update] 修改任务小写

parent 01a101a7
...@@ -8,7 +8,7 @@ msgid "" ...@@ -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-16 17:58+0800\n" "POT-Creation-Date: 2019-01-21 17:40+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"
...@@ -120,7 +120,7 @@ msgstr "端口" ...@@ -120,7 +120,7 @@ msgstr "端口"
#: perms/templates/perms/asset_permission_create_update.html:45 #: perms/templates/perms/asset_permission_create_update.html:45
#: perms/templates/perms/asset_permission_list.html:56 #: perms/templates/perms/asset_permission_list.html:56
#: perms/templates/perms/asset_permission_list.html:125 #: perms/templates/perms/asset_permission_list.html:125
#: terminal/backends/command/models.py:13 terminal/models.py:143 #: terminal/backends/command/models.py:13 terminal/models.py:155
#: terminal/templates/terminal/command_list.html:40 #: terminal/templates/terminal/command_list.html:40
#: terminal/templates/terminal/command_list.html:73 #: terminal/templates/terminal/command_list.html:73
#: terminal/templates/terminal/session_list.html:41 #: terminal/templates/terminal/session_list.html:41
...@@ -158,8 +158,8 @@ msgstr "不能包含特殊字符" ...@@ -158,8 +158,8 @@ msgstr "不能包含特殊字符"
#: perms/templates/perms/asset_permission_detail.html:62 #: perms/templates/perms/asset_permission_detail.html:62
#: perms/templates/perms/asset_permission_list.html:53 #: perms/templates/perms/asset_permission_list.html:53
#: perms/templates/perms/asset_permission_list.html:72 #: perms/templates/perms/asset_permission_list.html:72
#: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:21 #: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:22
#: terminal/models.py:212 terminal/templates/terminal/terminal_detail.html:43 #: terminal/models.py:233 terminal/templates/terminal/terminal_detail.html:43
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14 #: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: users/models/user.py:55 users/templates/users/_select_user_modal.html:13 #: users/models/user.py:55 users/templates/users/_select_user_modal.html:13
#: users/templates/users/user_detail.html:63 #: users/templates/users/user_detail.html:63
...@@ -427,7 +427,7 @@ msgstr "创建日期" ...@@ -427,7 +427,7 @@ msgstr "创建日期"
#: assets/templates/assets/user_asset_list.html:159 common/models.py:34 #: assets/templates/assets/user_asset_list.html:159 common/models.py:34
#: ops/models/adhoc.py:43 orgs/models.py:17 perms/models.py:39 #: ops/models/adhoc.py:43 orgs/models.py:17 perms/models.py:39
#: perms/models.py:92 perms/templates/perms/asset_permission_detail.html:102 #: perms/models.py:92 perms/templates/perms/asset_permission_detail.html:102
#: terminal/models.py:31 terminal/templates/terminal/terminal_detail.html:63 #: terminal/models.py:32 terminal/templates/terminal/terminal_detail.html:63
#: users/models/group.py:15 users/models/user.py:88 #: users/models/group.py:15 users/models/user.py:88
#: users/templates/users/user_detail.html:127 #: users/templates/users/user_detail.html:127
#: users/templates/users/user_group_detail.html:67 #: users/templates/users/user_group_detail.html:67
...@@ -461,7 +461,7 @@ msgstr "可连接" ...@@ -461,7 +461,7 @@ msgstr "可连接"
#: assets/models/asset.py:119 assets/models/base.py:36 #: assets/models/asset.py:119 assets/models/base.py:36
msgid "Unknown" msgid "Unknown"
msgstr "" msgstr "未知"
#: assets/models/base.py:25 #: assets/models/base.py:25
msgid "SSH private key" msgid "SSH private key"
...@@ -534,7 +534,7 @@ msgid "Regex" ...@@ -534,7 +534,7 @@ msgid "Regex"
msgstr "正则表达式" msgstr "正则表达式"
#: assets/models/cmd_filter.py:36 ops/models/command.py:21 #: assets/models/cmd_filter.py:36 ops/models/command.py:21
#: ops/templates/ops/command_execution_list.html:60 terminal/models.py:149 #: ops/templates/ops/command_execution_list.html:60 terminal/models.py:161
#: terminal/templates/terminal/command_list.html:55 #: terminal/templates/terminal/command_list.html:55
#: terminal/templates/terminal/command_list.html:71 #: terminal/templates/terminal/command_list.html:71
#: terminal/templates/terminal/session_detail.html:48 #: terminal/templates/terminal/session_detail.html:48
...@@ -638,7 +638,7 @@ msgstr "默认资产组" ...@@ -638,7 +638,7 @@ msgstr "默认资产组"
#: perms/templates/perms/asset_permission_create_update.html:41 #: perms/templates/perms/asset_permission_create_update.html:41
#: perms/templates/perms/asset_permission_list.html:54 #: perms/templates/perms/asset_permission_list.html:54
#: perms/templates/perms/asset_permission_list.html:119 templates/index.html:87 #: perms/templates/perms/asset_permission_list.html:119 templates/index.html:87
#: terminal/backends/command/models.py:12 terminal/models.py:142 #: terminal/backends/command/models.py:12 terminal/models.py:154
#: terminal/templates/terminal/command_list.html:32 #: terminal/templates/terminal/command_list.html:32
#: terminal/templates/terminal/command_list.html:72 #: terminal/templates/terminal/command_list.html:72
#: terminal/templates/terminal/session_list.html:33 #: terminal/templates/terminal/session_list.html:33
...@@ -726,7 +726,7 @@ msgstr "登录模式" ...@@ -726,7 +726,7 @@ msgstr "登录模式"
#: perms/templates/perms/asset_permission_list.html:58 #: perms/templates/perms/asset_permission_list.html:58
#: perms/templates/perms/asset_permission_list.html:79 #: perms/templates/perms/asset_permission_list.html:79
#: perms/templates/perms/asset_permission_list.html:131 templates/_nav.html:25 #: perms/templates/perms/asset_permission_list.html:131 templates/_nav.html:25
#: terminal/backends/command/models.py:14 terminal/models.py:144 #: terminal/backends/command/models.py:14 terminal/models.py:156
#: terminal/templates/terminal/command_list.html:48 #: terminal/templates/terminal/command_list.html:48
#: terminal/templates/terminal/command_list.html:74 #: terminal/templates/terminal/command_list.html:74
#: terminal/templates/terminal/session_list.html:49 #: terminal/templates/terminal/session_list.html:49
...@@ -1661,7 +1661,7 @@ msgstr "系统用户资产" ...@@ -1661,7 +1661,7 @@ msgstr "系统用户资产"
#: audits/templates/audits/ftp_log_list.html:73 #: audits/templates/audits/ftp_log_list.html:73
#: audits/templates/audits/operate_log_list.html:70 #: audits/templates/audits/operate_log_list.html:70
#: audits/templates/audits/password_change_log_list.html:52 #: audits/templates/audits/password_change_log_list.html:52
#: terminal/models.py:146 terminal/templates/terminal/session_list.html:74 #: terminal/models.py:158 terminal/templates/terminal/session_list.html:74
#: terminal/templates/terminal/terminal_detail.html:47 #: terminal/templates/terminal/terminal_detail.html:47
msgid "Remote addr" msgid "Remote addr"
msgstr "远端地址" msgstr "远端地址"
...@@ -1704,7 +1704,7 @@ msgstr "修改者" ...@@ -1704,7 +1704,7 @@ msgstr "修改者"
#: ops/templates/ops/adhoc_history_detail.html:61 #: ops/templates/ops/adhoc_history_detail.html:61
#: ops/templates/ops/command_execution_list.html:65 #: ops/templates/ops/command_execution_list.html:65
#: ops/templates/ops/task_history.html:58 perms/models.py:35 #: ops/templates/ops/task_history.html:58 perms/models.py:35
#: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:153 #: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:165
#: terminal/templates/terminal/session_list.html:78 #: terminal/templates/terminal/session_list.html:78
msgid "Date start" msgid "Date start"
msgstr "开始日期" msgstr "开始日期"
...@@ -1836,10 +1836,6 @@ msgstr "创建成功" ...@@ -1836,10 +1836,6 @@ msgstr "创建成功"
msgid "Delete succeed" msgid "Delete succeed"
msgstr "删除成功" msgstr "删除成功"
#: common/api.py:221
msgid "Waiting ...\n"
msgstr ""
#: common/const.py:6 #: common/const.py:6
#, python-format #, python-format
msgid "<b>%(name)s</b> was created successfully" msgid "<b>%(name)s</b> was created successfully"
...@@ -2218,7 +2214,7 @@ msgid "Password check rule" ...@@ -2218,7 +2214,7 @@ msgid "Password check rule"
msgstr "密码校验规则" msgstr "密码校验规则"
#: common/templates/common/terminal_setting.html:76 terminal/forms.py:27 #: common/templates/common/terminal_setting.html:76 terminal/forms.py:27
#: terminal/models.py:25 #: terminal/models.py:26
msgid "Command storage" msgid "Command storage"
msgstr "命令存储" msgstr "命令存储"
...@@ -2235,7 +2231,7 @@ msgid "Add" ...@@ -2235,7 +2231,7 @@ msgid "Add"
msgstr "添加" msgstr "添加"
#: common/templates/common/terminal_setting.html:98 terminal/forms.py:32 #: common/templates/common/terminal_setting.html:98 terminal/forms.py:32
#: terminal/models.py:26 #: terminal/models.py:27
msgid "Replay storage" msgid "Replay storage"
msgstr "录像存储" msgstr "录像存储"
...@@ -2324,6 +2320,14 @@ msgstr "Become" ...@@ -2324,6 +2320,14 @@ msgstr "Become"
msgid "Create by" msgid "Create by"
msgstr "创建者" msgstr "创建者"
#: ops/models/adhoc.py:223
msgid "{} Start task: {}"
msgstr "{} 任务开始: {}"
#: ops/models/adhoc.py:226
msgid "{} Task finish"
msgstr "{} 任务结束"
#: ops/models/adhoc.py:324 #: ops/models/adhoc.py:324
msgid "Start time" msgid "Start time"
msgstr "开始时间" msgstr "开始时间"
...@@ -3073,55 +3077,55 @@ msgstr "" ...@@ -3073,55 +3077,55 @@ msgstr ""
"录像文件支持存储到服务器端硬盘、AWS S3、 阿里云 OSS 中,默认存储到服务器端硬" "录像文件支持存储到服务器端硬盘、AWS S3、 阿里云 OSS 中,默认存储到服务器端硬"
"盘, 更多查看文档" "盘, 更多查看文档"
#: terminal/models.py:22 #: terminal/models.py:23
msgid "Remote Address" msgid "Remote Address"
msgstr "远端地址" msgstr "远端地址"
#: terminal/models.py:23 #: terminal/models.py:24
msgid "SSH Port" msgid "SSH Port"
msgstr "SSH端口" msgstr "SSH端口"
#: terminal/models.py:24 #: terminal/models.py:25
msgid "HTTP Port" msgid "HTTP Port"
msgstr "HTTP端口" msgstr "HTTP端口"
#: terminal/models.py:113 #: terminal/models.py:125
msgid "Session Online" msgid "Session Online"
msgstr "在线会话" msgstr "在线会话"
#: terminal/models.py:114 #: terminal/models.py:126
msgid "CPU Usage" msgid "CPU Usage"
msgstr "CPU使用" msgstr "CPU使用"
#: terminal/models.py:115 #: terminal/models.py:127
msgid "Memory Used" msgid "Memory Used"
msgstr "内存使用" msgstr "内存使用"
#: terminal/models.py:116 #: terminal/models.py:128
msgid "Connections" msgid "Connections"
msgstr "连接数" msgstr "连接数"
#: terminal/models.py:117 #: terminal/models.py:129
msgid "Threads" msgid "Threads"
msgstr "线程数" msgstr "线程数"
#: terminal/models.py:118 #: terminal/models.py:130
msgid "Boot Time" msgid "Boot Time"
msgstr "运行时间" msgstr "运行时间"
#: terminal/models.py:148 terminal/templates/terminal/session_list.html:104 #: terminal/models.py:160 terminal/templates/terminal/session_list.html:104
msgid "Replay" msgid "Replay"
msgstr "回放" msgstr "回放"
#: terminal/models.py:152 #: terminal/models.py:164
msgid "Date last active" msgid "Date last active"
msgstr "最后活跃日期" msgstr "最后活跃日期"
#: terminal/models.py:154 #: terminal/models.py:166
msgid "Date end" msgid "Date end"
msgstr "结束日期" msgstr "结束日期"
#: terminal/models.py:213 #: terminal/models.py:234
msgid "Args" msgid "Args"
msgstr "参数" msgstr "参数"
......
...@@ -118,18 +118,6 @@ class AdHocResultCallback(CallbackMixin, CallbackModule, CMDCallBackModule): ...@@ -118,18 +118,6 @@ class AdHocResultCallback(CallbackMixin, CallbackModule, CMDCallBackModule):
self.gather_result("unreachable", result) self.gather_result("unreachable", result)
super().v2_runner_on_unreachable(result) super().v2_runner_on_unreachable(result)
def on_playbook_start(self, name):
date_start = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
self.display(
"{} Start task: {}\r\n".format(date_start, name)
)
def on_playbook_end(self, name):
date_finished = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
self.display(
"{} Task finish\r\n".format(date_finished)
)
def display_skipped_hosts(self): def display_skipped_hosts(self):
pass pass
......
...@@ -220,10 +220,10 @@ class AdHoc(models.Model): ...@@ -220,10 +220,10 @@ class AdHoc(models.Model):
time_start = time.time() time_start = time.time()
try: try:
date_start = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') date_start = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print("{} Start task: {}\r\n".format(date_start, self.task.name)) print(_("{} Start task: {}").format(date_start, self.task.name))
raw, summary = self._run_only() raw, summary = self._run_only()
date_end = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') date_end = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print("\r\n{} Task finished".format(date_end)) print(_("{} Task finish").format(date_end))
history.is_finished = True history.is_finished = True
if summary.get('dark'): if summary.get('dark'):
history.is_success = False history.is_success = False
...@@ -235,7 +235,6 @@ class AdHoc(models.Model): ...@@ -235,7 +235,6 @@ class AdHoc(models.Model):
except Exception as e: except Exception as e:
return {}, {"dark": {"all": str(e)}, "contacted": []} return {}, {"dark": {"all": str(e)}, "contacted": []}
finally: finally:
# f.close()
history.date_finished = timezone.now() history.date_finished = timezone.now()
history.timedelta = time.time() - time_start history.timedelta = time.time() - time_start
history.save() history.save()
......
...@@ -48,7 +48,7 @@ def update_or_create_ansible_task( ...@@ -48,7 +48,7 @@ def update_or_create_ansible_task(
hosts_same = old_hosts == new_hosts hosts_same = old_hosts == new_hosts
if not adhoc or adhoc != new_adhoc or not hosts_same: if not adhoc or adhoc != new_adhoc or not hosts_same:
logger.info(_("Update task content: {}").format(task_name)) logger.debug(_("Update task content: {}").format(task_name))
new_adhoc.save() new_adhoc.save()
new_adhoc.hosts.set(hosts) new_adhoc.hosts.set(hosts)
task.latest_adhoc = new_adhoc task.latest_adhoc = new_adhoc
......
...@@ -9,7 +9,7 @@ from ..models import Terminal, Status, Session, Task ...@@ -9,7 +9,7 @@ from ..models import Terminal, Status, Session, Task
class TerminalSerializer(serializers.ModelSerializer): class TerminalSerializer(serializers.ModelSerializer):
session_online = serializers.SerializerMethodField() session_online = serializers.SerializerMethodField()
is_alive = serializers.BooleanField() is_alive = serializers.BooleanField(read_only=True)
class Meta: class Meta:
model = Terminal model = Terminal
...@@ -25,7 +25,7 @@ class TerminalSerializer(serializers.ModelSerializer): ...@@ -25,7 +25,7 @@ class TerminalSerializer(serializers.ModelSerializer):
class SessionSerializer(BulkSerializerMixin, serializers.ModelSerializer): class SessionSerializer(BulkSerializerMixin, serializers.ModelSerializer):
command_amount = serializers.IntegerField() command_amount = serializers.IntegerField(read_only=True)
class Meta: class Meta:
model = Session model = Session
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment