Merge pull request #10273 from jumpserver/pr@dev@account_auto_i18n

perf: account auto i18n
pull/10276/head
老广 2023-04-20 14:44:54 +08:00 committed by GitHub
commit 4b5d9d3a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 186 additions and 39 deletions

View File

@ -1,5 +1,5 @@
id: change_secret_by_ssh id: change_secret_by_ssh
name: Change secret by SSH name: "{{ 'SSH account change secret' | trans }}"
category: category:
- device - device
- host - host
@ -10,5 +10,10 @@ params:
- name: commands - name: commands
type: list type: list
label: '自定义命令' label: '自定义命令'
default: [''] default: [ '' ]
help_text: '自定义命令中如需包含账号的 账号、密码、SSH 连接的用户密码 字段,<br />请使用 &#123;username&#125;、&#123;password&#125;、&#123;login_password&#125;格式,执行任务时会进行替换 。<br />比如针对 Cisco 主机进行改密,一般需要配置五条命令:<br />1. enable<br />2. &#123;login_password&#125;<br />3. configure terminal<br />4. username &#123;username&#125; privilege 0 password &#123;password&#125; <br />5. end' help_text: '自定义命令中如需包含账号的 账号、密码、SSH 连接的用户密码 字段,<br />请使用 &#123;username&#125;、&#123;password&#125;、&#123;login_password&#125;格式,执行任务时会进行替换 。<br />比如针对 Cisco 主机进行改密,一般需要配置五条命令:<br />1. enable<br />2. &#123;login_password&#125;<br />3. configure terminal<br />4. username &#123;username&#125; privilege 0 password &#123;password&#125; <br />5. end'
i18n:
SSH account change secret:
zh: SSH 账号改密
ja: SSH アカウントのパスワード変更

View File

@ -1,6 +1,11 @@
id: change_secret_mongodb id: change_secret_mongodb
name: Change secret for MongoDB name: "{{ 'MongoDB account change secret' | trans }}"
category: database category: database
type: type:
- mongodb - mongodb
method: change_secret method: change_secret
i18n:
MongoDB account change secret:
zh: MongoDB 账号改密
ja: MongoDB アカウントのパスワード変更

View File

@ -1,7 +1,12 @@
id: change_secret_mysql id: change_secret_mysql
name: Change secret for MySQL name: "{{ 'MySQL account change secret' | trans }}"
category: database category: database
type: type:
- mysql - mysql
- mariadb - mariadb
method: change_secret method: change_secret
i18n:
MySQL account change secret:
zh: MySQL 账号改密
ja: MySQL アカウントのパスワード変更

View File

@ -1,6 +1,11 @@
id: change_secret_oracle id: change_secret_oracle
name: Change secret for Oracle name: "{{ 'Oracle account change secret' | trans }}"
category: database category: database
type: type:
- oracle - oracle
method: change_secret method: change_secret
i18n:
Oracle account change secret:
zh: Oracle 账号改密
ja: Oracle アカウントのパスワード変更

View File

@ -1,6 +1,11 @@
id: change_secret_postgresql id: change_secret_postgresql
name: Change secret for PostgreSQL name: "{{ 'PostgreSQL account change secret' | trans }}"
category: database category: database
type: type:
- postgresql - postgresql
method: change_secret method: change_secret
i18n:
PostgreSQL account change secret:
zh: PostgreSQL 账号改密
ja: PostgreSQL アカウントのパスワード変更

View File

@ -1,6 +1,11 @@
id: change_secret_sqlserver id: change_secret_sqlserver
name: Change secret for SQLServer name: "{{ 'SQLServer account change secret' | trans }}"
category: database category: database
type: type:
- sqlserver - sqlserver
method: change_secret method: change_secret
i18n:
SQLServer account change secret:
zh: SQLServer 账号改密
ja: SQLServer アカウントのパスワード変更

View File

@ -1,6 +1,11 @@
id: change_secret_aix id: change_secret_aix
name: Change secret for aix name: "{{ 'AIX account change secret' | trans }}"
category: host category: host
type: type:
- AIX - AIX
method: change_secret method: change_secret
i18n:
AIX account change secret:
zh: AIX 账号改密
ja: AIX アカウントのパスワード変更

View File

@ -1,7 +1,12 @@
id: change_secret_posix id: change_secret_posix
name: Change secret for posix name: "{{ 'Posix account change secret' | trans }}"
category: host category: host
type: type:
- unix - unix
- linux - linux
method: change_secret method: change_secret
i18n:
Posix account change secret:
zh: Posix 账号改密
ja: Posix アカウントのパスワード変更

View File

@ -1,7 +1,12 @@
id: change_secret_local_windows id: change_secret_local_windows
name: Change secret local account for Windows name: "{{ 'Windows account change secret' | trans }}"
version: 1 version: 1
method: change_secret method: change_secret
category: host category: host
type: type:
- windows - windows
i18n:
Windows account change secret:
zh: Windows 账号改密
ja: Windows アカウントのパスワード変更

