From 42feb4b86219082d942a53612c541354c86012b7 Mon Sep 17 00:00:00 2001 From: dagongren <53748875+wang-liang0615@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:59:16 +0800 Subject: [PATCH] feat(cmdb-ui):service tree grant (#425) --- .../components/CMDBFilterComp/constants.js | 82 +- .../components/CMDBFilterComp/expression.vue | 678 ++-- .../src/components/CMDBFilterComp/index.vue | 598 +-- .../src/components/SplitPane/SplitPane.vue | 362 +- cmdb-ui/src/components/SplitPane/index.js | 4 +- cmdb-ui/src/components/SplitPane/index.less | 96 +- cmdb-ui/src/lang/en.js | 1 + cmdb-ui/src/lang/zh.js | 1 + cmdb-ui/src/modules/cmdb/api/CIType.js | 7 + .../cmdb/components/cmdbGrant/ciTypeGrant.vue | 300 +- .../cmdb/components/cmdbGrant/constants.js | 30 +- .../cmdb/components/cmdbGrant/grantComp.vue | 686 ++-- .../cmdb/components/cmdbGrant/grantModal.vue | 124 +- .../cmdb/components/cmdbGrant/index.vue | 114 +- .../components/cmdbGrant/readCheckbox.vue | 178 +- .../components/cmdbGrant/readGrantModal.vue | 417 +-- .../cmdbGrant/relationViewGrant.vue | 196 +- .../cmdb/components/cmdbGrant/revokeModal.vue | 122 + .../cmdbGrant/typeRelationGrant.vue | 200 +- .../cmdb/components/cmdbGrant/utils.js | 8 +- .../cmdb/components/searchForm/SearchForm.vue | 606 +-- cmdb-ui/src/modules/cmdb/lang/en.js | 995 ++--- cmdb-ui/src/modules/cmdb/lang/zh.js | 993 ++--- .../views/ci/modules/CreateInstanceForm.vue | 824 +++-- .../cmdb/views/ci/modules/ciDetailTab.vue | 780 ++-- .../src/modules/cmdb/views/ci_types/index.vue | 2118 +++++------ .../cmdb/views/relation_views/index.vue | 3243 +++++++++-------- .../relation_views/modules/AddTableModal.vue | 474 +-- .../relation_views/modules/ContextMenu.vue | 419 ++- .../modules/ReadPermissionsModal.vue | 105 + .../cmdb/views/resource_search/index.vue | 1066 +++--- .../setting/components/employeeTreeSelect.vue | 203 +- 32 files changed, 8378 insertions(+), 7652 deletions(-) create mode 100644 cmdb-ui/src/modules/cmdb/components/cmdbGrant/revokeModal.vue create mode 100644 cmdb-ui/src/modules/cmdb/views/relation_views/modules/ReadPermissionsModal.vue diff --git a/cmdb-ui/src/components/CMDBFilterComp/constants.js b/cmdb-ui/src/components/CMDBFilterComp/constants.js index 90fbfa3..7087eb3 100644 --- a/cmdb-ui/src/components/CMDBFilterComp/constants.js +++ b/cmdb-ui/src/components/CMDBFilterComp/constants.js @@ -1,41 +1,41 @@ -import i18n from '@/lang' - -export const ruleTypeList = () => { - return [ - { value: 'and', label: i18n.t('cmdbFilterComp.and') }, - { value: 'or', label: i18n.t('cmdbFilterComp.or') }, - // { value: 'not', label: '非' }, - ] -} - -export const expList = () => { - return [ - { value: 'is', label: i18n.t('cmdbFilterComp.is') }, - { value: '~is', label: i18n.t('cmdbFilterComp.~is') }, - { value: 'contain', label: i18n.t('cmdbFilterComp.contain') }, - { value: '~contain', label: i18n.t('cmdbFilterComp.~contain') }, - { value: 'start_with', label: i18n.t('cmdbFilterComp.start_with') }, - { value: '~start_with', label: i18n.t('cmdbFilterComp.~start_with') }, - { value: 'end_with', label: i18n.t('cmdbFilterComp.end_with') }, - { value: '~end_with', label: i18n.t('cmdbFilterComp.~end_with') }, - { value: '~value', label: i18n.t('cmdbFilterComp.~value') }, // 为空的定义有点绕 - { value: 'value', label: i18n.t('cmdbFilterComp.value') }, - ] -} - -export const advancedExpList = () => { - return [ - { value: 'in', label: i18n.t('cmdbFilterComp.in') }, - { value: '~in', label: i18n.t('cmdbFilterComp.~in') }, - { value: 'range', label: i18n.t('cmdbFilterComp.range') }, - { value: '~range', label: i18n.t('cmdbFilterComp.~range') }, - { value: 'compare', label: i18n.t('cmdbFilterComp.compare') }, - ] -} - -export const compareTypeList = [ - { value: '1', label: '>' }, - { value: '2', label: '>=' }, - { value: '3', label: '<' }, - { value: '4', label: '<=' }, -] +import i18n from '@/lang' + +export const ruleTypeList = () => { + return [ + { value: 'and', label: i18n.t('cmdbFilterComp.and') }, + { value: 'or', label: i18n.t('cmdbFilterComp.or') }, + // { value: 'not', label: '非' }, + ] +} + +export const expList = () => { + return [ + { value: 'is', label: i18n.t('cmdbFilterComp.is') }, + { value: '~is', label: i18n.t('cmdbFilterComp.~is') }, + { value: 'contain', label: i18n.t('cmdbFilterComp.contain') }, + { value: '~contain', label: i18n.t('cmdbFilterComp.~contain') }, + { value: 'start_with', label: i18n.t('cmdbFilterComp.start_with') }, + { value: '~start_with', label: i18n.t('cmdbFilterComp.~start_with') }, + { value: 'end_with', label: i18n.t('cmdbFilterComp.end_with') }, + { value: '~end_with', label: i18n.t('cmdbFilterComp.~end_with') }, + { value: '~value', label: i18n.t('cmdbFilterComp.~value') }, // 为空的定义有点绕 + { value: 'value', label: i18n.t('cmdbFilterComp.value') }, + ] +} + +export const advancedExpList = () => { + return [ + { value: 'in', label: i18n.t('cmdbFilterComp.in') }, + { value: '~in', label: i18n.t('cmdbFilterComp.~in') }, + { value: 'range', label: i18n.t('cmdbFilterComp.range') }, + { value: '~range', label: i18n.t('cmdbFilterComp.~range') }, + { value: 'compare', label: i18n.t('cmdbFilterComp.compare') }, + ] +} + +export const compareTypeList = [ + { value: '1', label: '>' }, + { value: '2', label: '>=' }, + { value: '3', label: '<' }, + { value: '4', label: '<=' }, +] diff --git a/cmdb-ui/src/components/CMDBFilterComp/expression.vue b/cmdb-ui/src/components/CMDBFilterComp/expression.vue index aa499b4..2b0fbef 100644 --- a/cmdb-ui/src/components/CMDBFilterComp/expression.vue +++ b/cmdb-ui/src/components/CMDBFilterComp/expression.vue @@ -1,332 +1,346 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/components/CMDBFilterComp/index.vue b/cmdb-ui/src/components/CMDBFilterComp/index.vue index acd28a9..0a0f327 100644 --- a/cmdb-ui/src/components/CMDBFilterComp/index.vue +++ b/cmdb-ui/src/components/CMDBFilterComp/index.vue @@ -1,296 +1,302 @@ - - - - - - - + + + + + + + diff --git a/cmdb-ui/src/components/SplitPane/SplitPane.vue b/cmdb-ui/src/components/SplitPane/SplitPane.vue index e0e6440..8a7a21d 100644 --- a/cmdb-ui/src/components/SplitPane/SplitPane.vue +++ b/cmdb-ui/src/components/SplitPane/SplitPane.vue @@ -1,179 +1,183 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/components/SplitPane/index.js b/cmdb-ui/src/components/SplitPane/index.js index 6443dbd..aae5c29 100644 --- a/cmdb-ui/src/components/SplitPane/index.js +++ b/cmdb-ui/src/components/SplitPane/index.js @@ -1,2 +1,2 @@ -import SplitPane from './SplitPane' -export default SplitPane +import SplitPane from './SplitPane' +export default SplitPane diff --git a/cmdb-ui/src/components/SplitPane/index.less b/cmdb-ui/src/components/SplitPane/index.less index 4cd81c9..4bf5d7d 100644 --- a/cmdb-ui/src/components/SplitPane/index.less +++ b/cmdb-ui/src/components/SplitPane/index.less @@ -1,48 +1,48 @@ -.split-pane { - height: 100%; - display: flex; -} - -.split-pane .pane-two { - flex: 1; -} - -.split-pane .pane-trigger { - user-select: none; -} - -.split-pane.row .pane-one { - width: 20%; - height: 100%; - // overflow-y: auto; -} - -.split-pane.column .pane { - width: 100%; -} - -.split-pane.row .pane-trigger { - width: 8px; - height: 100%; - cursor: e-resize; - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAPCAYAAADDNm69AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAeSURBVBhXY/4PBMzMzA379u1rANFMDGhgGAswMAAAn6EH6K9ktYAAAAAASUVORK5CYII=') - 1px 50% no-repeat #f0f2f5; -} - -.split-pane .collapse-btn { - width: 25px; - height: 70px; - position: absolute; - right: 8px; - top: calc(50% - 35px); - background-color: #f0f2f5; - border-color: transparent; - border-radius: 8px 0px 0px 8px; - .anticon { - color: #7cb0fe; - } -} - -.split-pane .spliter-wrap { - position: relative; -} +.split-pane { + height: 100%; + display: flex; +} + +.split-pane .pane-two { + flex: 1; +} + +.split-pane .pane-trigger { + user-select: none; +} + +.split-pane.row .pane-one { + width: 20%; + height: 100%; + // overflow-y: auto; +} + +.split-pane.column .pane { + width: 100%; +} + +.split-pane.row .pane-trigger { + width: 8px; + height: 100%; + cursor: e-resize; + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAPCAYAAADDNm69AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAeSURBVBhXY/4PBMzMzA379u1rANFMDGhgGAswMAAAn6EH6K9ktYAAAAAASUVORK5CYII=') + 1px 50% no-repeat #f0f2f5; +} + +.split-pane .collapse-btn { + width: 25px; + height: 70px; + position: absolute; + right: 8px; + top: calc(50% - 35px); + background-color: #f0f2f5; + border-color: transparent; + border-radius: 8px 0px 0px 8px; + .anticon { + color: #7cb0fe; + } +} + +.split-pane .spliter-wrap { + position: relative; +} diff --git a/cmdb-ui/src/lang/en.js b/cmdb-ui/src/lang/en.js index bd2de11..7663723 100644 --- a/cmdb-ui/src/lang/en.js +++ b/cmdb-ui/src/lang/en.js @@ -25,6 +25,7 @@ export default { deleting: 'Deleting', deletingTip: 'Deleting, total of {total}, {successNum} succeeded, {errorNum} failed', grant: 'Grant', + revoke: 'Revoke', login_at: 'Login At', logout_at: 'Logout At', createSuccess: 'Create Success', diff --git a/cmdb-ui/src/lang/zh.js b/cmdb-ui/src/lang/zh.js index 42c5eae..253d788 100644 --- a/cmdb-ui/src/lang/zh.js +++ b/cmdb-ui/src/lang/zh.js @@ -25,6 +25,7 @@ export default { deleting: '正在删除', deletingTip: '正在删除,共{total}个,成功{successNum}个,失败{errorNum}个', grant: '授权', + revoke: '回收', login_at: '登录时间', logout_at: '登出时间', createSuccess: '创建成功', diff --git a/cmdb-ui/src/modules/cmdb/api/CIType.js b/cmdb-ui/src/modules/cmdb/api/CIType.js index 6a323a7..6e60735 100644 --- a/cmdb-ui/src/modules/cmdb/api/CIType.js +++ b/cmdb-ui/src/modules/cmdb/api/CIType.js @@ -223,3 +223,10 @@ export function deleteCiTypeInheritance(data) { data }) } + +export function getCITypeIcons() { + return axios({ + url: '/v0.1/ci_types/icons', + method: 'GET', + }) +} diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue index d37b5a9..85bcaa5 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue @@ -1,150 +1,150 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/constants.js b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/constants.js index 631e5da..726e83f 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/constants.js +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/constants.js @@ -1,15 +1,15 @@ -import i18n from '@/lang' - -export const permMap = () => { - return { - read: i18n.t('view'), - add: i18n.t('new'), - create: i18n.t('new'), - update: i18n.t('update'), - delete: i18n.t('delete'), - config: i18n.t('cmdb.components.config'), - grant: i18n.t('grant'), - 'read_attr': i18n.t('cmdb.components.readAttribute'), - 'read_ci': i18n.t('cmdb.components.readCI') - } -} +import i18n from '@/lang' + +export const permMap = () => { + return { + read: i18n.t('view'), + add: i18n.t('new'), + create: i18n.t('new'), + update: i18n.t('update'), + delete: i18n.t('delete'), + config: i18n.t('cmdb.components.config'), + grant: i18n.t('grant'), + 'read_attr': i18n.t('cmdb.components.readAttribute'), + 'read_ci': i18n.t('cmdb.components.readCI') + } +} diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue index e9f2756..848ebae 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue @@ -1,343 +1,343 @@ - - - - - - - + + + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue index 5f3f8e7..11acfa8 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue @@ -1,57 +1,67 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/index.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/index.vue index 3347389..c279817 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/index.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/index.vue @@ -1,57 +1,57 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readCheckbox.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readCheckbox.vue index 24826f6..99160fb 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readCheckbox.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readCheckbox.vue @@ -1,89 +1,89 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readGrantModal.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readGrantModal.vue index e3b5e6d..74a6528 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readGrantModal.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/readGrantModal.vue @@ -1,205 +1,212 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/relationViewGrant.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/relationViewGrant.vue index 395315c..ddddb5a 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/relationViewGrant.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/relationViewGrant.vue @@ -1,98 +1,98 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/revokeModal.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/revokeModal.vue new file mode 100644 index 0000000..bd6eb1e --- /dev/null +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/revokeModal.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/typeRelationGrant.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/typeRelationGrant.vue index 120e2a4..2f5fdb3 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/typeRelationGrant.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/typeRelationGrant.vue @@ -1,100 +1,100 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/utils.js b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/utils.js index 8beb5f0..c299795 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/utils.js +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/utils.js @@ -1,4 +1,4 @@ -export const getCurrentRowStyle = ({ row }, addedRids) => { - const idx = addedRids.findIndex(item => item.rid === row.rid) - return idx > -1 ? 'background-color:#E0E7FF!important' : '' -} +export const getCurrentRowStyle = ({ row }, addedRids) => { + const idx = addedRids.findIndex(item => item.rid === row.rid) + return idx > -1 ? 'background-color:#E0E7FF!important' : '' +} diff --git a/cmdb-ui/src/modules/cmdb/components/searchForm/SearchForm.vue b/cmdb-ui/src/modules/cmdb/components/searchForm/SearchForm.vue index a5e58e0..9394345 100644 --- a/cmdb-ui/src/modules/cmdb/components/searchForm/SearchForm.vue +++ b/cmdb-ui/src/modules/cmdb/components/searchForm/SearchForm.vue @@ -1,301 +1,305 @@ - - - - - - + + + + + + diff --git a/cmdb-ui/src/modules/cmdb/lang/en.js b/cmdb-ui/src/modules/cmdb/lang/en.js index 56e099a..820ef4a 100644 --- a/cmdb-ui/src/modules/cmdb/lang/en.js +++ b/cmdb-ui/src/modules/cmdb/lang/en.js @@ -1,492 +1,503 @@ -const cmdb_en = { - relation: 'Relation', - attribute: 'Attributes', - menu: { - views: 'Views', - config: 'Configuration', - backend: 'Management', - ciTable: 'Resource Views', - ciTree: 'Tree Views', - ciSearch: 'Search', - adCIs: 'AutoDiscovery Pool', - preference: 'Preference', - batchUpload: 'Batch Import', - citypeManage: 'Modeling', - backendManage: 'Backend', - customDashboard: 'Custom Dashboard', - serviceTreeDefine: 'Service Tree', - citypeRelation: 'CIType Relation', - operationHistory: 'Operation Audit', - relationType: 'Relation Type', - ad: 'AutoDiscovery', - cidetail: 'CI Detail' - }, - ciType: { - ciType: 'CIType', - attributes: 'Attributes', - relation: 'Relation', - trigger: 'Triggers', - attributeAD: 'Attributes AutoDiscovery', - relationAD: 'Relation AutoDiscovery', - grant: 'Grant', - addGroup: 'New Group', - editGroup: 'Edit Group', - group: 'Group', - attributeLibray: 'Attribute Library', - addCITypeInGroup: 'Add a new CIType to the group', - addCIType: 'Add CIType', - editGroupName: 'Edit group name', - deleteGroup: 'Delete this group', - CITypeName: 'Name(English)', - English: 'English', - inputAttributeName: 'Please enter the attribute name', - attributeNameTips: 'It cannot start with a number, it can be English numbers and underscores (_)', - editCIType: 'Edit CIType', - defaultSort: 'Default sort', - selectDefaultOrderAttr: 'Select default sorting attributes', - asec: 'Forward order', - desc: 'Reverse order', - uniqueKey: 'Uniquely Identifies', - uniqueKeySelect: 'Please select a unique identifier', - notfound: 'Can\'t find what you want?', - cannotDeleteGroupTips: 'There is data under this group and cannot be deleted!', - confirmDeleteGroup: 'Are you sure you want to delete group [{groupName}]?', - confirmDeleteCIType: 'Are you sure you want to delete model [{typeName}]?', - uploading: 'Uploading', - uploadFailed: 'Upload failed, please try again later', - addPlugin: 'New plugin', - deletePlugin: 'Delete plugin', - confirmDeleteADT: 'Do you confirm to delete [{pluginName}]', - attributeMap: 'Attribute mapping', - autoDiscovery: 'AutoDiscovery', - node: 'Node', - adExecConfig: 'Execute configuration', - adExecTarget: 'Execute targets', - oneagentIdTips: 'Please enter the hexadecimal OneAgent ID starting with 0x', - selectFromCMDBTips: 'Select from CMDB ', - adAutoInLib: 'Save as CI auto', - adInterval: 'Collection frequency', - byInterval: 'by interval', - allNodes: 'All nodes', - specifyNodes: 'Specify Node', - specifyNodesTips: 'Please fill in the specify node!', - username: 'Username', - password: 'Password', - link: 'Link', - list: 'List', - listTips: 'The value of the field is one or more, and the type of the value returned by the interface is list.', - computeForAllCITips: 'All CI trigger computes', - confirmcomputeForAllCITips: 'Confirm triggering computes for all CIs?', - isUnique: 'Is it unique', - unique: 'Unique', - isChoice: 'Choiced', - defaultShow: 'Default Display', - defaultShowTips: 'The CI instance table displays this field by default', - isSortable: 'Sortable', - isIndex: 'Indexed', - index: 'Index', - indexTips: 'Fields can be used for retrieval to speed up queries', - confirmDelete: 'Confirm to delete [{name}]?', - confirmDelete2: 'Confirm to delete?', - computeSuccess: 'Triggered successfully!', - basicConfig: 'Basic Settings', - AttributeName: 'Name(English)', - DataType: 'Data Type', - defaultValue: 'Default value', - autoIncID: 'Auto-increment ID', - customTime: 'Custom time', - advancedSettings: 'Advanced Settings', - font: 'Font', - color: 'Color', - choiceValue: 'Predefined value', - computedAttribute: 'Computed Attribute', - computedAttributeTips: 'The value of this attribute is calculated through an expression constructed from other attributes of the CIType or by executing a piece of code. The reference method of the attribute is: {{ attribute name }}', - addAttribute: 'New attribute', - existedAttributes: 'Already have attributes', - editAttribute: 'Edit attribute', - addAttributeTips1: 'If sorting is selected, it must also be selected!', - uniqueConstraint: 'Unique Constraint', - up: 'Move up', - down: 'Move down', - selectAttribute: 'Select Attribute', - groupExisted: 'Group name already exists', - attributeSortedTips: 'Attributes in other groups cannot be sorted. If you need to sort, please drag them to a custom group first!', - buildinAttribute: 'built-in attributes', - expr: 'Expression', - code: 'Code', - apply: 'apply', - continueAdd: 'Keep adding', - filter: 'Filter', - choiceOther: 'Other CIType Attributes', - choiceWebhookTips: 'The returned results are filtered by fields, and the hierarchical nesting is separated by ##, such as k1##k2. The web request returns {k1: [{k2: 1}, {k2: 2}]}, and the parsing result is [1, 2 ]', - selectCIType: 'Please select a CMDB CIType', - selectCITypeAttributes: 'Please select CIType attributes', - selectAttributes: 'Please select attributes', - choiceScriptDemo: 'class ChoiceValue(object):\n @staticmethod\n def values():\n """\n Execution entry, returns predefined value\n :return: Returns a list, the type of the value is the same as the type of the attribute\n For example:\n return ["online", "offline"]\n """\n return []', - valueExisted: 'The current value already exists!', - addRelation: 'Add Relation', - sourceCIType: 'Source CIType', - sourceCITypeTips: 'Please select Source CIType', - dstCIType: 'Target CIType', - dstCITypeTips: 'Please select target CIType', - relationType: 'Relation Type', - relationTypeTips: 'Please select relation type', - isParent: 'is parent', - relationConstraint: 'Constraints', - relationConstraintTips: 'please select a relationship constraint', - one2Many: 'One to Many', - one2One: 'One to One', - many2Many: 'Many to Many', - basicInfo: 'Basic Information', - nameInputTips: 'Please enter name', - triggerDataChange: 'Data changes', - triggerDate: 'Date attribute', - triggerEnable: 'Turn on', - descInput: 'Please enter remarks', - triggerCondition: 'Triggering conditions', - addInstance: 'Add new instance', - deleteInstance: 'Delete instance', - changeInstance: 'Instance changes', - selectMutipleAttributes: 'Please select attributes (multiple selections)', - selectSingleAttribute: 'Please select an attribute (single choice)', - beforeDays: 'ahead of time', - days: 'Days', - notifyAt: 'Send time', - notify: 'Notify', - triggerAction: 'Trigger action', - receivers: 'Recipients', - emailTips: 'Please enter your email address, separate multiple email addresses with ;', - customEmail: 'Custom recipients', - notifySubject: 'Notification title', - notifySubjectTips: 'Please enter notification title', - notifyContent: 'Content', - notifyMethod: 'Notify methods', - botSelect: 'Please select a robot', - refAttributeTips: 'The title and content can reference the attribute value of the CIType. The reference method is: {{ attr_name }}', - webhookRefAttributeTips: 'Request parameters can reference the attribute value of the model. The reference method is: {{ attr_name }}', - newTrigger: 'Add trigger', - editTriggerTitle: 'Edit trigger {name}', - newTriggerTitle: 'Add trigger {name}', - confirmDeleteTrigger: 'Are you sure to delete this trigger?', - int: 'Integer', - float: 'Float', - text: 'Text', - datetime: 'DateTime', - date: 'Date', - time: 'Time', - json: 'JSON', - event: 'Event', - reg: 'Regex', - isInherit: 'Inherit', - inheritType: 'Inherit Type', - inheritTypePlaceholder: 'Please select inherit types', - inheritFrom: 'inherit from {name}', - groupInheritFrom: 'Please go to the {name} for modification' - }, - components: { - unselectAttributes: 'Unselected', - selectAttributes: 'Selected', - downloadCI: 'Export data', - filename: 'Filename', - filenameInputTips: 'Please enter filename', - saveType: 'Save type', - saveTypeTips: 'Please select save type', - xlsx: 'Excel workbook (*.xlsx)', - csv: 'CSV (comma separated) (*.csv)', - html: 'Web page (*.html)', - xml: 'XML data (*.xml)', - txt: 'Text file (tab delimited) (*.txt)', - grantUser: 'Grant User/Department', - grantRole: 'Grant Role', - confirmRevoke: 'Confirm to delete the [Authorization] permission of [{name}]?', - readAttribute: 'View Attributes', - readCI: 'View CIs', - config: 'Configuration', - ciTypeGrant: 'Grant CIType', - ciGrant: 'Grant CI', - attributeGrant: 'Grant Attribute', - relationGrant: 'Grant Relation', - perm: 'Permissions', - all: 'All', - customize: 'Customize', - none: 'None', - customizeFilterName: 'Please enter a custom filter name', - colorPickerError: 'Initialization color format error, use #fff or rgb format', - example: 'Example value', - aliyun: 'aliyun', - tencentcloud: 'Tencent Cloud', - huaweicloud: 'Huawei Cloud', - beforeChange: 'Before change', - afterChange: 'After change', - noticeContentTips: 'Please enter notification content', - saveQuery: 'Save Filters', - pleaseSearch: 'Please search', - conditionFilter: 'Conditional filtering', - attributeDesc: 'Attribute Description', - ciSearchTips: '1. JSON attributes cannot be searched
2. If the search content includes commas, they need to be escaped,
3. Only index attributes are searched, non-index attributes use conditional filtering', - ciSearchTips2: 'For example: q=hostname:*0.0.0.0*', - subCIType: 'Subscription CIType', - already: 'already', - not: 'not', - sub: 'subscription', - selectBelow: 'Please select below', - subSuccess: 'Subscription successful', - selectMethods: 'Please select a method', - noAuthRequest: 'No certification requested yet', - noParamRequest: 'No parameter certification yet', - requestParam: 'Request parameters', - param: 'Parameter{param}', - value: 'Value{value}', - clear: 'Clear', - }, - batch: { - downloadFailed: 'Download failed', - unselectCIType: 'No CIType selected yet', - pleaseUploadFile: 'Please upload files', - batchUploadCanceled: 'Batch upload canceled', - selectCITypeTips: 'Please select CIType', - downloadTemplate: 'Download Template', - drawTips: 'Click or drag files here to upload!', - supportFileTypes: 'Supported file types: xls, xlsx', - uploadResult: 'Upload results', - total: 'total', - successItems: 'items, succeeded', - failedItems: 'items, failed', - items: 'items', - errorTips: 'Error message', - requestFailedTips: 'An error occurred with the request, please try again later', - requestSuccessTips: 'Upload completed', - }, - preference: { - mySub: 'My Subscription', - sub: 'Subscribe', - cancelSub: 'Unsubscribe', - editSub: 'Edit subscription', - peopleSub: ' people subscribed', - noSub: 'No subscribed', - cancelSubSuccess: 'Unsubscribe successfully', - confirmcancelSub: 'Are you sure to cancel your subscription?', - confirmcancelSub2: 'Are you sure you want to unsubscribe {name}?', - of: 'of', - hoursAgo: 'hours ago', - daysAgo: 'days ago', - monthsAgo: 'month ago', - yearsAgo: 'years ago', - just: 'just now', - }, - custom_dashboard: { - charts: 'Chart', - newChart: 'Add Chart', - editChart: 'Edit Chart', - title: 'Title', - titleTips: 'Please enter a chart title', - calcIndicators: 'Counter', - dimensions: 'Dimensions', - selectDimensions: 'Please select a dimension', - quantity: 'Quantity', - childCIType: 'Relational CIType', - level: 'Level', - levelTips: 'Please enter the relationship level', - preview: 'Preview', - showIcon: 'Display icon', - chartType: 'Chart Type', - dataFilter: 'Data Filtering', - format: 'Formats', - fontColor: 'Font Color', - backgroundColor: 'Background', - chartColor: 'Chart Color', - chartLength: 'Length', - barType: 'Bar Type', - stackedBar: 'Stacked Bar', - multipleSeriesBar: 'Multiple Series Bar ', - axis: 'Axis', - direction: 'Direction', - lowerShadow: 'Lower Shadow', - count: 'Indicator', - bar: 'Bar', - line: 'Line', - pie: 'Pie', - table: 'Table', - default: 'default', - relation: 'Relation', - noCustomDashboard: 'The administrator has not customized the dashboard yet', - }, - preference_relation: { - newServiceTree: 'Add ServiceTree', - serviceTreeName: 'Name', - public: 'Public', - saveLayout: 'Save Layout', - childNodesNotFound: 'There are no child nodes and no business relationship can be formed. Please select again!', - tips1: 'Cannot form a view with the currently selected node, please select again!', - tips2: 'Please enter the new serviceTree name!', - tips3: 'Please select at least two nodes!', - }, - history: { - ciChange: 'CI', - relationChange: 'Relation', - ciTypeChange: 'CIType', - triggerHistory: 'Triggers', - opreateTime: 'Operate Time', - user: 'User', - userTips: 'Enter filter username', - filter: 'Search', - filterOperate: 'fitler operation', - attribute: 'Attribute', - old: 'Old', - new: 'New', - noUpdate: 'No update', - itemsPerPage: '/page', - triggerName: 'Name', - event: 'Event', - action: 'Actoin', - status: 'Status', - done: 'Done', - undone: 'Undone', - triggerTime: 'Trigger Time', - totalItems: '{total} records in total', - pleaseSelect: 'Please select', - startTime: 'Start Time', - endTime: 'End Time', - deleteCIType: 'Delete CIType', - addCIType: 'Add CIType', - updateCIType: 'Update CIType', - addAttribute: 'Add Attribute', - updateAttribute: 'Update Attribute', - deleteAttribute: 'Delete Attribute', - addTrigger: 'Add Trigger', - updateTrigger: 'Update Trigger', - deleteTrigger: 'Delete Trigger', - addUniqueConstraint: 'Add Unique Constraint', - updateUniqueConstraint: 'Update Unique Constraint', - deleteUniqueConstraint: 'Delete Unique Constraint', - addRelation: 'Add Relation', - deleteRelation: 'Delete Relation', - noModifications: 'No Modifications', - attr: 'attribute', - attrId: 'attribute id', - changeDescription: 'attribute id: {attr_id}, {before_days} day(s) in advance, Subject: {subject}\nContent: {body}\nNotify At: {notify_at}' - }, - relation_type: { - addRelationType: 'New', - nameTips: 'Please enter a type name', - }, - ad: { - upload: 'Import', - download: 'Export', - accept: 'Accept', - acceptBy: 'Accept By', - acceptTime: 'Accept Time', - confirmAccept: 'Confirm Accept?', - acceptSuccess: 'Accept successfully', - isAccept: 'Is accept', - deleteADC: 'Confirm to delete this data?', - batchDelete: 'Confirm to delete this data?', - agent: 'Built-in & Plug-ins', - snmp: 'Network Devices', - http: 'Public Clouds', - rule: 'AutoDiscovery Rules', - timeout: 'Timeout error', - mode: 'Mode', - collectSettings: 'Collection Settings', - updateFields: 'Update Field', - pluginScript: `# -*- coding:utf-8 -*- - - import json - - - class AutoDiscovery(object): - - @property - def unique_key(self): - """ - - :return: Returns the name of a unique attribute - """ - return - - @staticmethod - def attributes(): - """ - Define attribute fields - :return: Returns a list of attribute fields. The list items are (name, type, description). The name must be in English. - type: String Integer Float Date DateTime Time JSON - For example: - return [ - ("ci_type", "String", "CIType name"), - ("private_ip", "String", "Internal IP, multiple values separated by commas") - ] - """ - return [] - - @staticmethod - def run(): - """ - Execution entry, returns collected attribute values - :return: - Returns a list, the list item is a dictionary, the dictionary key is the attribute name, and the value is the attribute value - For example: - return [dict(ci_type="server", private_ip="192.168.1.1")] - """ - return [] - - - if __name__ == "__main__": - result = AutoDiscovery().run() - if isinstance(result, list): - print("AutoDiscovery::Result::{}".format(json.dumps(result))) - else: - print("ERROR: The collection return must be a list") - `, - server: 'Server', - vserver: 'VServer', - nic: 'NIC', - disk: 'harddisk', - }, - ci: { - attributeDesc: 'Attribute Description', - selectRows: 'Select: {rows} items', - addRelation: 'Add Relation', - all: 'All', - batchUpdate: 'Batch Update', - batchUpdateConfirm: 'Are you sure you want to make batch updates?', - batchUpdateInProgress: 'Currently being updated in batches', - batchUpdateInProgress2: 'Updating in batches, {total} in total, {successNum} successful, {errorNum} failed', - batchDeleting: 'Deleting...', - batchDeleting2: 'Deleting {total} items in total, {successNum} items successful, {errorNum} items failed', - copyFailed: 'Copy failed', - noLevel: 'No hierarchical relationship!', - batchAddRelation: 'Batch Add Relation', - history: 'History', - topo: 'Topology', - table: 'Table', - m2mTips: 'The current CIType relationship is many-to-many, please go to the SerivceTree(relation view) to add or delete', - confirmDeleteRelation: 'Confirm to delete the relationship?', - tips1: 'Use commas to separate multiple values', - tips2: 'The field can be modified as needed. When the value is empty, the field will be left empty.', - tips3: 'Please select the fields that need to be modified', - tips4: 'At least one field must be selected', - tips5: 'Search name | alias', - tips6: 'Speed ​​up retrieval, full-text search possible, no need to use conditional filtering\n\n json currently does not support indexing \n\nText characters longer than 190 cannot be indexed', - tips7: 'The form of expression is a drop-down box, and the value must be in the predefined value', - tips8: 'Multiple values, such as intranet IP', - tips9: 'For front-end only', - tips10: 'Other attributes of the CIType are computed using expressions\n\nA code snippet computes the returned value.', - newUpdateField: 'Add a Attribute', - attributeSettings: 'Attribute Settings', - share: 'Share', - noPermission: 'No Permission' - }, - serviceTree: { - deleteNode: 'Delete Node', - tips1: 'For example: q=os_version:centos&sort=os_version', - tips2: 'Expression search', - alert1: 'The administrator has not configured the ServiceTree(relation view), or you do not have permission to access it!', - copyFailed: 'Copy failed', - deleteRelationConfirm: 'Confirm to remove selected {name} from current relationship?', - }, - tree: { - tips1: 'Please go to Preference page first to complete your subscription!', - subSettings: 'Settings', - } -} -export default cmdb_en +const cmdb_en = { + relation: 'Relation', + attribute: 'Attributes', + menu: { + views: 'Views', + config: 'Configuration', + backend: 'Management', + ciTable: 'Resource Views', + ciTree: 'Tree Views', + ciSearch: 'Search', + adCIs: 'AutoDiscovery Pool', + preference: 'Preference', + batchUpload: 'Batch Import', + citypeManage: 'Modeling', + backendManage: 'Backend', + customDashboard: 'Custom Dashboard', + serviceTreeDefine: 'Service Tree', + citypeRelation: 'CIType Relation', + operationHistory: 'Operation Audit', + relationType: 'Relation Type', + ad: 'AutoDiscovery', + cidetail: 'CI Detail' + }, + ciType: { + ciType: 'CIType', + attributes: 'Attributes', + relation: 'Relation', + trigger: 'Triggers', + attributeAD: 'Attributes AutoDiscovery', + relationAD: 'Relation AutoDiscovery', + grant: 'Grant', + addGroup: 'New Group', + editGroup: 'Edit Group', + group: 'Group', + attributeLibray: 'Attribute Library', + addCITypeInGroup: 'Add a new CIType to the group', + addCIType: 'Add CIType', + editGroupName: 'Edit group name', + deleteGroup: 'Delete this group', + CITypeName: 'Name(English)', + English: 'English', + inputAttributeName: 'Please enter the attribute name', + attributeNameTips: 'It cannot start with a number, it can be English numbers and underscores (_)', + editCIType: 'Edit CIType', + defaultSort: 'Default sort', + selectDefaultOrderAttr: 'Select default sorting attributes', + asec: 'Forward order', + desc: 'Reverse order', + uniqueKey: 'Unique Identifies', + uniqueKeySelect: 'Please select a unique identifier', + uniqueKeyTips: 'json/password/computed/choice can not be unique identifies', + notfound: 'Can\'t find what you want?', + cannotDeleteGroupTips: 'There is data under this group and cannot be deleted!', + confirmDeleteGroup: 'Are you sure you want to delete group [{groupName}]?', + confirmDeleteCIType: 'Are you sure you want to delete model [{typeName}]?', + uploading: 'Uploading', + uploadFailed: 'Upload failed, please try again later', + addPlugin: 'New plugin', + deletePlugin: 'Delete plugin', + confirmDeleteADT: 'Do you confirm to delete [{pluginName}]', + attributeMap: 'Attribute mapping', + autoDiscovery: 'AutoDiscovery', + node: 'Node', + adExecConfig: 'Execute configuration', + adExecTarget: 'Execute targets', + oneagentIdTips: 'Please enter the hexadecimal OneAgent ID starting with 0x', + selectFromCMDBTips: 'Select from CMDB ', + adAutoInLib: 'Save as CI auto', + adInterval: 'Collection frequency', + byInterval: 'by interval', + allNodes: 'All nodes', + specifyNodes: 'Specify Node', + specifyNodesTips: 'Please fill in the specify node!', + username: 'Username', + password: 'Password', + link: 'Link', + list: 'List', + listTips: 'The value of the field is one or more, and the type of the value returned by the interface is list.', + computeForAllCITips: 'All CI trigger computes', + confirmcomputeForAllCITips: 'Confirm triggering computes for all CIs?', + isUnique: 'Is it unique', + unique: 'Unique', + isChoice: 'Choiced', + defaultShow: 'Default Display', + defaultShowTips: 'The CI instance table displays this field by default', + isSortable: 'Sortable', + isIndex: 'Indexed', + index: 'Index', + indexTips: 'Fields can be used for retrieval to speed up queries', + confirmDelete: 'Confirm to delete [{name}]?', + confirmDelete2: 'Confirm to delete?', + computeSuccess: 'Triggered successfully!', + basicConfig: 'Basic Settings', + AttributeName: 'Name(English)', + DataType: 'Data Type', + defaultValue: 'Default value', + autoIncID: 'Auto-increment ID', + customTime: 'Custom time', + advancedSettings: 'Advanced Settings', + font: 'Font', + color: 'Color', + choiceValue: 'Predefined value', + computedAttribute: 'Computed Attribute', + computedAttributeTips: 'The value of this attribute is calculated through an expression constructed from other attributes of the CIType or by executing a piece of code. The reference method of the attribute is: {{ attribute name }}', + addAttribute: 'New attribute', + existedAttributes: 'Already have attributes', + editAttribute: 'Edit attribute', + addAttributeTips1: 'If sorting is selected, it must also be selected!', + uniqueConstraint: 'Unique Constraint', + up: 'Move up', + down: 'Move down', + selectAttribute: 'Select Attribute', + groupExisted: 'Group name already exists', + attributeSortedTips: 'Attributes in other groups cannot be sorted. If you need to sort, please drag them to a custom group first!', + buildinAttribute: 'built-in attributes', + expr: 'Expression', + code: 'Code', + apply: 'apply', + continueAdd: 'Keep adding', + filter: 'Filter', + choiceOther: 'Other CIType Attributes', + choiceWebhookTips: 'The returned results are filtered by fields, and the hierarchical nesting is separated by ##, such as k1##k2. The web request returns {k1: [{k2: 1}, {k2: 2}]}, and the parsing result is [1, 2 ]', + selectCIType: 'Please select a CMDB CIType', + selectCITypeAttributes: 'Please select CIType attributes', + selectAttributes: 'Please select attributes', + choiceScriptDemo: 'class ChoiceValue(object):\n @staticmethod\n def values():\n """\n Execution entry, returns predefined value\n :return: Returns a list, the type of the value is the same as the type of the attribute\n For example:\n return ["online", "offline"]\n """\n return []', + valueExisted: 'The current value already exists!', + addRelation: 'Add Relation', + sourceCIType: 'Source CIType', + sourceCITypeTips: 'Please select Source CIType', + dstCIType: 'Target CIType', + dstCITypeTips: 'Please select target CIType', + relationType: 'Relation Type', + relationTypeTips: 'Please select relation type', + isParent: 'is parent', + relationConstraint: 'Constraints', + relationConstraintTips: 'please select a relationship constraint', + one2Many: 'One to Many', + one2One: 'One to One', + many2Many: 'Many to Many', + basicInfo: 'Basic Information', + nameInputTips: 'Please enter name', + triggerDataChange: 'Data changes', + triggerDate: 'Date attribute', + triggerEnable: 'Turn on', + descInput: 'Please enter remarks', + triggerCondition: 'Triggering conditions', + addInstance: 'Add new instance', + deleteInstance: 'Delete instance', + changeInstance: 'Instance changes', + selectMutipleAttributes: 'Please select attributes (multiple selections)', + selectSingleAttribute: 'Please select an attribute (single choice)', + beforeDays: 'ahead of time', + days: 'Days', + notifyAt: 'Send time', + notify: 'Notify', + triggerAction: 'Trigger action', + receivers: 'Recipients', + emailTips: 'Please enter your email address, separate multiple email addresses with ;', + customEmail: 'Custom recipients', + notifySubject: 'Notification title', + notifySubjectTips: 'Please enter notification title', + notifyContent: 'Content', + notifyMethod: 'Notify methods', + botSelect: 'Please select a robot', + refAttributeTips: 'The title and content can reference the attribute value of the CIType. The reference method is: {{ attr_name }}', + webhookRefAttributeTips: 'Request parameters can reference the attribute value of the model. The reference method is: {{ attr_name }}', + newTrigger: 'Add trigger', + editTriggerTitle: 'Edit trigger {name}', + newTriggerTitle: 'Add trigger {name}', + confirmDeleteTrigger: 'Are you sure to delete this trigger?', + int: 'Integer', + float: 'Float', + text: 'Text', + datetime: 'DateTime', + date: 'Date', + time: 'Time', + json: 'JSON', + event: 'Event', + reg: 'Regex', + isInherit: 'Inherit', + inheritType: 'Inherit Type', + inheritTypePlaceholder: 'Please select inherit types', + inheritFrom: 'inherit from {name}', + groupInheritFrom: 'Please go to the {name} for modification' + }, + components: { + unselectAttributes: 'Unselected', + selectAttributes: 'Selected', + downloadCI: 'Export data', + filename: 'Filename', + filenameInputTips: 'Please enter filename', + saveType: 'Save type', + saveTypeTips: 'Please select save type', + xlsx: 'Excel workbook (*.xlsx)', + csv: 'CSV (comma separated) (*.csv)', + html: 'Web page (*.html)', + xml: 'XML data (*.xml)', + txt: 'Text file (tab delimited) (*.txt)', + grantUser: 'Grant User/Department', + grantRole: 'Grant Role', + confirmRevoke: 'Confirm to delete the [Authorization] permission of [{name}]?', + readAttribute: 'View Attributes', + readCI: 'View CIs', + config: 'Configuration', + ciTypeGrant: 'Grant CIType', + ciGrant: 'Grant CI', + attributeGrant: 'Grant Attribute', + relationGrant: 'Grant Relation', + perm: 'Permissions', + all: 'All', + customize: 'Customize', + none: 'None', + customizeFilterName: 'Please enter a custom filter name', + colorPickerError: 'Initialization color format error, use #fff or rgb format', + example: 'Example value', + aliyun: 'aliyun', + tencentcloud: 'Tencent Cloud', + huaweicloud: 'Huawei Cloud', + beforeChange: 'Before change', + afterChange: 'After change', + noticeContentTips: 'Please enter notification content', + saveQuery: 'Save Filters', + pleaseSearch: 'Please search', + conditionFilter: 'Conditional filtering', + attributeDesc: 'Attribute Description', + ciSearchTips: '1. JSON/password/link attributes cannot be searched\n2. If the search content includes commas, they need to be escaped\n3. Only index attributes are searched, non-index attributes use conditional filtering', + ciSearchTips2: 'For example: q=hostname:*0.0.0.0*', + subCIType: 'Subscription CIType', + already: 'already', + not: 'not', + sub: 'subscription', + selectBelow: 'Please select below', + subSuccess: 'Subscription successful', + selectMethods: 'Please select a method', + noAuthRequest: 'No certification requested yet', + noParamRequest: 'No parameter certification yet', + requestParam: 'Request parameters', + param: 'Parameter{param}', + value: 'Value{value}', + clear: 'Clear', + }, + batch: { + downloadFailed: 'Download failed', + unselectCIType: 'No CIType selected yet', + pleaseUploadFile: 'Please upload files', + batchUploadCanceled: 'Batch upload canceled', + selectCITypeTips: 'Please select CIType', + downloadTemplate: 'Download Template', + drawTips: 'Click or drag files here to upload!', + supportFileTypes: 'Supported file types: xls, xlsx', + uploadResult: 'Upload results', + total: 'total', + successItems: 'items, succeeded', + failedItems: 'items, failed', + items: 'items', + errorTips: 'Error message', + requestFailedTips: 'An error occurred with the request, please try again later', + requestSuccessTips: 'Upload completed', + }, + preference: { + mySub: 'My Subscription', + sub: 'Subscribe', + cancelSub: 'Unsubscribe', + editSub: 'Edit subscription', + peopleSub: ' people subscribed', + noSub: 'No subscribed', + cancelSubSuccess: 'Unsubscribe successfully', + confirmcancelSub: 'Are you sure to cancel your subscription?', + confirmcancelSub2: 'Are you sure you want to unsubscribe {name}?', + of: 'of', + hoursAgo: 'hours ago', + daysAgo: 'days ago', + monthsAgo: 'month ago', + yearsAgo: 'years ago', + just: 'just now', + }, + custom_dashboard: { + charts: 'Chart', + newChart: 'Add Chart', + editChart: 'Edit Chart', + title: 'Title', + titleTips: 'Please enter a chart title', + calcIndicators: 'Counter', + dimensions: 'Dimensions', + selectDimensions: 'Please select a dimension', + quantity: 'Quantity', + childCIType: 'Relational CIType', + level: 'Level', + levelTips: 'Please enter the relationship level', + preview: 'Preview', + showIcon: 'Display icon', + chartType: 'Chart Type', + dataFilter: 'Data Filtering', + format: 'Formats', + fontColor: 'Font Color', + backgroundColor: 'Background', + chartColor: 'Chart Color', + chartLength: 'Length', + barType: 'Bar Type', + stackedBar: 'Stacked Bar', + multipleSeriesBar: 'Multiple Series Bar ', + axis: 'Axis', + direction: 'Direction', + lowerShadow: 'Lower Shadow', + count: 'Indicator', + bar: 'Bar', + line: 'Line', + pie: 'Pie', + table: 'Table', + default: 'default', + relation: 'Relation', + noCustomDashboard: 'The administrator has not customized the dashboard yet', + }, + preference_relation: { + newServiceTree: 'Add ServiceTree', + serviceTreeName: 'Name', + public: 'Public', + saveLayout: 'Save Layout', + childNodesNotFound: 'There are no child nodes and no business relationship can be formed. Please select again!', + tips1: 'Cannot form a view with the currently selected node, please select again!', + tips2: 'Please enter the new serviceTree name!', + tips3: 'Please select at least two nodes!', + }, + history: { + ciChange: 'CI', + relationChange: 'Relation', + ciTypeChange: 'CIType', + triggerHistory: 'Triggers', + opreateTime: 'Operate Time', + user: 'User', + userTips: 'Enter filter username', + filter: 'Search', + filterOperate: 'fitler operation', + attribute: 'Attribute', + old: 'Old', + new: 'New', + noUpdate: 'No update', + itemsPerPage: '/page', + triggerName: 'Name', + event: 'Event', + action: 'Actoin', + status: 'Status', + done: 'Done', + undone: 'Undone', + triggerTime: 'Trigger Time', + totalItems: '{total} records in total', + pleaseSelect: 'Please select', + startTime: 'Start Time', + endTime: 'End Time', + deleteCIType: 'Delete CIType', + addCIType: 'Add CIType', + updateCIType: 'Update CIType', + addAttribute: 'Add Attribute', + updateAttribute: 'Update Attribute', + deleteAttribute: 'Delete Attribute', + addTrigger: 'Add Trigger', + updateTrigger: 'Update Trigger', + deleteTrigger: 'Delete Trigger', + addUniqueConstraint: 'Add Unique Constraint', + updateUniqueConstraint: 'Update Unique Constraint', + deleteUniqueConstraint: 'Delete Unique Constraint', + addRelation: 'Add Relation', + deleteRelation: 'Delete Relation', + noModifications: 'No Modifications', + attr: 'attribute', + attrId: 'attribute id', + changeDescription: 'attribute id: {attr_id}, {before_days} day(s) in advance, Subject: {subject}\nContent: {body}\nNotify At: {notify_at}' + }, + relation_type: { + addRelationType: 'New', + nameTips: 'Please enter a type name', + }, + ad: { + upload: 'Import', + download: 'Export', + accept: 'Accept', + acceptBy: 'Accept By', + acceptTime: 'Accept Time', + confirmAccept: 'Confirm Accept?', + acceptSuccess: 'Accept successfully', + isAccept: 'Is accept', + deleteADC: 'Confirm to delete this data?', + batchDelete: 'Confirm to delete this data?', + agent: 'Built-in & Plug-ins', + snmp: 'Network Devices', + http: 'Public Clouds', + rule: 'AutoDiscovery Rules', + timeout: 'Timeout error', + mode: 'Mode', + collectSettings: 'Collection Settings', + updateFields: 'Update Field', + pluginScript: `# -*- coding:utf-8 -*- + + import json + + + class AutoDiscovery(object): + + @property + def unique_key(self): + """ + + :return: Returns the name of a unique attribute + """ + return + + @staticmethod + def attributes(): + """ + Define attribute fields + :return: Returns a list of attribute fields. The list items are (name, type, description). The name must be in English. + type: String Integer Float Date DateTime Time JSON + For example: + return [ + ("ci_type", "String", "CIType name"), + ("private_ip", "String", "Internal IP, multiple values separated by commas") + ] + """ + return [] + + @staticmethod + def run(): + """ + Execution entry, returns collected attribute values + :return: + Returns a list, the list item is a dictionary, the dictionary key is the attribute name, and the value is the attribute value + For example: + return [dict(ci_type="server", private_ip="192.168.1.1")] + """ + return [] + + + if __name__ == "__main__": + result = AutoDiscovery().run() + if isinstance(result, list): + print("AutoDiscovery::Result::{}".format(json.dumps(result))) + else: + print("ERROR: The collection return must be a list") + `, + server: 'Server', + vserver: 'VServer', + nic: 'NIC', + disk: 'harddisk', + }, + ci: { + attributeDesc: 'Attribute Description', + selectRows: 'Select: {rows} items', + addRelation: 'Add Relation', + all: 'All', + batchUpdate: 'Batch Update', + batchUpdateConfirm: 'Are you sure you want to make batch updates?', + batchUpdateInProgress: 'Currently being updated in batches', + batchUpdateInProgress2: 'Updating in batches, {total} in total, {successNum} successful, {errorNum} failed', + batchDeleting: 'Deleting...', + batchDeleting2: 'Deleting {total} items in total, {successNum} items successful, {errorNum} items failed', + copyFailed: 'Copy failed', + noLevel: 'No hierarchical relationship!', + batchAddRelation: 'Batch Add Relation', + history: 'History', + topo: 'Topology', + table: 'Table', + m2mTips: 'The current CIType relationship is many-to-many, please go to the SerivceTree(relation view) to add or delete', + confirmDeleteRelation: 'Confirm to delete the relationship?', + tips1: 'Use commas to separate multiple values', + tips2: 'The field can be modified as needed. When the value is empty, the field will be left empty.', + tips3: 'Please select the fields that need to be modified', + tips4: 'At least one field must be selected', + tips5: 'Search name | alias', + tips6: 'Speed ​​up retrieval, full-text search possible, no need to use conditional filtering\n\n json/link/password currently does not support indexing \n\nText characters longer than 190 cannot be indexed', + tips7: 'The form of expression is a drop-down box, and the value must be in the predefined value', + tips8: 'Multiple values, such as intranet IP', + tips9: 'For front-end only', + tips10: 'Other attributes of the CIType are computed using expressions\n\nA code snippet computes the returned value.', + newUpdateField: 'Add a Attribute', + attributeSettings: 'Attribute Settings', + share: 'Share', + noPermission: 'No Permission' + }, + serviceTree: { + deleteNode: 'Delete Node', + tips1: 'For example: q=os_version:centos&sort=os_version', + tips2: 'Expression search', + alert1: 'The administrator has not configured the ServiceTree(relation view), or you do not have permission to access it!', + copyFailed: 'Copy failed', + deleteRelationConfirm: 'Confirm to remove selected {name} from current relationship?', + batch: 'Batch', + grantTitle: 'Grant(read)', + userPlaceholder: 'Please select users', + rolePlaceholder: 'Please select roles', + grantedByServiceTree: 'Granted By Service Tree:', + grantedByServiceTreeTips: 'Please delete id_filter in Servive Tree', + peopleHasRead: 'Personnel authorized to read:', + authorizationPolicy: 'CI Authorization Policy:', + idAuthorizationPolicy: 'Authorized by node:', + view: 'View permissions' + }, + tree: { + tips1: 'Please go to Preference page first to complete your subscription!', + subSettings: 'Settings', + } +} +export default cmdb_en diff --git a/cmdb-ui/src/modules/cmdb/lang/zh.js b/cmdb-ui/src/modules/cmdb/lang/zh.js index 41f9bcc..e278f58 100644 --- a/cmdb-ui/src/modules/cmdb/lang/zh.js +++ b/cmdb-ui/src/modules/cmdb/lang/zh.js @@ -1,491 +1,502 @@ -const cmdb_zh = { - relation: '关系', - attribute: '属性', - menu: { - views: '视图', - config: '配置', - backend: '管理端', - ciTable: '资源数据', - ciTree: '资源层级', - ciSearch: '资源搜索', - adCIs: '自动发现池', - preference: '我的订阅', - batchUpload: '批量导入', - citypeManage: '模型配置', - backendManage: '后台管理', - customDashboard: '定制仪表盘', - serviceTreeDefine: '服务树定义', - citypeRelation: '模型关系', - operationHistory: '操作审计', - relationType: '关系类型', - ad: '自动发现', - cidetail: 'CI 详情' - }, - ciType: { - ciType: '模型', - attributes: '模型属性', - relation: '模型关联', - trigger: '触发器', - attributeAD: '属性自动发现', - relationAD: '关系自动发现', - grant: '权限配置', - addGroup: '新增分组', - editGroup: '修改分组', - group: '分组', - attributeLibray: '属性库', - addCITypeInGroup: '在该组中新增CI模型', - addCIType: '新增CI模型', - editGroupName: '编辑组名称', - deleteGroup: '删除该组', - CITypeName: '模型名(英文)', - English: '英文', - inputAttributeName: '请输入属性名', - attributeNameTips: '不能以数字开头,可以是英文 数字以及下划线 (_)', - editCIType: '编辑模型', - defaultSort: '默认排序', - selectDefaultOrderAttr: '选择默认排序属性', - asec: '正序', - desc: '倒序', - uniqueKey: '唯一标识', - uniqueKeySelect: '请选择唯一标识', - notfound: '找不到想要的?', - cannotDeleteGroupTips: '该分组下有数据, 不能删除!', - confirmDeleteGroup: '确定要删除分组 【{groupName}】 吗?', - confirmDeleteCIType: '确定要删除模型 【{typeName}】 吗?', - uploading: '正在导入中', - uploadFailed: '导入失败,请稍后重试', - addPlugin: '新建plugin', - deletePlugin: '删除plugin', - confirmDeleteADT: '确认删除 【{pluginName}】', - attributeMap: '字段映射', - autoDiscovery: '自动发现', - node: '节点', - adExecConfig: '执行配置', - adExecTarget: '执行机器', - oneagentIdTips: '请输入以0x开头的16进制OneAgent ID', - selectFromCMDBTips: '从CMDB中选择 ', - adAutoInLib: '自动入库', - adInterval: '采集频率', - byInterval: '按间隔', - allNodes: '所有节点', - specifyNodes: '指定节点', - specifyNodesTips: '请填写指定节点!', - username: '用户名', - password: '密码', - link: '链接', - list: '多值', - listTips: '字段的值是1个或者多个,接口返回的值的类型是list', - computeForAllCITips: '所有CI触发计算', - confirmcomputeForAllCITips: '确认触发所有CI的计算?', - isUnique: '是否唯一', - unique: '唯一', - isChoice: '是否选择', - defaultShow: '默认显示', - defaultShowTips: 'CI实例表格默认展示该字段', - isSortable: '可排序', - isIndex: '是否索引', - index: '索引', - indexTips: '字段可被用于检索,加速查询', - confirmDelete: '确认删除【{name}】?', - confirmDelete2: '确认删除?', - computeSuccess: '触发成功!', - basicConfig: '基础设置', - AttributeName: '属性名(英文)', - DataType: '数据类型', - defaultValue: '默认值', - autoIncID: '自增ID', - customTime: '自定义时间', - advancedSettings: '高级设置', - font: '字体', - color: '颜色', - choiceValue: '预定义值', - computedAttribute: '计算属性', - computedAttributeTips: '该属性的值是通过模型的其它属性构建的表达式或者执行一段代码的方式计算而来,属性的引用方法为: {{ 属性名 }}', - addAttribute: '新增属性', - existedAttributes: '已有属性', - editAttribute: '编辑属性', - addAttributeTips1: '选中排序,则必须也要选中!', - uniqueConstraint: '唯一校验', - up: '上移', - down: '下移', - selectAttribute: '添加属性', - groupExisted: '分组名称已存在', - attributeSortedTips: '其他分组中的属性不能进行排序,如需排序请先拖至自定义的分组!', - buildinAttribute: '内置字段', - expr: '表达式', - code: '代码', - apply: '应用', - continueAdd: '继续添加', - filter: '过滤', - choiceOther: '其他模型属性', - choiceWebhookTips: '返回的结果按字段来过滤,层级嵌套用##分隔,比如k1##k2,web请求返回{k1: [{k2: 1}, {k2: 2}]}, 解析结果为[1, 2]', - selectCIType: '请选择CMDB模型', - selectCITypeAttributes: '请选择模型属性', - selectAttributes: '请选择属性', - choiceScriptDemo: 'class ChoiceValue(object):\n @staticmethod\n def values():\n """\n 执行入口, 返回预定义值\n :return: 返回一个列表, 值的类型同属性的类型\n 例如:\n return ["在线", "下线"]\n """\n return []', - valueExisted: '当前值已存在!', - addRelation: '新增关系', - sourceCIType: '源模型', - sourceCITypeTips: '请选择源模型', - dstCIType: '目标模型名', - dstCITypeTips: '请选择目标模型', - relationType: '关联类型', - relationTypeTips: '请选择关联类型', - isParent: '被', - relationConstraint: '关系约束', - relationConstraintTips: '请选择关系约束', - one2Many: '一对多', - one2One: '一对一', - many2Many: '多对多', - basicInfo: '基本信息', - nameInputTips: '请输入名称', - triggerDataChange: '数据变更', - triggerDate: '日期属性', - triggerEnable: '开启', - descInput: '请输入备注', - triggerCondition: '触发条件', - addInstance: '新增实例', - deleteInstance: '删除实例', - changeInstance: '实例变更', - selectMutipleAttributes: '请选择属性(多选)', - selectSingleAttribute: '请选择属性(单选)', - beforeDays: '提前', - days: '天', - notifyAt: '发送时间', - notify: '通知', - triggerAction: '触发动作', - receivers: '收件人', - emailTips: '请输入邮箱,多个邮箱用;分隔', - customEmail: '自定义收件人', - notifySubject: '通知标题', - notifySubjectTips: '请输入通知标题', - notifyContent: '内容', - notifyMethod: '通知方式', - botSelect: '请选择机器人', - refAttributeTips: '标题、内容可以引用该模型的属性值,引用方法为: {{ attr_name }}', - webhookRefAttributeTips: '请求参数可以引用该模型的属性值,引用方法为: {{ attr_name }}', - newTrigger: '新增触发器', - editTriggerTitle: '编辑触发器 {name}', - newTriggerTitle: '新增触发器 {name}', - confirmDeleteTrigger: '确认删除该触发器吗?', - int: '整数', - float: '浮点数', - text: '文本', - datetime: '日期时间', - date: '日期', - time: '时间', - json: 'JSON', - event: '事件', - reg: '正则校验', - isInherit: '是否继承', - inheritType: '继承模型', - inheritTypePlaceholder: '请选择继承模型(多选)', - inheritFrom: '属性继承自{name}', - groupInheritFrom: '请至{name}进行修改' - }, - components: { - unselectAttributes: '未选属性', - selectAttributes: '已选属性', - downloadCI: '导出数据', - filename: '文件名', - filenameInputTips: '请输入文件名', - saveType: '保存类型', - saveTypeTips: '请选择保存类型', - xlsx: 'Excel工作簿(*.xlsx)', - csv: 'CSV(逗号分隔)(*.csv)', - html: '网页(*.html)', - xml: 'XML数据(*.xml)', - txt: '文本文件(制表符分隔)(*.txt)', - grantUser: '授权用户/部门', - grantRole: '授权角色', - confirmRevoke: '确认删除 【{name}】 的 【授权】 权限?', - readAttribute: '查看字段', - readCI: '查看实例', - config: '配置', - ciTypeGrant: '模型权限', - ciGrant: '实例权限', - attributeGrant: '字段权限', - relationGrant: '关系权限', - perm: '权限', - all: '全部', - customize: '自定义', - none: '无', - customizeFilterName: '请输入自定义筛选条件名', - colorPickerError: '初始化颜色格式错误,使用#fff或rgb格式', - example: '示例值', - aliyun: '阿里云', - tencentcloud: '腾讯云', - huaweicloud: '华为云', - beforeChange: '变更前', - afterChange: '变更后', - noticeContentTips: '请输入通知内容', - saveQuery: '保存筛选条件', - pleaseSearch: '请查找', - conditionFilter: '条件过滤', - attributeDesc: '属性说明', - ciSearchTips: '1. json属性不能搜索
2. 搜索内容包括逗号, 则需转义 ,
3. 只搜索索引属性, 非索引属性使用条件过滤', - ciSearchTips2: '例: q=hostname:*0.0.0.0*', - subCIType: '订阅模型', - already: '已', - not: '未', - sub: '订阅', - selectBelow: '请在下方进行选择', - subSuccess: '订阅成功', - selectMethods: '请选择方式', - noAuthRequest: '暂无请求认证', - noParamRequest: '暂无参数认证', - requestParam: '请求参数', - param: '参数{param}', - value: '值{value}', - clear: '清空', - }, - batch: { - downloadFailed: '失败下载', - unselectCIType: '尚未选择模板类型', - pleaseUploadFile: '请上传文件', - batchUploadCanceled: '批量上传已取消', - selectCITypeTips: '请选择模板类型', - downloadTemplate: '下载模板', - drawTips: '点击或拖拽文件至此上传!', - supportFileTypes: '支持文件类型:xls,xlsx', - uploadResult: '上传结果', - total: '共', - successItems: '条,已成功', - failedItems: '条,失败', - items: '条', - errorTips: '错误信息', - requestFailedTips: '请求出现错误,请稍后再试', - requestSuccessTips: '批量上传已完成', - }, - preference: { - mySub: '我的订阅', - sub: '订阅', - cancelSub: '取消订阅', - editSub: '编辑订阅', - peopleSub: '位同事已订阅', - noSub: '暂无同事订阅', - cancelSubSuccess: '取消订阅成功', - confirmcancelSub: '确认取消订阅', - confirmcancelSub2: '确认取消订阅 {name} 吗?', - of: '的', - hoursAgo: '小时前', - daysAgo: '天前', - monthsAgo: '月前', - yearsAgo: '年前', - just: '刚刚', - }, - custom_dashboard: { - charts: '图表', - newChart: '新增图表', - editChart: '编辑图表', - title: '标题', - titleTips: '请输入图表标题', - calcIndicators: '计算指标', - dimensions: '维度', - selectDimensions: '请选择维度', - quantity: '数量', - childCIType: '关系模型', - level: '层级', - levelTips: '请输入关系层级', - preview: '预览', - showIcon: '是否显示icon', - chartType: '图表类型', - dataFilter: '数据筛选', - format: '格式', - fontColor: '字体颜色', - backgroundColor: '背景颜色', - chartColor: '图表颜色', - chartLength: '图表长度', - barType: '柱状图类型', - stackedBar: '堆积柱状图', - multipleSeriesBar: '多系列柱状图', - axis: '轴', - direction: '方向', - lowerShadow: '下方阴影', - count: '指标', - bar: '柱状图', - line: '折线图', - pie: '饼状图', - table: '表格', - default: '默认', - relation: '关系', - noCustomDashboard: '管理员暂未定制仪表盘', - }, - preference_relation: { - newServiceTree: '新增服务树', - serviceTreeName: '服务树名', - public: '公开', - saveLayout: '保存布局', - childNodesNotFound: '不存在子节点,不能形成业务关系,请重新选择!', - tips1: '不能与当前选中节点形成视图,请重新选择!', - tips2: '请输入新增服务树名!', - tips3: '请选择至少两个节点!', - }, - history: { - ciChange: 'CI变更', - relationChange: '关系变更', - ciTypeChange: '模型变更', - triggerHistory: '触发历史', - opreateTime: '操作时间', - user: '用户', - userTips: '输入筛选用户名', - filter: '筛选', - filterOperate: '筛选操作', - attribute: '属性', - old: '旧', - new: '新', - noUpdate: '没有修改', - itemsPerPage: '/页', - triggerName: '触发器名称', - event: '事件', - action: '动作', - status: '状态', - done: '已完成', - undone: '未完成', - triggerTime: '触发时间', - totalItems: '共 {total} 条记录', - pleaseSelect: '请选择', - startTime: '开始时间', - endTime: '结束时间', - deleteCIType: '删除模型', - addCIType: '新增模型', - updateCIType: '修改模型', - addAttribute: '新增属性', - updateAttribute: '修改属性', - deleteAttribute: '删除属性', - addTrigger: '新增触发器', - updateTrigger: '修改触发器', - deleteTrigger: '删除触发器', - addUniqueConstraint: '新增联合唯一', - updateUniqueConstraint: '修改联合唯一', - deleteUniqueConstraint: '删除联合唯一', - addRelation: '新增关系', - deleteRelation: '删除关系', - noModifications: '没有修改', - attr: '属性名', - attrId: '属性ID', - changeDescription: '属性ID:{attr_id},提前:{before_days}天,主题:{subject}\n内容:{body}\n通知时间:{notify_at}' - }, - relation_type: { - addRelationType: '新增关系类型', - nameTips: '请输入类型名', - }, - ad: { - upload: '规则导入', - download: '规则导出', - accept: '入库', - acceptBy: '入库人', - acceptTime: '入库时间', - confirmAccept: '确认入库?', - acceptSuccess: '入库成功', - isAccept: '是否入库', - deleteADC: '确认删除该条数据?', - batchDelete: '确认删除这些数据?', - agent: '内置 & 插件', - snmp: '网络设备', - http: '公有云资源', - rule: '自动发现规则', - timeout: '超时错误', - mode: '模式', - collectSettings: '采集设置', - updateFields: '更新字段', - pluginScript: `# -*- coding:utf-8 -*- - - import json - - - class AutoDiscovery(object): - - @property - def unique_key(self): - """ - - :return: 返回唯一属性的名字 - """ - return - - @staticmethod - def attributes(): - """ - 定义属性字段 - :return: 返回属性字段列表, 列表项是(名称, 类型, 描述), 名称必须是英文 - 类型: String Integer Float Date DateTime Time JSON - 例如: - return [ - ("ci_type", "String", "模型名称"), - ("private_ip", "String", "内网IP, 多值逗号分隔") - ] - """ - return [] - - @staticmethod - def run(): - """ - 执行入口, 返回采集的属性值 - :return: 返回一个列表, 列表项是字典, 字典key是属性名称, value是属性值 - 例如: - return [dict(ci_type="server", private_ip="192.168.1.1")] - """ - return [] - - - if __name__ == "__main__": - result = AutoDiscovery().run() - if isinstance(result, list): - print("AutoDiscovery::Result::{}".format(json.dumps(result))) - else: - print("ERROR: 采集返回必须是列表") - `, - server: '物理机', - vserver: '虚拟机', - nic: '网卡', - disk: '硬盘', - }, - ci: { - attributeDesc: '属性说明', - selectRows: '选取:{rows} 项', - addRelation: '添加关系', - all: '全部', - batchUpdate: '批量修改', - batchUpdateConfirm: '确认要批量修改吗?', - batchUpdateInProgress: '正在批量修改', - batchUpdateInProgress2: '正在批量修改,共{total}个,成功{successNum}个,失败{errorNum}个', - batchDeleting: '正在删除...', - batchDeleting2: '正在删除,共{total}个,成功{successNum}个,失败{errorNum}个', - copyFailed: '复制失败!', - noLevel: '无层级关系!', - batchAddRelation: '批量添加关系', - history: '操作历史', - topo: '拓扑', - table: '表格', - m2mTips: '当前模型关系为多对多,请前往关系视图进行增删操作', - confirmDeleteRelation: '确认删除关系?', - tips1: '多个值使用,分割', - tips2: '可根据需要修改字段,当值为 空 时,则该字段 置空', - tips3: '请选择需要修改的字段', - tips4: '必须至少选择一个字段', - tips5: '搜索 名称 | 别名', - tips6: '加快检索, 可以全文搜索, 无需使用条件过滤\n\n json目前不支持建索引 \n\n文本字符长度超过190不能建索引', - tips7: '表现形式是下拉框, 值必须在预定义值里', - tips8: '多值, 比如内网IP', - tips9: '仅针对前端', - tips10: '模型的其他属性通过表达式的方式计算出来\n\n一个代码片段计算返回的值', - newUpdateField: '新增修改字段', - attributeSettings: '字段设置', - share: '分享', - noPermission: '暂无权限' - }, - serviceTree: { - deleteNode: '删除节点', - tips1: '例:q=os_version:centos&sort=os_version', - tips2: '表达式搜索', - alert1: '管理员 还未配置业务关系, 或者你无权限访问!', - copyFailed: '复制失败', - deleteRelationConfirm: '确认将选中的 {name} 从当前关系中删除?', - }, - tree: { - tips1: '请先到 我的订阅 页面完成订阅!', - subSettings: '订阅设置', - } -} -export default cmdb_zh +const cmdb_zh = { + relation: '关系', + attribute: '属性', + menu: { + views: '视图', + config: '配置', + backend: '管理端', + ciTable: '资源数据', + ciTree: '资源层级', + ciSearch: '资源搜索', + adCIs: '自动发现池', + preference: '我的订阅', + batchUpload: '批量导入', + citypeManage: '模型配置', + backendManage: '后台管理', + customDashboard: '定制仪表盘', + serviceTreeDefine: '服务树定义', + citypeRelation: '模型关系', + operationHistory: '操作审计', + relationType: '关系类型', + ad: '自动发现', + cidetail: 'CI 详情' + }, + ciType: { + ciType: '模型', + attributes: '模型属性', + relation: '模型关联', + trigger: '触发器', + attributeAD: '属性自动发现', + relationAD: '关系自动发现', + grant: '权限配置', + addGroup: '新增分组', + editGroup: '修改分组', + group: '分组', + attributeLibray: '属性库', + addCITypeInGroup: '在该组中新增CI模型', + addCIType: '新增CI模型', + editGroupName: '编辑组名称', + deleteGroup: '删除该组', + CITypeName: '模型名(英文)', + English: '英文', + inputAttributeName: '请输入属性名', + attributeNameTips: '不能以数字开头,可以是英文 数字以及下划线 (_)', + editCIType: '编辑模型', + defaultSort: '默认排序', + selectDefaultOrderAttr: '选择默认排序属性', + asec: '正序', + desc: '倒序', + uniqueKey: '唯一标识', + uniqueKeySelect: '请选择唯一标识', + uniqueKeyTips: 'json、密码、计算属性、预定义值属性不能作为唯一标识', + notfound: '找不到想要的?', + cannotDeleteGroupTips: '该分组下有数据, 不能删除!', + confirmDeleteGroup: '确定要删除分组 【{groupName}】 吗?', + confirmDeleteCIType: '确定要删除模型 【{typeName}】 吗?', + uploading: '正在导入中', + uploadFailed: '导入失败,请稍后重试', + addPlugin: '新建plugin', + deletePlugin: '删除plugin', + confirmDeleteADT: '确认删除 【{pluginName}】', + attributeMap: '字段映射', + autoDiscovery: '自动发现', + node: '节点', + adExecConfig: '执行配置', + adExecTarget: '执行机器', + oneagentIdTips: '请输入以0x开头的16进制OneAgent ID', + selectFromCMDBTips: '从CMDB中选择 ', + adAutoInLib: '自动入库', + adInterval: '采集频率', + byInterval: '按间隔', + allNodes: '所有节点', + specifyNodes: '指定节点', + specifyNodesTips: '请填写指定节点!', + username: '用户名', + password: '密码', + link: '链接', + list: '多值', + listTips: '字段的值是1个或者多个,接口返回的值的类型是list', + computeForAllCITips: '所有CI触发计算', + confirmcomputeForAllCITips: '确认触发所有CI的计算?', + isUnique: '是否唯一', + unique: '唯一', + isChoice: '是否选择', + defaultShow: '默认显示', + defaultShowTips: 'CI实例表格默认展示该字段', + isSortable: '可排序', + isIndex: '是否索引', + index: '索引', + indexTips: '字段可被用于检索,加速查询', + confirmDelete: '确认删除【{name}】?', + confirmDelete2: '确认删除?', + computeSuccess: '触发成功!', + basicConfig: '基础设置', + AttributeName: '属性名(英文)', + DataType: '数据类型', + defaultValue: '默认值', + autoIncID: '自增ID', + customTime: '自定义时间', + advancedSettings: '高级设置', + font: '字体', + color: '颜色', + choiceValue: '预定义值', + computedAttribute: '计算属性', + computedAttributeTips: '该属性的值是通过模型的其它属性构建的表达式或者执行一段代码的方式计算而来,属性的引用方法为: {{ 属性名 }}', + addAttribute: '新增属性', + existedAttributes: '已有属性', + editAttribute: '编辑属性', + addAttributeTips1: '选中排序,则必须也要选中!', + uniqueConstraint: '唯一校验', + up: '上移', + down: '下移', + selectAttribute: '添加属性', + groupExisted: '分组名称已存在', + attributeSortedTips: '其他分组中的属性不能进行排序,如需排序请先拖至自定义的分组!', + buildinAttribute: '内置字段', + expr: '表达式', + code: '代码', + apply: '应用', + continueAdd: '继续添加', + filter: '过滤', + choiceOther: '其他模型属性', + choiceWebhookTips: '返回的结果按字段来过滤,层级嵌套用##分隔,比如k1##k2,web请求返回{k1: [{k2: 1}, {k2: 2}]}, 解析结果为[1, 2]', + selectCIType: '请选择CMDB模型', + selectCITypeAttributes: '请选择模型属性', + selectAttributes: '请选择属性', + choiceScriptDemo: 'class ChoiceValue(object):\n @staticmethod\n def values():\n """\n 执行入口, 返回预定义值\n :return: 返回一个列表, 值的类型同属性的类型\n 例如:\n return ["在线", "下线"]\n """\n return []', + valueExisted: '当前值已存在!', + addRelation: '新增关系', + sourceCIType: '源模型', + sourceCITypeTips: '请选择源模型', + dstCIType: '目标模型名', + dstCITypeTips: '请选择目标模型', + relationType: '关联类型', + relationTypeTips: '请选择关联类型', + isParent: '被', + relationConstraint: '关系约束', + relationConstraintTips: '请选择关系约束', + one2Many: '一对多', + one2One: '一对一', + many2Many: '多对多', + basicInfo: '基本信息', + nameInputTips: '请输入名称', + triggerDataChange: '数据变更', + triggerDate: '日期属性', + triggerEnable: '开启', + descInput: '请输入备注', + triggerCondition: '触发条件', + addInstance: '新增实例', + deleteInstance: '删除实例', + changeInstance: '实例变更', + selectMutipleAttributes: '请选择属性(多选)', + selectSingleAttribute: '请选择属性(单选)', + beforeDays: '提前', + days: '天', + notifyAt: '发送时间', + notify: '通知', + triggerAction: '触发动作', + receivers: '收件人', + emailTips: '请输入邮箱,多个邮箱用;分隔', + customEmail: '自定义收件人', + notifySubject: '通知标题', + notifySubjectTips: '请输入通知标题', + notifyContent: '内容', + notifyMethod: '通知方式', + botSelect: '请选择机器人', + refAttributeTips: '标题、内容可以引用该模型的属性值,引用方法为: {{ attr_name }}', + webhookRefAttributeTips: '请求参数可以引用该模型的属性值,引用方法为: {{ attr_name }}', + newTrigger: '新增触发器', + editTriggerTitle: '编辑触发器 {name}', + newTriggerTitle: '新增触发器 {name}', + confirmDeleteTrigger: '确认删除该触发器吗?', + int: '整数', + float: '浮点数', + text: '文本', + datetime: '日期时间', + date: '日期', + time: '时间', + json: 'JSON', + event: '事件', + reg: '正则校验', + isInherit: '是否继承', + inheritType: '继承模型', + inheritTypePlaceholder: '请选择继承模型(多选)', + inheritFrom: '属性继承自{name}', + groupInheritFrom: '请至{name}进行修改' + }, + components: { + unselectAttributes: '未选属性', + selectAttributes: '已选属性', + downloadCI: '导出数据', + filename: '文件名', + filenameInputTips: '请输入文件名', + saveType: '保存类型', + saveTypeTips: '请选择保存类型', + xlsx: 'Excel工作簿(*.xlsx)', + csv: 'CSV(逗号分隔)(*.csv)', + html: '网页(*.html)', + xml: 'XML数据(*.xml)', + txt: '文本文件(制表符分隔)(*.txt)', + grantUser: '授权用户/部门', + grantRole: '授权角色', + confirmRevoke: '确认删除 【{name}】 的 【授权】 权限?', + readAttribute: '查看字段', + readCI: '查看实例', + config: '配置', + ciTypeGrant: '模型权限', + ciGrant: '实例权限', + attributeGrant: '字段权限', + relationGrant: '关系权限', + perm: '权限', + all: '全部', + customize: '自定义', + none: '无', + customizeFilterName: '请输入自定义筛选条件名', + colorPickerError: '初始化颜色格式错误,使用#fff或rgb格式', + example: '示例值', + aliyun: '阿里云', + tencentcloud: '腾讯云', + huaweicloud: '华为云', + beforeChange: '变更前', + afterChange: '变更后', + noticeContentTips: '请输入通知内容', + saveQuery: '保存筛选条件', + pleaseSearch: '请查找', + conditionFilter: '条件过滤', + attributeDesc: '属性说明', + ciSearchTips: '1. json、密码、链接属性不能搜索\n2. 搜索内容包括逗号, 则需转义\n3. 只搜索索引属性, 非索引属性使用条件过滤', + ciSearchTips2: '例: q=hostname:*0.0.0.0*', + subCIType: '订阅模型', + already: '已', + not: '未', + sub: '订阅', + selectBelow: '请在下方进行选择', + subSuccess: '订阅成功', + selectMethods: '请选择方式', + noAuthRequest: '暂无请求认证', + noParamRequest: '暂无参数认证', + requestParam: '请求参数', + param: '参数{param}', + value: '值{value}', + clear: '清空', + }, + batch: { + downloadFailed: '失败下载', + unselectCIType: '尚未选择模板类型', + pleaseUploadFile: '请上传文件', + batchUploadCanceled: '批量上传已取消', + selectCITypeTips: '请选择模板类型', + downloadTemplate: '下载模板', + drawTips: '点击或拖拽文件至此上传!', + supportFileTypes: '支持文件类型:xls,xlsx', + uploadResult: '上传结果', + total: '共', + successItems: '条,已成功', + failedItems: '条,失败', + items: '条', + errorTips: '错误信息', + requestFailedTips: '请求出现错误,请稍后再试', + requestSuccessTips: '批量上传已完成', + }, + preference: { + mySub: '我的订阅', + sub: '订阅', + cancelSub: '取消订阅', + editSub: '编辑订阅', + peopleSub: '位同事已订阅', + noSub: '暂无同事订阅', + cancelSubSuccess: '取消订阅成功', + confirmcancelSub: '确认取消订阅', + confirmcancelSub2: '确认取消订阅 {name} 吗?', + of: '的', + hoursAgo: '小时前', + daysAgo: '天前', + monthsAgo: '月前', + yearsAgo: '年前', + just: '刚刚', + }, + custom_dashboard: { + charts: '图表', + newChart: '新增图表', + editChart: '编辑图表', + title: '标题', + titleTips: '请输入图表标题', + calcIndicators: '计算指标', + dimensions: '维度', + selectDimensions: '请选择维度', + quantity: '数量', + childCIType: '关系模型', + level: '层级', + levelTips: '请输入关系层级', + preview: '预览', + showIcon: '是否显示icon', + chartType: '图表类型', + dataFilter: '数据筛选', + format: '格式', + fontColor: '字体颜色', + backgroundColor: '背景颜色', + chartColor: '图表颜色', + chartLength: '图表长度', + barType: '柱状图类型', + stackedBar: '堆积柱状图', + multipleSeriesBar: '多系列柱状图', + axis: '轴', + direction: '方向', + lowerShadow: '下方阴影', + count: '指标', + bar: '柱状图', + line: '折线图', + pie: '饼状图', + table: '表格', + default: '默认', + relation: '关系', + noCustomDashboard: '管理员暂未定制仪表盘', + }, + preference_relation: { + newServiceTree: '新增服务树', + serviceTreeName: '服务树名', + public: '公开', + saveLayout: '保存布局', + childNodesNotFound: '不存在子节点,不能形成业务关系,请重新选择!', + tips1: '不能与当前选中节点形成视图,请重新选择!', + tips2: '请输入新增服务树名!', + tips3: '请选择至少两个节点!', + }, + history: { + ciChange: 'CI变更', + relationChange: '关系变更', + ciTypeChange: '模型变更', + triggerHistory: '触发历史', + opreateTime: '操作时间', + user: '用户', + userTips: '输入筛选用户名', + filter: '筛选', + filterOperate: '筛选操作', + attribute: '属性', + old: '旧', + new: '新', + noUpdate: '没有修改', + itemsPerPage: '/页', + triggerName: '触发器名称', + event: '事件', + action: '动作', + status: '状态', + done: '已完成', + undone: '未完成', + triggerTime: '触发时间', + totalItems: '共 {total} 条记录', + pleaseSelect: '请选择', + startTime: '开始时间', + endTime: '结束时间', + deleteCIType: '删除模型', + addCIType: '新增模型', + updateCIType: '修改模型', + addAttribute: '新增属性', + updateAttribute: '修改属性', + deleteAttribute: '删除属性', + addTrigger: '新增触发器', + updateTrigger: '修改触发器', + deleteTrigger: '删除触发器', + addUniqueConstraint: '新增联合唯一', + updateUniqueConstraint: '修改联合唯一', + deleteUniqueConstraint: '删除联合唯一', + addRelation: '新增关系', + deleteRelation: '删除关系', + noModifications: '没有修改', + attr: '属性名', + attrId: '属性ID', + changeDescription: '属性ID:{attr_id},提前:{before_days}天,主题:{subject}\n内容:{body}\n通知时间:{notify_at}' + }, + relation_type: { + addRelationType: '新增关系类型', + nameTips: '请输入类型名', + }, + ad: { + upload: '规则导入', + download: '规则导出', + accept: '入库', + acceptBy: '入库人', + acceptTime: '入库时间', + confirmAccept: '确认入库?', + acceptSuccess: '入库成功', + isAccept: '是否入库', + deleteADC: '确认删除该条数据?', + batchDelete: '确认删除这些数据?', + agent: '内置 & 插件', + snmp: '网络设备', + http: '公有云资源', + rule: '自动发现规则', + timeout: '超时错误', + mode: '模式', + collectSettings: '采集设置', + updateFields: '更新字段', + pluginScript: `# -*- coding:utf-8 -*- + + import json + + + class AutoDiscovery(object): + + @property + def unique_key(self): + """ + + :return: 返回唯一属性的名字 + """ + return + + @staticmethod + def attributes(): + """ + 定义属性字段 + :return: 返回属性字段列表, 列表项是(名称, 类型, 描述), 名称必须是英文 + 类型: String Integer Float Date DateTime Time JSON + 例如: + return [ + ("ci_type", "String", "模型名称"), + ("private_ip", "String", "内网IP, 多值逗号分隔") + ] + """ + return [] + + @staticmethod + def run(): + """ + 执行入口, 返回采集的属性值 + :return: 返回一个列表, 列表项是字典, 字典key是属性名称, value是属性值 + 例如: + return [dict(ci_type="server", private_ip="192.168.1.1")] + """ + return [] + + + if __name__ == "__main__": + result = AutoDiscovery().run() + if isinstance(result, list): + print("AutoDiscovery::Result::{}".format(json.dumps(result))) + else: + print("ERROR: 采集返回必须是列表") + `, + server: '物理机', + vserver: '虚拟机', + nic: '网卡', + disk: '硬盘', + }, + ci: { + attributeDesc: '属性说明', + selectRows: '选取:{rows} 项', + addRelation: '添加关系', + all: '全部', + batchUpdate: '批量修改', + batchUpdateConfirm: '确认要批量修改吗?', + batchUpdateInProgress: '正在批量修改', + batchUpdateInProgress2: '正在批量修改,共{total}个,成功{successNum}个,失败{errorNum}个', + batchDeleting: '正在删除...', + batchDeleting2: '正在删除,共{total}个,成功{successNum}个,失败{errorNum}个', + copyFailed: '复制失败!', + noLevel: '无层级关系!', + batchAddRelation: '批量添加关系', + history: '操作历史', + topo: '拓扑', + table: '表格', + m2mTips: '当前模型关系为多对多,请前往关系视图进行增删操作', + confirmDeleteRelation: '确认删除关系?', + tips1: '多个值使用,分割', + tips2: '可根据需要修改字段,当值为 空 时,则该字段 置空', + tips3: '请选择需要修改的字段', + tips4: '必须至少选择一个字段', + tips5: '搜索 名称 | 别名', + tips6: '加快检索, 可以全文搜索, 无需使用条件过滤\n\n json、链接、密码目前不支持建索引 \n\n文本字符长度超过190不能建索引', + tips7: '表现形式是下拉框, 值必须在预定义值里', + tips8: '多值, 比如内网IP', + tips9: '仅针对前端', + tips10: '模型的其他属性通过表达式的方式计算出来\n\n一个代码片段计算返回的值', + newUpdateField: '新增修改字段', + attributeSettings: '字段设置', + share: '分享', + noPermission: '暂无权限' + }, + serviceTree: { + deleteNode: '删除节点', + tips1: '例:q=os_version:centos&sort=os_version', + tips2: '表达式搜索', + alert1: '管理员 还未配置业务关系, 或者你无权限访问!', + copyFailed: '复制失败', + deleteRelationConfirm: '确认将选中的 {name} 从当前关系中删除?', + batch: '批量操作', + grantTitle: '授权(查看权限)', + userPlaceholder: '请选择用户', + rolePlaceholder: '请选择角色', + grantedByServiceTree: '服务树授权:', + grantedByServiceTreeTips: '请先在服务树里删掉节点授权', + peopleHasRead: '当前有查看权限的人员:', + authorizationPolicy: '实例授权策略:', + idAuthorizationPolicy: '按节点授权的:', + view: '查看权限' + }, + tree: { + tips1: '请先到 我的订阅 页面完成订阅!', + subSettings: '订阅设置', + } +} +export default cmdb_zh diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue index 40954a3..53f24e8 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue @@ -1,394 +1,430 @@ - - - - + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailTab.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailTab.vue index 81a471d..11491e1 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailTab.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailTab.vue @@ -1,390 +1,390 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue index e315e8e..48bd5c4 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci_types/index.vue @@ -1,1054 +1,1064 @@ - - - - - - - + + + + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue index ee3748d..3afcc72 100644 --- a/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue @@ -1,1497 +1,1746 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue index 4ccc2e5..e1238b1 100644 --- a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue +++ b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue @@ -1,224 +1,250 @@ - - - - - + + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue index 126883b..c22ec7b 100644 --- a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue +++ b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue @@ -1,166 +1,253 @@ - - - - - + + + + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ReadPermissionsModal.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ReadPermissionsModal.vue new file mode 100644 index 0000000..657a99c --- /dev/null +++ b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ReadPermissionsModal.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/cmdb-ui/src/modules/cmdb/views/resource_search/index.vue b/cmdb-ui/src/modules/cmdb/views/resource_search/index.vue index b9ff2c1..0468e84 100644 --- a/cmdb-ui/src/modules/cmdb/views/resource_search/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/resource_search/index.vue @@ -1,530 +1,536 @@ - - - + + + diff --git a/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue b/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue index ee39b78..301119f 100644 --- a/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue +++ b/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue @@ -1,97 +1,106 @@ - - - - - + + + + +