merge dev-shenjianbin into master

预警详情修改

Created-by: MaxShen
Commit-by: MaxShen
Merged-by: MaxShen
Description: 邀请列表接口接入
Merge branch 'master' of https://gitcode.com/hk_openRepo/OpenRepo_Portal into dev-shenjianbin
预警详情修改

See merge request: hk_openRepo/OpenRepo_Portal!22
This commit is contained in:
MaxShen
2025-03-18 17:26:22 +08:00
5 changed files with 86 additions and 41 deletions

View File

@@ -1,3 +1,4 @@
import { reqCatchV2, type catchRt } from '@/utils/catch';
import request from '@/utils/request';
// 详情-获取版本信息
@@ -8,3 +9,24 @@ export function releaseInfo(params: { repoId: string,releaseId: string }): Prom
method: 'get'
});
}
// 获取用户信息
export function getInviteListData(): catchRt<any> {
return reqCatchV2(() => request({
url: '/api/v1/group/member/invite/list',
method: 'get'
}, {
customError: true
}));
}
// 获取用户信息
export function acceptInvite(params): catchRt<any> {
return reqCatchV2(() => request({
url: '/api/v1/group/member/invite/accept',
method: 'post',
data: params,
}, {
customError: true
}));
}

View File

@@ -1,36 +1,26 @@
<template>
<div class="warning-detail-container">
<div class="warning-title">
<div>{{ warningData.title }}</div>
<div>{{ warningData.subject }}</div>
<div class="sub-title mt-3">
<div>
<span>重要性</span>
<d-tag type="danger" size="sm">{{warningData.importance}}</d-tag>
</div>
<div>
<div v-if="propsData.type === 'system'">
<d-button v-show="mode === 'readonly'" class="edit-btn" icon="icon-edit" variant="text" title="编辑" @click="handleModeChange"/>
<d-button v-show="mode === 'editonly'" class="edit-btn" @click="handleModeChange">预览</d-button>
</div>
</div>
</div>
<div class="warning-text">
<!-- <div class="text-box mb-5">
<div>概要</div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ warningData.summary }}</p>
<d-textarea v-model="warningData.summary" id="textArea" autosize></d-textarea>
</div>
<div class="text-box">
<div>修复方案</div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ warningData.fixMethod }}</p>
<d-textarea v-model="warningData.fixMethod" id="textArea2"></d-textarea>
</div> -->
<d-editor-md
v-model="warningData.text"
v-model="warningData.overview"
:mode="mode"
:toolbar-config="toolbarConfig"
></d-editor-md>
</div>
<div :style="{'border-radius': propsData.type === 'user' ? '6px' : 0}" class="warning-from">可信开源代码库运营团队 {{ warningData.fromTime }}</div>
<div :style="{'border-radius': propsData.type === 'user' ? '6px' : 0}" class="warning-from">{{warningData.group}} {{ warningData.pulishTime }}</div>
<div v-if="propsData.type === 'system'" class="warning-operation">
<d-button @click="confirm" variant="solid" class="mr-2">确定</d-button>
<d-button @click="$emit('close')">取消</d-button>
@@ -43,24 +33,14 @@ import { ref } from 'vue';
const emit = defineEmits(['close']);
const propsData = defineProps(['type', 'warningData']);
const warningData = ref({
title: '【漏洞排查预警】ApacheIgnite远程代码执行漏洞排查CVE-2024-52577)',
importance: '高',
summary: '近日安全中心发现Apache lgnite远程代码执行漏洞CVE-2024-52577。在 2.6.0<Apache Ignite< 2.17.0版本中由于lgnite未能正确实施类序列化过滤器攻击者能够利用恶意序列化对象绕过安全检查从而在服务器端反序列化时触发任意代码的执行。经可信开源代码库运营团队评审漏洞技术定级2级/3级若不满足利用条件可举证降为6级。请你按要求在XX时间内完成修复。',
fixMethod: '升级Apache Ignite至安全版本2.17.0',
fromTime: '2025-2-20',
text: `## 一、概要
近日安全中心发现Apache lgnite远程代码执行漏洞CVE-2024-52577。在 2.6.0<Apache Ignite< 2.17.0版本中由于lgnite未能正确实施类序列化过滤器攻击者能够利用恶意序列化对象绕过安全检查从而在服务器端反序列化时触发任意代码的执行。经可信开源代码库运营团队评审漏洞技术定级2级/3级若不满足利用条件可举证降为6级。请你按要求在XX时间内完成修复。
## 二、修复方案
升级Apache Ignite至安全版本2.17.0`
});
const warningData = ref({});
const toolbarConfig = [
['undo', 'redo'],
['h1', 'h2', 'bold', 'italic', 'strike', 'underline', 'color', 'font'],
['ul', 'ol', 'checklist', 'code', 'link', 'image', 'table'],
];
const mode = ref('readonly');
// warningData.value = propsData.warningData;
warningData.value = JSON.parse(propsData.warningData.alertMsg ?? '{}');
const confirm = () => {
emit('close');
};
@@ -83,7 +63,7 @@ const handleModeChange = () => {
font-weight: 600;
font-size: 20px;
line-height: 28px;
padding: 4px 20px 12px;
padding: 20px 20px 12px;
.sub-title {
display: flex;
@@ -102,7 +82,15 @@ const handleModeChange = () => {
background: #F6F6F8;
color: initial;
::v-deep .dp-md-view {
:deep .dp-md-readonly {
.dp-md-toolbar-container {
display: none;
}
}
:deep .dp-md-view {
background-color: #F6F6F8;
h2 {
font-size: 1.5em;
font-weight: bold;

View File

@@ -29,7 +29,7 @@
</div>
</Card>
<d-modal class="warning-modal" v-model="warningModalVisable" title="主题:">
<d-modal class="warning-modal" v-model="warningModalVisable" title="">
<EarlyWarningDetail @close="colseWarningDetail" :warningData="currentWarning" type="user"></EarlyWarningDetail>
</d-modal>
</template>

View File

@@ -28,7 +28,7 @@
</div>
</Card>
<d-modal class="warning-modal" v-model="warningModalVisable" title="主题:">
<d-modal class="warning-modal" v-model="warningModalVisable" title="">
<EarlyWarningDetail @close="colseWarningDetail" :warningData="currentWarning" type="user"></EarlyWarningDetail>
</d-modal>
</template>

View File

@@ -8,26 +8,31 @@
:header-bg="true"
:data="noticeTableData"
>
<d-column field="content" header="邀请内容"></d-column>
<d-column field="time" header="邀请时间" width="200"></d-column>
<d-column field="creator" header="邀请人" width="180"></d-column>
<d-column field="content" header="邀请内容" show-overflow-tooltip></d-column>
<d-column field="createTime" header="邀请时间" width="200" show-overflow-tooltip></d-column>
<d-column field="createUser" header="邀请人" width="180" show-overflow-tooltip></d-column>
<d-column header="操作" width="150">
<template #default="scope">
<d-button
variant="text"
color="primary"
class="mr-2"
@click="handleAccept(scope.row, 1)"
>
接收
</d-button>
<d-button
variant="text"
color="primary"
@click="handleAccept(scope.row, -1)"
>
拒绝
</d-button>
</template>
</d-column>
<template #empty>
<NoData />
</template>
</d-table>
<div class="invitation-pagination">
<d-pagination
@@ -47,21 +52,51 @@
</template>
<script setup lang="ts">
import { acceptInvite, getInviteListData } from '@/api/jyh';
import { ref, shallowReactive } from 'vue';
import NoData from "@/components/NoData/NoData.vue";
import { Message } from 'vue-devui';
const noticeTableData = ref([
{
content: '当您订阅的软件有漏洞预警通知时,将以应用号的方式通知。可在首页查看或取消订阅!',
time: '2025-03-15 17:29:30',
creator: '132456798',
}
]);
const noticeTableData = ref([]);
const pager = shallowReactive({
total: 1,
total: 0,
pageIndex: 1,
pageSize: 10,
pageSizeOptions: [10, 20, 30, 40, 50],
});
const queryInviteListData = async () => {
const data = await getInviteListData();
console.log(data)
if (!data?.data?.data?.data) {
pager.total = 0;
return;
}
noticeTableData.value = data.data.data.data.map(item => {
return {
...item,
content: `尊敬的用户,您好!为更好地整合资源、协同开发,现诚邀您加入${item.name}`
}
});
pager.total = data.data.data.data.length;
};
queryInviteListData();
const handleAccept = async (row, type) => {
const data = await acceptInvite({
groupId: row.groupId,
status: type,
});
if (data?.data?.data?.data) {
Message({
type,
message: '成功接受',
});
} else {
Message({
type,
message: '接受失败',
});
}
};
</script>
<style lang="scss" scoped>