View File

@ -1,6 +1,11 @@
id: gather_accounts_mongodb id: gather_accounts_mongodb
name: Gather account from MongoDB name: "{{ 'MongoDB account gather' | trans }}"
category: database category: database
type: type:
- mongodb - mongodb
method: gather_accounts method: gather_accounts
i18n:
MongoDB account gather:
zh: MongoDB 账号收集
ja: MongoDB アカウントの収集

View File

@ -1,5 +1,5 @@
id: gather_accounts_mysql id: gather_accounts_mysql
name: "{{ 'Gather account from MySQL' | trans }}" name: "{{ 'MySQL account gather' | trans }}"
category: database category: database
type: type:
- mysql - mysql
@ -7,9 +7,6 @@ type:
method: gather_accounts method: gather_accounts
i18n: i18n:
en: MySQL account gather:
Gather account from MySQL: Gather account from MySQL zh: MySQL 账号收集
zh: ja: MySQL アカウントの収集
Gather account from MySQL: 从MySQL获取账号
ja:
Gather account from MySQL: MySQLからアカウントを取得する

View File

@ -1,6 +1,11 @@
id: gather_accounts_oracle id: gather_accounts_oracle
name: Gather account from Oracle name: "{{ 'Oracle account gather' | trans }}"
category: database category: database
type: type:
- oracle - oracle
method: gather_accounts method: gather_accounts
i18n:
Oracle account gather:
zh: Oracle 账号收集
ja: Oracle アカウントの収集

View File

@ -1,6 +1,11 @@
id: gather_accounts_postgresql id: gather_accounts_postgresql
name: Gather account for PostgreSQL name: "{{ 'PostgreSQL account gather' | trans }}"
category: database category: database
type: type:
- postgresql - postgresql
method: gather_accounts method: gather_accounts
i18n:
PostgreSQL account gather:
zh: PostgreSQL 账号收集
ja: PostgreSQL アカウントの収集

View File

@ -1,7 +1,12 @@
id: gather_accounts_posix id: gather_accounts_posix
name: Gather posix account name: "{{ 'Posix account gather' | trans }}"
category: host category: host
type: type:
- linux - linux
- unix - unix
method: gather_accounts method: gather_accounts
i18n:
Posix account gather:
zh: Posix 账号收集
ja: Posix アカウントの収集

View File

@ -1,7 +1,12 @@
id: gather_accounts_windows id: gather_accounts_windows
name: Gather account windows name: "{{ 'Windows account gather' | trans }}"
version: 1 version: 1
method: gather_accounts method: gather_accounts
category: host category: host
type: type:
- windows - windows
i18n:
Windows account gather:
zh: Windows 账号收集
ja: Windows アカウントの収集

View File

@ -1,6 +1,11 @@
id: push_account_mongodb id: push_account_mongodb
name: Push account for MongoDB name: "{{ 'MongoDB account push' | trans }}"
category: database category: database
type: type:
- mongodb - mongodb
method: push_account method: push_account
i18n:
MongoDB account push:
zh: MongoDB 账号推送
ja: MongoDB アカウントのプッシュ

View File

@ -1,7 +1,12 @@
id: push_account_mysql id: push_account_mysql
name: Push account for MySQL name: "{{ 'MySQL account push' | trans }}"
category: database category: database
type: type:
- mysql - mysql
- mariadb - mariadb
method: push_account method: push_account
i18n:
MySQL account push:
zh: MySQL 账号推送
ja: MySQL アカウントのプッシュ

View File

@ -1,6 +1,11 @@
id: push_account_oracle id: push_account_oracle
name: Push account for Oracle name: "{{ 'Oracle account push' | trans }}"
category: database category: database
type: type:
- oracle - oracle
method: push_account method: push_account
i18n:
Oracle account push:
zh: Oracle 账号推送
ja: Oracle アカウントのプッシュ

View File

@ -1,6 +1,11 @@
id: push_account_postgresql id: push_account_postgresql
name: Push account for PostgreSQL name: "{{ 'PostgreSQL account push' | trans }}"
category: database category: database
type: type:
- postgresql - postgresql
method: push_account method: push_account
i18n:
PostgreSQL account push:
zh: PostgreSQL 账号推送
ja: PostgreSQL アカウントのプッシュ

View File

@ -1,6 +1,11 @@
id: push_account_sqlserver id: push_account_sqlserver
name: Push account for SQLServer name: "{{ 'SQLServer account push' | trans }}"
category: database category: database
type: type:
- sqlserver - sqlserver
method: push_account method: push_account
i18n:
SQLServer account push:
zh: SQLServer 账号推送
ja: SQLServer アカウントのプッシュ

View File

@ -1,5 +1,5 @@
id: push_account_aix id: push_account_aix
name: Push account for aix name: "{{ 'Aix account push' | trans }}"
category: host category: host
type: type:
- AIX - AIX
@ -22,3 +22,8 @@ params:
default: '' default: ''
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)' help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
i18n:
Aix account push:
zh: Aix 账号推送
ja: Aix アカウントのプッシュ

View File

@ -1,5 +1,5 @@
id: push_account_posix id: push_account_posix
name: Push account for posix name: "{{ 'Posix account push' | trans }}"
category: host category: host
type: type:
- unix - unix
@ -23,3 +23,8 @@ params:
label: '用户组' label: '用户组'
default: '' default: ''
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)' help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
i18n:
Posix account push:
zh: Posix 账号推送
ja: Posix アカウントのプッシュ

View File

@ -1,5 +1,5 @@
id: push_account_local_windows id: push_account_local_windows
name: Push account local account for Windows name: "{{ 'Windows account push' | trans }}"
version: 1 version: 1
method: push_account method: push_account
category: host category: host
@ -11,3 +11,8 @@ params:
label: '用户组' label: '用户组'
default: 'Users,Remote Desktop Users' default: 'Users,Remote Desktop Users'
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)' help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
i18n:
Windows account push:
zh: Windows 账号推送
ja: Windows アカウントのプッシュ

View File

@ -1,8 +1,13 @@
id: verify_account_by_ssh id: verify_account_by_ssh
name: Verify account by SSH name: "{{ 'SSH account verify' | trans }}"
category: category:
- device - device
- host - host
type: type:
- all - all
method: verify_account method: verify_account
i18n:
SSH account verify:
zh: SSH 账号验证
ja: SSH アカウントの検証

View File

@ -1,6 +1,11 @@
id: verify_account_mongodb id: verify_account_mongodb
name: Verify account from MongoDB name: "{{ 'MongoDB account verify' | trans }}"
category: database category: database
type: type:
- mongodb - mongodb
method: verify_account method: verify_account
i18n:
MongoDB account verify:
zh: MongoDB 账号验证
ja: MongoDB アカウントの検証

View File

@ -1,7 +1,12 @@
id: verify_account_mysql id: verify_account_mysql
name: Verify account from MySQL name: "{{ 'MySQL account verify' | trans }}"
category: database category: database
type: type:
- mysql - mysql
- mariadb - mariadb
method: verify_account method: verify_account
i18n:
MySQL account verify:
zh: MySQL 账号验证
ja: MySQL アカウントの検証

View File

@ -1,6 +1,11 @@
id: verify_account_oracle id: verify_account_oracle
name: Verify account from Oracle name: "{{ 'Oracle account verify' | trans }}"
category: database category: database
type: type:
- oracle - oracle
method: verify_account method: verify_account
i18n:
Oracle account verify:
zh: Oracle 账号验证
ja: Oracle アカウントの検証

View File

@ -1,6 +1,11 @@
id: verify_account_postgresql id: verify_account_postgresql
name: Verify account for PostgreSQL name: "{{ 'PostgreSQL account verify' | trans }}"
category: database category: database
type: type:
- postgresql - postgresql
method: verify_account method: verify_account
i18n:
PostgreSQL account verify:
zh: PostgreSQL 账号验证
ja: PostgreSQL アカウントの検証

View File

@ -1,6 +1,11 @@
id: verify_account_sqlserver id: verify_account_sqlserver
name: Verify account from SQLServer name: "{{ 'SQLServer account verify' | trans }}"
category: database category: database
type: type:
- sqlserver - sqlserver
method: verify_account method: verify_account
i18n:
SQLServer account verify:
zh: SQLServer 账号验证
ja: SQLServer アカウントの検証

View File

@ -1,7 +1,12 @@
id: verify_account_posix id: verify_account_posix
name: Verify posix account name: "{{ 'Posix account verify' | trans }}"
category: host category: host
type: type:
- linux - linux
- unix - unix
method: verify_account method: verify_account
i18n:
Posix account verify:
zh: Posix 账号验证
ja: Posix アカウントの検証

View File

@ -1,7 +1,12 @@
id: verify_account_windows id: verify_account_windows
name: Verify account windows name: "{{ 'Windows account verify' | trans }}"
version: 1 version: 1
method: verify_account method: verify_account
category: host category: host
type: type:
- windows - windows
i18n:
Windows account verify:
zh: Windows 账号验证
ja: Windows アカウントの検証

View File

@ -71,7 +71,7 @@ class PlatformAutomationMethodsApi(generics.ListAPIView):
def generate_serializer_fields(self): def generate_serializer_fields(self):
data = self.automation_methods() data = self.automation_methods()
fields = { fields = {
i['id']: i['params_serializer']() i['id']: i['params_serializer'](label=i['name'])
if i['params_serializer'] else None if i['params_serializer'] else None
for i in data for i in data
} }