一些issue修改

This commit is contained in:
付民康
2025-03-26 17:52:03 +08:00
parent 0a81c46e35
commit eb55e0171f
5 changed files with 99 additions and 74 deletions

View File

@@ -105,6 +105,16 @@ export function getRepairInfo(data) {
data
});
}
// 可信软件详情-AI 修复建议接口
export const remediationSearchRemediations = (data): Promise<any> => {
return reqCatchV2(() =>
request({
url: '/api/v1/repo/repair/info',
method: 'POST',
data
})
);
};
// 获取许可证列表
export function getLicenseList(data) {

View File

@@ -1,6 +1,16 @@
<template>
<d-table :data="dataSource" @sort-change="handleSortChange" :header-bg="true">
<d-column v-for="(column, index) in props.tableConfig" :field="column.field" :header="column.header"></d-column>
<d-column
v-for="(column, index) in props.tableConfig"
:field="column.field"
:header="column.header"
:sortable="column.sortable"
:sort-method="column.sortMethod"
>
<template #default="scope">
{{ column.format ? column.format(scope.row[column.field]) : scope.row[column.field] }}
</template>
</d-column>
</d-table>
</template>

View File

@@ -7,9 +7,10 @@
</div>
<div>
<br />通过AI技术精准诊断漏洞类型智能匹配多维度定制化修复策略实现从数据校验代码加固到权限控制的全链路防御助力漏洞修复效率提升全方位保障开源软件使用安全<br />
<!-- <ul>
<li v-for="info in infoList">{{ info }}</li>
</ul> -->
<!-- <ul>-->
<!-- <li v-for="info in infoList">{{ info }}</li>-->
<!-- </ul>-->
</div>
</div>
</div>
@@ -25,7 +26,7 @@
<div style="width: 100%; padding: 20px 20px 0px 0">
<div class="ai-panel-header-title">
<div>
<d-tag color="red-w98" class="mr-1" size="sm">{{ '严重' }}</d-tag>
<d-tag color="red-w98" class="mr-1" size="sm">严重</d-tag>
<span>{{ rowItem.libraryName || '--' }}</span>
</div>
<div
@@ -45,9 +46,7 @@
<span class="weak-text">修复兼容性</span>
<span>{{ rowItem.vulnerabilities.length || '--' }}</span>
<img src="@/assets/imgs/jyh/help.png" class="icon-sm" />
<d-tag class="ml-1" type="warning" size="sm">{{
rowItem.vulnerabilities.length > 0 ? rowItem.vulnerabilities[0].severity : '--'
}}</d-tag>
<d-tag class="ml-1" type="warning" size="sm"></d-tag>
</div>
<div>
<span class="weak-text">升级版本</span>
@@ -76,12 +75,12 @@
</template>
<script setup>
import { ref, onMounted, defineProps } from 'vue';
import { defineProps, onMounted, ref } from 'vue';
import Panel from '@/components/AIRepair/Panel.vue';
import Table from '@/components/AIRepair/Table.vue';
import NoData from '@/components/NoData/NoData.vue';
import { getRepairInfo } from '@/api/jyh';
const propsData = defineProps(['versionId']);
import { getVulnList, remediationSearchRemediations } from '@/api/jyh';
const infoList = ref([
'当前代码主要风险为易受常见的注入攻击包括命令注入、SQL注入、表达式注入针对每种攻击应提供相应的防范措施如数据校验、使用安全函数和限制程序权限。',
'相对上一次检查【提升点】在于代码基础编码问题少了47.8%问题总数降低29.3%'
@@ -98,7 +97,11 @@ const tableConfig = ref([
field: 'vulnType',
header: '安全问题类型',
sortable: false,
sortMethod: null
sortMethod: null,
format: (val) => {
// val小写转大写
return (val || '').toUpperCase();
}
},
{
field: 'vulnId',
@@ -114,64 +117,63 @@ const tableConfig = ref([
}
]);
const list = ref([
{
expand: true,
title: 'Morgan',
data: {
listData: [
{
securityProblemCode: '1',
type: '安全问题',
CWEcode: 'CWE-123',
score: 70
},
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'MIT-LICENSE',
score: 89
}
]
}
},
{
expand: true,
title: 'webpack',
data: {
listData: [
{
securityProblemCode: '1',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
},
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'MIT-LICENSE',
score: 90
}
]
}
}
]);
const propsData = defineProps(['versionId']);
const getInfo = async () => {
const { data } = await getRepairInfo({
const fetchVulnList = async () => {
const { data } = await remediationSearchRemediations({
// softwareId: 47,
softwareId: propsData.versionId,
current: 1,
size: 10,
// "softwareId": 47,
softwareId: propsData.versionId
size: 10
// componentId: '',
});
if (data.code === 200) {
tableData.value = data?.data?.components || [];
if (data.data.code === 200) {
tableData.value = data?.data?.data?.components || [];
// pager.value.total = data?.data?.data?.total || [];
}
};
const tableData = ref([]);
const tableData = ref([
// {
// "componentId": 1,
// "libraryName": "Spring Framework",
// "currentVersion": "5.3.26",
// "vulnerabilities": [
// {
// "vulnId": "CVE-2024-12345",
// "severity": "High",
// "vulnType": "Remote Code Execution",
// "cvssScore": 8.5,
// "remediation": {
// "recommendedFix": "Upgrade to version 5.3.27 or later.",
// "patchLink": "https://spring.io/security/advisory/CVE-2024-12345",
// "recommendedVersion": "5.3.27"
// }
// }
// ]
// },
// {
// "componentId": 2,
// "libraryName": "Log4j",
// "currentVersion": "2.14.0",
// "vulnerabilities": [
// {
// "vulnId": "CVE-2023-67890",
// "severity": "Critical",
// "vulnType": "Information Disclosure",
// "cvssScore": 9.8,
// "remediation": {
// "recommendedFix": "Apply security patch 2.14.1.",
// "patchLink": "https://logging.apache.org/log4j/2.x/security.html",
// "recommendedVersion": "2.14.1"
// }
// }
// ]
// }
]);
onMounted(() => {
getInfo();
fetchVulnList();
});
</script>
@@ -239,13 +241,13 @@ onMounted(() => {
padding: 1px;
border-radius: 8px;
background-image: linear-gradient(
134.79deg,
#a4f7df 0%,
#a0cefb 21%,
#5f9afe 43%,
#d9b9fc 62%,
#01efbb 73%,
#fbae46 100%
134.79deg,
#a4f7df 0%,
#a0cefb 21%,
#5f9afe 43%,
#d9b9fc 62%,
#01efbb 73%,
#fbae46 100%
);
}

View File

@@ -23,7 +23,8 @@
</d-col>
<d-col :span="8">
<span class="card-key width-90">发布时间</span>
<span class="card-val">{{ ReleaseInfo.basicInfo.releaseDate || '--' }}</span>
<span class="card-val">
{{ ReleaseInfo.basicInfo.releaseDate?dayjs(ReleaseInfo.basicInfo.releaseDate).format('YYYY-MM-DD HH:mm:ss') :'--' }}</span>
</d-col>
<d-col :span="8">
<span class="card-key width-90">版本描述</span>
@@ -37,7 +38,7 @@
<d-row class="mb-3">
<d-col :span="8">
<span class="card-key width-110">集成风险</span>
<d-tag color="#F6933B">{{ jcfxList[ReleaseInfo.referenceInfo.integrationRisk || ReleaseInfo.basicInfo.integrationRiskLevel] || '--' }}</d-tag>
<d-tag color="#F6933B">{{ ReleaseInfo.referenceInfo.integrationRisk || jcfxList[ReleaseInfo.basicInfo.integrationRiskLevel] || '--' }}</d-tag>
<!-- <span class="card-val">{{ ReleaseInfo.referenceInfo.integrationRisk || ReleaseInfo.basicInfo.integrationRisk || '&#45;&#45;' }}</span>-->
</d-col>
<d-col :span="8">
@@ -54,7 +55,8 @@
<d-row class="mb-3">
<d-col :span="8">
<span class="card-key width-110">社区EOL日期</span>
<span class="card-val">{{ ReleaseInfo.referenceInfo.communityEolDate || '--' }}</span>
<span class="card-val">
{{ ReleaseInfo.referenceInfo.communityEolDate?dayjs(ReleaseInfo.referenceInfo.communityEolDate).format('YYYY-MM-DD HH:mm:ss') :'--' }}</span>
</d-col>
<d-col :span="8">
<span class="card-key width-110">所属领域/产业</span>
@@ -231,6 +233,7 @@ import { Message } from 'vue-devui/message';
import { useClipboard } from '@vueuse/core/index';
import { releaseInfo } from '@/api/jyh';
import { useGlobalInfoStore } from '@/stores/Global';
import dayjs from 'dayjs';
const route = useRoute();
const emits = defineEmits(['changeTabs']);

View File

@@ -18,7 +18,7 @@
<span class="span1">软件评分</span><span class="span2">{{ ReleaseInfo.networkSecurity.softwareRating || ReleaseInfo.basicInfo.securityScore || '&#45;&#45;' }}</span>
<span class="split"></span>
<span class="span1">集成风险</span>
<d-tag color="#F6933B">{{ jcfxList[ReleaseInfo.referenceInfo.integrationRisk || ReleaseInfo.basicInfo.integrationRiskLevel] || '--' }}</d-tag>
<d-tag color="#F6933B">{{ ReleaseInfo.referenceInfo.integrationRisk || jcfxList[ReleaseInfo.basicInfo.integrationRiskLevel] || '--' }}</d-tag>
<!-- <d-tag color="#F6933B">{{ ReleaseInfo.referenceInfo.integrationRisk || '&#45;&#45;' }}</d-tag>-->
</div>
</div>