forked from Gitlink/forgeplus-react
Merge pull request 'sona列表换行显示' (#269) from caishi/forgeplus-react:mulanoss_git_server into mulanoss_git_server
This commit is contained in:
commit
a58188c662
|
@ -4,6 +4,7 @@ import { Base64 } from 'js-base64';
|
|||
import moment from 'moment'
|
||||
import axios from 'axios';
|
||||
import Nodata from '../Nodata';
|
||||
import './Index.scss';
|
||||
|
||||
const limit = 15;
|
||||
|
||||
|
@ -18,8 +19,8 @@ function Index(props) {
|
|||
},[page])
|
||||
|
||||
function getInit() {
|
||||
// MLh8klm46f_ceshi
|
||||
const url = `https://sonar.learnerhub.net/api/issues/search?componentKeys=${owner}_${projectsId}&s=FILE_LINE&resolved=false&types=BUG&ps=${limit}&facets=owaspTop10%2CsansTop25%2Cseverities%2CsonarsourceSecurity%2Ctypes&additionalFields=_all&timeZone=Asia%2FShanghai&p=${page}`
|
||||
// MLh8klm46f_ceshi ${owner}_${projectsId}
|
||||
const url = `https://sonar.learnerhub.net/api/issues/search?componentKeys=MLh8klm46f_ceshi&s=FILE_LINE&resolved=false&types=BUG&ps=${limit}&facets=owaspTop10%2CsansTop25%2Cseverities%2CsonarsourceSecurity%2Ctypes&additionalFields=_all&timeZone=Asia%2FShanghai&p=${page}`
|
||||
axios.get(url,{
|
||||
headers:{Authorization:`Basic ${Base64.encode('ecae161ce05add6121c6263f843c76d79fcd953c:')}`}
|
||||
}).then(result=>{
|
||||
|
@ -35,8 +36,7 @@ function Index(props) {
|
|||
title: '文件',
|
||||
dataIndex: 'component',
|
||||
key: 'component',
|
||||
width:"24%",
|
||||
ellipsis:true,
|
||||
width:"20%",
|
||||
render:(v,l,i)=>{
|
||||
const name = l.component && l.component.split(":")[1];
|
||||
return(
|
||||
|
@ -79,8 +79,7 @@ function Index(props) {
|
|||
title: '问题信息',
|
||||
dataIndex: 'message',
|
||||
key: 'message',
|
||||
width:"25%",
|
||||
ellipsis:true
|
||||
width:"45%"
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
@ -100,7 +99,7 @@ function Index(props) {
|
|||
total > 0 ?
|
||||
<div style={{minHeight:"300px"}}>
|
||||
<p style={{padding:"12px 20px"}}>一共存在{total}个问题</p>
|
||||
<Table dataSource={data} columns={columns} pagination={false}/>
|
||||
<Table className="sonarTable" dataSource={data} columns={columns} pagination={false}/>
|
||||
</div>
|
||||
:
|
||||
<Nodata _html="代码质量非常优秀,没有检测到问题存在!" />
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
.sonarTable{
|
||||
.ant-table-thead > tr > th, .ant-table-tbody > tr > td{
|
||||
padding:10px 12px;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue