Merge branch 'dev' into pr@dev@perf_icon

This commit is contained in:
老广
2023-02-06 17:19:47 +08:00
committed by GitHub
36 changed files with 11210 additions and 11117 deletions

View File

@@ -4,11 +4,17 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
indent_size = 2
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.{js,jsx,ts,tsx,vue}]
indent_size = 2
[*.py]
indent_size = 4
[*.md] [*.md]
insert_final_newline = false insert_final_newline = false
trim_trailing_whitespace = false trim_trailing_whitespace = false

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@ tests/**/coverage/
*.njsproj *.njsproj
*.sln *.sln
.env.development .env.development
.python-version

View File

@@ -19,7 +19,9 @@
"vue-i18n-extract": "vue-i18n-extract", "vue-i18n-extract": "vue-i18n-extract",
"vue-i18n-report": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json'", "vue-i18n-report": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json'",
"vue-i18n-report-json": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -o /tmp/abc.json", "vue-i18n-report-json": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -o /tmp/abc.json",
"vue-i18n-report-add-miss": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -a" "vue-i18n-report-add-miss": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -a",
"diff-i18n": "python ./src/i18n/langs/i18n-util.py diff en ja",
"apply-i18n": "python ./src/i18n/langs/i18n-util.py apply en ja"
}, },
"dependencies": { "dependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.13.12", "@babel/plugin-proposal-optional-chaining": "^7.13.12",

View File

@@ -54,7 +54,7 @@ export default {
'secret_type', 'secret', 'ssh_key', 'token', 'secret_type', 'secret', 'ssh_key', 'token',
'api_key', 'passphrase' 'api_key', 'passphrase'
]], ]],
[this.$t('common.Other'), ['push_now', 'comment']] [this.$t('common.Other'), ['push_now', 'is_active', 'comment']]
], ],
fieldsMeta: { fieldsMeta: {
assets: { assets: {

View File

@@ -106,7 +106,7 @@ export default {
app: 'assets', app: 'assets',
resource: 'account' resource: 'account'
}, },
columnsExclude: ['specific'], columnsExclude: ['spec_info'],
columnsShow: { columnsShow: {
min: ['name', 'username', 'actions'], min: ['name', 'username', 'actions'],
default: [ default: [
@@ -244,7 +244,7 @@ export default {
hasLeftActions: this.hasLeftActions, hasLeftActions: this.hasLeftActions,
hasMoreActions: true, hasMoreActions: true,
hasCreate: false, hasCreate: false,
hasImport: true, hasImport: this.hasImport,
hasExport: this.hasExport && this.$hasPerm('accounts.view_accountsecret'), hasExport: this.hasExport && this.$hasPerm('accounts.view_accountsecret'),
exportOptions: { exportOptions: {
url: this.exportUrl, url: this.exportUrl,

View File

@@ -114,9 +114,11 @@ export default {
methods: { methods: {
handleConfirm() { handleConfirm() {
this.$emit('confirm', this.rowSelected, this.rowsAdd) this.$emit('confirm', this.rowSelected, this.rowsAdd)
this.$eventBus.$emit('treeComponentKey')
}, },
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
this.$eventBus.$emit('treeComponentKey')
}, },
addRowToSelect(row) { addRowToSelect(row) {
const selectValueIndex = this.rowSelected.indexOf(row.id) const selectValueIndex = this.rowSelected.indexOf(row.id)

View File

@@ -14,6 +14,7 @@
:value="value" :value="value"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
v-bind="$attrs" v-bind="$attrs"
:base-url="baseUrl"
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
v-on="$listeners" v-on="$listeners"

View File

@@ -39,8 +39,6 @@ export default {
showDelete: true, showDelete: true,
showUpdate: true, showUpdate: true,
showSearch: false, showSearch: false,
// 自定义header
customTreeHeader: false,
customTreeHeaderName: this.$t('assets.AssetTree'), customTreeHeaderName: this.$t('assets.AssetTree'),
async: { async: {
enable: true, enable: true,

View File

@@ -361,28 +361,36 @@ export default {
*/ */
newText: { newText: {
type: String, type: String,
default: '新增' default: function() {
return this.$t('ops.Add')
}
}, },
/** /**
* 修改按钮文案 * 修改按钮文案
*/ */
editText: { editText: {
type: String, type: String,
default: '修改' default: function() {
return this.$t('ops.Modify')
}
}, },
/** /**
* 查看按钮文案 * 查看按钮文案
*/ */
viewText: { viewText: {
type: String, type: String,
default: '查看' default: function() {
return this.$t('ops.View')
}
}, },
/** /**
* 删除按钮文案 * 删除按钮文案
*/ */
deleteText: { deleteText: {
type: String, type: String,
default: '删除' default: function() {
return this.$t('ops.Delete')
}
}, },
/** /**
* 删除提示语。接受要删除的数据(单个对象或数组);返回字符串 * 删除提示语。接受要删除的数据(单个对象或数组);返回字符串
@@ -392,7 +400,7 @@ export default {
deleteMessage: { deleteMessage: {
type: Function, type: Function,
default() { default() {
return `确认${this.deleteText}吗?` return this.$t('ops.Confirm') + this.deleteText + '?'
} }
}, },
/** /**
@@ -451,7 +459,7 @@ export default {
onSuccess: { onSuccess: {
type: Function, type: Function,
default() { default() {
return this.$message.success('操作成功') return this.$message.success(this.$t('ops.SuccessfulOperation'))
} }
}, },
/** /**
@@ -1159,7 +1167,7 @@ export default {
* @param {object|object[]} - 要删除的数据对象或数组 * @param {object|object[]} - 要删除的数据对象或数组
*/ */
onDefaultDelete(data) { onDefaultDelete(data) {
this.$confirm(this.deleteMessage(data), '提示', { this.$confirm(this.deleteMessage(data), this.$t('common.Info'), {
type: 'warning', type: 'warning',
confirmButtonClass: 'el-button--danger', confirmButtonClass: 'el-button--danger',
beforeClose: async(action, instance, done) => { beforeClose: async(action, instance, done) => {

View File

@@ -1,43 +1,6 @@
<template> <template>
<div> <div>
<div <div class="treebox">
v-if="treeSetting.customTreeHeader"
class="tree-header treebox"
>
<div class="content">
<span class="title">
{{ treeSetting.customTreeHeaderName }}
</span>
<span class="tree-banner-icon-zone">
<a id="searchIcon" class="tree-search special">
<svg-icon
:icon-class="'search'"
class="tree-banner-icon"
style="font-size: 14px;"
@click.stop="treeSearch"
/>
<input
id="searchInput"
v-model="treeSearchValue"
autocomplete="off"
class="tree-input"
type="text"
>
</a>
<span v-if="treeSetting.showRefresh" class="icon-refresh" @click="refresh">
<svg-icon :icon-class="'refresh'" style="font-size: 14px;" />
</span>
</span>
</div>
<ul v-if="loading" class="ztree">
{{ this.$t('common.tree.Loading') }}...
</ul>
<ul v-else :id="iZTreeID" class="ztree tree-obj" />
<div v-if="treeSetting.treeUrl===''" class="tree-empty">
{{ this.$t('common.tree.Empty') }}
</div>
</div>
<div v-else class="treebox">
<div> <div>
<el-input <el-input
v-if="treeSetting.showSearch && showTreeSearch" v-if="treeSetting.showSearch && showTreeSearch"
@@ -162,10 +125,8 @@ export default {
} }
this.treeSetting.treeUrl = treeUrl this.treeSetting.treeUrl = treeUrl
vm.zTree = $.fn.zTree.init($(`#${this.iZTreeID}`), this.treeSetting, res) vm.zTree = $.fn.zTree.init($(`#${this.iZTreeID}`), this.treeSetting, res)
if (!this.treeSetting.customTreeHeader) { const rootNode = this.zTree.getNodes()[0]
const rootNode = this.zTree.getNodes()[0] this.rootNodeAddDom(rootNode)
this.rootNodeAddDom(rootNode)
}
// 手动上报事件, Tree加载完成 // 手动上报事件, Tree加载完成
this.$emit('TreeInitFinish', this.zTree) this.$emit('TreeInitFinish', this.zTree)
@@ -358,10 +319,8 @@ export default {
const newNode = { id: 'search', name: name, isParent: true, open: true, zAsync: true } const newNode = { id: 'search', name: name, isParent: true, open: true, zAsync: true }
searchNode = this.zTree.addNodes(null, newNode)[0] searchNode = this.zTree.addNodes(null, newNode)[0]
searchNode.zAsync = true searchNode.zAsync = true
this.rootNodeAddDom(searchNode)
if (!this.treeSetting.customTreeHeader) {
this.rootNodeAddDom(searchNode)
}
const nodesGroupByOrg = this.groupBy(nodes, (node) => { const nodesGroupByOrg = this.groupBy(nodes, (node) => {
return node.meta?.data?.org_name return node.meta?.data?.org_name
}) })

View File

@@ -97,6 +97,9 @@ export default {
}, },
async mounted() { async mounted() {
this.iActiveMenu = await this.getPropActiveTab() this.iActiveMenu = await this.getPropActiveTab()
this.$eventBus.$on('treeComponentKey', () => {
this.componentKey += 1
})
}, },
methods: { methods: {
hideRMenu() { hideRMenu() {

View File

@@ -6,7 +6,95 @@
"AccountHistoryHelpMessage": "Record the historical version of the current account", "AccountHistoryHelpMessage": "Record the historical version of the current account",
"PleaseClickLeftAssetToViewAssetAccount": "Asset account list, please click on the assets on the left to view", "PleaseClickLeftAssetToViewAssetAccount": "Asset account list, please click on the assets on the left to view",
"PleaseClickLeftApplicationToViewApplicationAccount": "Application account list, please click on the application on the left to view", "PleaseClickLeftApplicationToViewApplicationAccount": "Application account list, please click on the application on the left to view",
"PleaseClickLeftAssetToViewGatheredUser": "Gathered user list, please click on the assets on the left to view" "PleaseClickLeftAssetToViewGatheredUser": "Gathered user list, please click on the assets on the left to view",
"AccountGather": {
"ExecutionDetail": "Execution detail",
"AccountGatherTaskExecutionList": "Task execution list",
"ExecutionList": "Execution list",
"AccountGatherTaskUpdate": "Update task",
"AccountGatherTaskCreate": "Create task",
"AccountGather": "Account gather",
"AccountGatherTaskList": "Account gather",
"AccountGatherList": "Gather task"
},
"AccountChangeSecret": {
"Result": "Result",
"ExecutionTimes": "Execution times",
"TaskList": "Task record",
"TimerPeriod": "Timed execution cycle",
"DatabaseId": "Database ID",
"Database": "Database",
"SecretKeyStrategy": "Secret key strategy",
"HelpText": {
"UsernameOfCreateUpdatePage": "The username of the user on the target host; if it already exists, modify the user password; if it does not exist, add the user and set the password;",
"CrontabOfCreateUpdatePage": "For example: execute <5 3 * * 0> every Sunday at 03:05 <br/> Use the 5-digit Linux crontab expression <time-sharing day month weekday> (<a href=\"https://tool.lu/crontab /\" target=\"_blank\">online tool</a>) <br/> If both periodic execution and periodic execution are set at the same time, periodic execution is preferred",
"IntervalOfCreateUpdatePage": "Unit: hour"
},
"SymbolSetHelpText": "Please enter a set of special symbols supported by this type of database. If the generated random password contains special characters that are not supported by this type of database, the encryption plan will fail",
"ContainAttachment": "Contain attachment",
"PasswordStrategy": "Ciphertext Generation Strategy",
"Addressee": "Recipient",
"PasswordLength": "Password length",
"Asset": "Asset",
"SystemUserId": "System user ID",
"ChangePassword": "Change password",
"AssetAndNode": "Asset and Node",
"validatorMessage": {
"EnsureThisValueIsGreaterThanOrEqualTo1": "Make sure the value is greater than or equal to 1"
},
"ModifySSHKey": "Modify SSH Key",
"DateUpdated": "Date updated",
"AccountChangeSecret": "Account change",
"RegularlyPerform": "Regular execution",
"SystemUser": "SystemUser",
"AddNode": "Add node",
"NodeAmount": "Node amount",
"OnlyMailSend": "Currently only supports mail sending",
"Username": "Username",
"DateStart": "Date start",
"AssetAmount": "Asset amount",
"AddAsset": "Add asset",
"SymbolSet": "Collection of special symbols",
"DateJoined": "Date joined",
"ManualExecutePlan": "Manual execution plan",
"Log": "Log",
"CyclePerform": "Periodic execution",
"MailRecipient": "Mail recipient",
"ExecutionDetail": "Execution detail",
"Name": "Name",
"Retry": "Retry",
"Timer": "Timed execution",
"Detail": "Detail",
"TimeDelta": "Time delta",
"AppAmount": "Application amount",
"AssetChangeSecretCreate": "Create account change secret",
"ExecutionList": "Execution List",
"Execute": "Execute",
"SystemUserAmount": "SystemUser amount",
"AssetChangeSecretUpdate": "Update account change secret",
"Success": "Success",
"AddSystemUser": "Add system user"
},
"AccountPush": {
"AccountPushExecutionList": "Execution list",
"AccountPushCreate": "Account push create",
"AccountPushList": "Account push "
},
"AccountBackup": {
"IsSuccess": "Is success",
"ExecutionDetail": "Execution detail",
"MailRecipient": "Mail receiver",
"Types": "Type",
"AccountBackupUpdate": "Update account backup",
"AccountBackupCreate": "Create account backup",
"Backup": "Backup",
"ExecutionList": "Execution list",
"Reason": "Reason",
"AccountBackup": "Account backup"
},
"DynamicUsername": "Dynamic username",
"AutoCreate": "Auto create",
"TaskID": "Task ID"
}, },
"acl": { "acl": {
"IgnoreCase": "Ignore case", "IgnoreCase": "Ignore case",
@@ -37,7 +125,12 @@
"apply_login_asset": "Apply login asset", "apply_login_asset": "Apply login asset",
"apply_login_system_user": "Apply login system user", "apply_login_system_user": "Apply login system user",
"apply_login_user": "Apply login user", "apply_login_user": "Apply login user",
"RuleDetail": "Rule detail" "RuleDetail": "Rule detail",
"login_confirm_user": "Log in as the review assignee",
"users": "User",
"Rules": "Rule",
"Action": "Action",
"ip_group_help_text": "The format is a comma-separated string, * means match all. Example: 192.168.10.1, 192.168.1.0/24, 10.1.1.1-10.1.1.20, 2001:db8:2de::e13, 2001:db8:1a:1110::/64"
}, },
"applications": { "applications": {
"": "", "": "",
@@ -59,7 +152,8 @@
"sqlserver": "SQLServer", "sqlserver": "SQLServer",
"redis": "Redis", "redis": "Redis",
"mongodb": "MongoDB", "mongodb": "MongoDB",
"k8s": "kubernetes" "k8s": "kubernetes",
"clickhouse": "ClickHouse"
}, },
"applicationsCategory": { "applicationsCategory": {
"remote_app": "Remote app", "remote_app": "Remote app",
@@ -69,9 +163,8 @@
"appPath": "App path", "appPath": "App path",
"appType": "App type", "appType": "App type",
"appName": "App name", "appName": "App name",
"host": "Asset",
"database": "Database",
"host": "Host", "host": "Host",
"database": "Database",
"mysql": "Mysql", "mysql": "Mysql",
"port": "Port", "port": "Port",
"type": "Type", "type": "Type",
@@ -300,7 +393,18 @@
"RDBProtocol": "RDS Protocol", "RDBProtocol": "RDS Protocol",
"NoSQLProtocol": "NoSQL Protocol", "NoSQLProtocol": "NoSQL Protocol",
"OtherProtocol": "Other Protocol", "OtherProtocol": "Other Protocol",
"PasswordOrToken": "Password / Token" "PasswordOrToken": "Password / Token",
"Accounts": "Account list",
"CustomTree": "Custom tree",
"AccessKey": "Access Key",
"Cloud": "Cloud",
"ApiKey": "API Key",
"SSHKey": "SSH Key",
"BuiltinTree": "Type tree",
"AccountDetail": "Account detail",
"Token": "Token",
"Category": "Category",
"AssetTree": "Asset tree"
}, },
"audits": { "audits": {
"ChangeField": "Change field", "ChangeField": "Change field",
@@ -313,7 +417,9 @@
"View": "View", "View": "View",
"LoginIP": "Login IP", "LoginIP": "Login IP",
"LoginCity": "Login city", "LoginCity": "Login city",
"LoginDate": "Login date" "LoginDate": "Login date",
"BeforeChange": "Before change",
"AfterChange": "After the change"
}, },
"auth": { "auth": {
"LoginRequiredMsg": "You account has logout, Please login again", "LoginRequiredMsg": "You account has logout, Please login again",
@@ -413,7 +519,7 @@
"DateLast3Months": "Last 3 months", "DateLast3Months": "Last 3 months",
"DateLastMonth": "Last month", "DateLastMonth": "Last month",
"DateLastWeek": "Last week", "DateLastWeek": "Last week",
"DateStart": "Start date", "DateStart": "Date start",
"Delete": "Delete", "Delete": "Delete",
"Disable": "Disable", "Disable": "Disable",
"Download": "Download", "Download": "Download",
@@ -491,7 +597,6 @@
"dateCreated": "Date created", "dateCreated": "Date created",
"dateFinished": "Date finished", "dateFinished": "Date finished",
"dateExpired": "Date expired", "dateExpired": "Date expired",
"DateStart": "Date start",
"deleteErrorMsg": "Delete failed", "deleteErrorMsg": "Delete failed",
"deleteFailedMsg": "Delete failed", "deleteFailedMsg": "Delete failed",
"deleteSelected": "Delete selected", "deleteSelected": "Delete selected",
@@ -520,7 +625,8 @@
"updateSuccessMsg": "Update success, total: {count}", "updateSuccessMsg": "Update success, total: {count}",
"dragUploadFileInfo": "Drag file here or click here to upload", "dragUploadFileInfo": "Drag file here or click here to upload",
"uploadCsvLth10MHelpText": "csv/xlsx files with a size less than 10M", "uploadCsvLth10MHelpText": "csv/xlsx files with a size less than 10M",
"hasImportErrorItemMsg": "There is an error item, click the x icon to view the details, and continue to import after editing" "hasImportErrorItemMsg": "There is an error item, click the x icon to view the details, and continue to import after editing",
"ImportFail": "Import failed"
}, },
"isValid": "Is valid", "isValid": "Is valid",
"nav": { "nav": {
@@ -621,7 +727,29 @@
"SelectAll": "Select all", "SelectAll": "Select all",
"CanDragSelect": "Can drag the mouse to select a time period", "CanDragSelect": "Can drag the mouse to select a time period",
"WeekOrTime": "Week/Time" "WeekOrTime": "Week/Time"
} },
"other": "Other setting",
"User": "User",
"CertificateKey": "Certificate Key",
"Radius": "Radius",
"OpenId": "OpenID",
"Inactive": "Disabled",
"Valid": "Valid",
"AllowInvalidCert": "Ignore certificate check",
"UseSSL": "Use SSL/TLS",
"ApprovaLevel": "Approval information",
"DateUpdated": "Date updated",
"requiredHasUserNameMapped": "Must contain a mapping for the username field, such as { 'uid': 'username' }",
"QuickSelect": "Quick select",
"ClientCertificate": "Client certificate",
"OfflineUpload": "Upload offline",
"CACertificate": "CA Certificate",
"SecretKey": "Secret Key",
"NotSpecialEmoji": "No special emoji allowed",
"Task": "Task",
"Cas": "CAS",
"Invalid": "Invalid",
"Filename": "Filename"
}, },
"dashboard": { "dashboard": {
"ActiveAsset": "Asset active", "ActiveAsset": "Asset active",
@@ -738,7 +866,102 @@
"PENDING": "Pending", "PENDING": "Pending",
"RUNNING": "Running", "RUNNING": "Running",
"SUCCESS": "Success", "SUCCESS": "Success",
"FAILURE": "Failure" "FAILURE": "Failure",
"ScrollToBottom": "Roll to the bottom",
"VariableHelpText": "You can read built-in variables using {{ key }} in your command",
"RequiredEntryFile": "This file is used as the entry file for running and must exist",
"State": "State",
"AverageTimeCost": "Average time spent",
"RunJob": "Run job",
"failed": "Failed",
"DeleteConfirmMessage": "It cannot be restored after deletion, continue?",
"ClearScreen": "Clear screen",
"Workspace": "Workspace",
"Parameter": "Parameter",
"History": "Execution history",
"Cancel": "Cancel",
"SuccessAsset": "Successful assets",
"Asset": "Asset",
"Language": "Language",
"privilegeFirst": "Prefer privileged accounts",
"Material": "Material",
"createAdhoc": "Create Adhoc",
"Module": "Module",
"UseParameterDefine": "Define parameters",
"DeleteSuccess": "Successfully deleted",
"AssetResultDetail": "Asset result",
"total": "Total",
"Variable": "Variable",
"PlaybookDetail": "Playbook detail",
"DryRun": "Dry run",
"SelectAdhoc": "Select Adhoc",
"TimeoutHelpText": "When this value is -1, no timeout is specified",
"Command": "Command",
"PlaybookManage": "Playbook manage",
"ChdirHelpText": "The default execution directory is the home directory of the executing user",
"timeout": "Timeout",
"Skip": "Skip",
"Reason": "Reason",
"PrivilegedOnly": "Privileged accounts only",
"JobType": "Job type",
"OpenCommand": "Open command",
"PlaybookUpdate": "Update Playbook",
"NewDirectory": "New directory",
"skip": "Ignore current asset",
"ExecutionDetail": "Execution detail",
"ScriptDetail": "Script detail",
"SaveAdhoc": "Save Adhoc",
"AdhocManage": "Adhoc manage",
"LastPublishedTime": "Last published",
"CloseConfirmMessage": "The file has changed, do you want to save it?",
"privilegeOnly": "Select only privileged accounts",
"UploadPlaybook": "Upload Playbook",
"Rename": "Rename",
"instantAdhoc": "Instant command",
"Summary(success/total)": "Overview (Success/Total)",
"Queue": "Queue",
"history": "History record",
"Help": "Help",
"Timeout": "Timeout (seconds)",
"Confirm": "Confirm",
"RequiredAssetOrNode": "Please select at least one asset or node",
"SaveCommandSuccess": "Save command succeeded",
"Run": "Run",
"NewFile": "New file",
"Job": "Job",
"Type": "Type",
"running": "Runing",
"ScrollToTop": "Scroll to top",
"Plan": "Plan",
"ThisPeriodic": "This is a periodic job",
"QuickJob": "Shortcut command",
"DateLastRun": "last run date",
"FailedAsset": "Failed asset",
"AdhocDetail": "Adhoc detail",
"RequiredContent": "Please input the command",
"DateFinished": "Date finished",
"DeleteFile": "Delete file",
"AssetAmount": "Assets amount",
"Comment": "Comment",
"SaveSuccess": "Saved successfully",
"script": "Script list",
"SaveCommand": "Save command",
"Log": "Log",
"ExcludeAsset": "Skipped assets",
"DateCreated": "Date created",
"RunCommand": "Run command",
"Delete": "Delete",
"RunasPolicy": "Account policy",
"TaskDispatch": "The task was sent successfully",
"PrivilegedFirst": "Prefer privileged accounts",
"CloseConfirm": "Confirm close",
"SelectCreateMethod": "Choose how to create",
"View": "View",
"BuiltinVariable": "Builtin variable",
"Add": "Add",
"SuccessfulOperation": "Successful operation",
"Modify": "Modify",
"AdhocUpdate": "Update Adhoc"
}, },
"perms": { "perms": {
"": "", "": "",
@@ -809,7 +1032,8 @@
"clipboardPaste": "Clipboard paste", "clipboardPaste": "Clipboard paste",
"userCount": "User count", "userCount": "User count",
"userGroupCount": "User group count", "userGroupCount": "User group count",
"usersAndUserGroups": "Users and user groups" "usersAndUserGroups": "Users and user groups",
"Account": "Account"
}, },
"route": { "route": {
"": "", "": "",
@@ -984,7 +1208,41 @@
"NoPermissionVew": "No permission view current page", "NoPermissionVew": "No permission view current page",
"AjaxError404": "404 ajax error", "AjaxError404": "404 ajax error",
"CannotAccess": "Unable to access the current page", "CannotAccess": "Unable to access the current page",
"GoHomePage": "Go home page" "GoHomePage": "Go home page",
"RemoteApps": "Remote application",
"MyTickets": "My tickets ",
"AssetPermissionList": "Asset permission list",
"Database": "Database",
"TicketFlowCreate": "Create Ticket flow",
"Device": "Device",
"JobUpdate": "Update job",
"TicketFlowUpdate": "Update approval flow",
"WorkBench": "Workbench",
"TemplateDetail": "Template detail",
"AppletCreate": "Create a remote application",
"TemplateCreate": "Create template",
"AppletHostUpdate": "Updating the Remote Application Publisher",
"Template": "Template",
"AppletHostDetail": "Remote Application Publisher Details",
"TicketFlow": "Ticket flow",
"TicketsDone": "Ticket Done",
"TemplateUpdate": "Update template",
"Session": "Session",
"Templates": "模版管理",
"AssetUserList": "Asset user",
"UserLoginACLUpdate": "Update User Login ACL",
"JobCreate": "Create job",
"JobExecutionLog": "Job Execution Log",
"JobList": "Job List",
"HostList": "Host list",
"UserLoginACLCreate": "Create User Login ACL",
"TicketsNew": "Submit ticket",
"TicketsTodo": "Todo ticket",
"AppletHostCreate": "Add a remote application publisher",
"Execution": "Execution history",
"AssignedTicketList": "Todo approval",
"JobDetail": "Job detail",
"Clouds": "Cloud"
}, },
"rbac": { "rbac": {
"Permissions": "Permissions", "Permissions": "Permissions",
@@ -998,7 +1256,9 @@
"AppletHosts": "Remote hosts", "AppletHosts": "Remote hosts",
"uploadZipTips": "Please upload zip file", "uploadZipTips": "Please upload zip file",
"HostDeployment": "Remote host deployment", "HostDeployment": "Remote host deployment",
"TerminalStat": "CPU/MEM/DISK" "TerminalStat": "CPU/MEM/DISK",
"DatabasePort": "Database protocol port",
"BasePort": "listening port"
}, },
"sessions": { "sessions": {
"SetToDefaultStorage": "Set to default storage", "SetToDefaultStorage": "Set to default storage",
@@ -1202,7 +1462,8 @@
"terminalHeartbeatInterval": "Units: seconds", "terminalHeartbeatInterval": "Units: seconds",
"terminalSessionKeepDuration": "Units: days, Session, record, command will be delete if more than duration, only in database", "terminalSessionKeepDuration": "Units: days, Session, record, command will be delete if more than duration, only in database",
"terminalTelnetRegex": "ex: Last\\\\s*login|success|\\u6210\\u529f", "terminalTelnetRegex": "ex: Last\\\\s*login|success|\\u6210\\u529f",
"userGuideUrl": "User first login update profile done redirect to it" "userGuideUrl": "User first login update profile done redirect to it",
"SecurityInsecureCommandEmailReceiver": "For multiple mailboxes, separate them with a comma ','"
}, },
"helpTip": { "helpTip": {
"emailUserSSL": "If SMTP port is 465, may be select", "emailUserSSL": "If SMTP port is 465, may be select",
@@ -1213,7 +1474,8 @@
"securityPasswordNumber": "After opening, the user password changes and resets must contain numeric characters", "securityPasswordNumber": "After opening, the user password changes and resets must contain numeric characters",
"securityPasswordSpecialChar": "After opening, the user password changes and resets must contain special characters", "securityPasswordSpecialChar": "After opening, the user password changes and resets must contain special characters",
"securityPasswordUpperCase": "After opening, the user password changes and resets must contain uppercase letters", "securityPasswordUpperCase": "After opening, the user password changes and resets must contain uppercase letters",
"securityServiceAccountRegistration": "Allow using bootstrap token register service account, when terminal setup, can disable it" "securityServiceAccountRegistration": "Allow using bootstrap token register service account, when terminal setup, can disable it",
"SecurityInsecureCommand": "After it is enabled, when a dangerous command is executed on the asset, an email alarm notification will be sent"
}, },
"validatorMessage": { "validatorMessage": {
"EnsureThisValueIsGreaterThanOrEqualTo3": "Ensure this value is greater than or equal to 3", "EnsureThisValueIsGreaterThanOrEqualTo3": "Ensure this value is greater than or equal to 3",
@@ -1267,7 +1529,29 @@
"weComTest": "Test", "weComTest": "Test",
"FeiShu": "FeiShu", "FeiShu": "FeiShu",
"feiShuTest": "Test", "feiShuTest": "Test",
"setting": "Setting" "setting": "Setting",
"OtherAuth": "Other Auth",
"OAuth2LogoTip": "Tip: Authentication service provider (recommended image size: 64px*64px)",
"tokenHTTPMethod": "Token Obtain method",
"enableOAuth2Auth": "Enable OAuth2 authentication",
"Config": "Config",
"Senior": "Senior",
"HuaweiCloud": "Huawei Cloud",
"SecurityInsecureCommandEmailReceiver": "Alert receive email",
"JMSSSO": "SSO Token Login",
"AppAuth": "App auth",
"testPort": "Port",
"CMPP2": "CMPP v2.0",
"SignChannelNum": "Signature channel number",
"testHelpText": "Please enter the destination address for testing",
"OAuth2": "OAuth2",
"destinationIP": "Destination address",
"AppEndpoint": "Application access address",
"authCASAttrMap": "User Attribute Mapping",
"SignaturesAndTemplates": "Signatures and Templates",
"SystemTools": "System Tool",
"testTools": "Test",
"basicTools": "Basic tool"
}, },
"tickets": { "tickets": {
"PermissionName": "Permission name", "PermissionName": "Permission name",
@@ -1322,7 +1606,23 @@
"ApplyRunSystemUser": "Apply run system user", "ApplyRunSystemUser": "Apply run system user",
"ApplyRunCommand": "Apply run command", "ApplyRunCommand": "Apply run command",
"ApplyFromSession": "Session", "ApplyFromSession": "Session",
"ApplyFromCMDFilterRule": "Command filter rule" "ApplyFromCMDFilterRule": "Command filter rule",
"RelevantSystemUser": "System user",
"CustomUser": "Custom user",
"SuperOrgAdmin": "Super administrator + organization administrator",
"OrgAdmin": "Organization administrator",
"TwoAssigneeType": "Type of secondary assignee",
"ApprovalLevel": "Approval level",
"OneAssigneeType": "Type of primary assignee",
"RelevantCommand": "Command",
"RelevantApp": "Application",
"RelevantAsset": "Asset",
"StateClosed": "closed",
"TwoAssignee": "Secondary Recipient",
"SuperAdmin": "Super administrator",
"FlowDetail": "Flow detail",
"OneAssignee": "First-level Assignee",
"RelevantAssignees": "Relevant assignees"
}, },
"tree": { "tree": {
"AddAssetToNode": "Add asset to node", "AddAssetToNode": "Add asset to node",
@@ -1433,7 +1733,10 @@
"unbind": "Unbind", "unbind": "Unbind",
"unblock": "Unblock", "unblock": "Unblock",
"unblockSuccessMsg": "Account has unblocked", "unblockSuccessMsg": "Account has unblocked",
"unblockUser": "Unblock login" "unblockUser": "Unblock login",
"resetDingTalkLoginSuccessMsg": "The reset is successful, and the user can re-bind DingTalk",
"resetDingTalkLoginWarningMsg": "Are you sure you want to unbind the user's DingTalk?",
"resetDingTalk": "Untie DingTalk"
}, },
"removeFromOrgWarningMsg": "Are you sure remove ", "removeFromOrgWarningMsg": "Are you sure remove ",
"tabs": { "tabs": {
@@ -1455,7 +1758,8 @@
"UpdatePublicKey": "", "UpdatePublicKey": "",
"passwordExpired": "Password expired", "passwordExpired": "Password expired",
"passwordWillExpiredPrefixMsg": "The password will expire in ", "passwordWillExpiredPrefixMsg": "The password will expire in ",
"passwordWillExpiredSuffixMsg": " days.Please change your password as soon as possible." "passwordWillExpiredSuffixMsg": " days.Please change your password as soon as possible.",
"dateLastLogin": "Date last login"
}, },
"notifications": { "notifications": {
"MessageType": "Message Type", "MessageType": "Message Type",
@@ -1620,7 +1924,11 @@
"DateSync": "Date sync", "DateSync": "Date sync",
"Status": "Status", "Status": "Status",
"Log": "Log", "Log": "Log",
"DeleteReleasedAssets": "Delete released assets" "DeleteReleasedAssets": "Delete released assets",
"QcloudLighthouse": "Tencent Cloud (lightweight application server)",
"KingSoftCloud": "KingSoft Cloud",
"CTYunPrivate": "CTYun Private",
"LAN": "LAN"
}, },
"Corporation": "Corporation", "Corporation": "Corporation",
"Edition": "Edition", "Edition": "Edition",
@@ -1706,6 +2014,14 @@
"CrontabOfCreateUpdatePage": "For example: every Sunday at 03:05 execute <5 3 * * 0> <br/> Using the 5-bit Linux crontab expression <minute hour day month week> (<a href=\"https://tool.lu/crontab/\" target=\"_blank\"> Online tool </a>) <br/> If both regularly perform and cycle perform execution are set, use regularly perform first", "CrontabOfCreateUpdatePage": "For example: every Sunday at 03:05 execute <5 3 * * 0> <br/> Using the 5-bit Linux crontab expression <minute hour day month week> (<a href=\"https://tool.lu/crontab/\" target=\"_blank\"> Online tool </a>) <br/> If both regularly perform and cycle perform execution are set, use regularly perform first",
"IntervalOfCreateUpdatePage": "Unit: hour", "IntervalOfCreateUpdatePage": "Unit: hour",
"UsernameOfCreateUpdatePage": "The username of the user on the target host; If already existed, modify user password; If it doesn't exist, add the user and set the password." "UsernameOfCreateUpdatePage": "The username of the user on the target host; If already existed, modify user password; If it doesn't exist, add the user and set the password."
},
"officialWebsite": "Official website link",
"Template": {
"Template": "Template"
} }
},
"applets": {
"PublishStatus": "Publish status",
"NoPublished": "Unpublished"
} }
} }

137
src/i18n/langs/i18n-util.py Normal file
View File

@@ -0,0 +1,137 @@
"""
描述: Lina i18n 翻译 检测、更新 工具
两个功能:
1. 以 zh.json 文件为基础,检测 en.json 和 ja.json 文件是否有缺失的翻译,如果有会将缺少的翻译信息写入到新文件 diff-zh-en.json 和 diff-zh-ja.json 中
2. 用户直接修改 diff-zh-en.json 和 diff-zh-ja.json 文件中对应的翻译,然后执行命令,会将修改后的翻译写入到 en.json 和 ja.json 文件中
使用方法:
1. 生成差异文件: python i18n-util.py diff en ja
2. 修改差异文件: vi diff-zh-en.json 和 vi diff-zh-ja.json
3. 更新翻译文件: python i18n-util.py apply en ja
依赖包:
pip install data-tree
pip install pathdict
"""
import os
import json
import argparse
import data_tree
from pathdict import PathDict
actions_display_mapper = {
'diff': '检测',
'apply': '更新'
}
langs_display_map = {
'en': '英文',
'ja': '日文'
}
class I18NFileUtil(object):
dir_path = './src/i18n/langs'
def diff(self, lang):
zh_json = self.load_json(f'{self.dir_path}/zh.json')
zh_tree = data_tree.Data_tree_node(arg_data=zh_json)
zh_paths = list(zh_tree.paths(arg_bool_get_paths_as_strings=True))
lang_json = self.load_json(f'{self.dir_path}/{lang}.json')
lang_tree = data_tree.Data_tree_node(arg_data=lang_json)
lang_paths = list(lang_tree.paths(arg_bool_get_paths_as_strings=True))
diff_paths = set(zh_paths) - set(lang_paths)
data = {}
diff_filepath = f'{self.dir_path}/.diff-zh-{lang}.json'
with open(diff_filepath, 'w', encoding='utf-8') as f:
for path in diff_paths:
value = zh_tree.get(path)
if not isinstance(value, str):
continue
data[path] = value
json_data = json.dumps(data, ensure_ascii=False, indent=2)
f.write(json_data)
msg = f'\n' \
f'* 检测到 ./{lang}.json 有 {len(data)} 条翻译未处理, ' \
f'待翻译条目已写入到 {diff_filepath} 文件中. \n'
print(msg)
def apply(self, lang):
diff_filepath = f'{self.dir_path}/.diff-zh-{lang}.json'
diff_data = self.load_json(diff_filepath)
lang_data = self.load_json(f'{self.dir_path}/{lang}.json')
lang_pdict = PathDict(lang_data, create_if_not_exists=True)
for key_path, value in diff_data.items():
lang_pdict[key_path] = value
with open(f'{self.dir_path}/{lang}.json', 'w', encoding='utf-8') as f:
data = self.pathdict_to_dict(lang_pdict)
data = json.dumps(data, ensure_ascii=False, indent=2)
f.write(data)
print(f'\n翻译文件 {self.dir_path}/{lang}.json 已更新, 总共写入新的翻译 {len(diff_data)} 条.\n')
# 删除 diff 文件
os.remove(diff_filepath)
def pathdict_to_dict(self, data):
d = {}
for k, v in data.items():
if isinstance(v, PathDict):
v = self.pathdict_to_dict(v)
d[k] = v
return d
@staticmethod
def load_json(filename):
with open(filename, 'r') as f:
data = f.read()
return json.loads(data)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""
Lina i18n util
Example: \r\n
%(prog)s diff en(ja);
%(prog)s apply en(ja);
"""
)
parser.add_argument(
'action', type=str, choices=("diff", "apply"),
)
parser.add_argument(
'langs', type=str, choices=("en", "ja"), nargs='*'
)
args = parser.parse_args()
action = args.action
langs = args.langs
util = I18NFileUtil()
method = getattr(util, action)
action_display = actions_display_mapper[action]
print('-'*100)
for index, _lang in enumerate(langs):
lang_display = langs_display_map[_lang]
method(_lang)
print('-'*100)
if action == 'diff':
_langs = ' '.join(langs)
msg = f'\n* Tips: 修改差异文件后, 执行命令 ```npm run apply-i18n ``` 更新翻译文件 *\n'
print(msg)

View File

@@ -6,7 +6,95 @@
"AccountHistoryHelpMessage": "現在のアカウントの履歴バージョンを記録する", "AccountHistoryHelpMessage": "現在のアカウントの履歴バージョンを記録する",
"PleaseClickLeftAssetToViewAssetAccount": "資産のアカウントのリスト、左側の資産をクリックして表示します", "PleaseClickLeftAssetToViewAssetAccount": "資産のアカウントのリスト、左側の資産をクリックして表示します",
"PleaseClickLeftApplicationToViewApplicationAccount": "アカウントのリストを適用して、左側のアプリケーションをクリックして表示します", "PleaseClickLeftApplicationToViewApplicationAccount": "アカウントのリストを適用して、左側のアプリケーションをクリックして表示します",
"PleaseClickLeftAssetToViewGatheredUser": "ユーザーリストを収集し、左側の資産をクリックして表示します。" "PleaseClickLeftAssetToViewGatheredUser": "ユーザーリストを収集し、左側の資産をクリックして表示します。",
"AccountGather": {
"ExecutionDetail": "タスクの詳細",
"AccountGatherTaskExecutionList": "タスク実行リスト",
"ExecutionList": "実行リスト",
"AccountGatherTaskUpdate": "更新タスク",
"AccountGatherTaskCreate": "タスクを作成",
"AccountGather": "アカウントのコレクション",
"AccountGatherTaskList": "アカウントのコレクション",
"AccountGatherList": "収集タスク"
},
"AccountChangeSecret": {
"Result": "結果",
"ExecutionTimes": "実行時間",
"TaskList": "タスク レコード",
"TimerPeriod": "時限実行サイクル",
"DatabaseId": "データベース ID",
"Database": "データベース",
"SecretKeyStrategy": "パスワード ポリシー",
"HelpText": {
"UsernameOfCreateUpdatePage": "ターゲット ホスト上のユーザーのユーザー名。既に存在する場合は、ユーザー パスワードを変更します。存在しない場合は、ユーザーを追加してパスワードを設定します。",
"CrontabOfCreateUpdatePage": "例: <5 3 * * 0> を毎週日曜日の 03:05 に実行 <br/> 5 桁の Linux crontab 式 <time-sharing day month weekday> (<a href=\"https://tool. lu/crontab /\" target=\"_blank\">オンライン ツール</a>) <br/> 定期実行と定期実行の両方を同時に設定した場合は、定期実行が優先されます",
"IntervalOfCreateUpdatePage": "単位:時間"
},
"SymbolSetHelpText": "このタイプのデータベースでサポートされている一連の特殊記号を入力してください。生成されたランダム パスワードに、このタイプのデータベースでサポートされていない特殊文字が含まれている場合、暗号化プランは失敗します。",
"ContainAttachment": "付属品付き",
"PasswordStrategy": "暗号文生成戦略",
"Addressee": "受取人",
"AssetAndNode": "アセットとノード",
"Asset": "資産",
"PasswordLength": "パスワードの長さ",
"SystemUserId": "システム ユーザー ID",
"ChangePassword": "パスワードを変更する",
"validatorMessage": {
"EnsureThisValueIsGreaterThanOrEqualTo1": "値が 1 以上であることを確認してください"
},
"ModifySSHKey": "改訂 SSH Key",
"DateUpdated": "更新しました",
"AccountChangeSecret": "アカウントのパスワード変更",
"RegularlyPerform": "定期実行",
"SystemUser": "システム ユーザー",
"AddNode": "ノードを追加",
"NodeAmount": "ノード数",
"OnlyMailSend": "現在メール送信のみ対応",
"Username": "ユーザー名",
"AssetAmount": "資産量",
"DateStart": "開始日",
"AddAsset": "アセットを追加",
"SymbolSet": "特殊記号のコレクション",
"DateJoined": "作成日",
"ManualExecutePlan": "手動実行計画",
"Log": "ログ",
"CyclePerform": "定期実行",
"MailRecipient": "メール受信者",
"ExecutionDetail": "実行の詳細",
"Name": "名前",
"Retry": "リトライ",
"Timer": "時限実行",
"Detail": "詳細",
"TimeDelta": "営業時間",
"AppAmount": "応募数",
"AssetChangeSecretCreate": "アカウントの作成とパスワードの変更",
"ExecutionList": "実行リスト",
"Execute": "埋め込む",
"SystemUserAmount": "システムユーザー数",
"AssetChangeSecretUpdate": "アカウントの更新とパスワードの変更",
"Success": "成功",
"AddSystemUser": "システムユーザーを追加"
},
"AccountPush": {
"AccountPushExecutionList": "実行リスト",
"AccountPushCreate": "アカウントのプッシュ作成",
"AccountPushList": "アカウントプッシュ"
},
"AccountBackup": {
"IsSuccess": "成功するかどうか",
"ExecutionDetail": "実行の詳細",
"MailRecipient": "メール受信者 ",
"Types": "タイプ",
"AccountBackupUpdate": "アカウントのバックアップを更新する",
"AccountBackupCreate": "アカウントのバックアップを作成する",
"Backup": "バックアップ",
"ExecutionList": "実行リスト",
"Reason": "理由",
"AccountBackup": "アカウントのバックアップ"
},
"DynamicUsername": "動的ユーザー名",
"AutoCreate": "自動作成",
"TaskID": "タスク ID"
}, },
"acl": { "acl": {
"IgnoreCase": "大文字小文字を無視する", "IgnoreCase": "大文字小文字を無視する",
@@ -75,9 +163,8 @@
"appPath": "適用パス", "appPath": "適用パス",
"appType": "適用タイプ", "appType": "適用タイプ",
"appName": "アプリ名", "appName": "アプリ名",
"host": "資産",
"database": "データベース",
"host": "本体", "host": "本体",
"database": "データベース",
"mysql": "Mysql", "mysql": "Mysql",
"port": "ポート", "port": "ポート",
"type": "タイプ", "type": "タイプ",
@@ -301,7 +388,23 @@
"RDBProtocol": "リレーショナルデータベース", "RDBProtocol": "リレーショナルデータベース",
"NoSQLProtocol": "非リレーショナルデータベース", "NoSQLProtocol": "非リレーショナルデータベース",
"OtherProtocol": "その他の契約", "OtherProtocol": "その他の契約",
"PasswordOrToken": "パスワード/トークン" "PasswordOrToken": "パスワード/トークン",
"Accounts": "アカウント一覧",
"CustomTree": "カスタムツリー",
"AccessKey": "アクセスキー",
"Cloud": "クラウド サービス",
"Address": "アドレス",
"Secret": "パスワード",
"ApiKey": "API Key",
"SSHKey": "SSH 鍵",
"BuiltinTree": "タイプツリー",
"Network": "ネットワーク",
"AccountDetail": "アカウント詳細",
"Token": "トークン",
"GatewayList": "ゲートウェイ一覧",
"InitialDeploy": "初期展開",
"PrivateKey": "鍵",
"Category": "カテゴリー"
}, },
"audits": { "audits": {
"ChangeField": "フィールドを変更します", "ChangeField": "フィールドを変更します",
@@ -399,7 +502,7 @@
"BadConflictErrorMsg": "更新中です。後で再試行してください。", "BadConflictErrorMsg": "更新中です。後で再試行してください。",
"Basic": "基本", "Basic": "基本",
"PleaseAgreeToTheTerms": "条項に同意してください", "PleaseAgreeToTheTerms": "条項に同意してください",
"OpenId": "OpenId設定", "OpenId": "OpenID設定",
"Radius": "Radius設定", "Radius": "Radius設定",
"Cas": "Cas設定", "Cas": "Cas設定",
"other": "その他の設定", "other": "その他の設定",
@@ -495,7 +598,6 @@
"dateCreated": "作成日", "dateCreated": "作成日",
"dateExpired": "失効日", "dateExpired": "失効日",
"dateFinished": "完了日", "dateFinished": "完了日",
"DateStart": "開始日",
"deleteErrorMsg": "削除に失敗しました", "deleteErrorMsg": "削除に失敗しました",
"deleteFailedMsg": "削除に失敗しました", "deleteFailedMsg": "削除に失敗しました",
"deleteSelected": "削除選択した", "deleteSelected": "削除選択した",
@@ -630,7 +732,23 @@
"runningTimes": "直近5回の稼働時間", "runningTimes": "直近5回の稼働時間",
"calculationResults": "Cron式エラー", "calculationResults": "Cron式エラー",
"failedConditions": "条件に達していない結果!" "failedConditions": "条件に達していない結果!"
} },
"Deploy": "配備",
"Publish": "リリース",
"Icon": "アイコン",
"Automations": "オートメーション",
"Inactive": "無効",
"Valid": "効率的",
"Selector": "セレクタ",
"Version": "バージョン",
"Detail": "詳細",
"OfflineUpload": "オフラインでアップロード",
"DisplayName": "名前",
"Task": "タスク",
"Invalid": "無効",
"PublishAllApplets": "すべてのアプリを公開する",
"Sync": "同期する",
"Filename": "ファイル名"
}, },
"dashboard": { "dashboard": {
"ActiveAsset": "最近ログインされました", "ActiveAsset": "最近ログインされました",
@@ -743,7 +861,106 @@
"version": "バージョン", "version": "バージョン",
"versionDetail": "バージョンの詳細", "versionDetail": "バージョンの詳細",
"versionRunExecution": "実行履歴", "versionRunExecution": "実行履歴",
"Unknown": "不明" "Unknown": "不明",
"ScrollToBottom": "一番下までスクロール",
"VariableHelpText": "コマンドで {{ key }} を使用して組み込み変数を読み取ることができます",
"RequiredEntryFile": "このファイルは、実行のエントリ ファイルとして使用され、存在する必要があります。",
"State": "状況",
"AverageTimeCost": "平均滞在時間",
"RunJob": "ジョブを実行",
"failed": "失敗",
"DeleteConfirmMessage": "削除後は復元できません,続行しますか?",
"ClearScreen": "清屏",
"Workspace": "ワークスペース",
"Parameter": "パラメータ",
"History": "実行履歴",
"Cancel": "確認",
"SuccessAsset": "成功した資産",
"Asset": "資産",
"Language": "言語",
"privilegeFirst": "特権アカウントを優先",
"Material": "コンテンツ",
"createAdhoc": "作成コマンド",
"Module": "モジュール",
"UseParameterDefine": "パラメータを定義する",
"DeleteSuccess": "正常に削除されました",
"AssetResultDetail": "アセットの結果",
"total": "合計",
"Variable": "変数",
"PlaybookDetail": "Playbook 詳細",
"DryRun": "テスト走行",
"SelectAdhoc": "コマンドを選択",
"TimeoutHelpText": "この値が -1 の場合、タイムアウトは指定されません",
"Command": "注文",
"PlaybookManage": "Playbook 管理",
"ChdirHelpText": "デフォルトの実行ディレクトリは、実行ユーザーのホーム ディレクトリです。",
"timeout": "タイムアウト",
"Skip": "飛び越える",
"Reason": "理由",
"PrivilegedOnly": "特権アカウントのみ",
"JobType": "職種",
"OpenCommand": "コマンドを開く",
"PlaybookUpdate": "更新する Playbook",
"NewDirectory": "新しいディレクトリ",
"skip": "現在のアセットを無視",
"ExecutionDetail": "実行の詳細",
"ScriptDetail": "スクリプトの詳細",
"SaveAdhoc": "保存コマンド",
"AdhocManage": "コマンド管理",
"LastPublishedTime": "最終公開",
"CloseConfirmMessage": "ファイルが変更されました,保存しますか?",
"privilegeOnly": "特権アカウントのみを選択",
"UploadPlaybook": "アップロード Playbook",
"Rename": "名前を変更",
"RUNNING": "ランニング",
"instantAdhoc": "インスタントコマンド",
"Summary(success/total)": "概要 (成功/合計)",
"Queue": "列",
"history": "履歴書",
"Help": "ヘルプ",
"Timeout": "タイムアウト (秒)",
"Confirm": "確認",
"RequiredAssetOrNode": "少なくとも 1 つのアセットまたはノードを選択してください",
"Run": "走る",
"SaveCommandSuccess": "保存コマンドが成功しました",
"NewFile": "新しいファイルを作成する",
"Job": "手術",
"SUCCESS": "成功",
"Type": "タイプ",
"running": "ランニング",
"ScrollToTop": "トップにスクロールします",
"Plan": "プラン",
"ThisPeriodic": "定期的なお仕事です",
"QuickJob": "ショートカット コマンド",
"DateLastRun": "最終実行日",
"FailedAsset": "失敗したアセット",
"AdhocDetail": "コマンド詳細",
"RequiredContent": "コマンドを入力してください",
"DateFinished": "完了時間",
"DeleteFile": "ファイルの削除",
"AssetAmount": "資産",
"Comment": "述べる",
"SaveSuccess": "正常に保存",
"PENDING": "待っている",
"script": "スクリプト一覧",
"SaveCommand": "保存コマンド",
"FAILURE": "失敗",
"Log": "ログ",
"ExcludeAsset": "スキップされたアセット",
"DateCreated": "作成時間",
"RunCommand": "コマンドを実行",
"Delete": "消去",
"TaskDispatch": "タスクは正常に送信されました",
"RunasPolicy": "アカウント ポリシー",
"PrivilegedFirst": "優先特権アカウント",
"CloseConfirm": "閉じることを確認",
"SelectCreateMethod": "作り方を選ぶ",
"View": "チェック",
"BuiltinVariable": "組み込み変数",
"Add": "追加",
"SuccessfulOperation": "成功した操作",
"Modify": "改訂",
"AdhocUpdate": "更新コマンド"
}, },
"perms": { "perms": {
"": "", "": "",
@@ -813,7 +1030,8 @@
"clipboardPaste": "クリップボードに貼り付ける", "clipboardPaste": "クリップボードに貼り付ける",
"userCount": "ユーザー数", "userCount": "ユーザー数",
"userGroupCount": "ユーザーグループ数", "userGroupCount": "ユーザーグループ数",
"usersAndUserGroups": "ユーザーまたはユーザーグループ" "usersAndUserGroups": "ユーザーまたはユーザーグループ",
"Account": "アカウント"
}, },
"route": { "route": {
"": "", "": "",
@@ -998,7 +1216,27 @@
"NoPermissionVew": "現在のページを表示する権限がありません", "NoPermissionVew": "現在のページを表示する権限がありません",
"AjaxError404": "404リクエストエラー", "AjaxError404": "404リクエストエラー",
"CannotAccess": "現在のページにアクセスできません", "CannotAccess": "現在のページにアクセスできません",
"GoHomePage": "トップページへ" "GoHomePage": "トップページへ",
"RemoteApps": "リモート アプリケーション",
"MyTickets": "私のアプリケーション",
"AssetPermissionList": "アセット認可リスト",
"Database": "データベース",
"Device": "インターネット機器",
"JobUpdate": "更新ジョブ",
"TaskCenter": "タスクセンター",
"AppletCreate": "リモート アプリケーションを作成する",
"AppletHostUpdate": "リモート アプリケーション パブリッシャの更新",
"Template": "テンプレート管理",
"AppletHostDetail": "リモート アプリケーション パブリッシャの詳細",
"JobCreate": "ジョブを作成",
"JobExecutionLog": "ジョブログ",
"JobList": "ジョブ管理",
"BatchScript": "バッチ スクリプト",
"HostList": "ホスト リスト",
"AppletHostCreate": "リモート アプリケーション発行者を追加する",
"Execution": "実行履歴",
"JobDetail": "仕事の詳細",
"Clouds": "クラウド プラットフォーム"
}, },
"rbac": { "rbac": {
"Permissions": "権限", "Permissions": "権限",
@@ -1012,7 +1250,9 @@
"AppletHosts": "アプリケーションパブリッシャ", "AppletHosts": "アプリケーションパブリッシャ",
"uploadZipTips": "zip形式のファイルをアップロードしてください", "uploadZipTips": "zip形式のファイルをアップロードしてください",
"HostDeployment": "パブリッシャーの導入", "HostDeployment": "パブリッシャーの導入",
"TerminalStat": "CPU/メモリ/ディスク" "TerminalStat": "CPU/メモリ/ディスク",
"DatabasePort": "データベース プロトコル ポート",
"BasePort": "リスニング ポート"
}, },
"sessions": { "sessions": {
"SetToDefaultStorage": "デフォルトストレージに設定", "SetToDefaultStorage": "デフォルトストレージに設定",
@@ -1302,7 +1542,8 @@
"testPort": "テストポート", "testPort": "テストポート",
"testTools": "テスト", "testTools": "テスト",
"testHelpText": "テストの宛先アドレスを入力してください", "testHelpText": "テストの宛先アドレスを入力してください",
"SMSProvider": "メールサービス業者 / プロトコル" "SMSProvider": "メールサービス業者 / プロトコル",
"Applets": "リモート アプリケーション"
}, },
"tickets": { "tickets": {
"OneAssigneeType": "一次受付者タイプ", "OneAssigneeType": "一次受付者タイプ",
@@ -1371,7 +1612,8 @@
"ApplyRunSystemUser": "実行を申請するシステムユーザー", "ApplyRunSystemUser": "実行を申請するシステムユーザー",
"ApplyRunCommand": "実行を申請するコマンド", "ApplyRunCommand": "実行を申請するコマンド",
"ApplyFromSession": "会話", "ApplyFromSession": "会話",
"ApplyFromCMDFilterRule": "コマンドフィルタルール" "ApplyFromCMDFilterRule": "コマンドフィルタルール",
"RelevantAssignees": "関連する譲受人"
}, },
"tree": { "tree": {
"AddAssetToNode": "ノードにアセットを追加", "AddAssetToNode": "ノードにアセットを追加",
@@ -1768,5 +2010,9 @@
"IntervalOfCreateUpdatePage": "単位: 時", "IntervalOfCreateUpdatePage": "単位: 時",
"UsernameOfCreateUpdatePage": "ターゲットホスト上のユーザーのユーザー名存在する場合は、ユーザーパスワードを変更します存在しない場合は、ユーザーを追加してパスワードを設定します" "UsernameOfCreateUpdatePage": "ターゲットホスト上のユーザーのユーザー名存在する場合は、ユーザーパスワードを変更します存在しない場合は、ユーザーを追加してパスワードを設定します"
} }
},
"applets": {
"PublishStatus": "投稿ステータス",
"NoPublished": "未発表"
} }
} }

View File

@@ -425,6 +425,7 @@
"ReLoginErr": "登录时长已超过 5 分钟,请重新登录" "ReLoginErr": "登录时长已超过 5 分钟,请重新登录"
}, },
"common": { "common": {
"Filename": "文件名",
"ApproverNumbers": "审批人数量", "ApproverNumbers": "审批人数量",
"Overview": "概览", "Overview": "概览",
"Now": "现在", "Now": "现在",
@@ -512,9 +513,9 @@
"BadConflictErrorMsg": "正在刷新中,请稍后再试", "BadConflictErrorMsg": "正在刷新中,请稍后再试",
"Basic": "基本", "Basic": "基本",
"PleaseAgreeToTheTerms": "请同意条款", "PleaseAgreeToTheTerms": "请同意条款",
"OpenId": "OpenId设置", "OpenId": "OpenID设置",
"Radius": "Radius设置", "Radius": "Radius设置",
"Cas": "Cas设置", "Cas": "CAS设置",
"other": "其它设置", "other": "其它设置",
"ApplyInfo": "申请信息", "ApplyInfo": "申请信息",
"Cancel": "取消", "Cancel": "取消",
@@ -812,8 +813,14 @@
"Weekly": "按周" "Weekly": "按周"
}, },
"ops": { "ops": {
"AdhocUpdate": "更新命令",
"Add": "新增",
"Modify": "修改",
"View": "查看",
"Confirm": "确认", "Confirm": "确认",
"Cancel": "确认", "Delete": "删除",
"SuccessfulOperation": "操作成功",
"Cancel": "取消",
"DeleteFile": "删除文件", "DeleteFile": "删除文件",
"DeleteConfirmMessage": "删除后无法恢复,是否继续?", "DeleteConfirmMessage": "删除后无法恢复,是否继续?",
"CloseConfirm": "确认关闭", "CloseConfirm": "确认关闭",
@@ -823,7 +830,6 @@
"NewFile": "新建文件", "NewFile": "新建文件",
"NewDirectory": "新建目录", "NewDirectory": "新建目录",
"Rename": "重命名", "Rename": "重命名",
"Delete": "删除",
"SelectCreateMethod": "选择创建方式", "SelectCreateMethod": "选择创建方式",
"Workspace": "工作空间", "Workspace": "工作空间",
"UploadPlaybook": "上传 Playbook", "UploadPlaybook": "上传 Playbook",
@@ -858,6 +864,7 @@
"ScriptDetail": "脚本详情", "ScriptDetail": "脚本详情",
"AssetResultDetail": "资产结果", "AssetResultDetail": "资产结果",
"VariableHelpText": "您可以在命令中使用 {{ key }} 读取内置变量", "VariableHelpText": "您可以在命令中使用 {{ key }} 读取内置变量",
"BuiltinVariable": "内置变量",
"ChdirHelpText": "默认执行目录为执行用户的 home 目录", "ChdirHelpText": "默认执行目录为执行用户的 home 目录",
"OpenCommand": "打开命令", "OpenCommand": "打开命令",
"SaveCommand": "保存命令 ", "SaveCommand": "保存命令 ",
@@ -1533,6 +1540,7 @@
"testHelpText": "请输入目的地址进行测试" "testHelpText": "请输入目的地址进行测试"
}, },
"tickets": { "tickets": {
"RelevantAssignees": "相关受理人",
"OneAssigneeType": "一级受理人类型", "OneAssigneeType": "一级受理人类型",
"OneAssignee": "一级受理人", "OneAssignee": "一级受理人",
"TwoAssigneeType": "二级受理人类型", "TwoAssigneeType": "二级受理人类型",
@@ -1770,6 +1778,7 @@
"AssetCount": "资产数量", "AssetCount": "资产数量",
"Auditor": "审计员", "Auditor": "审计员",
"Cloud": { "Cloud": {
"LAN": "局域网",
"CloudSync": "云同步", "CloudSync": "云同步",
"ServerAccountKey": "服务账号密钥", "ServerAccountKey": "服务账号密钥",
"IPNetworkSegment": "IP网段", "IPNetworkSegment": "IP网段",

View File

@@ -187,7 +187,7 @@ export default {
component: () => import('@/views/ops/Template/Adhoc/AdhocUpdateCreate'), component: () => import('@/views/ops/Template/Adhoc/AdhocUpdateCreate'),
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('route.updateAdhoc'), title: i18n.t('ops.AdhocUpdate'),
permissions: ['ops.change_adhoc'], permissions: ['ops.change_adhoc'],
activeMenu: '/workbench/ops/templates' activeMenu: '/workbench/ops/templates'
} }

View File

@@ -52,6 +52,9 @@ export const getChangeSecretFields = () => {
rules: [ rules: [
{ required: false } { required: false }
], ],
el: {
baseUrl: '/api/v1/assets/assets/?change_secret_enabled=true'
},
label: i18n.t('xpack.Asset') label: i18n.t('xpack.Asset')
}, },
nodes: { nodes: {

View File

@@ -5,6 +5,8 @@
<script> <script>
import { GenericCreateUpdatePage } from '@/layout/components' import { GenericCreateUpdatePage } from '@/layout/components'
import { getChangeSecretFields } from '@/views/accounts/AccountChangeSecret/fields' import { getChangeSecretFields } from '@/views/accounts/AccountChangeSecret/fields'
import { AssetSelect } from '@/components'
import i18n from '@/i18n/i18n'
export default { export default {
name: 'AccountPushCreateUpdate', name: 'AccountPushCreateUpdate',
@@ -24,13 +26,6 @@ export default {
}, },
url: '/api/v1/accounts/push-account-automations/', url: '/api/v1/accounts/push-account-automations/',
fields: [ fields: [
// ['触发方式', ['triggers']],
// [this.$t('assets.Account'), [
// 'username', 'dynamic_username',
// 'secret_type', 'secret_strategy', 'secret',
// 'password_rules', 'ssh_key', 'passphrase'
// ]],
// [this.$t('common.Action'), ['action', 'ssh_key_change_strategy']],
[this.$t('common.Basic'), ['name']], [this.$t('common.Basic'), ['name']],
[this.$t('xpack.Asset'), ['accounts', 'assets', 'nodes']], [this.$t('xpack.Asset'), ['accounts', 'assets', 'nodes']],
[ [
@@ -46,6 +41,17 @@ export default {
], ],
fieldsMeta: { fieldsMeta: {
...getChangeSecretFields(), ...getChangeSecretFields(),
assets: {
type: 'assetSelect',
component: AssetSelect,
rules: [
{ required: false }
],
el: {
baseUrl: '/api/v1/assets/assets/?push_account_enabled=true'
},
label: i18n.t('xpack.Asset')
},
username: { username: {
hidden: (formValue) => formValue['dynamic_username'] hidden: (formValue) => formValue['dynamic_username']
}, },

View File

@@ -25,7 +25,7 @@ export default {
tableConfig: { tableConfig: {
url: '/api/v1/accounts/account-templates/', url: '/api/v1/accounts/account-templates/',
columns: null, columns: null,
columnsExclude: ['specific'], columnsExclude: ['spec_info'],
columnsShow: { columnsShow: {
min: ['name', 'actions'], min: ['name', 'actions'],
default: ['name', 'username', 'secret_type', 'has_secret', 'privileged', 'actions'] default: ['name', 'username', 'secret_type', 'has_secret', 'privileged', 'actions']

View File

@@ -27,7 +27,8 @@ export default {
iShowTree: true, iShowTree: true,
tableConfig: { tableConfig: {
url: '/api/v1/accounts/accounts/', url: '/api/v1/accounts/accounts/',
hasLeftActions: true hasLeftActions: true,
hasImport: true
}, },
treeSetting: { treeSetting: {
showMenu: false, showMenu: false,

View File

@@ -49,10 +49,6 @@ export default {
accounts: { accounts: {
fields: ['username_group'] fields: ['username_group']
}, },
priority: {
// helpText: '优先级可选范围为1-1001最低优先级100最高优先级'
// helpText: this.$t('assets.CommandFilterRulePriorityHelpText')
},
action: { action: {
}, },
command_groups: { command_groups: {

View File

@@ -64,10 +64,6 @@ export default {
}, },
helpText: '' helpText: ''
}, },
priority: {
// helpText: '优先级可选范围为1-1001最低优先级100最高优先级'
// helpText: this.$t('assets.CommandFilterRulePriorityHelpText')
},
reviewers: { reviewers: {
hidden: (item) => item.action !== 2, hidden: (item) => item.action !== 2,
rules: [rules.RequiredChange], rules: [rules.RequiredChange],

View File

@@ -23,11 +23,11 @@ export default {
component: AssetSelect, component: AssetSelect,
label: this.$t('assets.Assets'), label: this.$t('assets.Assets'),
el: { el: {
value: [] value: [],
baseUrl: '/api/v1/assets/assets/?domain_enabled=true'
} }
} }
}, },
url: '/api/v1/assets/domains/' url: '/api/v1/assets/domains/'
} }
} }

View File

@@ -32,7 +32,7 @@ export default {
}, },
initial: { initial: {
comment: '', comment: '',
charset: 'utf8', charset: 'utf-8',
category_type: ['host', 'linux'], category_type: ['host', 'linux'],
automation: { automation: {
ansible_enabled: true ansible_enabled: true

View File

@@ -214,7 +214,6 @@ export default {
showRefresh: true, showRefresh: true,
showMenu: false, showMenu: false,
showSearch: true, showSearch: true,
customTreeHeader: false,
check: { check: {
enable: true enable: true
}, },

View File

@@ -31,7 +31,7 @@ export default {
}, },
data() { data() {
return { return {
title: '内置变量', title: this.$t('ops.BuiltinVariable'),
variables: {} variables: {}
} }
}, },

View File

@@ -1,7 +1,7 @@
<template> <template>
<Dialog <Dialog
v-if="iVisible" v-if="iVisible"
title="新建文件" :title="$tc('ops.NewFile')"
:visible.sync="iVisible" :visible.sync="iVisible"
width="20%" width="20%"
top="1vh" top="1vh"
@@ -10,7 +10,7 @@
@confirm="onConfirm" @confirm="onConfirm"
> >
<el-form> <el-form>
<el-form-item label="名称"> <el-form-item :label="$tc('common.DisplayName')">
<el-input v-model="name" /> <el-input v-model="name" />
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@@ -10,7 +10,7 @@
> >
<el-form ref="form" label-width="80px"> <el-form ref="form" label-width="80px">
<el-form-item label="文件名"> <el-form-item :label="$tc('common.Filename')">
<el-input v-model="newFileName" /> <el-input v-model="newFileName" />
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@@ -105,7 +105,6 @@ export default {
showCreate: false, showCreate: false,
showUpdate: false, showUpdate: false,
showSearch: false, showSearch: false,
customTreeHeader: false,
callback: { callback: {
onSelected: function(event, treeNode) { onSelected: function(event, treeNode) {
console.log(treeNode) console.log(treeNode)

View File

@@ -1,6 +1,6 @@
<template> <template>
<Dialog <Dialog
title="离线上传" :title="$tc('common.OfflineUpload')"
v-bind="$attrs" v-bind="$attrs"
@confirm="onSubmit" @confirm="onSubmit"
v-on="$listeners" v-on="$listeners"
@@ -83,6 +83,10 @@ export default {
const error = err.response.data?.error || this.$t('terminal.UploadFailed') const error = err.response.data?.error || this.$t('terminal.UploadFailed')
this.$message.error(error) this.$message.error(error)
}) })
setTimeout(() => {
this.$refs.upload.clearFiles()
}, 400)
} }
} }
} }

View File

@@ -19,6 +19,9 @@ export default {
return { return {
columnsMeta: { columnsMeta: {
name: { name: {
formatter: (row) => <span>{row.name}</span>
},
asset: {
label: this.$t('assets.Asset'), label: this.$t('assets.Asset'),
formatter: (row) => <span>{row.asset.name}</span> formatter: (row) => <span>{row.asset.name}</span>
} }

View File

@@ -70,7 +70,7 @@ export default {
} }
}, },
date_updated: { date_updated: {
label: '日期' label: this.$t('ops.date')
}, },
actions: { actions: {
formatterArgs: { formatterArgs: {

View File

@@ -49,7 +49,6 @@ export default {
} }
}, },
ANNOUNCEMENT_ENABLED: { ANNOUNCEMENT_ENABLED: {
// label: '公告',
component: Announcement component: Announcement
} }
}, },

View File

@@ -101,7 +101,7 @@ export default {
content.push(h('p', null, item),) content.push(h('p', null, item),)
}) })
this.$msgbox({ this.$msgbox({
title: '相关受理人', title: this.$t('tickets.RelevantAssignees'),
customClass: 'acceptance', customClass: 'acceptance',
message: h('p', null, content), message: h('p', null, content),
showCancelButton: false, showCancelButton: false,

View File

@@ -53,7 +53,6 @@ export default {
showMenu: false, showMenu: false,
showRefresh: true, showRefresh: true,
showSearch: false, showSearch: false,
customTreeHeader: false,
treeUrl: '', treeUrl: '',
check: { check: {
enable: true enable: true

21370
yarn.lock

File diff suppressed because it is too large Load Diff