conf sync optimize and add file trace interface

This commit is contained in:
smjiao 2024-07-03 14:45:07 +08:00
parent ee2614d124
commit 354627e1c7
4 changed files with 1854 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,269 @@
From 1dabd9f512bdfd256111bb87facee242110184ca Mon Sep 17 00:00:00 2001
From: smjiao <smjiao@isoftstone.com>
Date: Thu, 18 Apr 2024 09:43:36 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E9=92=88=E5=AF=B9ragdoll=E5=85=A5?=
=?UTF-8?q?=E5=8F=82=E5=92=8C=E8=BF=94=E5=9B=9E=E5=80=BC=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/configuration.js | 12 +++---------
.../TranscationDomainConfigurations.vue | 4 ++--
.../configuration/TranscationDomainDetail.vue | 15 +++++++++------
.../configuration/TranscationDomainManagement.vue | 8 +++-----
.../components/AddConfigurationDrawer.vue | 10 +++++-----
.../configuration/components/AddHostDrawer.vue | 6 +++---
.../components/AddTranscationDomainModal.vue | 6 ++----
.../components/DomainSelectionModal.vue | 2 +-
.../components/GetDomainStatusDrawer.vue | 4 ++--
.../components/QueryRealConfsDrawer.vue | 2 +-
10 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/src/api/configuration.js b/src/api/configuration.js
index 0f9c5ef..37f7b0d 100644
--- a/src/api/configuration.js
+++ b/src/api/configuration.js
@@ -69,18 +69,12 @@ export function createDomain(domainInfo, ...parameter) {
});
}
// 删除业务域
-export function deleteDomain(parameter) {
- const domainName = parameter.domainNameArray;
+export function deleteDomain({domainName, ...parameter}) {
return request({
url: api.deleteDomain,
method: 'delete',
- params: {
- domainName
- },
- paramsSerializer: {
- serialize: (params) => {
- return qs.stringify(params, {indices: false});
- }
+ data: {
+ domainName: domainName
}
});
}
diff --git a/src/views/configuration/TranscationDomainConfigurations.vue b/src/views/configuration/TranscationDomainConfigurations.vue
index b5a8469..b20e233 100644
--- a/src/views/configuration/TranscationDomainConfigurations.vue
+++ b/src/views/configuration/TranscationDomainConfigurations.vue
@@ -307,7 +307,7 @@ export default {
domainName: _this.domainName
})
.then(function (res) {
- _this.tableData = res.confFiles;
+ _this.tableData = res.data.confFiles;
})
.catch(function (err) {
_this.$message.error(err.response.message);
@@ -426,7 +426,7 @@ export default {
confFiles: [{filePath: record.filePath.replace('openEuler:', '')}]
})
.then(function (res) {
- _this.manageConfChange = res.confBaseInfos;
+ _this.manageConfChange = res.data.confBaseInfos;
})
.catch(function (err) {
_this.$message.error(err.response.message);
diff --git a/src/views/configuration/TranscationDomainDetail.vue b/src/views/configuration/TranscationDomainDetail.vue
index e460ad2..6756817 100644
--- a/src/views/configuration/TranscationDomainDetail.vue
+++ b/src/views/configuration/TranscationDomainDetail.vue
@@ -220,16 +220,19 @@ export default {
handleDelete(hostInfos) {
const _this = this;
return new Promise((resolve, reject) => {
+ const hostInfosList = []
hostInfos.map((hostInfo) => {
- hostInfo.hostId = hostInfo.host_id;
- return hostInfo;
+ const newHostInfo = {}
+ newHostInfo.hostId = hostInfo.host_id;
+ hostInfosList.push(newHostInfo);
+ return hostInfosList;
});
deleteHost({
domainName: _this.domainName,
- hostInfos: hostInfos
+ hostInfos: hostInfosList
})
.then((res) => {
- _this.$message.success(res.msg);
+ _this.$message.success(res.message);
_this.getHostAndStatus();
_this.selectedRowKeys = [];
_this.selectedRows = [];
@@ -269,7 +272,7 @@ export default {
batchSyncConf(_this.domainName, hostIds)
.then((res) => {
let msg = '';
- for (const item of res) {
+ for (const item of res.data) {
const hostId = item.host_id;
let success = '';
let fail = '';
@@ -328,7 +331,7 @@ export default {
domainName
})
.then(function (res) {
- _this.confsOfDomain = res.confFiles || [];
+ _this.confsOfDomain = res.data.confFiles || [];
})
.catch(function (err) {
_this.$message.error(err.response.message);
diff --git a/src/views/configuration/TranscationDomainManagement.vue b/src/views/configuration/TranscationDomainManagement.vue
index db51c0c..d94469d 100644
--- a/src/views/configuration/TranscationDomainManagement.vue
+++ b/src/views/configuration/TranscationDomainManagement.vue
@@ -125,7 +125,7 @@ export default {
domainList()
.then(function (res) {
// 特殊处理
- _this.domainData = res || [];
+ _this.domainData = res.data || [];
})
.catch(function (err) {
if (err.response.code === '400') return;
@@ -164,15 +164,13 @@ export default {
});
},
handleDelDomain(domainName) {
- const domainNameArray = [];
- domainNameArray.push(domainName);
const _this = this;
return new Promise((resolve, reject) => {
deleteDomain({
- domainNameArray
+ domainName: domainName
})
.then((res) => {
- _this.$message.success(res.msg);
+ _this.$message.success(res.message);
_this.getDomainList();
resolve();
})
diff --git a/src/views/configuration/components/AddConfigurationDrawer.vue b/src/views/configuration/components/AddConfigurationDrawer.vue
index 0679955..670c51c 100644
--- a/src/views/configuration/components/AddConfigurationDrawer.vue
+++ b/src/views/configuration/components/AddConfigurationDrawer.vue
@@ -265,10 +265,10 @@ export default {
const _this = this;
addManagementConf(params)
.then(function (res) {
- if (res.code === 200) {
- _this.$message.success(res.msg);
- } else if (res.code === 206) {
- _this.$message.warning(res.msg);
+ if (res.code === '200') {
+ _this.$message.success(res.message);
+ } else if (res.code === '206') {
+ _this.$message.warning(res.message);
}
_this.visible = false;
_this.$emit('ok');
@@ -308,7 +308,7 @@ export default {
this.hostListLoading = true;
domainHostList(this.domainName)
.then(function (res) {
- _this.hostList = res;
+ _this.hostList = res.data;
})
.catch(function (err) {
_this.$message.error(err.response.data.msg || err.response.data.detail);
diff --git a/src/views/configuration/components/AddHostDrawer.vue b/src/views/configuration/components/AddHostDrawer.vue
index 9981acc..b4ad91b 100644
--- a/src/views/configuration/components/AddHostDrawer.vue
+++ b/src/views/configuration/components/AddHostDrawer.vue
@@ -120,8 +120,8 @@ export default {
const _this = this;
domainHostList(domainName)
.then(function (res) {
- _this.targetKeys = res.map((host) => host.hostId);
- _this.oldTargetKeys = res.map((host) => host.hostId);
+ _this.targetKeys = res.data.map((host) => host.hostId);
+ _this.oldTargetKeys = res.data.map((host) => host.hostId);
})
.catch(function (err) {
// code == 400时为域内未添加主机不报错
@@ -159,7 +159,7 @@ export default {
});
addHost(values.domainName, hostInfos)
.then(function (res) {
- _this.$message.success(res.msg);
+ _this.$message.success(res.message);
_this.form.resetFields();
_this.close();
_this.$emit('addHostSuccess');
diff --git a/src/views/configuration/components/AddTranscationDomainModal.vue b/src/views/configuration/components/AddTranscationDomainModal.vue
index 2f29133..cad671d 100644
--- a/src/views/configuration/components/AddTranscationDomainModal.vue
+++ b/src/views/configuration/components/AddTranscationDomainModal.vue
@@ -62,11 +62,9 @@ export default {
const _this = this;
this.isLoading = true;
values.priority = 0;
- const domainInfo = [];
- domainInfo.push(values);
- createDomain(domainInfo)
+ createDomain(values)
.then(function (res) {
- _this.$message.success(res.msg);
+ _this.$message.success(res.message);
_this.onSuccess && _this.onSuccess();
_this.visible = false;
_this.form.resetFields();
diff --git a/src/views/configuration/components/DomainSelectionModal.vue b/src/views/configuration/components/DomainSelectionModal.vue
index 9b4e961..b4598a2 100644
--- a/src/views/configuration/components/DomainSelectionModal.vue
+++ b/src/views/configuration/components/DomainSelectionModal.vue
@@ -55,7 +55,7 @@ export default {
const _this = this;
domainList()
.then(function (res) {
- _this.domainNameList = res;
+ _this.domainNameList = res.data;
})
.catch(function (err) {
_this.$message.error(err.response.message);
diff --git a/src/views/configuration/components/GetDomainStatusDrawer.vue b/src/views/configuration/components/GetDomainStatusDrawer.vue
index 88a5aa3..d4238f1 100644
--- a/src/views/configuration/components/GetDomainStatusDrawer.vue
+++ b/src/views/configuration/components/GetDomainStatusDrawer.vue
@@ -149,7 +149,7 @@ export default {
})
.then((res) => {
let message = '';
- for (const item of res) {
+ for (const item of res.data) {
const hostId = item.host_id;
let success = '';
let fail = '';
@@ -193,7 +193,7 @@ export default {
this.domainStatusIsLoading = true;
domainStatus(_this.domainName, hostIp)
.then(function (res) {
- _this.statusData = res.hostStatus[0].syncStatus || [];
+ _this.statusData = res.data.hostStatus[0].syncStatus || [];
})
.catch(function (err) {
if (err.response.code !== '404' && err.code !== 'ERR_BAD_REQUEST') {
diff --git a/src/views/configuration/components/QueryRealConfsDrawer.vue b/src/views/configuration/components/QueryRealConfsDrawer.vue
index 9f9bea2..68cdcad 100644
--- a/src/views/configuration/components/QueryRealConfsDrawer.vue
+++ b/src/views/configuration/components/QueryRealConfsDrawer.vue
@@ -136,7 +136,7 @@ export default {
hostIds: [{hostId}]
})
.then((res) => {
- _this.confsOfHost = (res && res[0] && res[0].confBaseInfos) || [];
+ _this.confsOfHost = (res.data && res.data[0] && res.data[0].confBaseInfos) || [];
})
.catch((err) => {
if (err.response.code !== '400' && err.code !== 'ERR_BAD_REQUEST') {
--
2.38.1.windows.1

View File

@ -0,0 +1,498 @@
From 42c3bb00c3398b65ee65c5fd62f5796b23a9bd46 Mon Sep 17 00:00:00 2001
From: smjiao <smjiao@isoftstone.com>
Date: Thu, 27 Jun 2024 15:07:40 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=BA=AF=E6=BA=90?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E8=BF=BD=E6=BA=AF=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/configuration.js | 21 +++-
src/config/router.config.js | 12 +-
.../TranscationDomainConfigurations.vue | 4 +-
.../TranscationDomainManagement.vue | 100 ++++++++--------
.../components/AddTranscationDomainModal.vue | 29 ++++-
.../components/QueryRealConfsDrawer.vue | 108 +++++++++++++++++-
6 files changed, 212 insertions(+), 62 deletions(-)
diff --git a/src/api/configuration.js b/src/api/configuration.js
index 37f7b0d..e25c686 100644
--- a/src/api/configuration.js
+++ b/src/api/configuration.js
@@ -1,5 +1,4 @@
import request from '@/vendor/ant-design-pro/utils/request';
-import qs from 'qs';
const api = {
domainList: '/domain/queryDomain', // 获取域信息列表
@@ -13,7 +12,8 @@ const api = {
batchSyncConf: '/confs/batch/syncConf', // 将当前业务域的配置批量同步到各主机
queryRealConfs: '/confs/queryRealConfs', // 获取主机当前配置
queryExpectedConfs: '/confs/queryExpectedConfs', // 获取主机配置日志
- queryHostAndStatus: '/manage/host/sync/status/get' // 获取业务域下的主机及其同步状态
+ queryHostAndStatus: '/manage/host/sync/status/get', // 获取业务域下的主机及其同步状态
+ queryConfTraceInfos: '/conftrace/query' // 获取业务域下单个主机的单个配置文件监控记录
};
export default api;
@@ -147,3 +147,20 @@ export function batchSyncConf(domainName, hostIds) {
}
});
}
+
+// 获取业务域下单个hostId的单个文件监控记录
+export function queryConfTraceInfos(parameter) {
+ return request({
+ url: api.queryConfTraceInfos,
+ method: 'post',
+ data: {
+ domain_name: parameter.domainName,
+ host_id: parameter.hostId,
+ conf_name: parameter.confName,
+ sort: 'create_time',
+ direction: 'desc',
+ page: parameter.page || 1,
+ per_page: parameter.per_page || 10
+ }
+ });
+}
diff --git a/src/config/router.config.js b/src/config/router.config.js
index 6e7b70c..6730a81 100644
--- a/src/config/router.config.js
+++ b/src/config/router.config.js
@@ -3,10 +3,11 @@ import {UserLayout, BasicLayout} from '@/vendor/ant-design-pro/layouts';
const RouteView = {
name: 'RouteView',
- render: (h) => h('router-view')
+ render: h => h('router-view')
};
const routeMap = {
+
/**
* @title: 路由名称。通过i18nRender转换成不同语种
* @path: 路由链接
@@ -812,8 +813,8 @@ export const asyncRouterMap = [
breadcrumbName:
routeMap.configuration.children.TranscationDomainView.children.TranscationDomainManagement
.title,
- path: routeMap.configuration.children.TranscationDomainView.children.TranscationDomainManagement
- .path
+ path:
+ routeMap.configuration.children.TranscationDomainView.children.TranscationDomainManagement.path
}
]
}
@@ -839,8 +840,8 @@ export const asyncRouterMap = [
breadcrumbName:
routeMap.configuration.children.TranscationDomainView.children.TranscationDomainManagement
.title,
- path: routeMap.configuration.children.TranscationDomainView.children.TranscationDomainManagement
- .path
+ path:
+ routeMap.configuration.children.TranscationDomainView.children.TranscationDomainManagement.path
},
{
breadcrumbName:
@@ -856,6 +857,7 @@ export const asyncRouterMap = [
path: routeMap.configuration.children.TranscationDomainConfigurations.path,
name: 'transcationDomainConfigurations',
component: RouteView,
+ hidden: true,
hideChildrenInMenu: true,
// $noDomain is used for the case where domain are not selected.
redirect: routeMap.configuration.children.TranscationDomainConfigurations.path + '/$noDomain',
diff --git a/src/views/configuration/TranscationDomainConfigurations.vue b/src/views/configuration/TranscationDomainConfigurations.vue
index b20e233..26fad7e 100644
--- a/src/views/configuration/TranscationDomainConfigurations.vue
+++ b/src/views/configuration/TranscationDomainConfigurations.vue
@@ -105,7 +105,7 @@
:columns="confChangeColumns"
:data-source="manageConfChange[0].changeLog"
:expandIconAsCell="false"
- :expandIconColumnIndex="4"
+ :expandIconColumnIndex="2"
:expandIcon="(props) => this.customExpandIcon(props)"
:pagination="false"
bordered>
@@ -247,14 +247,12 @@ export default {
},
confChangeColumns() {
return [
- {title: '变更ID', dataIndex: 'changeId', key: 'changeId'},
{
title: '变更时间',
dataIndex: 'date',
key: 'date',
customRender: (text, record, index) => dateFormat('YYYY-mm-dd HH:MM:SS', text)
},
- {title: '变更人', dataIndex: 'author', key: 'author'},
{title: '变更原因', dataIndex: 'changeReason', key: 'changeReason'},
{title: '变更详情', dataIndex: '', key: 'x', align: 'center'}
];
diff --git a/src/views/configuration/TranscationDomainManagement.vue b/src/views/configuration/TranscationDomainManagement.vue
index d94469d..45b2e78 100644
--- a/src/views/configuration/TranscationDomainManagement.vue
+++ b/src/views/configuration/TranscationDomainManagement.vue
@@ -3,55 +3,44 @@
<page-header-wrapper :breadcrumb="breadcrumb">
<a-card :bordered="false" class="aops-theme">
<div>
- <h3 class="card-title">业务域列表</h3>
- <span>共有业务域{{ domainData.length }}个</span>
+ <a-row class="aops-app-table-control-row" type="flex" justify="space-between">
+ <a-col>
+ <h3 class="card-title">业务域列表</h3>
+ <span>共有业务域{{ domainData.length }}个</span>
+ </a-col>
+ <a-col>
+ <a-row type="flex" :gutter="70">
+ <a-col>
+ <add-transcation-domain-modal :onSuccess="handleAddSuccess"/>
+ </a-col>
+ <a-col>
+ <a-button @click="getDomainList"> <a-icon type="redo" />刷新 </a-button>
+ </a-col>
+ </a-row>
+ </a-col>
+ </a-row>
</div>
<div>
- <a-list
+ <a-table
+ :rowKey="rowKey"
+ :columns="columns"
+ :data-source="domainData"
:loading="domainLoading"
- :data-source="cardListData"
- :grid="{gutter: 24, xl: 3, lg: 3, md: 2, sm: 1, xs: 1}"
- >
- <a-list-item slot="renderItem" slot-scope="domain, index">
- <a-card :bodyStyle="{padding: 0}" :bordered="false" :class="index !== 0 ? 'aops-theme-incard' : ''">
- <div class="aops-card-body">
- <router-link :to="`${domain.domainName || ''}`">
- <div class="aops-card-content">
- <h3>{{ `业务域 ${domain.domainName}` }}</h3>
- </div>
- </router-link>
- <div class="aops-card-bottom">
- <a-row type="flex" justify="space-between">
- <a-col>priority</a-col>
- <a-col>
- <router-link :to="`/configuration/transcation-domain-configurations/${domain.domainName}`">
- 查看域内配置
- </router-link>
- <a-divider type="vertical" />
- <a-dropdown>
- <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
- 更多 <a-icon type="down" />
- </a>
- <a-menu slot="overlay">
- <a-menu-item>
- <a href="javascript:;" @click="showAddHostDrawer(domain.domainName)">添加主机</a>
- </a-menu-item>
- <a-menu-item>
- <a href="javascript:;" @click="delDomain(domain.domainName)">删除</a>
- </a-menu-item>
- </a-menu>
- </a-dropdown>
- </a-col>
- </a-row>
- </div>
- </div>
- <add-transcation-domain-modal :onSuccess="handleAddSuccess" v-if="index === 0" />
- </a-card>
- </a-list-item>
- </a-list>
- <a-row type="flex" justify="center" v-show="showNumber < domainData.length + 1">
- <a-col><a-button @click="showMore">加载更多</a-button></a-col>
- </a-row>
+ :pagination="false">
+ <span slot="action" slot-scope="domain">
+ <router-link :to="`${domain.domainName || ''}`">
+ 业务域详情
+ </router-link>
+ <span> | </span>
+ <router-link :to="`/configuration/transcation-domain-configurations/${domain.domainName}`">
+ 查看域内配置
+ </router-link>
+ <span> | </span>
+ <a @click="showAddHostDrawer(domain.domainName)">添加主机</a>
+ <span> | </span>
+ <a @click="delDomain(domain.domainName)">删除</a>
+ </span>
+ </a-table>
</div>
</a-card>
<drawer-view title="添加主机" ref="addHostDrawer" :bodyStyle="{paddingBottom: '80px'}">
@@ -85,10 +74,27 @@ export default {
domainData: [],
showNumber: 6,
domainLoading: false,
- domainName: ''
+ domainName: '',
+ rowKey: 'domainName'
};
},
computed: {
+ columns() {
+ return [
+ {
+ dataIndex: 'domainName',
+ width: '50%',
+ key: 'domainName',
+ title: '业务域名称'
+ },
+ {
+ key: 'operation',
+ width: '50%',
+ title: '操作',
+ scopedSlots: {customRender: 'action'}
+ }
+ ];
+ },
// 自定义面包屑内容
breadcrumb() {
const routes = this.$route.meta.diyBreadcrumb.map((route) => {
diff --git a/src/views/configuration/components/AddTranscationDomainModal.vue b/src/views/configuration/components/AddTranscationDomainModal.vue
index cad671d..6718203 100644
--- a/src/views/configuration/components/AddTranscationDomainModal.vue
+++ b/src/views/configuration/components/AddTranscationDomainModal.vue
@@ -1,6 +1,6 @@
<template>
<div class="aops-add-domain" @click="showModal">
- <a-icon type="plus" />
+ <a-button type="primary">创建业务域</a-button>
<a-modal
title="创建业务域"
:visible="visible"
@@ -25,6 +25,12 @@
v-decorator="['priority', {rules: [{required: false, message: '请输入优先级'}]}]">
</a-input>
</a-form-item>
+ <a-form-item label="监控开关">
+ <a-switch v-model="traceIsActive" @change="handleTraceSwitchChange" checked-children="on" un-checked-children="off" />
+ </a-form-item>
+ <a-form-item label="告警开关">
+ <a-switch v-model="warningIsActive" @change="handleWarningSwitchChange" checked-children="on" un-checked-children="off" />
+ </a-form-item>
</a-form>
</a-modal>
</div>
@@ -45,6 +51,9 @@ export default {
return {
visible: false,
isLoading: false,
+ traceIsActive: false,
+ warningIsActive: false,
+ text: 'ON',
form: this.$form.createForm(this, {name: 'addHostGroup'})
};
},
@@ -62,6 +71,8 @@ export default {
const _this = this;
this.isLoading = true;
values.priority = 0;
+ values.conf_change_flag = this.traceIsActive
+ values.report_flag = this.warningIsActive
createDomain(values)
.then(function (res) {
_this.$message.success(res.message);
@@ -93,6 +104,22 @@ export default {
}
// 26个大小写字母。数字。下划线。底划线。小数点.
cb();
+ },
+ handleTraceSwitchChange() {
+ this.traceIsActive = !this.traceIsActive;
+ if (this.traceIsActive) {
+ this.traceIsActive = false
+ } else {
+ this.traceIsActive = true
+ }
+ },
+ handleWarningSwitchChange() {
+ this.warningIsActive = !this.warningIsActive;
+ if (this.warningIsActive) {
+ this.warningIsActive = false
+ } else {
+ this.warningIsActive = true
+ }
}
}
};
diff --git a/src/views/configuration/components/QueryRealConfsDrawer.vue b/src/views/configuration/components/QueryRealConfsDrawer.vue
index 68cdcad..26a6c01 100644
--- a/src/views/configuration/components/QueryRealConfsDrawer.vue
+++ b/src/views/configuration/components/QueryRealConfsDrawer.vue
@@ -4,7 +4,7 @@
<h1>主机当前配置</h1>
<div>主机:{{ host.hostId }}</div>
<div>IP地址{{ host.ip }}</div>
- <a-collapse>
+ <a-collapse @change="handlePanelChange">
<a-collapse-panel v-for="item in confs" :key="item.filePath" :header="`配置项:${item.filePath}`">
<div class="conf-description">
<a-descriptions title="属性" :column="2">
@@ -41,6 +41,21 @@
{{ item.confContents }}
</div>
</div>
+ <div class="conf-trace">
+ <a-row type="flex" justify="space-between" class="conf-content-header">
+ <a-col>
+ <div class="ant-descriptions-title">操作记录:</div>
+ </a-col>
+ </a-row>
+ <div>当前显示{{ confTraceInfos.length }}条监控信息</div>
+ <a-table
+ :rowKey="rowKey"
+ :columns="columns"
+ :data-source="confTraceInfos"
+ :loading="isLoading"
+ :pagination="pagination"
+ @change="handlePanelChange"/>
+ </div>
<template slot="extra" v-if="item.syncStatus === 'NOT SYNC'">
<a-icon type="close-circle" theme="twoTone" two-tone-color="#ff0000" />
<span style="color: #ff0000">&nbsp;与业务域配置不一致</span>
@@ -81,21 +96,31 @@
<script>
import Vue from 'vue';
+import MyPageHeaderWrapper from '@/views/utils/MyPageHeaderWrapper';
import {Collapse} from 'ant-design-vue';
import CompareDiffView from './CompareDiffView';
import {checkIsDiff} from '../utils/compareContent';
-import {queryRealConfs} from '@/api/configuration';
+import {queryConfTraceInfos, queryRealConfs} from '@/api/configuration';
+import {isArray} from 'ant-design-vue/lib/_util/vue-types/utils';
Vue.use(Collapse);
const Diff = require('diff');
+const defaultPagination = {
+ current: 1,
+ pageSize: 10,
+ showTotal: (total) => `总计 ${total} 项`,
+ showSizeChanger: true,
+ showQuickJumper: true
+};
export default {
name: 'QueryRealConfsDrawer',
inject: ['onload'], // 来自祖辈们provide中声明的参数、方法
components: {
Collapse,
- CompareDiffView
+ CompareDiffView,
+ MyPageHeaderWrapper
},
props: {
confsOfDomain: {
@@ -113,10 +138,15 @@ export default {
collapseIsLoading: false,
confsOfHost: [],
confs: [],
+ confTraceInfos: [],
confsNotInHost: [],
host: {},
compareDrawerVisible: false,
- comparedConf: {}
+ comparedConf: {},
+ pagination: defaultPagination,
+ isLoading: false,
+ rowKey: 'conf_name',
+ temp_conf: ''
};
},
watch: {
@@ -128,6 +158,47 @@ export default {
}
},
methods: {
+ handlePanelChange(row) {
+ if (Object.keys(row).length !== 0) {
+ if (isArray(row)) {
+ this.temp_conf = row[0]
+ this.handleConfTraceChange(row[0]);
+ } else {
+ const confName = this.temp_conf
+ this.pagination.current = row.current
+ this.pagination.pageSize = row.pageSize
+ this.handleConfTraceChange(confName);
+ }
+ }
+ },
+ handleConfTraceChange(confName) {
+ const _this = this
+ const pagination = this.pagination || {};
+ this.isLoading = true;
+ queryConfTraceInfos({
+ domainName: _this.domainName,
+ hostId: _this.host.hostId,
+ confName: confName,
+ page: pagination.current,
+ per_page: pagination.pageSize
+ })
+ .then((res) => {
+ _this.confTraceInfos = res.data.conf_trace_infos || [];
+ _this.totalCount = res.data.total_count
+ _this.pagination = {
+ ..._this.pagination,
+ current: pagination.current,
+ pageSize: pagination.pageSize,
+ total: res.data.total_count || (res.data.total_count === 0 ? 0 : pagination.total)
+ };
+ })
+ .catch((err) => {
+ _this.$message.error(err.response.message || err.response.data.detail || err.message);
+ })
+ .finally(() => {
+ _this.isLoading = false;
+ });
+ },
getRealConfsList(hostId) {
const _this = this;
_this.collapseIsLoading = true;
@@ -186,6 +257,35 @@ export default {
this.compareDrawerVisible = false;
}
},
+ computed: {
+ columns() {
+ return [
+ {
+ dataIndex: 'create_time',
+ title: '时间',
+ width: '15%',
+ key: 'create_time',
+ align: 'left',
+ scopedSlots: {customRender: 'create_time'}
+ },
+ {
+ dataIndex: 'info',
+ title: '监控记录',
+ width: '15%',
+ key: 'info',
+ align: 'left',
+ scopedSlots: {customRender: 'info'}
+ },
+ {
+ dataIndex: 'ptrace',
+ title: '进程追溯',
+ width: '15%',
+ key: 'ptrace',
+ align: 'left'
+ }
+ ];
+ }
+ },
mounted: function () {
const _this = this;
this.onload(function (params) {
--
2.38.1.windows.1

View File

@ -2,7 +2,7 @@
Name: aops-hermes
Version: v1.4.0
Release: 8
Release: 9
Summary: Web for an intelligent diagnose frame
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
@ -19,7 +19,9 @@ Patch008: 008-fix-diagnosis.patch
Patch009: 009-fix-hot-patch-prompts-are-only-executed-if-executed.patch
Patch010: 010-modify-the-task-description-copy-of-the-create-hot-patch-removal-task.patch
Patch011: 011-fix-prompt-word.patch
Patch012: 012-file-conf-sync-property-optimize.patch
Patch013: 013-optimize-conf-trace-request-and-response.patch
Patch014: 014-add-conf-trace-info-function.patch
BuildRequires: nodejs node-gyp nodejs-yarn
Requires: nginx
@ -35,6 +37,7 @@ Web for an intelligent diagnose frame
%build
export NODE_OPTIONS=--openssl-legacy-provider
yarn build
@ -54,6 +57,9 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
%changelog
* Mon Jul 01 2024 smjiao<smjiao@isoftstone.com> - v1.4.0-9
- conf sync optimize and add file trace interface
* Tue Jun 11 2024 Hu gang<18768366022@163.com> - v1.4.0-8
- Modify password interface prompt word modification
@ -97,7 +103,71 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
- Update the master branch code to the 1.3.5
* Tue Nov 14 2023 wangkunlong<505997900@qq.com> - v1.3.4-1
- update 22.03 LTS NEXT branch code to 1.3.4
- Update the master branch code to the 1.3.4
* Wed Oct 18 2023 wangkunlong<505997900@qq.com> - v1.3.3-4
- Update the master branch code to the latest version
* Wed Sep 20 2023 wangkunlong<505997900@qq.com> - v1.3.3-3
- Change params in rpms under host
- Change hotpatch rpms show way
* Wed Sep 20 2023 wangkunlong<505997900@qq.com> - v1.3.3-2
- Resolve the issue of abnormal display of paginated data after expanding the rpm list when setting multiple data pagination settings
- Resolve the issue of abnormal upload security announcement parameters
* Tue Sep 19 2023 wangkunlong<505997900@qq.com> - v1.3.3-1
- Fix parameter passing when expanding a secondary list of unselectable items in the CVE list
- Fix the issue of abnormal repo settings during deployment and adjust the parameters for rollback tasks
* Tue Sep 19 2023 wangkunlong<505997900@qq.com> - v1.3.2-1
- Resolve the issue of abnormal data deletion on the host management page
- Resolve the issue of undefined related fields in the host details interface during CVE scanning
- Resolve the issue of generating task pages with option buttons not cleared
- Resolve the issue of abnormal hot patch data when multiple hot patches are selected for repair on the CVE details page
- Resolve CVE repair details page: issues with installed rpm and affected rpm errors associated with CVE
- Resolve the issue of installed rpm and affected rpm errors associated with the host on the CVE details page
- Resolve the issue of page page number jumping and abnormal page display on the front-end page
- Solve vulnerability scanning, and identify requirements that users are not aware of after scanning
- Resolve the issue of requesting page failure and reporting 400 errors after refreshtoken failure
- Resolve the issue of incorrect email specifications on the registered user page
- Solve the issue of inconsistency between the actual repair task and the displayed one on the CVE detail page and generate a repair task
* Wed Sep 13 2023 wangkunlong<505997900@qq.com> - v1.3.1-5
- Add a configuration synchronization interface on the interface to support configuration synchronization of configuration files
* Wed Sep 13 2023 wangkunlong<505997900@qq.com> - v1.3.1-4
- The current Aops integration configuration file traceability function has added a large number of configuration file processing
- Add processing on the interface, allowing users to select supported configuration file objects
* Wed Sep 13 2023 wangkunlong<505997900@qq.com> - v1.3.1-3
- Modify generation repair tasks and set repo task parameters
- Solve task description font issues in task details
- Resolve the issue of page request failure after refreshtoken failure
- Add front-end description to the takeover filter item
* Mon Sep 11 2023 wangkunlong<505997900@qq.com> - v1.3.1-2
- Resolve the issue of fixing RPMS
- Solve the problem of format verification when registering hosts
- Resolve the issue of generating incorrect repair task information
- Resolve the issue of abnormal display in the task management section
* Tue Sep 5 2023 wangkunlong<505997900@qq.com> - v1.3.1-1
- fix cve rollback task params problems
- cancel rpms selection under fixed cves
* Tue Sep 5 2023 wangkunlong<505997900@qq.com> - v1.3.0-1
- Updata to 23.09 rc3
* Fri Jul 28 2023 wangkunlong<505997900@qq.com> - v1.2.2-2
- Fixed an issue where deleting some hosts after bulk uploading resulted in incorrect display of the current host list
- Fix an issue where a batch upload host failed due to field restrictions
- Fixed the issue of incorrect display of host information after entering a part of the host list without CVE hosts
* Tue Jul 18 2023 wangkunlong<505997900@qq.com> - v1.2.2-1
- Solved the problem of nodejs being unable to build successfully in the 23.03 environment on the master branch
- Modify the front-end tab icon to the openeuler icon
- Fix the issue of selecting a fixed cold patch for rollback operation, with incorrect prompts in the previous paragraph
* Wed Jun 14 2023 wangkunlong<505997900@qq.com> - v1.2.1-7
- The host list under cve has been fixed and the hot patch repair column has been changed to support hot patches