cont.
This commit is contained in:
parent
5fa8984a2c
commit
0e3aeda1cf
|
|
@ -200,7 +200,7 @@
|
|||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"proxy": "http://172.20.32.202:9999",
|
||||
"proxy": "http://172.20.32.202:4000",
|
||||
"port": "3007",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.6",
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) {
|
|||
// 判断网络是否连接
|
||||
initOnlineOfflineListener();
|
||||
|
||||
var proxy = "https://testforgeplus.trustie.net";
|
||||
var proxy = "http://172.20.32.202:4000/";
|
||||
// var proxy = "https://www.gitlink.org.cn";
|
||||
|
||||
//响应前的设置
|
||||
|
|
|
|||
|
|
@ -35,3 +35,10 @@ export function getProblemData(component, keys) {
|
|||
});
|
||||
}
|
||||
|
||||
// 初始化sonar
|
||||
export function initSonar(open, owner, repo) {
|
||||
return fetch({
|
||||
url: `/api/v1/${owner}/${repo}/sonarqubes/sonar_initialize.json?has_actions=${ open }`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState, useEffect, Fragment } from "react";
|
||||
import { getList, getCodeSnippets, getProblemDetail, getProblemData } from "../api";
|
||||
import { getList, getCodeSnippets, getProblemDetail, getProblemData, initSonar } from "../api";
|
||||
import './detail.scss';
|
||||
import ProblemDetail from "./component/ProblemDetail";
|
||||
import { issueType, maintainability, issueTypeIcon, maintainabilityIcon } from "../constants/quality";
|
||||
|
|
@ -25,6 +25,7 @@ function IssueList(props) {
|
|||
const [selectedTag, setSelectedTag] = useState([]);
|
||||
const [pageNum, setPageNum] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const [isopen, setIsopen] = useState(false);
|
||||
const { projectDetail, history } = props;
|
||||
const metricKeys = 'lines,coverage,lines_to_cover,duplicated_lines_density,maintainability_issues,vulnerabilities,bugs,code_smells';
|
||||
const facets = 'impactSeverities,tags,types';
|
||||
|
|
@ -157,6 +158,10 @@ function IssueList(props) {
|
|||
})
|
||||
}
|
||||
|
||||
const openAnalysis = () => {
|
||||
initSonar(true, owner, projectsId)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="issue-total">
|
||||
<ProblemDetail
|
||||
|
|
@ -166,19 +171,19 @@ function IssueList(props) {
|
|||
onClose={() => setDetailVisible(false)}
|
||||
/>
|
||||
{
|
||||
false && <Fragment>
|
||||
!isopen && <Fragment>
|
||||
<div className="headBox font-16 pl15">sonar代码质量分析工具</div>
|
||||
<div className="nullStoreBox mt25">
|
||||
<img src={logo} alt="" className="loBox mt50"/>
|
||||
<p className="font-22 mt10">欢迎使用代码质量分析工具</p>
|
||||
<div className="introBox font-15">代码质量分析工具通过静态代码分析帮助开发者识别和修复代码库潜在的缺陷、代码异味、复杂度过高的代码段以及潜在的安全漏洞。同时能够评估代码的结构和风格,提供关于代码覆盖率、重复率等关键指标的深入洞察。</div>
|
||||
<div className="borBox"></div>
|
||||
<Button type="primary" style={{width: '112px', height: '36px'}}>开始体验</Button>
|
||||
<Button type="primary" style={{width: '112px', height: '36px'}} onClick={openAnalysis}>开始体验</Button>
|
||||
</div>
|
||||
</Fragment>
|
||||
}
|
||||
{
|
||||
true && <div>
|
||||
isopen && <div>
|
||||
<div className="container total-info">
|
||||
<p>代码分析结果</p>
|
||||
<div className="info-list">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ let baseZoneUrl = `${zoneUrl}/api`
|
|||
|
||||
if (__CLIENT__ ) {
|
||||
let settings = localStorage.chromesetting && localStorage.chromesetting !== 'undefined' &&JSON.parse(localStorage.chromesetting);
|
||||
baseUrl = settings ? `${settings && settings.common.main_site_url}/api` : '/api';
|
||||
// 测试待删
|
||||
// baseUrl = settings ? `${settings && settings.common.main_site_url}/api` : '/api';
|
||||
baseUrl = settings ? `http://172.20.32.202:4000/api` : '/api';
|
||||
baseZoneUrl = settings ? `${settings && settings.common.zone}/api` : `${zoneUrl}/api`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue