diff --git a/cmdb-ui/.env b/cmdb-ui/.env
index 1be71b7..f9596a2 100644
--- a/cmdb-ui/.env
+++ b/cmdb-ui/.env
@@ -3,3 +3,4 @@ VUE_APP_PREVIEW=false
VUE_APP_API_BASE_URL=http://127.0.0.1:5000/api
VUE_APP_BUILD_PACKAGES="ticket,calendar,acl"
VUE_APP_IS_OUTER=true
+VUE_APP_IS_OPEN_SOURCE=true
diff --git a/cmdb-ui/src/core/use.js b/cmdb-ui/src/core/use.js
index 283889a..c8c90f7 100644
--- a/cmdb-ui/src/core/use.js
+++ b/cmdb-ui/src/core/use.js
@@ -69,6 +69,8 @@ Vue.prototype.$httpError = function (err, describe) {
window.$message = Vue.prototype.$message
+Vue.prototype.isOpenSource = process.env.VUE_APP_IS_OPEN_SOURCE === 'true'
+
Vue.use(Antd)
Vue.use(Viser)
diff --git a/cmdb-ui/src/modules/cmdb/api/CIType.js b/cmdb-ui/src/modules/cmdb/api/CIType.js
index 6e60735..bab02c7 100644
--- a/cmdb-ui/src/modules/cmdb/api/CIType.js
+++ b/cmdb-ui/src/modules/cmdb/api/CIType.js
@@ -1,232 +1,257 @@
-import { axios } from '@/utils/request'
-
-/**
- * 获取 所有的 ci_types
- * @param parameter
- * @returns {AxiosPromise}
- */
-export function getCITypes(parameter) {
- return axios({
- url: '/v0.1/ci_types',
- method: 'GET',
- params: parameter
- })
-}
-
-/**
- * 获取 某个 ci_types
- * @param CITypeName
- * @param parameter
- * @returns {AxiosPromise}
- */
-export function getCIType(CITypeName, parameter) {
- return axios({
- url: `/v0.1/ci_types/${CITypeName}`,
- method: 'GET',
- params: parameter
- })
-}
-
-/**
- * 创建 ci_type
- * @param data
- * @returns {AxiosPromise}
- */
-export function createCIType(data) {
- return axios({
- url: '/v0.1/ci_types',
- method: 'POST',
- data: data
- })
-}
-
-/**
- * 更新 ci_type
- * @param CITypeId
- * @param data
- * @returns {AxiosPromise}
- */
-export function updateCIType(CITypeId, data) {
- return axios({
- url: `/v0.1/ci_types/${CITypeId}`,
- method: 'PUT',
- data: data
- })
-}
-
-/**
- * 删除 ci_type
- * @param CITypeId
- * @returns {AxiosPromise}
- */
-export function deleteCIType(CITypeId) {
- return axios({
- url: `/v0.1/ci_types/${CITypeId}`,
- method: 'DELETE'
- })
-}
-
-/**
- * 获取 某个 ci_type 的分组
- * @param CITypeId
- * @param data
- * @returns {AxiosPromise}
- */
-export function getCITypeGroupById(CITypeId, data) {
- return axios({
- url: `/v0.1/ci_types/${CITypeId}/attribute_groups`,
- method: 'GET',
- params: data
- })
-}
-
-/**
- * 保存 某个 ci_type 的分组
- * @param CITypeId
- * @param data
- * @returns {AxiosPromise}
- */
-export function createCITypeGroupById(CITypeId, data) {
- return axios({
- url: `/v0.1/ci_types/${CITypeId}/attribute_groups`,
- method: 'POST',
- data: data
- })
-}
-
-/**
- * 修改 某个 ci_type 的分组
- * @param groupId
- * @param data
- * @returns {AxiosPromise}
- */
-export function updateCITypeGroupById(groupId, data) {
- return axios({
- url: `/v0.1/ci_types/attribute_groups/${groupId}`,
- method: 'PUT',
- data: data
- })
-}
-
-/**
- * 删除 某个 ci_type 的分组
- * @param groupId
- * @param data
- * @returns {AxiosPromise}
- */
-export function deleteCITypeGroupById(groupId, data) {
- return axios({
- url: `/v0.1/ci_types/attribute_groups/${groupId}`,
- method: 'delete',
- data: data
- })
-}
-
-export function getUniqueConstraintList(type_id) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/unique_constraint`,
- method: 'get',
- })
-}
-
-export function addUniqueConstraint(type_id, data) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/unique_constraint`,
- method: 'post',
- data: data
- })
-}
-
-export function updateUniqueConstraint(type_id, id, data) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/unique_constraint/${id}`,
- method: 'put',
- data: data
- })
-}
-
-export function deleteUniqueConstraint(type_id, id) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/unique_constraint/${id}`,
- method: 'delete',
- })
-}
-
-export function getTriggerList(type_id) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/triggers`,
- method: 'get',
- })
-}
-
-export function addTrigger(type_id, data) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/triggers`,
- method: 'post',
- data: data
- })
-}
-
-export function updateTrigger(type_id, id, data) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/triggers/${id}`,
- method: 'put',
- data: data
- })
-}
-
-export function deleteTrigger(type_id, id) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/triggers/${id}`,
- method: 'delete',
- })
-}
-
-// CMDB的模型和实例的授权接口
-export function grantCiType(type_id, rid, data) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/roles/${rid}/grant`,
- method: 'post',
- data
- })
-}
-// CMDB的模型和实例的删除授权接口
-export function revokeCiType(type_id, rid, data) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/roles/${rid}/revoke`,
- method: 'post',
- data
- })
-}
-// CMDB的模型和实例的过滤的权限
-export function ciTypeFilterPermissions(type_id) {
- return axios({
- url: `/v0.1/ci_types/${type_id}/filters/permissions`,
- method: 'get',
- })
-}
-
-// parent_ids, child_id
-export function postCiTypeInheritance(data) {
- return axios({
- url: `/v0.1/ci_types/inheritance`,
- method: 'post',
- data
- })
-}
-
-// parent_id, child_id
-export function deleteCiTypeInheritance(data) {
- return axios({
- url: `/v0.1/ci_types/inheritance`,
- method: 'delete',
- data
- })
-}
-
-export function getCITypeIcons() {
- return axios({
- url: '/v0.1/ci_types/icons',
- method: 'GET',
- })
-}
+import { axios } from '@/utils/request'
+
+/**
+ * 获取 所有的 ci_types
+ * @param parameter
+ * @returns {AxiosPromise}
+ */
+export function getCITypes(parameter) {
+ return axios({
+ url: '/v0.1/ci_types',
+ method: 'GET',
+ params: parameter
+ })
+}
+
+/**
+ * 获取 某个 ci_types
+ * @param CITypeName
+ * @param parameter
+ * @returns {AxiosPromise}
+ */
+export function getCIType(CITypeName, parameter) {
+ return axios({
+ url: `/v0.1/ci_types/${CITypeName}`,
+ method: 'GET',
+ params: parameter
+ })
+}
+
+/**
+ * 创建 ci_type
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function createCIType(data) {
+ return axios({
+ url: '/v0.1/ci_types',
+ method: 'POST',
+ data: data
+ })
+}
+
+/**
+ * 更新 ci_type
+ * @param CITypeId
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function updateCIType(CITypeId, data) {
+ return axios({
+ url: `/v0.1/ci_types/${CITypeId}`,
+ method: 'PUT',
+ data: data
+ })
+}
+
+/**
+ * 删除 ci_type
+ * @param CITypeId
+ * @returns {AxiosPromise}
+ */
+export function deleteCIType(CITypeId) {
+ return axios({
+ url: `/v0.1/ci_types/${CITypeId}`,
+ method: 'DELETE'
+ })
+}
+
+/**
+ * 获取 某个 ci_type 的分组
+ * @param CITypeId
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function getCITypeGroupById(CITypeId, data) {
+ return axios({
+ url: `/v0.1/ci_types/${CITypeId}/attribute_groups`,
+ method: 'GET',
+ params: data
+ })
+}
+
+/**
+ * 保存 某个 ci_type 的分组
+ * @param CITypeId
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function createCITypeGroupById(CITypeId, data) {
+ return axios({
+ url: `/v0.1/ci_types/${CITypeId}/attribute_groups`,
+ method: 'POST',
+ data: data
+ })
+}
+
+/**
+ * 修改 某个 ci_type 的分组
+ * @param groupId
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function updateCITypeGroupById(groupId, data) {
+ return axios({
+ url: `/v0.1/ci_types/attribute_groups/${groupId}`,
+ method: 'PUT',
+ data: data
+ })
+}
+
+/**
+ * 删除 某个 ci_type 的分组
+ * @param groupId
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function deleteCITypeGroupById(groupId, data) {
+ return axios({
+ url: `/v0.1/ci_types/attribute_groups/${groupId}`,
+ method: 'delete',
+ data: data
+ })
+}
+
+/**
+ * 获取级联属性配置
+ * @param {*} typeId
+ * @returns
+ */
+export function getCITypeCascadeAttributes(typeId) {
+ return axios({
+ url: `/v0.1/cascade_attributes/ci_types/${typeId}`,
+ method: 'get'
+ })
+}
+
+/**
+ * 获取级联属性数据
+ * @param {*} typeId
+ * @returns
+ */
+export function postCITypeCascadeAttributesValues(attrId, data) {
+ return axios({
+ url: `/v0.1/cascade_attributes/${attrId}/values`,
+ method: 'post',
+ data
+ })
+}
+
+export function getUniqueConstraintList(type_id) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/unique_constraint`,
+ method: 'get',
+ })
+}
+
+export function addUniqueConstraint(type_id, data) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/unique_constraint`,
+ method: 'post',
+ data: data
+ })
+}
+
+export function updateUniqueConstraint(type_id, id, data) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/unique_constraint/${id}`,
+ method: 'put',
+ data: data
+ })
+}
+
+export function deleteUniqueConstraint(type_id, id) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/unique_constraint/${id}`,
+ method: 'delete',
+ })
+}
+
+export function getTriggerList(type_id) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/triggers`,
+ method: 'get',
+ })
+}
+
+export function addTrigger(type_id, data) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/triggers`,
+ method: 'post',
+ data: data
+ })
+}
+
+export function updateTrigger(type_id, id, data) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/triggers/${id}`,
+ method: 'put',
+ data: data
+ })
+}
+
+export function deleteTrigger(type_id, id) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/triggers/${id}`,
+ method: 'delete',
+ })
+}
+
+// CMDB的模型和实例的授权接口
+export function grantCiType(type_id, rid, data) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/roles/${rid}/grant`,
+ method: 'post',
+ data
+ })
+}
+// CMDB的模型和实例的删除授权接口
+export function revokeCiType(type_id, rid, data) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/roles/${rid}/revoke`,
+ method: 'post',
+ data
+ })
+}
+// CMDB的模型和实例的过滤的权限
+export function ciTypeFilterPermissions(type_id) {
+ return axios({
+ url: `/v0.1/ci_types/${type_id}/filters/permissions`,
+ method: 'get',
+ })
+}
+
+// parent_ids, child_id
+export function postCiTypeInheritance(data) {
+ return axios({
+ url: `/v0.1/ci_types/inheritance`,
+ method: 'post',
+ data
+ })
+}
+
+// parent_id, child_id
+export function deleteCiTypeInheritance(data) {
+ return axios({
+ url: `/v0.1/ci_types/inheritance`,
+ method: 'delete',
+ data
+ })
+}
+
+export function getCITypeIcons() {
+ return axios({
+ url: '/v0.1/ci_types/icons',
+ method: 'GET',
+ })
+}
diff --git a/cmdb-ui/src/modules/cmdb/components/httpSnmpAD/httpADCategory.vue b/cmdb-ui/src/modules/cmdb/components/httpSnmpAD/httpADCategory.vue
index 5a30752..fb57c20 100644
--- a/cmdb-ui/src/modules/cmdb/components/httpSnmpAD/httpADCategory.vue
+++ b/cmdb-ui/src/modules/cmdb/components/httpSnmpAD/httpADCategory.vue
@@ -29,7 +29,7 @@
class="category-side-children-item-corporate"
v-if="ruleType === 'private_cloud' || (ruleType === 'http' && (categoryIndex !== 0 || itemIndex !== 0))"
>
- 企
+ {{ $t('cmdb.enterpriseVersionFlag') }}
@@ -67,7 +67,7 @@
class="corporate-flag"
v-if="ruleType === 'private_cloud' || (ruleType === 'http' && (categoryIndex !== 0 || itemIndex !== 0))"
>
- 企
+ {{ $t('cmdb.enterpriseVersionFlag') }}
diff --git a/cmdb-ui/src/modules/cmdb/lang/en.js b/cmdb-ui/src/modules/cmdb/lang/en.js
index c95d8c4..e5fbb69 100644
--- a/cmdb-ui/src/modules/cmdb/lang/en.js
+++ b/cmdb-ui/src/modules/cmdb/lang/en.js
@@ -2,6 +2,8 @@ const cmdb_en = {
relation: 'Relation',
attribute: 'Attributes',
configTable: 'Config Table',
+ enterpriseVersionFlag: 'Pro',
+ enterpriseVersionTip: 'Enterprise version only',
menu: {
views: 'Views',
topologyView: 'Topology Views',
@@ -274,8 +276,12 @@ const cmdb_en = {
attrAlias: 'Attr Alias',
attrCode: 'Attr Code',
computedAttrTip1: 'Reference attributes follow jinja2 syntax',
- computedAttrTip2: `Multi-valued attributes (lists) are rendered with [ ] included by default, if you want to remove it, the reference method is: ‘’‘{{ attr_name | join(’,‘)}}}’‘’ where commas are separators`,
- example: 'Example'
+ computedAttrTip2: `Multi-valued attributes (lists) are rendered with [ ] included by default, if you want to remove it, the reference method is: """{{ attr_name | join(',') }}""" where commas are separators`,
+ example: 'Example',
+ attrFilterTip: `The third column of values allows you to select attributes of this model to cascade attributes`,
+ rule: 'Rule',
+ cascadeAttr: 'Cascade',
+ cascadeAttrTip: 'Cascading attributes note the order',
},
components: {
unselectAttributes: 'Unselected',
@@ -325,6 +331,7 @@ const cmdb_en = {
sub: 'subscription',
selectBelow: 'Please select below',
subSuccess: 'Subscription successful',
+ subFailed: 'Subscription failed, please try again later',
selectMethods: 'Please select a method',
noAuthRequest: 'No certification requested yet',
noParamRequest: 'No parameter certification yet',
@@ -380,6 +387,8 @@ const cmdb_en = {
yearsAgo: 'years ago',
just: 'just now',
searchPlaceholder: 'Please search CIType',
+ subCITable: 'Data',
+ subCITree: 'Tree',
},
custom_dashboard: {
charts: 'Chart',
@@ -639,6 +648,7 @@ if __name__ == "__main__":
rollbackingTips: 'Rollbacking',
batchRollbacking: 'Deleting {total} items in total, {successNum} items successful, {errorNum} items failed',
baselineTips: 'Changes at this point in time will also be rollbacked, Unique ID, password and dynamic attributes do not support',
+ cover: 'Cover',
},
serviceTree: {
remove: 'Remove',
diff --git a/cmdb-ui/src/modules/cmdb/lang/zh.js b/cmdb-ui/src/modules/cmdb/lang/zh.js
index 99e0aa4..40fdc00 100644
--- a/cmdb-ui/src/modules/cmdb/lang/zh.js
+++ b/cmdb-ui/src/modules/cmdb/lang/zh.js
@@ -2,6 +2,8 @@ const cmdb_zh = {
relation: '关系',
attribute: '属性',
configTable: '配置表格',
+ enterpriseVersionFlag: '企',
+ enterpriseVersionTip: '仅限企业版',
menu: {
views: '视图',
topologyView: '拓扑视图',
@@ -274,8 +276,12 @@ const cmdb_zh = {
attrAlias: '属性别名',
attrCode: '属性代码',
computedAttrTip1: '引用属性遵循jinja2语法',
- computedAttrTip2: `多值属性(列表)默认呈现包括[ ], 如果要去掉, 引用方法为: """{{ attr_name | join(',')}}""" 其中逗号为分隔符`,
- example: '例如'
+ computedAttrTip2: `多值属性(列表)默认呈现包括[ ], 如果要去掉, 引用方法为: """{{ attr_name | join(',') }}""" 其中逗号为分隔符`,
+ example: '例如',
+ attrFilterTip: '第三列值可选择本模型的属性,来实现级联属性的功能',
+ rule: '规则',
+ cascadeAttr: '级联',
+ cascadeAttrTip: '级联属性注意顺序',
},
components: {
unselectAttributes: '未选属性',
@@ -325,6 +331,7 @@ const cmdb_zh = {
sub: '订阅',
selectBelow: '请在下方进行选择',
subSuccess: '订阅成功',
+ subFailed: '订阅失败,请稍后再试',
selectMethods: '请选择方式',
noAuthRequest: '暂无请求认证',
noParamRequest: '暂无参数认证',
@@ -379,6 +386,8 @@ const cmdb_zh = {
yearsAgo: '年前',
just: '刚刚',
searchPlaceholder: '请搜索模型',
+ subCITable: '数据订阅',
+ subCITree: '层级订阅',
},
custom_dashboard: {
charts: '图表',
@@ -638,6 +647,7 @@ if __name__ == "__main__":
rollbackingTips: '正在批量回滚中',
batchRollbacking: '正在回滚,共{total}个,成功{successNum}个,失败{errorNum}个',
baselineTips: '该时间点的变更也会被回滚, 唯一标识、密码属性、动态属性不支持回滚',
+ cover: '覆盖',
},
serviceTree: {
remove: '移除',
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 4fc5254..2ae66a5 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue
@@ -1,431 +1,504 @@
-
- {{ $t('cmdb.ci.tips2') }} {{ $t('cmdb.ci.tips2') }}