mirror of https://github.com/veops/cmdb.git
chore: release v2.4.4
This commit is contained in:
parent
994a28dd25
commit
9ead4e7d8d
|
@ -275,16 +275,25 @@ class AttributeValueManager(object):
|
||||||
if attr.is_list:
|
if attr.is_list:
|
||||||
existed_attrs = value_table.get_by(attr_id=attr.id, ci_id=ci.id, to_dict=False)
|
existed_attrs = value_table.get_by(attr_id=attr.id, ci_id=ci.id, to_dict=False)
|
||||||
existed_values = [i.value for i in existed_attrs]
|
existed_values = [i.value for i in existed_attrs]
|
||||||
added = set(value) - set(existed_values)
|
|
||||||
deleted = set(existed_values) - set(value)
|
|
||||||
for v in added:
|
|
||||||
value_table.create(ci_id=ci.id, attr_id=attr.id, value=v, flush=False, commit=False)
|
|
||||||
changed.append((ci.id, attr.id, OperateType.ADD, None, v, ci.type_id))
|
|
||||||
|
|
||||||
|
# Comparison array starts from which position changes
|
||||||
|
min_len = min(len(value), len(existed_values))
|
||||||
|
index = 0
|
||||||
|
while index < min_len:
|
||||||
|
if value[index] != existed_values[index]:
|
||||||
|
break
|
||||||
|
index += 1
|
||||||
|
added = value[index:]
|
||||||
|
deleted = existed_values[index:]
|
||||||
|
|
||||||
|
# Delete first and then add to ensure id sorting
|
||||||
for v in deleted:
|
for v in deleted:
|
||||||
existed_attr = existed_attrs[existed_values.index(v)]
|
existed_attr = existed_attrs[existed_values.index(v)]
|
||||||
existed_attr.delete(flush=False, commit=False)
|
existed_attr.delete(flush=False, commit=False)
|
||||||
changed.append((ci.id, attr.id, OperateType.DELETE, v, None, ci.type_id))
|
changed.append((ci.id, attr.id, OperateType.DELETE, v, None, ci.type_id))
|
||||||
|
for v in added:
|
||||||
|
value_table.create(ci_id=ci.id, attr_id=attr.id, value=v, flush=False, commit=False)
|
||||||
|
changed.append((ci.id, attr.id, OperateType.ADD, None, v, ci.type_id))
|
||||||
else:
|
else:
|
||||||
existed_attr = value_table.get_by(attr_id=attr.id, ci_id=ci.id, first=True, to_dict=False)
|
existed_attr = value_table.get_by(attr_id=attr.id, ci_id=ci.id, first=True, to_dict=False)
|
||||||
existed_value = existed_attr and existed_attr.value
|
existed_value = existed_attr and existed_attr.value
|
||||||
|
|
|
@ -432,6 +432,7 @@ class CITypeHistory(Model):
|
||||||
|
|
||||||
attr_id = db.Column(db.Integer)
|
attr_id = db.Column(db.Integer)
|
||||||
trigger_id = db.Column(db.Integer)
|
trigger_id = db.Column(db.Integer)
|
||||||
|
rc_id = db.Column(db.Integer)
|
||||||
unique_constraint_id = db.Column(db.Integer)
|
unique_constraint_id = db.Column(db.Integer)
|
||||||
|
|
||||||
uid = db.Column(db.Integer, index=True)
|
uid = db.Column(db.Integer, index=True)
|
||||||
|
|
|
@ -502,7 +502,8 @@ if __name__ == "__main__":
|
||||||
copyFailed: 'Copy failed',
|
copyFailed: 'Copy failed',
|
||||||
noLevel: 'No hierarchical relationship!',
|
noLevel: 'No hierarchical relationship!',
|
||||||
batchAddRelation: 'Batch Add Relation',
|
batchAddRelation: 'Batch Add Relation',
|
||||||
history: 'History',
|
history: 'Change Logs',
|
||||||
|
relITSM: 'Related Tickets',
|
||||||
topo: 'Topology',
|
topo: 'Topology',
|
||||||
table: 'Table',
|
table: 'Table',
|
||||||
m2mTips: 'The current CIType relationship is many-to-many, please go to the SerivceTree(relation view) to add or delete',
|
m2mTips: 'The current CIType relationship is many-to-many, please go to the SerivceTree(relation view) to add or delete',
|
||||||
|
|
|
@ -502,7 +502,8 @@ if __name__ == "__main__":
|
||||||
copyFailed: '复制失败!',
|
copyFailed: '复制失败!',
|
||||||
noLevel: '无层级关系!',
|
noLevel: '无层级关系!',
|
||||||
batchAddRelation: '批量添加关系',
|
batchAddRelation: '批量添加关系',
|
||||||
history: '操作历史',
|
history: '变更记录',
|
||||||
|
relITSM: '关联工单',
|
||||||
topo: '拓扑',
|
topo: '拓扑',
|
||||||
table: '表格',
|
table: '表格',
|
||||||
m2mTips: '当前模型关系为多对多,请前往关系视图进行增删操作',
|
m2mTips: '当前模型关系为多对多,请前往关系视图进行增删操作',
|
||||||
|
|
|
@ -13,7 +13,7 @@ const genCmdbRoutes = async () => {
|
||||||
{
|
{
|
||||||
path: '/cmdb/dashboard',
|
path: '/cmdb/dashboard',
|
||||||
name: 'cmdb_dashboard',
|
name: 'cmdb_dashboard',
|
||||||
meta: { title: 'dashboard', icon: 'ops-cmdb-dashboard', selectedIcon: 'ops-cmdb-dashboard-selected', keepAlive: false },
|
meta: { title: 'dashboard', icon: 'ops-cmdb-dashboard', selectedIcon: 'ops-cmdb-dashboard', keepAlive: false },
|
||||||
component: () => import('../views/dashboard/index_v2.vue')
|
component: () => import('../views/dashboard/index_v2.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ const genCmdbRoutes = async () => {
|
||||||
path: '/cmdb/resourceviews',
|
path: '/cmdb/resourceviews',
|
||||||
name: 'cmdb_resource_views',
|
name: 'cmdb_resource_views',
|
||||||
component: RouteView,
|
component: RouteView,
|
||||||
meta: { title: 'cmdb.menu.ciTable', icon: 'ops-cmdb-resource', selectedIcon: 'ops-cmdb-resource-selected', keepAlive: true },
|
meta: { title: 'cmdb.menu.ciTable', icon: 'ops-cmdb-resource', selectedIcon: 'ops-cmdb-resource', keepAlive: true },
|
||||||
hideChildrenInMenu: false,
|
hideChildrenInMenu: false,
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
|
@ -33,7 +33,7 @@ const genCmdbRoutes = async () => {
|
||||||
path: '/cmdb/tree_views',
|
path: '/cmdb/tree_views',
|
||||||
component: () => import('../views/tree_views'),
|
component: () => import('../views/tree_views'),
|
||||||
name: 'cmdb_tree_views',
|
name: 'cmdb_tree_views',
|
||||||
meta: { title: 'cmdb.menu.ciTree', icon: 'ops-cmdb-tree', selectedIcon: 'ops-cmdb-tree-selected', keepAlive: false },
|
meta: { title: 'cmdb.menu.ciTree', icon: 'ops-cmdb-tree', selectedIcon: 'ops-cmdb-tree', keepAlive: false },
|
||||||
hideChildrenInMenu: true,
|
hideChildrenInMenu: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -47,13 +47,13 @@ const genCmdbRoutes = async () => {
|
||||||
{
|
{
|
||||||
path: '/cmdb/resourcesearch',
|
path: '/cmdb/resourcesearch',
|
||||||
name: 'cmdb_resource_search',
|
name: 'cmdb_resource_search',
|
||||||
meta: { title: 'cmdb.menu.ciSearch', icon: 'ops-cmdb-search', selectedIcon: 'ops-cmdb-search-selected', keepAlive: false },
|
meta: { title: 'cmdb.menu.ciSearch', icon: 'ops-cmdb-search', selectedIcon: 'ops-cmdb-search', keepAlive: false },
|
||||||
component: () => import('../views/resource_search/index.vue')
|
component: () => import('../views/resource_search/index.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/cmdb/adc',
|
path: '/cmdb/adc',
|
||||||
name: 'cmdb_auto_discovery_ci',
|
name: 'cmdb_auto_discovery_ci',
|
||||||
meta: { title: 'cmdb.menu.adCIs', icon: 'ops-cmdb-adc', selectedIcon: 'ops-cmdb-adc-selected', keepAlive: false },
|
meta: { title: 'cmdb.menu.adCIs', icon: 'ops-cmdb-adc', selectedIcon: 'ops-cmdb-adc', keepAlive: false },
|
||||||
component: () => import('../views/discoveryCI/index.vue')
|
component: () => import('../views/discoveryCI/index.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -72,19 +72,19 @@ const genCmdbRoutes = async () => {
|
||||||
path: '/cmdb/preference',
|
path: '/cmdb/preference',
|
||||||
component: () => import('../views/preference/index'),
|
component: () => import('../views/preference/index'),
|
||||||
name: 'cmdb_preference',
|
name: 'cmdb_preference',
|
||||||
meta: { title: 'cmdb.menu.preference', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference-selected', keepAlive: false }
|
meta: { title: 'cmdb.menu.preference', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference', keepAlive: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/cmdb/batch',
|
path: '/cmdb/batch',
|
||||||
component: () => import('../views/batch'),
|
component: () => import('../views/batch'),
|
||||||
name: 'cmdb_batch',
|
name: 'cmdb_batch',
|
||||||
meta: { 'title': 'cmdb.menu.batchUpload', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
|
meta: { 'title': 'cmdb.menu.batchUpload', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch', keepAlive: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/cmdb/ci_types',
|
path: '/cmdb/ci_types',
|
||||||
name: 'ci_type',
|
name: 'ci_type',
|
||||||
component: () => import('../views/ci_types/index'),
|
component: () => import('../views/ci_types/index'),
|
||||||
meta: { title: 'cmdb.menu.citypeManage', icon: 'ops-cmdb-citype', selectedIcon: 'ops-cmdb-citype-selected', keepAlive: false, permission: ['cmdb_admin', 'admin'] }
|
meta: { title: 'cmdb.menu.citypeManage', icon: 'ops-cmdb-citype', selectedIcon: 'ops-cmdb-citype', keepAlive: false, permission: ['cmdb_admin', 'admin'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/cmdb/disabled3',
|
path: '/cmdb/disabled3',
|
||||||
|
@ -166,7 +166,7 @@ const genCmdbRoutes = async () => {
|
||||||
path: `/cmdb/relationviews/${item[1]}`,
|
path: `/cmdb/relationviews/${item[1]}`,
|
||||||
name: `cmdb_relation_views_${item[1]}`,
|
name: `cmdb_relation_views_${item[1]}`,
|
||||||
component: () => import('../views/relation_views/index'),
|
component: () => import('../views/relation_views/index'),
|
||||||
meta: { title: item[0], icon: 'ops-cmdb-relation', selectedIcon: 'ops-cmdb-relation-selected', keepAlive: false, name: item[0] },
|
meta: { title: item[0], icon: 'ops-cmdb-relation', selectedIcon: 'ops-cmdb-relation', keepAlive: false, name: item[0] },
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
routes.children.splice(2, 0, ...relationViews)
|
routes.children.splice(2, 0, ...relationViews)
|
||||||
|
|
|
@ -673,7 +673,7 @@ export default {
|
||||||
message: this.$t('warning'),
|
message: this.$t('warning'),
|
||||||
description: errorMsg,
|
description: errorMsg,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
style: { whiteSpace: 'break-spaces', overflow: 'auto', height: this.windowHeight - 80 + 'px' },
|
style: { whiteSpace: 'break-spaces', overflow: 'auto', maxHeight: this.windowHeight - 80 + 'px' },
|
||||||
})
|
})
|
||||||
errorNum += 1
|
errorNum += 1
|
||||||
})
|
})
|
||||||
|
|
|
@ -45,7 +45,7 @@ services:
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
cmdb-api:
|
cmdb-api:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/veops/cmdb-api:2.4.3
|
image: registry.cn-hangzhou.aliyuncs.com/veops/cmdb-api:2.4.4
|
||||||
# build:
|
# build:
|
||||||
# context: .
|
# context: .
|
||||||
# target: cmdb-api
|
# target: cmdb-api
|
||||||
|
@ -84,7 +84,7 @@ services:
|
||||||
- cmdb-api
|
- cmdb-api
|
||||||
|
|
||||||
cmdb-ui:
|
cmdb-ui:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/veops/cmdb-ui:2.4.3
|
image: registry.cn-hangzhou.aliyuncs.com/veops/cmdb-ui:2.4.4
|
||||||
# build:
|
# build:
|
||||||
# context: .
|
# context: .
|
||||||
# target: cmdb-ui
|
# target: cmdb-ui
|
||||||
|
|
Loading…
Reference in New Issue