Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
68edf22689
!210 修复cve详情点击关联的cve跳转错误问题
From: @hu-gang 
Reviewed-by: @Lostwayzxc 
Signed-off-by: @Lostwayzxc
2024-12-10 11:25:31 +00:00
Hu Gang
aa1ba9a5b9 fix the cve detail display issue 2024-12-10 14:34:21 +08:00
openeuler-ci-bot
7d8598558a
!207 optimize request encapsulation logic
From: @hu-gang 
Reviewed-by: @Lostwayzxc 
Signed-off-by: @Lostwayzxc
2024-12-02 13:28:39 +00:00
Hu Gang
ca70024d06 set the default language for requests 2024-12-02 16:17:42 +08:00
openeuler-ci-bot
d1909a6e3e
!206 优化上传主机组入参校验
From: @hu-gang 
Reviewed-by: @Lostwayzxc 
Signed-off-by: @Lostwayzxc
2024-11-30 08:54:39 +00:00
Hu Gang
b26b482f6e modify host group input parameter verification 2024-11-30 15:29:49 +08:00
openeuler-ci-bot
ff17e6807d
!204 更新版本2.1.1
From: @hu-gang 
Reviewed-by: @Lostwayzxc 
Signed-off-by: @Lostwayzxc
2024-11-19 13:19:22 +00:00
Hu Gang
6bbbefb1ea update version to 2.1.1 2024-11-19 20:59:32 +08:00
openeuler-ci-bot
562b147178
!182 [sync] PR-179: 修改密码提示词错误修改
From: @openeuler-sync-bot 
Reviewed-by: @Lostwayzxc 
Signed-off-by: @Lostwayzxc
2024-06-19 02:11:35 +00:00
hugang
02e24cc00f fix: fix prompt word
(cherry picked from commit 4353f2e9c19e471065a2f841c88d226f452e4e09)
2024-06-17 15:59:41 +08:00
17 changed files with 471 additions and 1887 deletions

View File

