Compare commits
No commits in common. "ee2614d1246ad1e863aa6e490549de6f57991cae" and "4b72ca6a25146d82638756bf1a9330ee35b35705" have entirely different histories.
ee2614d124
...
4b72ca6a25
@ -1,261 +0,0 @@
|
|||||||
From 47aaab21d6606f27d6117eb53034f6c2c5f3edf3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hu gang <18768366022@163.com>
|
|
||||||
Date: Wed, 20 Dec 2023 19:26:33 +0800
|
|
||||||
Subject: [PATCH] fix: host status adaptation
|
|
||||||
|
|
||||||
---
|
|
||||||
src/api/leaks.js | 3 +-
|
|
||||||
src/vendor/ant-design-pro/utils/request.js | 6 ++++
|
|
||||||
src/views/assests/HostDetail.vue | 34 +++++++------------
|
|
||||||
.../assests/components/HostBasicInfo.vue | 4 +--
|
|
||||||
.../assests/components/HostChartInfo.vue | 33 +++++++-----------
|
|
||||||
src/views/leaks/CVEsDetail.vue | 21 +++++-------
|
|
||||||
src/views/leaks/LeakTaskDetail.vue | 3 +-
|
|
||||||
src/views/leaks/components/HostTable.vue | 12 +++----
|
|
||||||
8 files changed, 49 insertions(+), 67 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/api/leaks.js b/src/api/leaks.js
|
|
||||||
index c6f704b..da3fbf8 100644
|
|
||||||
--- a/src/api/leaks.js
|
|
||||||
+++ b/src/api/leaks.js
|
|
||||||
@@ -347,6 +347,7 @@ export function setCveStatus({cveList, status}) {
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getHostUnderCVE({tableInfo, ...parameter}) {
|
|
||||||
+ const repoList = tableInfo.filters.repo ? tableInfo.filters.repo.map((v) => (v === '' ? null : v)) : null;
|
|
||||||
return request({
|
|
||||||
url: api.getHostUnderCVE,
|
|
||||||
method: 'post',
|
|
||||||
@@ -358,7 +359,7 @@ export function getHostUnderCVE({tableInfo, ...parameter}) {
|
|
||||||
fixed: tableInfo.fixed,
|
|
||||||
host_name: tableInfo.filters.host_name === null ? undefined : tableInfo.filters.host_name,
|
|
||||||
host_group: tableInfo.filters.host_group === null ? undefined : tableInfo.filters.host_group,
|
|
||||||
- repo: tableInfo.filters.repo === null ? undefined : tableInfo.filters.repo,
|
|
||||||
+ repo: repoList === null ? undefined : repoList,
|
|
||||||
last_scan: tableInfo.filters.last_scan
|
|
||||||
},
|
|
||||||
page: tableInfo.pagination.current,
|
|
||||||
diff --git a/src/vendor/ant-design-pro/utils/request.js b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
index 11be85a..36615ad 100644
|
|
||||||
--- a/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
+++ b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
@@ -165,6 +165,12 @@ request.interceptors.response.use((response) => {
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return retryRequest;
|
|
||||||
+ case '1108':
|
|
||||||
+ notification.error({
|
|
||||||
+ message: '暂无指标数据!',
|
|
||||||
+ description: response.data.message
|
|
||||||
+ });
|
|
||||||
+ break;
|
|
||||||
default:
|
|
||||||
notification.error({
|
|
||||||
message: response.data.label,
|
|
||||||
diff --git a/src/views/assests/HostDetail.vue b/src/views/assests/HostDetail.vue
|
|
||||||
index 6eadb05..ea08cfa 100644
|
|
||||||
--- a/src/views/assests/HostDetail.vue
|
|
||||||
+++ b/src/views/assests/HostDetail.vue
|
|
||||||
@@ -49,30 +49,20 @@ export default {
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
- fetchHostInfo() {
|
|
||||||
+ async fetchHostInfo() {
|
|
||||||
this.basicHostInfoIsLoading = true;
|
|
||||||
- getHostDetail(Number(this.hostId), true)
|
|
||||||
- .then((res) => {
|
|
||||||
- this.basicHostInfo = res.data.host_infos[0];
|
|
||||||
- this.scene = this.basicHostInfo.scene;
|
|
||||||
- })
|
|
||||||
- .catch((err) => {
|
|
||||||
- this.$message.error(err.response.message);
|
|
||||||
- })
|
|
||||||
- .finally(() => {
|
|
||||||
- this.basicHostInfoIsLoading = false;
|
|
||||||
- });
|
|
||||||
this.basicInfoIsLoading = true;
|
|
||||||
- getHostDetail(Number(this.hostId), false)
|
|
||||||
- .then((res) => {
|
|
||||||
- this.basicInfo = res.data.host_infos[0];
|
|
||||||
- })
|
|
||||||
- .catch((err) => {
|
|
||||||
- this.$message.error(err.response.message);
|
|
||||||
- })
|
|
||||||
- .finally(() => {
|
|
||||||
- this.basicInfoIsLoading = false;
|
|
||||||
- });
|
|
||||||
+ const basicHostRes = await getHostDetail(Number(this.hostId), true);
|
|
||||||
+ if (basicHostRes) {
|
|
||||||
+ this.basicHostInfo = basicHostRes.data.host_infos[0];
|
|
||||||
+ this.scene = this.basicHostInfo.scene;
|
|
||||||
+ }
|
|
||||||
+ const basicRes = await getHostDetail(Number(this.hostId), false);
|
|
||||||
+ if (basicRes) {
|
|
||||||
+ this.basicInfo = basicRes.data.host_infos[0];
|
|
||||||
+ }
|
|
||||||
+ this.basicInfoIsLoading = false;
|
|
||||||
+ this.basicHostInfoIsLoading = false;
|
|
||||||
},
|
|
||||||
reFetchHostInfo() {
|
|
||||||
this.fetchHostInfo();
|
|
||||||
diff --git a/src/views/assests/components/HostBasicInfo.vue b/src/views/assests/components/HostBasicInfo.vue
|
|
||||||
index bab1074..9909e44 100644
|
|
||||||
--- a/src/views/assests/components/HostBasicInfo.vue
|
|
||||||
+++ b/src/views/assests/components/HostBasicInfo.vue
|
|
||||||
@@ -235,6 +235,7 @@ export default {
|
|
||||||
getDetail() {
|
|
||||||
let data = this.basicInfo;
|
|
||||||
data = data.host_info;
|
|
||||||
+ this.basicInfo.status !== null && (this.status = this.basicInfo.status);
|
|
||||||
for (const member in data.os) {
|
|
||||||
this.os[member] = data.os[member] || '暂无';
|
|
||||||
}
|
|
||||||
@@ -257,8 +258,7 @@ export default {
|
|
||||||
this.detailIcon = 'up';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- },
|
|
||||||
- mounted() {}
|
|
||||||
+ }
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="less" scoped>
|
|
||||||
diff --git a/src/views/assests/components/HostChartInfo.vue b/src/views/assests/components/HostChartInfo.vue
|
|
||||||
index 2763d3c..d9e8fe7 100644
|
|
||||||
--- a/src/views/assests/components/HostChartInfo.vue
|
|
||||||
+++ b/src/views/assests/components/HostChartInfo.vue
|
|
||||||
@@ -120,29 +120,20 @@ export default {
|
|
||||||
methods: {
|
|
||||||
// 获取指标项,一个指标项对应一个图表
|
|
||||||
getHostMetrics() {
|
|
||||||
- const _this = this;
|
|
||||||
- _this.chartLoading = true;
|
|
||||||
+ this.chartLoading = true;
|
|
||||||
getHostMetrics({
|
|
||||||
- query_ip: _this.queryIp
|
|
||||||
- })
|
|
||||||
- .then((res) => {
|
|
||||||
- _this.metrics = res.data.results;
|
|
||||||
- if (_this.selectedMetrics.length < 1) {
|
|
||||||
- _this.selectedMetrics = res.data.results.slice(0, 4);
|
|
||||||
- storage.set('hostChartsSelectedMetrics', _this.selectedMetrics, 30 * 24 * 60 * 60 * 1000);
|
|
||||||
+ query_ip: this.queryIp
|
|
||||||
+ }).then((res) => {
|
|
||||||
+ if (res) {
|
|
||||||
+ this.metrics = res.data.results;
|
|
||||||
+ if (this.selectedMetrics.length < 1) {
|
|
||||||
+ this.selectedMetrics = res.data.results.slice(0, 4);
|
|
||||||
+ storage.set('hostChartsSelectedMetrics', this.selectedMetrics, 30 * 24 * 60 * 60 * 1000);
|
|
||||||
}
|
|
||||||
- _this.getMetricData();
|
|
||||||
- })
|
|
||||||
- .catch((err) => {
|
|
||||||
- if (err.response.code === '1108') {
|
|
||||||
- _this.$message.info('暂无指标数据!');
|
|
||||||
- } else {
|
|
||||||
- _this.$message.error(err.response.message);
|
|
||||||
- }
|
|
||||||
- })
|
|
||||||
- .finally(() => {
|
|
||||||
- _this.chartLoading = false;
|
|
||||||
- });
|
|
||||||
+ this.getMetricData();
|
|
||||||
+ }
|
|
||||||
+ this.chartLoading = false;
|
|
||||||
+ });
|
|
||||||
},
|
|
||||||
// 获取各个指标项下的所有序列数据
|
|
||||||
getMetricData() {
|
|
||||||
diff --git a/src/views/leaks/CVEsDetail.vue b/src/views/leaks/CVEsDetail.vue
|
|
||||||
index 3736592..4887c50 100644
|
|
||||||
--- a/src/views/leaks/CVEsDetail.vue
|
|
||||||
+++ b/src/views/leaks/CVEsDetail.vue
|
|
||||||
@@ -175,26 +175,21 @@ export default {
|
|
||||||
this.getHostList(this.cve_id, data);
|
|
||||||
},
|
|
||||||
getHostList(cveId, data) {
|
|
||||||
- const _this = this;
|
|
||||||
this.hostIsLoading = true;
|
|
||||||
getHostUnderCVE({
|
|
||||||
...data,
|
|
||||||
cve_id: cveId
|
|
||||||
- })
|
|
||||||
- .then(function (res) {
|
|
||||||
- _this.hostList = res.data.result || [];
|
|
||||||
- _this.hostList.forEach((item) => {
|
|
||||||
+ }).then((res) => {
|
|
||||||
+ if (res) {
|
|
||||||
+ this.hostList = res.data.result || [];
|
|
||||||
+ this.hostList.forEach((item) => {
|
|
||||||
item.hp_status = item.hp_status ? item.hp_status : '——';
|
|
||||||
item.fixStatus = item.hotpatch ? `是(${item.hp_status})` : '否';
|
|
||||||
});
|
|
||||||
- _this.paginationTotal = res.data.total_count || (res.data.total_count === 0 ? 0 : undefined);
|
|
||||||
- })
|
|
||||||
- .catch(function (err) {
|
|
||||||
- _this.$message.error(err.response.message);
|
|
||||||
- })
|
|
||||||
- .finally(function () {
|
|
||||||
- _this.hostIsLoading = false;
|
|
||||||
- });
|
|
||||||
+ this.paginationTotal = res.data.total_count || (res.data.total_count === 0 ? 0 : undefined);
|
|
||||||
+ }
|
|
||||||
+ });
|
|
||||||
+ this.hostIsLoading = false;
|
|
||||||
},
|
|
||||||
setStatus(status) {
|
|
||||||
const _this = this;
|
|
||||||
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
index 56056c9..134a0cb 100644
|
|
||||||
--- a/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
+++ b/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
@@ -105,7 +105,7 @@
|
|
||||||
<a-input-search
|
|
||||||
:placeholder="taskType === 'hotpatch remove' ? `按CVE ID搜索` : `按主机名或IP搜索`"
|
|
||||||
style="width: 200px"
|
|
||||||
- maxLength="20"
|
|
||||||
+ :maxLength="20"
|
|
||||||
@search="onSearch"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
@@ -646,6 +646,7 @@ export default {
|
|
||||||
this.tableIsLoading = false;
|
|
||||||
},
|
|
||||||
handleTableChange(pagination, filters, sorter) {
|
|
||||||
+ this.expandedRowKeys = [];
|
|
||||||
// 存储翻页状态
|
|
||||||
for (var key in filters) {
|
|
||||||
if (filters[key] !== null) {
|
|
||||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
|
||||||
index b83feb8..1546260 100644
|
|
||||||
--- a/src/views/leaks/components/HostTable.vue
|
|
||||||
+++ b/src/views/leaks/components/HostTable.vue
|
|
||||||
@@ -960,8 +960,8 @@ export default {
|
|
||||||
},
|
|
||||||
getRepoList() {
|
|
||||||
const _this = this;
|
|
||||||
- getRepoList()
|
|
||||||
- .then(function (res) {
|
|
||||||
+ getRepoList().then((res) => {
|
|
||||||
+ if (res) {
|
|
||||||
const arr = (res.data.result || []).map((repo) => {
|
|
||||||
return {
|
|
||||||
text: repo.repo_name,
|
|
||||||
@@ -972,11 +972,9 @@ export default {
|
|
||||||
text: '未设置',
|
|
||||||
value: ''
|
|
||||||
});
|
|
||||||
- _this.repoFilterList = arr;
|
|
||||||
- })
|
|
||||||
- .catch(function (err) {
|
|
||||||
- _this.$message.error(err.response.message);
|
|
||||||
- });
|
|
||||||
+ this.repoFilterList = arr;
|
|
||||||
+ }
|
|
||||||
+ });
|
|
||||||
},
|
|
||||||
// 检查是否有筛选条件
|
|
||||||
checkHasFilter(filters) {
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
@ -1,146 +0,0 @@
|
|||||||
From aaeef74c72b47edd85c79fceddd99e0b6f333f64 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hu gang <18768366022@163.com>
|
|
||||||
Date: Fri, 22 Dec 2023 09:44:17 +0800
|
|
||||||
Subject: [PATCH] feat: host info add reboot
|
|
||||||
|
|
||||||
---
|
|
||||||
src/vendor/ant-design-pro/utils/request.js | 14 +++++-------
|
|
||||||
src/views/assests/components/addMoreHost.vue | 3 ++-
|
|
||||||
src/views/leaks/HostLeakDetail.vue | 3 +++
|
|
||||||
.../components/CreateRepairTaskDrawer.vue | 22 +++++++++++++++++++
|
|
||||||
vue.config.js | 4 ++--
|
|
||||||
5 files changed, 35 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/vendor/ant-design-pro/utils/request.js b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
index 36615ad..d1c8d43 100644
|
|
||||||
--- a/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
+++ b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
@@ -101,7 +101,7 @@ request.interceptors.response.use((response) => {
|
|
||||||
const code = response.data.code || response.status;
|
|
||||||
// 不处理所有2xx的状态码
|
|
||||||
if (!code.toString().match(/^2[0-9]{2,2}$/)) {
|
|
||||||
- // let err = null;
|
|
||||||
+ let err = null;
|
|
||||||
switch (code) {
|
|
||||||
case '1201':
|
|
||||||
if (!timestamp1 || timestamp1 + 1632252465 < new Date().getTime()) {
|
|
||||||
@@ -171,18 +171,16 @@ request.interceptors.response.use((response) => {
|
|
||||||
description: response.data.message
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
+ case '1000':
|
|
||||||
+ err = new Error(response.data.message);
|
|
||||||
+ err.data = response.data.data;
|
|
||||||
+ err.response = response.data;
|
|
||||||
+ throw err;
|
|
||||||
default:
|
|
||||||
notification.error({
|
|
||||||
message: response.data.label,
|
|
||||||
description: response.data.message
|
|
||||||
});
|
|
||||||
- return new Promise((resolve) => {
|
|
||||||
- resolve(null);
|
|
||||||
- });
|
|
||||||
- // err = new Error(response.data.message);
|
|
||||||
- // err.data = response.data.data;
|
|
||||||
- // err.response = response.data;
|
|
||||||
- // throw err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (response.headers['content-type'] === 'application/octet-stream') {
|
|
||||||
diff --git a/src/views/assests/components/addMoreHost.vue b/src/views/assests/components/addMoreHost.vue
|
|
||||||
index 0b05ffd..1a6c62f 100644
|
|
||||||
--- a/src/views/assests/components/addMoreHost.vue
|
|
||||||
+++ b/src/views/assests/components/addMoreHost.vue
|
|
||||||
@@ -316,6 +316,8 @@ export default {
|
|
||||||
},
|
|
||||||
showModal() {
|
|
||||||
this.visible = true;
|
|
||||||
+ this.tableVis = false;
|
|
||||||
+ this.fileDataList = [];
|
|
||||||
},
|
|
||||||
closeModal() {
|
|
||||||
this.visible = false;
|
|
||||||
@@ -468,7 +470,6 @@ export default {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 当部分成功移除成功的主机
|
|
||||||
-
|
|
||||||
this.$message.success('部分主机添加成功!');
|
|
||||||
this.$emit('addSuccess');
|
|
||||||
}
|
|
||||||
diff --git a/src/views/leaks/HostLeakDetail.vue b/src/views/leaks/HostLeakDetail.vue
|
|
||||||
index ef1295d..27ed786 100644
|
|
||||||
--- a/src/views/leaks/HostLeakDetail.vue
|
|
||||||
+++ b/src/views/leaks/HostLeakDetail.vue
|
|
||||||
@@ -36,6 +36,9 @@
|
|
||||||
<a-col span="8">
|
|
||||||
<p>{{ `不受影响的CVE数量: ${detail.unaffected_cve_num}` }}</p>
|
|
||||||
</a-col>
|
|
||||||
+ <a-col span="8">
|
|
||||||
+ <p>{{ `重启后内核变更: ${detail.reboot ? '是' : '否'}` }}</p>
|
|
||||||
+ </a-col>
|
|
||||||
</a-row>
|
|
||||||
</div>
|
|
||||||
</a-spin>
|
|
||||||
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
index b302439..30efbe5 100644
|
|
||||||
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
@@ -55,6 +55,17 @@
|
|
||||||
<a-icon slot="unCheckedChildren" type="close" />
|
|
||||||
</a-switch>
|
|
||||||
</a-form-item>
|
|
||||||
+ <div class="notice" v-if="taskType === 'cve fix'">
|
|
||||||
+ <a-popover placement="topLeft">
|
|
||||||
+ <template slot="content">
|
|
||||||
+ <p>1. 冷、热补丁将拆分成2个任务分别执行</p>
|
|
||||||
+ <p>2. 同一主机,热补丁任务需在冷补丁修复任务前执行</p>
|
|
||||||
+ <p>3. 冷补丁任务执行完毕后,需重启才能生效</p>
|
|
||||||
+ </template>
|
|
||||||
+ <span slot="title">注意事项:</span>
|
|
||||||
+ <span class="notice-container">注意事项 <a-icon type="question-circle" /></span>
|
|
||||||
+ </a-popover>
|
|
||||||
+ </div>
|
|
||||||
<a-form-item label="选择REPO" v-if="taskType === 'repo set'">
|
|
||||||
<a-select
|
|
||||||
v-decorator="['repo', {rules: [{required: true, message: '请选择REPO'}]}]"
|
|
||||||
@@ -196,6 +207,7 @@
|
|
||||||
>点击跳转到{{ item.fix_way }}{{ taskType === 'cve fix' ? '修复' : '移除' }}任务页面</a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
+ <p v-if="jumpTaskId.length > 1">只执行热补丁任务,冷补丁任务需手动执行</p>
|
|
||||||
<p>{{ countDown }}秒后回到原页面</p>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
@@ -1076,3 +1088,13 @@ export default {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
+
|
|
||||||
+<style scoped lang="less">
|
|
||||||
+.notice {
|
|
||||||
+ padding: 0 0 10px 40px;
|
|
||||||
+ cursor: pointer;
|
|
||||||
+ &-container {
|
|
||||||
+ font-size: 14px;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+</style>
|
|
||||||
diff --git a/vue.config.js b/vue.config.js
|
|
||||||
index 402e69c..61c5a37 100644
|
|
||||||
--- a/vue.config.js
|
|
||||||
+++ b/vue.config.js
|
|
||||||
@@ -26,8 +26,8 @@ function getGitHash() {
|
|
||||||
|
|
||||||
const serverMap = {
|
|
||||||
// serverIpBase: 'http://127.0.0.1'
|
|
||||||
- // serverIpBase: 'http://172.168.61.81'
|
|
||||||
- serverIpBase: 'http://172.168.235.132'
|
|
||||||
+ // serverIpBase: 'http://172.168.235.132'
|
|
||||||
+ serverIpBase: 'http://172.168.97.229'
|
|
||||||
};
|
|
||||||
|
|
||||||
// vue.config.js
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
From b820fc785d288835793eddd30cdec8f107519ccc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hu gang <18768366022@163.com>
|
|
||||||
Date: Fri, 22 Dec 2023 18:02:16 +0800
|
|
||||||
Subject: [PATCH] fix: fix diagnosis
|
|
||||||
|
|
||||||
---
|
|
||||||
src/views/diagnosis/components/CreateWorkFlow.vue | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/views/diagnosis/components/CreateWorkFlow.vue b/src/views/diagnosis/components/CreateWorkFlow.vue
|
|
||||||
index ab76dce..cd85a23 100644
|
|
||||||
--- a/src/views/diagnosis/components/CreateWorkFlow.vue
|
|
||||||
+++ b/src/views/diagnosis/components/CreateWorkFlow.vue
|
|
||||||
@@ -120,7 +120,7 @@ const leftTableColumns = [
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'ip地址',
|
|
||||||
- dataIndex: 'public_ip'
|
|
||||||
+ dataIndex: 'host_ip'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '场景',
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
@ -1,158 +0,0 @@
|
|||||||
From a554b248224e1d4ab8030cb3c353eb835ed654ce Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hu gang <18768366022@163.com>
|
|
||||||
Date: Tue, 26 Dec 2023 16:54:57 +0800
|
|
||||||
Subject: [PATCH] fix: hot patch prompts are only executed if executed
|
|
||||||
immediately
|
|
||||||
|
|
||||||
---
|
|
||||||
.../assests/components/HostChartInfo.vue | 2 +-
|
|
||||||
src/views/leaks/LeakTaskDetail.vue | 44 +++++++++++++++++--
|
|
||||||
.../components/CreateRepairTaskDrawer.vue | 7 ++-
|
|
||||||
3 files changed, 47 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/views/assests/components/HostChartInfo.vue b/src/views/assests/components/HostChartInfo.vue
|
|
||||||
index d9e8fe7..8a144d8 100644
|
|
||||||
--- a/src/views/assests/components/HostChartInfo.vue
|
|
||||||
+++ b/src/views/assests/components/HostChartInfo.vue
|
|
||||||
@@ -124,7 +124,7 @@ export default {
|
|
||||||
getHostMetrics({
|
|
||||||
query_ip: this.queryIp
|
|
||||||
}).then((res) => {
|
|
||||||
- if (res) {
|
|
||||||
+ if (res.data) {
|
|
||||||
this.metrics = res.data.results;
|
|
||||||
if (this.selectedMetrics.length < 1) {
|
|
||||||
this.selectedMetrics = res.data.results.slice(0, 4);
|
|
||||||
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
index 134a0cb..38bc4f2 100644
|
|
||||||
--- a/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
+++ b/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
@@ -170,7 +170,12 @@
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div v-if="['cve fix', 'cve rollback'].includes(taskType)" slot="expandedRowRender" slot-scope="record">
|
|
||||||
- <a-table rowKey="id" :columns="innerColumns" :data-source="record.rpms || []" :pagination="false">
|
|
||||||
+ <a-table
|
|
||||||
+ :rowKey="(innerrecord) => innerrecord.installed_rpm + innerrecord[rpmTypeMap[taskType]]"
|
|
||||||
+ :columns="innerColumns"
|
|
||||||
+ :data-source="record.rpms || []"
|
|
||||||
+ :pagination="false"
|
|
||||||
+ >
|
|
||||||
<div slot="status" slot-scope="status">
|
|
||||||
<span>
|
|
||||||
<a-badge :status="statusValueMap[status]" />
|
|
||||||
@@ -184,6 +189,14 @@
|
|
||||||
<a-icon v-if="statusValueMap[status] === 'processing'" type="loading" class="color-running-circle" />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
+ <div slot="cves" slot-scope="cves" class="cve-text">
|
|
||||||
+ <a-popover placement="topLeft">
|
|
||||||
+ <template slot="content">
|
|
||||||
+ <p class="cve-text-pop">{{ cves }}</p>
|
|
||||||
+ </template>
|
|
||||||
+ {{ cves }}
|
|
||||||
+ </a-popover>
|
|
||||||
+ </div>
|
|
||||||
</a-table>
|
|
||||||
</div>
|
|
||||||
</a-table>
|
|
||||||
@@ -257,6 +270,12 @@ const rowKeyMap = {
|
|
||||||
'hotpatch remove': 'cve_id'
|
|
||||||
};
|
|
||||||
|
|
||||||
+// rpm类型与任务类型映射关系
|
|
||||||
+const rpmTypeMap = {
|
|
||||||
+ 'cve fix': 'available_rpm',
|
|
||||||
+ 'cve rollback': 'target_rpm'
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
const cveStatusTextMap = {
|
|
||||||
succeed: '修复成功',
|
|
||||||
fail: '待修复',
|
|
||||||
@@ -345,10 +364,12 @@ export default {
|
|
||||||
taskTypeMap,
|
|
||||||
rowKeyMap,
|
|
||||||
statusValueMap,
|
|
||||||
+ rpmTypeMap,
|
|
||||||
// rpm列表是否为展开状态
|
|
||||||
isRpmTableExtend: false,
|
|
||||||
isRollbackModelvisible: false,
|
|
||||||
countDown: 0,
|
|
||||||
+ // 创建的回滚任务id
|
|
||||||
rollbackTaskId: '',
|
|
||||||
jumpModalInterval: null,
|
|
||||||
// 详情页面下要执行任务的所有主机
|
|
||||||
@@ -467,15 +488,16 @@ export default {
|
|
||||||
title: taskType === 'cve fix' ? '受影响rpm' : '已安装rpm'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- dataIndex: taskType === 'cve fix' ? 'available_rpm' : 'target_rpm',
|
|
||||||
- key: taskType === 'cve fix' ? 'available_rpm' : 'target_rpm',
|
|
||||||
+ dataIndex: rpmTypeMap[taskType],
|
|
||||||
+ key: rpmTypeMap[taskType],
|
|
||||||
title: taskType === 'cve fix' ? '待安装rpm' : '目标rpm',
|
|
||||||
scopedSlots: {customRender: 'rpm'}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
dataIndex: 'cves',
|
|
||||||
key: 'cves',
|
|
||||||
- title: 'CVE'
|
|
||||||
+ title: 'CVE',
|
|
||||||
+ scopedSlots: {customRender: 'cves'}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
dataIndex: 'status',
|
|
||||||
@@ -1166,4 +1188,18 @@ export default {
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 4px 6px 20px;
|
|
||||||
}
|
|
||||||
+.cve-text {
|
|
||||||
+ max-width: 300px;
|
|
||||||
+ overflow: hidden;
|
|
||||||
+ white-space: nowrap;
|
|
||||||
+ text-overflow: ellipsis;
|
|
||||||
+ &-pop {
|
|
||||||
+ max-width: 500px;
|
|
||||||
+ display: -webkit-box;
|
|
||||||
+ -webkit-line-clamp: 25;
|
|
||||||
+ -webkit-box-orient: vertical;
|
|
||||||
+ overflow: hidden;
|
|
||||||
+ text-overflow: ellipsis;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
</style>
|
|
||||||
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
index 30efbe5..b7e4424 100644
|
|
||||||
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
@@ -207,7 +207,9 @@
|
|
||||||
>点击跳转到{{ item.fix_way }}{{ taskType === 'cve fix' ? '修复' : '移除' }}任务页面</a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
- <p v-if="jumpTaskId.length > 1">只执行热补丁任务,冷补丁任务需手动执行</p>
|
|
||||||
+ <p v-if="jumpTaskId.length > 1">
|
|
||||||
+ {{ isExcuteASAP ? '已自动执行热补丁任务,冷补丁任务需手动执行' : '请优先执行热补丁任务' }}
|
|
||||||
+ </p>
|
|
||||||
<p>{{ countDown }}秒后回到原页面</p>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
@@ -307,6 +309,8 @@ export default {
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
+ // 是否立即执行
|
|
||||||
+ isExcuteASAP: false,
|
|
||||||
hostListparams: [],
|
|
||||||
fixParams: {},
|
|
||||||
// 修复任务入参
|
|
||||||
@@ -788,6 +792,7 @@ export default {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleSubmit(excuteASAP = false) {
|
|
||||||
+ this.isExcuteASAP = excuteASAP;
|
|
||||||
const _this = this;
|
|
||||||
this.form.validateFields((err, values) => {
|
|
||||||
if (!err) {
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
From 33ba64d3fe7b96ad2a8d15d053e64f50401059f9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hu gang <18768366022@163.com>
|
|
||||||
Date: Wed, 17 Jan 2024 14:49:13 +0800
|
|
||||||
Subject: [PATCH] Modify the task description copy of the create hot patch removal task
|
|
||||||
|
|
||||||
---
|
|
||||||
.../components/CreateRepairTaskDrawer.vue | 7 +++--
|
|
||||||
src/views/leaks/components/HostTable.vue | 31 ++++++++++---------
|
|
||||||
2 files changed, 21 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
index b7e4424..a9023da 100644
|
|
||||||
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
@@ -241,7 +241,7 @@ const taskTypsbutton = {
|
|
||||||
'cve fix': '生成修复任务',
|
|
||||||
'repo set': '设置REPO',
|
|
||||||
'cve rollback': '生成回滚任务',
|
|
||||||
- 'hotpatch remove': '热补丁移除任务'
|
|
||||||
+ 'hotpatch remove': '热补丁移除'
|
|
||||||
};
|
|
||||||
const taskTypsEnum = {
|
|
||||||
'cve fix': 'cve修复',
|
|
||||||
@@ -486,7 +486,7 @@ export default {
|
|
||||||
if (this.taskType === 'cve fix') {
|
|
||||||
this.$message.info('至少需要选择一个CVE才能进行修复!');
|
|
||||||
} else {
|
|
||||||
- this.$message.info('至少需要选择一个CVE才能进行回滚!');
|
|
||||||
+ this.$message.info('至少需要选择一个CVE才能进行移除!');
|
|
||||||
}
|
|
||||||
this.hostUnderCveLoading = false;
|
|
||||||
return true;
|
|
||||||
@@ -515,6 +515,7 @@ export default {
|
|
||||||
|
|
||||||
// 每次展开抽屉时触发,替代mounted
|
|
||||||
handleOpen() {
|
|
||||||
+ console.log(111);
|
|
||||||
// inital defualt data
|
|
||||||
this.visible = true;
|
|
||||||
this.cveList = this.cveListProps;
|
|
||||||
@@ -1060,7 +1061,7 @@ export default {
|
|
||||||
switch (this.taskType) {
|
|
||||||
case 'hotpatch remove':
|
|
||||||
this.taskNameDefault = '热补丁移除任务';
|
|
||||||
- this.taskDescDefault = `移除以下${this.cveList.length}个CVE:${this.cveList
|
|
||||||
+ this.taskDescDefault = `移除以下${this.cveList.length}个CVE对应的热补丁:${this.cveList
|
|
||||||
.map((cve) => cve.cve_id)
|
|
||||||
.join('、')}`;
|
|
||||||
break;
|
|
||||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
|
||||||
index 1546260..557c71e 100644
|
|
||||||
--- a/src/views/leaks/components/HostTable.vue
|
|
||||||
+++ b/src/views/leaks/components/HostTable.vue
|
|
||||||
@@ -79,43 +79,43 @@
|
|
||||||
<a-col v-if="standalone">
|
|
||||||
<a-button @click="handleExport" type="primary">导出</a-button>
|
|
||||||
</a-col>
|
|
||||||
- <a-col v-if="!standalone && !fixed && selectedRowKeys.length === 0">
|
|
||||||
+ <a-col v-if="isStandFixedSelected(standalone, !fixed, selectedRowKeys.length === 0)">
|
|
||||||
<create-repair-task-drawer
|
|
||||||
text="生成修复任务"
|
|
||||||
taskType="cve fix"
|
|
||||||
:fixed="fixed"
|
|
||||||
- :cveListProps="cveList"
|
|
||||||
+ :cveListProps="propData.length !== 0 ? cveList : []"
|
|
||||||
hostListType="byLoading"
|
|
||||||
@createSuccess="handleTaskCreateSuccess"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
- <a-col v-if="!standalone && !fixed && selectedRowKeys.length !== 0">
|
|
||||||
+ <a-col v-if="isStandFixedSelected(standalone, !fixed, selectedRowKeys.length !== 0)">
|
|
||||||
<create-repair-task-drawer
|
|
||||||
taskType="cve fix"
|
|
||||||
:fixed="fixed"
|
|
||||||
- :cveListProps="cveList"
|
|
||||||
+ :cveListProps="propData.length !== 0 ? cveList : []"
|
|
||||||
hostListType="bySelection"
|
|
||||||
:hostList="selectedRowsAll"
|
|
||||||
@createSuccess="handleTaskCreateSuccess"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
- <a-col v-if="!standalone && fixed && selectedRowKeys.length === 0">
|
|
||||||
+ <a-col v-if="isStandFixedSelected(standalone, fixed, selectedRowKeys.length !== 0)">
|
|
||||||
<create-repair-task-drawer
|
|
||||||
- text="生成回滚任务"
|
|
||||||
- taskType="cve rollback"
|
|
||||||
+ taskType="hotpatch remove"
|
|
||||||
:fixed="fixed"
|
|
||||||
- :cveListProps="cveList"
|
|
||||||
- hostListType="byLoading"
|
|
||||||
+ :cveListProps="propData.length !== 0 ? cveList : []"
|
|
||||||
+ hostListType="bySelection"
|
|
||||||
+ :hostList="selectedRowsAll"
|
|
||||||
@createSuccess="handleTaskCreateSuccess"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
- <a-col v-if="!standalone && fixed && selectedRowKeys.length !== 0">
|
|
||||||
+ <a-col v-if="isStandFixedSelected(standalone, fixed, selectedRowKeys.length === 0)">
|
|
||||||
<create-repair-task-drawer
|
|
||||||
- taskType="cve rollback"
|
|
||||||
+ text="热补丁移除"
|
|
||||||
+ taskType="hotpatch remove"
|
|
||||||
:fixed="fixed"
|
|
||||||
- :cveListProps="cveList"
|
|
||||||
- hostListType="bySelection"
|
|
||||||
- :hostList="selectedRowsAll"
|
|
||||||
+ :cveListProps="propData.length !== 0 ? cveList : []"
|
|
||||||
+ hostListType="byLoading"
|
|
||||||
@createSuccess="handleTaskCreateSuccess"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
@@ -259,6 +259,9 @@ export default {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
+ isStandFixedSelected() {
|
|
||||||
+ return (standalone, fixed, selected) => !standalone && fixed && selected;
|
|
||||||
+ },
|
|
||||||
hostTableColumnsStandalone() {
|
|
||||||
let {filters} = this;
|
|
||||||
filters = filters || {};
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
From dae976daf452aeb851350c5c1315027872c1a399 Mon Sep 17 00:00:00 2001
|
|
||||||
From: hugang <18768366022@163.com>
|
|
||||||
Date: Tue, 11 Jun 2024 19:48:09 +0800
|
|
||||||
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?=
|
|
||||||
=?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9=E5=AF=86?=
|
|
||||||
=?UTF-8?q?=E7=A0=81=E6=97=B6=E6=8F=90=E7=A4=BA=E8=AF=8D=E9=94=99=E8=AF=AF?=
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
---
|
|
||||||
src/vendor/ant-design-pro/utils/request.js | 7 +------
|
|
||||||
src/views/leaks/components/CreateRepairTaskDrawer.vue | 6 +++---
|
|
||||||
2 files changed, 4 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/vendor/ant-design-pro/utils/request.js b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
index a09fe31..db07b57 100644
|
|
||||||
--- a/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
+++ b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
@@ -177,16 +177,11 @@ request.interceptors.response.use((response) => {
|
|
||||||
description: response.data.message
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
- case '1000':
|
|
||||||
+ default:
|
|
||||||
err = new Error(response.data.message);
|
|
||||||
err.data = response.data.data;
|
|
||||||
err.response = response.data;
|
|
||||||
throw err;
|
|
||||||
- default:
|
|
||||||
- notification.error({
|
|
||||||
- message: response.data.label,
|
|
||||||
- description: response.data.message
|
|
||||||
- });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (response.headers['content-type'] === 'application/octet-stream') {
|
|
||||||
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
index a9023da..6074199 100644
|
|
||||||
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
@@ -204,7 +204,7 @@
|
|
||||||
<h3>{{ jumpModalTitle || '成功' }}</h3>
|
|
||||||
<p v-for="item in jumpTaskId" :key="item.task_id">
|
|
||||||
<a @click="jumpToPage(item)"
|
|
||||||
- >点击跳转到{{ item.fix_way }}{{ taskType === 'cve fix' ? '修复' : '移除' }}任务页面</a
|
|
||||||
+ >点击跳转到 {{taskTypsEnum[taskType]}}任务页面</a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
<p v-if="jumpTaskId.length > 1">
|
|
||||||
@@ -246,7 +246,7 @@ const taskTypsbutton = {
|
|
||||||
const taskTypsEnum = {
|
|
||||||
'cve fix': 'cve修复',
|
|
||||||
'repo set': 'repo设置',
|
|
||||||
- 'cve rollback': '生成回滚任务(当前仅支持热补丁回滚)',
|
|
||||||
+ 'cve rollback': '回滚任务',
|
|
||||||
'hotpatch remove': '热补丁移除'
|
|
||||||
};
|
|
||||||
const hostListTypes = ['byLoading', 'bySelection', 'byOneHost'];
|
|
||||||
@@ -916,7 +916,7 @@ export default {
|
|
||||||
info: cveRoobackInfo
|
|
||||||
};
|
|
||||||
if (cveRoobackInfo.length === 0) {
|
|
||||||
- this.$message.info('请至少选择一个cve下的一台主机进行回滚!');
|
|
||||||
+ this.$message.info('请至少选择一个cve下的一台主机进行移除!');
|
|
||||||
this.submitLoading = false;
|
|
||||||
this.submitAndExecuteLoading = false;
|
|
||||||
break;
|
|
||||||
--
|
|
||||||
2.43.0.windows.1
|
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: aops-hermes
|
Name: aops-hermes
|
||||||
Version: v1.4.0
|
Version: v1.4.0
|
||||||
Release: 8
|
Release: 3
|
||||||
Summary: Web for an intelligent diagnose frame
|
Summary: Web for an intelligent diagnose frame
|
||||||
License: MulanPSL2
|
License: MulanPSL2
|
||||||
URL: https://gitee.com/openeuler/%{name}
|
URL: https://gitee.com/openeuler/%{name}
|
||||||
@ -13,12 +13,6 @@ Patch002: 002-fix-hotpatch-remove-filter.patch
|
|||||||
Patch003: 003-change-search-placeholder.patch
|
Patch003: 003-change-search-placeholder.patch
|
||||||
Patch004: 004-modify-search-key-for-hostlist.patch
|
Patch004: 004-modify-search-key-for-hostlist.patch
|
||||||
Patch005: 005-add-input-text-limit.patch
|
Patch005: 005-add-input-text-limit.patch
|
||||||
Patch006: 006-host-status-adaption.patch
|
|
||||||
Patch007: 007-host-info-and-generate-task.patch
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
BuildRequires: nodejs node-gyp nodejs-yarn
|
BuildRequires: nodejs node-gyp nodejs-yarn
|
||||||
@ -54,25 +48,6 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Jun 11 2024 Hu gang<18768366022@163.com> - v1.4.0-8
|
|
||||||
- Modify password interface prompt word modification
|
|
||||||
|
|
||||||
* Wed Jan 17 2024 Hu gang<18768366022@163.com> - v1.4.0-7
|
|
||||||
- Modify the task description copy of the create hot patch removal task
|
|
||||||
- remove create rollback button in cve detail,add hotpatch button in cve detail
|
|
||||||
|
|
||||||
* Wed Dec 27 2023 Hu gang<18768366022@163.com> - v1.4.0-6
|
|
||||||
- Fix hot patch prompts are only executed ifexecuted
|
|
||||||
|
|
||||||
* Fri Dec 22 2023 Hu gang<18768366022@163.com> - v1.4.0-5
|
|
||||||
- Fix diagnosis
|
|
||||||
|
|
||||||
* Fri Dec 22 2023 Hu gang<18768366022@163.com> - v1.4.0-4
|
|
||||||
- Added an interface adaptation for host status
|
|
||||||
- Added a field to determine whether the kernel changes after the host is restarted
|
|
||||||
- Added a new hot patch prompt for creating a repair task
|
|
||||||
- Fix some bug
|
|
||||||
|
|
||||||
* Tue Dec 19 2023 Hu gang<18768366022@163.com> - v1.4.0-3
|
* Tue Dec 19 2023 Hu gang<18768366022@163.com> - v1.4.0-3
|
||||||
- Add imput text limit
|
- Add imput text limit
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user