@ -0,0 +1,193 @@
From 1e59894bd65c00ecc8d7b546b034df40c79c6494 Mon Sep 17 00:00:00 2001
From: Hu Gang <18768366022@163.com>
Date: Wed, 27 Nov 2024 11:25:40 +0800
Subject: [PATCH] Modify host group input parameter verification
---
.eslintignore | 1 +
.eslintrc.js | 3 ++
src/locales/lang/en.json | 4 +-
src/locales/lang/zh-cn.json | 4 +-
.../assests/components/AddHostGroupModal.vue | 41 ++++++++-----------
src/views/execution/Scripts.vue | 8 +++-
6 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/.eslintignore b/.eslintignore
index 2b26093..b33de94 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -4,3 +4,4 @@ package.json
.vscode
.idea
+.eslintrc.js
diff --git a/.eslintrc.js b/.eslintrc.js
index c83a20c..5942158 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -32,5 +32,8 @@ module.exports = {
indent: ["error", 2],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-expressions": 'off',
+ "vue/valid-define-props": "off",
+ "vue/valid-define-emits": "off",
+ "vue/multi-word-component-names": "off"
},
}
diff --git a/src/locales/lang/en.json b/src/locales/lang/en.json
index 4440bbe..a9f9f06 100644
--- a/src/locales/lang/en.json
+++ b/src/locales/lang/en.json
@@ -138,9 +138,9 @@
"descriptionTwo": "There cannot be a >< symbol",
"hostGroup": "Please select the host group",
"hostGroup_input": "Please enter a host group name",
- "hostGroup_one": "It must start with a lowercase letter and cannot end with an underscore.",
+ "hostGroup_one": "The host group name must start with a lowercase letter and not end with an underscore.",
"hostGroup_three": "The name should consist of numbers, lowercase letters, and underscores.",
- "hostGroup_two": "It must start with a lowercase letter and cannot end with an underscore.",
+ "hostGroup_two": "The host group name should be less than 20 characters long.",
"hostName": "The host name length should be less than 50",
"hostName_one": "No leading or trailing spaces are allowed",
"hostName_two": "No full spaces allowed",
diff --git a/src/locales/lang/zh-cn.json b/src/locales/lang/zh-cn.json
index e8d58d5..207110f 100644
--- a/src/locales/lang/zh-cn.json
+++ b/src/locales/lang/zh-cn.json
@@ -138,9 +138,9 @@
"descriptionTwo": "不能有><符号",
"hostGroup": "请选择所属主机组",
"hostGroup_input": "请输入主机组名称",
- "hostGroup_one": "以小写字母开头,且结尾不能是英文下划线",
+ "hostGroup_one": "主机组名称以小写字母开头,且不以英文下划线结尾",
"hostGroup_three": "名称应由数字、小写字母、英文下划线组成",
- "hostGroup_two": "以小写字母开头,且结尾不能是英文下划线",
+ "hostGroup_two": "主机组名称长度应小于20",
"hostName": "主机名长度应小于50",
"hostName_one": "首尾不允许空格",
"hostName_two": "不允许全空格",
diff --git a/src/views/assests/components/AddHostGroupModal.vue b/src/views/assests/components/AddHostGroupModal.vue
index 205e904..ecac117 100644
--- a/src/views/assests/components/AddHostGroupModal.vue
+++ b/src/views/assests/components/AddHostGroupModal.vue
@@ -44,12 +44,15 @@ const form = reactive<Form>({
* @param value
*/
function validateGroupName(_rule: Rule, value: string) {
- if (/[^0-9a-z_]/.test(value))
- return Promise.reject(new Error(t('assests.validateMsg.hostGroup_one')))
- if (/^[^a-z]/.test(value))
+ if (!value) {
+ return Promise.resolve()
+ }
+ if (value.length > 20) {
return Promise.reject(new Error(t('assests.validateMsg.hostGroup_two')))
- if (value.endsWith('_'))
- return Promise.reject(new Error(t('assests.validateMsg.hostGroup_three')))
+ }
+ if (!/^[a-z](?:[^\n]{0,18})(?<!_)$/.test(value)) {
+ return Promise.reject(new Error(t('assests.validateMsg.hostGroup_one')))
+ }
return Promise.resolve()
}
@@ -59,10 +62,8 @@ function validateGroupName(_rule: Rule, value: string) {
* @param value
*/
function validateDesc(_rule: Rule, value: string) {
- if (value.length > 60)
- return Promise.reject(new Error(t('assests.validateMsg.descriptionOne')))
- if (/[<>]/.test(value))
- return Promise.reject(new Error(t('assests.validateMsg.descriptionTwo')))
+ if (value.length > 60) return Promise.reject(new Error(t('assests.validateMsg.descriptionOne')))
+ if (/[<>]/.test(value)) return Promise.reject(new Error(t('assests.validateMsg.descriptionTwo')))
return Promise.resolve()
}
@@ -74,10 +75,7 @@ async function addNewHostGroup() {
try {
await formRef.value.validate()
- const params: Record<
- string,
- { host_group_name: string, description: string, cluster_id: string }
- > = {}
+ const params: Record<string, { host_group_name: string; description: string; cluster_id: string }> = {}
params[form.cluster_id!] = {
description: form.desc,
host_group_name: form.hostName,
@@ -91,19 +89,16 @@ async function addNewHostGroup() {
message: t('common.fail'),
description: Object.values(res)[0].label,
})
- }
- else {
+ } else {
message.success(t('common.succeed'))
}
visible.value = false
emits('success')
formRef.value.resetFields()
}
- }
- catch {
+ } catch {
isLoading.value = false
- }
- finally {
+ } finally {
isLoading.value = false
}
}
@@ -139,9 +134,7 @@ function handleClose() {
<a-select v-model:value="form.cluster_id" :placeholder="t('assests.placeHolder.cluster')">
<template v-for="cluster in clusters" :key="cluster.cluster_id">
<a-select-option :value="cluster.cluster_id">
- {{
- cluster.cluster_name
- }}
+ {{ cluster.cluster_name }}
</a-select-option>
</template>
</a-select>
@@ -164,9 +157,7 @@ function handleClose() {
:placeholder="t('assests.placeHolder.hostGroupInput')"
>
<template #suffix>
- <a-tooltip
- :title="$t('assests.tips.hostGroupName')"
- >
+ <a-tooltip :title="$t('assests.tips.hostGroupName')">
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
diff --git a/src/views/execution/Scripts.vue b/src/views/execution/Scripts.vue
index ae98301..00959f7 100644
--- a/src/views/execution/Scripts.vue
+++ b/src/views/execution/Scripts.vue
@@ -108,6 +108,11 @@ function handleRefresh() {
getScripts()
}
+function handleNewScriptCanceled() {
+ tableState.selectedScriptId = ''
+ isModalVisible.value = false
+}
+
onMounted(() => {
getScripts()
})
@@ -168,9 +173,8 @@ onMounted(() => {
:visible="isModalVisible"
:script-id="tableState.selectedScriptId"
@success="handleSuccess"
- @cancel="isModalVisible = false"
+ @cancel="handleNewScriptCanceled"
/>
</template>
<style scoped></style>
-
--
2.33.0

View File

@ -0,0 +1,105 @@
From d18757fd6acf0315052267c8cf60061d9bd0285b Mon Sep 17 00:00:00 2001
From: Hu Gang <18768366022@163.com>
Date: Mon, 2 Dec 2024 15:43:31 +0800
Subject: [PATCH] fix: Coset the default language for requests
---
.eslintrc.js | 1 -
src/api/request.ts | 34 ++++++++++++++++++++--------------
src/views/account/Auth.vue | 2 +-
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 5942158..b4dbe94 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -29,7 +29,6 @@ module.exports = {
},
plugins: ["@typescript-eslint", "vue"],
rules: {
- indent: ["error", 2],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-expressions": 'off',
"vue/valid-define-props": "off",
diff --git a/src/api/request.ts b/src/api/request.ts
index 9644c2f..d7f93db 100644
--- a/src/api/request.ts
+++ b/src/api/request.ts
@@ -56,7 +56,7 @@ request.interceptors.request.use(
}
const { lang } = useLangStore()
- config.headers['Accept-Language'] = lang === 'zh_cn' ? 'zh' : 'en'
+ config.headers['Accept-Language'] = lang === 'en' ? 'en' : 'zh'
const aopsInfo = localStorage.getItem('aops')
if (aopsInfo) {
@@ -96,6 +96,7 @@ function dealBlobResponse(resp: AxiosResponse<any, any>) {
}
downloadBlobFile(resp.data, filename)
}
+let isAuthing = false
request.interceptors.response.use(
async (response: AxiosResponse<any, any>): Promise<any> => {
@@ -125,19 +126,23 @@ request.interceptors.response.use(
if (!code.toString().match(/^2\d{2}$/)) {
switch (Number(code)) {
case 1201:
- notification.error({
- message: `${t('account.sentence.validationFailed')}`,
- description: response.data.message,
- })
- setTimeout(async () => {
- const { clearInfo } = useAccountStore()
- const { getAuthRedirectUrl } = useAccountStore()
- const url = await getAuthRedirectUrl()
- if (url) {
- clearInfo()
- window.location.href = url
- }
- }, 1000)
+ if (!isAuthing) {
+ notification.error({
+ message: `${t('account.sentence.validationFailed')}`,
+ description: response.data.message,
+ })
+ isAuthing = true
+ setTimeout(async () => {
+ const { clearInfo } = useAccountStore()
+ const { getAuthRedirectUrl } = useAccountStore()
+ const url = await getAuthRedirectUrl()
+ if (url) {
+ clearInfo()
+ window.location.href = url
+ }
+ }, 1000)
+ }
+
break
case 1207:
if (response.config.url !== `/accounts/refreshtoken`) {
@@ -189,6 +194,7 @@ request.interceptors.response.use(
}
return Promise.reject(result)
}
+ isAuthing = false
return data
},
(error: AxiosError) => {
diff --git a/src/views/account/Auth.vue b/src/views/account/Auth.vue
index 55f81cc..4b8a33b 100644
--- a/src/views/account/Auth.vue
+++ b/src/views/account/Auth.vue
@@ -21,7 +21,7 @@ async function auth(code: string) {
type: res.type || '',
})
setTimeout(() => {
- router.push('/dashboard')
+ router.replace('/')
isAuthing.value = false
}, 1000)
} else {
--
2.33.0

View File

@ -0,0 +1,150 @@
From 66ca10539e70e6e5f81c50a80cf3402de764a3bf Mon Sep 17 00:00:00 2001
From: Hu Gang <18768366022@163.com>
Date: Tue, 10 Dec 2024 14:09:34 +0800
Subject: [PATCH] fix cve detail display issue
---
src/locales/lang/zh-cn.json | 2 +-
src/views/execution/Scripts.vue | 1 +
src/views/vulnerability/CveDetail.vue | 40 +++++++++++++++------------
3 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/src/locales/lang/zh-cn.json b/src/locales/lang/zh-cn.json
index 207110f..59c8841 100644
--- a/src/locales/lang/zh-cn.json
+++ b/src/locales/lang/zh-cn.json
@@ -626,7 +626,7 @@
"searchBy": "按主机名搜索"
},
"product": "产品",
- "publishTime": "发布时间:",
+ "publishTime": "发布时间",
"severity": "严重性:",
"unfixed": {
"rpms": {
diff --git a/src/views/execution/Scripts.vue b/src/views/execution/Scripts.vue
index 00959f7..97f906b 100644
--- a/src/views/execution/Scripts.vue
+++ b/src/views/execution/Scripts.vue
@@ -91,6 +91,7 @@ const isModalVisible = ref(false)
function handleSuccess() {
isModalVisible.value = false
+ tableState.selectedScriptId = ''
getScripts()
}
diff --git a/src/views/vulnerability/CveDetail.vue b/src/views/vulnerability/CveDetail.vue
index 6d1843e..632e7d1 100644
--- a/src/views/vulnerability/CveDetail.vue
+++ b/src/views/vulnerability/CveDetail.vue
@@ -1,6 +1,6 @@
<script lang="ts" setup>
-import { onBeforeRouteUpdate, useRoute } from 'vue-router'
-import { computed, onMounted, ref } from 'vue'
+import { useRoute } from 'vue-router'
+import { computed, onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { severityColorMap } from './config'
import HostTable from './components/HostTable.vue'
@@ -13,7 +13,7 @@ const route = useRoute()
const isSpanning = ref(false)
// #region ----------------------------------------< detail >----------------------------------------
-
+const cveId = ref()
const affectTableColumns = computed(() => [
{
dataIndex: 'os_version',
@@ -40,16 +40,14 @@ const cveInfo = ref<CveDetail>({
async function queryCveDetail(cveId: string) {
isSpanning.value = true
const [, res] = await api.getCveInfos(cveId)
- if (res)
- cveInfo.value = res.result
+ if (res) cveInfo.value = res.result
isSpanning.value = false
}
-function initCveDetail() {
- const cveId = (route.params.cve_id as string) ?? undefined
- if (!cveId)
- return
+function initCveDetail(cveId: string) {
+ if (!cveId) return
+
queryCveDetail(cveId)
}
// #endregion
@@ -58,7 +56,7 @@ function initCveDetail() {
const isDrawerVisible = ref(false)
-const drawerColunms = [
+const drawerColumns = [
{
dataIndex: 'index',
title: t('vul.cveDetail.index'),
@@ -70,12 +68,17 @@ const drawerColunms = [
]
// #endregion
-onBeforeRouteUpdate(() => {
- initCveDetail()
-})
+watch(
+ () => route.path,
+ () => {
+ cveId.value = (route.params.cve_id as string) ?? ''
+ initCveDetail(cveId.value)
+ },
+)
onMounted(() => {
- initCveDetail()
+ cveId.value = (route.params.cve_id as string) ?? ''
+ initCveDetail(cveId.value)
})
</script>
@@ -95,7 +98,8 @@ onMounted(() => {
{{ `${t('vul.cveDetail.publishTime')} : ${cveInfo.publish_time}` }}
</a-col>
<a-col v-if="cveInfo.severity" :span="8">
- {{ $t('vul.cveDetail.severity') }} <span :style="`color: ${severityColorMap[cveInfo.severity]}`">{{
+ {{ $t('vul.cveDetail.severity') }}
+ <span :style="`color: ${severityColorMap[cveInfo.severity]}`">{{
t(`vul.severityStatus.${cveInfo.severity.toLowerCase()}`)
}}</span>
</a-col>
@@ -117,7 +121,7 @@ onMounted(() => {
</a-col>
<a-drawer v-model:open="isDrawerVisible" :title="$t('vul.cveDetail.associateCVE')">
<a-table
- :columns="drawerColunms"
+ :columns="drawerColumns"
:data-source="cveInfo.related_cve.map((item, index) => ({ name: item, index }))"
:pagination="false"
bordered
@@ -125,7 +129,7 @@ onMounted(() => {
<template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'name'">
<router-link
- :to="{ path: `/vulnerability/cves-management/${record.name}` }"
+ :to="{ path: `/vulnerability/cves/cve-detail/${record.name}` }"
@click="isDrawerVisible = false"
>
{{ record.name }}
@@ -152,7 +156,7 @@ onMounted(() => {
</a-card>
<a-card>
<h1>{{ $t('vul.cveDetail.affectedHost') }}</h1>
- <HostTable class="host-table" />
+ <HostTable :key="cveId" class="host-table" />
</a-card>
</PageWrapper>
</template>
--
2.33.0

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
From a747433cfaf40104eb56d9d3dea6d86ed5d5b82d Mon Sep 17 00:00:00 2001
From: Hu gang <18768366022@163.com>
Date: Mon, 18 Dec 2023 10:27:00 +0800
Subject: [PATCH] fix: fix hotpathch remove filter failed
---
src/views/leaks/LeakTaskDetail.vue | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
index f7f7438..00438d7 100644
--- a/src/views/leaks/LeakTaskDetail.vue
+++ b/src/views/leaks/LeakTaskDetail.vue
@@ -661,6 +661,8 @@ export default {
// 出发排序、筛选、分页时,重新请求主机列表
if (this.taskType === 'cve fix' || this.taskType === 'cve rollback') {
this.getCveList();
+ } else if (this.taskType === 'hotpatch remove') {
+ this.getCveListWithHotpathRemove();
} else {
this.getHostList();
}
--
Gitee

View File

@ -1,24 +0,0 @@
From 2cc872cddbc8331941507167b23a977aa0b543ad Mon Sep 17 00:00:00 2001
From: Hu gang <18768366022@163.com>
Date: Mon, 18 Dec 2023 11:05:17 +0800
Subject: [PATCH] chore: change search input palceholder
---
src/views/leaks/LeakTaskDetail.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
index 00438d7..766a1cf 100644
--- a/src/views/leaks/LeakTaskDetail.vue
+++ b/src/views/leaks/LeakTaskDetail.vue
@@ -103,7 +103,7 @@
<a-row type="flex" :gutter="6">
<a-col>
<a-input-search
- :placeholder="taskType === 'hotpatch remove' ? `按CVE ID搜索` : `按主机搜索`"
+ :placeholder="taskType === 'hotpatch remove' ? `按CVE ID搜索` : `按主机名或主机ip搜索`"
style="width: 200px"
@search="onSearch"
/>
--
Gitee

View File

@ -1,38 +0,0 @@
From 3289156212ecda06c35ace47af0a6033ff41ea1d Mon Sep 17 00:00:00 2001
From: Hu gang <18768366022@163.com>
Date: Mon, 18 Dec 2023 15:17:42 +0800
Subject: [PATCH] chore: change search key
---
src/views/assests/HostManagement.vue | 2 +-
src/views/leaks/LeakTaskDetail.vue | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/assests/HostManagement.vue b/src/views/assests/HostManagement.vue
index 77e0ed8..e3c1635 100644
--- a/src/views/assests/HostManagement.vue
+++ b/src/views/assests/HostManagement.vue
@@ -18,7 +18,7 @@
</a-col>
<a-col>
<!-- <a-button @click="handleReset">重置条件</a-button> -->
- <a-input-search placeholder="按主机名或主机ip搜索" style="width: 200px" @search="handleSearch" />
+ <a-input-search placeholder="按主机名或IP搜索" style="width: 200px" @search="handleSearch" />
</a-col>
</a-row>
</a-col>
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
index 766a1cf..81f0a88 100644
--- a/src/views/leaks/LeakTaskDetail.vue
+++ b/src/views/leaks/LeakTaskDetail.vue
@@ -103,7 +103,7 @@
<a-row type="flex" :gutter="6">
<a-col>
<a-input-search
- :placeholder="taskType === 'hotpatch remove' ? `按CVE ID搜索` : `按主机名或主机ip搜索`"
+ :placeholder="taskType === 'hotpatch remove' ? `按CVE ID搜索` : `按主机名或IP搜索`"
style="width: 200px"
@search="onSearch"
/>
--
Gitee

View File

@ -1,41 +0,0 @@
From 36d6d8345ad7dc158f842d0cad7b5e9810b6e121 Mon Sep 17 00:00:00 2001
From: Hu gang <18768366022@163.com>
Date: Tue, 19 Dec 2023 11:20:33 +0800
Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9AInaddnput=20box=20text=20limit?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/vendor/ant-design-pro/utils/request.js | 3 +++
src/views/leaks/LeakTaskDetail.vue | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/vendor/ant-design-pro/utils/request.js b/src/vendor/ant-design-pro/utils/request.js
index 661bfd0..11be85a 100644
--- a/src/vendor/ant-design-pro/utils/request.js
+++ b/src/vendor/ant-design-pro/utils/request.js
@@ -170,6 +170,9 @@ request.interceptors.response.use((response) => {
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;
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
index 81f0a88..56056c9 100644
--- a/src/views/leaks/LeakTaskDetail.vue
+++ b/src/views/leaks/LeakTaskDetail.vue
@@ -105,6 +105,7 @@
<a-input-search
:placeholder="taskType === 'hotpatch remove' ? `按CVE ID搜索` : `按主机名或IP搜索`"
style="width: 200px"
+ maxLength="20"
@search="onSearch"
/>
</a-col>
--
Gitee

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

Binary file not shown.

BIN
aops-hermes-v2.1.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,59 +1,60 @@
%define debug_package %{nil}
Name: aops-hermes
Version: v1.4.0
Release: 7
Version: v2.1.1
Release: 4
Summary: Web for an intelligent diagnose frame
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
Source0: %{name}-%{version}.tar.gz
Source1: node_modules.tar.gz
Patch001: 001-bugfix-and-adapt-rollback-tasks.patch
Patch002: 002-fix-hotpatch-remove-filter.patch
Patch003: 003-change-search-placeholder.patch
Patch004: 004-modify-search-key-for-hostlist.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
Patch001: 0001-Modify-host-group-input-parameter-verification.patch
Patch002: 0002-set-the-default-language-for-requests.patch
Patch003: 0003-fix-cve-detail-display-issue.patch
BuildRequires: nodejs node-gyp nodejs-yarn
BuildRequires: nodejs
Requires: nginx
%description
Web for an intelligent diagnose frame
%prep
%autosetup -n %{name}-%{version} -p1
%setup -T -D -a 1
%build
export NODE_OPTIONS=--openssl-legacy-provider
yarn build
npm run build
%install
mkdir -p %{buildroot}/opt/aops/web
cp -r dist %{buildroot}/opt/aops/web/
mkdir -p %{buildroot}/%{_sysconfdir}/nginx
cp -r deploy/aops-nginx.conf %{buildroot}/%{_sysconfdir}/nginx/
mkdir -p %{buildroot}/usr/lib/systemd/system
cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
%files
%attr(0755, root, root) /opt/aops/web/dist/*
%attr(0755, root, root) %{_sysconfdir}/nginx/aops-nginx.conf
%attr(0755, root, root) /usr/lib/systemd/system/aops-hermes.service
%changelog
* Tue Dec 10 2024 Hu gang<18768366022@163.com> - v2.1.1-4
- fix the cve detail display issue
* Mon Dec 2 2024 Hu gang<18768366022@163.com> - v2.1.1-3
- set the default language for requests
* Sat Nov 30 2024 Hu gang<18768366022@163.com> - v2.1.1-2
- modify host group input parameter verification
* Mon Nov 18 2024 Hu gang<18768366022@163.com> - v2.1.1-1
- Integrate Authhub and Osmind in Aops
- Fixed some international translation issues
* 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

Binary file not shown.