diff --git a/src/AppConfig.js b/src/AppConfig.js index d76e9999b..ea85a4e52 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "https://code.mulanos.cn"; + var proxy = "https://testforgeplus.trustie.net"; //响应前的设置 axios.interceptors.request.use( config => { @@ -45,11 +45,11 @@ export function initAxiosInterceptors(props) { if (`${config[0]}` !== `true`) { if (window.location.port === "3007") { config.url = `${proxy}${url}`; - // if (config.url.indexOf('?') === -1) { - // config.url = `${config.url}?debug=${debugType}`; - // } else { - // config.url = `${config.url}&debug=${debugType}`; - // } + if (config.url.indexOf('?') === -1) { + config.url = `${config.url}?debug=${debugType}`; + } else { + config.url = `${config.url}&debug=${debugType}`; + } } else { config.url = url; } diff --git a/src/forge/Component/CopyTool.jsx b/src/forge/Component/CopyTool.jsx index 36ed1d8c1..8c1f8209d 100644 --- a/src/forge/Component/CopyTool.jsx +++ b/src/forge/Component/CopyTool.jsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback, memo } from 'react'; +import React, { useState, useCallback, memo, useEffect } from 'react'; import { Tooltip } from 'antd'; CopyTool.defaultProps = { @@ -10,16 +10,15 @@ CopyTool.defaultProps = { }; -function CopyTool({ beforeText, afterText, className , inputId , timeOut }) { +function CopyTool({ beforeText, afterText, className , inputId , timeOut , text }) { const [title, setTitle] = useState(() => { return beforeText; }); - // 复制链接 const copyUrl = useCallback(() => { const copyEle = document.querySelector(`#${inputId}`); // 获取要复制的节点 if (!copyEle) { - console.error("您的CopyTool未设置正确的inputId"); + console.error(`您的CopyTool未设置正确的inputId${inputId}`); return; } copyEle.select(); // 执行选中元素 @@ -37,12 +36,17 @@ function CopyTool({ beforeText, afterText, className , inputId , timeOut }) { }, []); return ( + { setTitle(beforeText) }} > - + {text? + {text} + : + + } ); } diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 9fdd8f141..fe7ad17e0 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -561,7 +561,7 @@ function CoderDepot(props){ {lesson_url} } - { + {/* {
@@ -580,7 +580,7 @@ function CoderDepot(props){ }
- } + } */} {/* 发布 */} { releaseVersions && diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.scss b/src/forge/SecuritySetting/notice/myNotice/Index.scss index 8eab84c0c..e7db80083 100644 --- a/src/forge/SecuritySetting/notice/myNotice/Index.scss +++ b/src/forge/SecuritySetting/notice/myNotice/Index.scss @@ -45,19 +45,6 @@ } } -button { - color: #333333; - background: #FAFBFC; - border: 1px solid #D0D0D0; - border-radius: 4px; - height: 32px; -} -button:hover { - background: #F3F4F6; -} -button:active { - background: #EBECF0; -} .deleteBut{ color: #DF0002; diff --git a/src/forge/Settings/Webhooks/Index.scss b/src/forge/Settings/Webhooks/Index.scss index 6c166a730..245e5d47b 100644 --- a/src/forge/Settings/Webhooks/Index.scss +++ b/src/forge/Settings/Webhooks/Index.scss @@ -88,8 +88,7 @@ background: #FAFCFF; border-radius: 4px 4px 0px 0px; border: 1px solid rgba(42, 97, 255, 0.23); - height: 50px; - padding:0px 20px; + padding:5px 20px; margin-top: 20px; display: flex; align-items: center; @@ -168,4 +167,19 @@ } } } +} +.checkModalStyle{ + .ant-modal-header{ + padding:8px 20px; + .ant-modal-title{ + text-align: left; + } + } + .ant-modal-close{ + top:0px!important; + } + input{ + width: 222px; + border:none; + } } \ No newline at end of file diff --git a/src/forge/Settings/Webhooks/New.jsx b/src/forge/Settings/Webhooks/New.jsx index 22b3899d7..f305fedf9 100644 --- a/src/forge/Settings/Webhooks/New.jsx +++ b/src/forge/Settings/Webhooks/New.jsx @@ -6,6 +6,7 @@ import axios from 'axios'; import PushHistory from './sub/PushHistory'; import DeleteBox from '../../Component/DeleteModal/Index'; import './Index.scss'; +import CheckModal from './sub/CheckModal'; // ,"issue_assign","issue_label","issue_milestone","issue_comment","issue_only","fork", //"pull_request_milestone","pull_request_sync","pull_request_comment","repository","pull_request_label" @@ -21,6 +22,10 @@ function New({ form , match , showNotification , history }) { const [ data , setData ] = useState(undefined); const [ eventFlag , setEventFlag ] = useState(false); + const [ checkVisible , setCheckVisible ] = useState(false); + const [ checkContent , setCheckContent ] = useState(1); + + const { getFieldDecorator, validateFields , setFieldsValue } = form; const { id , owner , projectsId } = match.params; @@ -169,8 +174,18 @@ function New({ form , match , showNotification , history }) { lineHeight: '30px', }; + function OpenCheckModal(params) { + setCheckContent(params); + setCheckVisible(true); + } + return(
+ setCheckVisible(false)} + /> setVisible(false)} @@ -185,7 +200,12 @@ function New({ form , match , showNotification , history }) { {id ? "更新" : "添加"}Webhook
-

当webhook被触发时,我们将向以下URL发送通知,包括已选择事件的详细信息。更多信息可查阅webhooks指南

+

+ 当webhook被触发时,我们将向以下URL发送通知,包括已选择事件的详细信息。更多信息可查阅 + webhooks指南。 +
OpenCheckModal(1)}>开源敏感词检测服务设置OpenCheckModal(2)}>PR审阅推荐服务设置 +
+

diff --git a/src/forge/Settings/Webhooks/sub/CheckModal.jsx b/src/forge/Settings/Webhooks/sub/CheckModal.jsx new file mode 100644 index 000000000..623a18521 --- /dev/null +++ b/src/forge/Settings/Webhooks/sub/CheckModal.jsx @@ -0,0 +1,53 @@ +import React, { useEffect, useState } from 'react'; +import { Modal } from 'antd'; +import CopyTool from '../../../Component/CopyTool'; + +function CheckModal({visible,content,onCancel}) { + + const [ type ,setType ] = useState(content); + useEffect(()=>{ + setType(content); + },[content]) + + + return( + +
+ { + type===1? +
+

如需使用开源敏感词检测云功能,请复制以下内容至指定的输入框中:

+

目标URL: + +

+

webhook密钥:默认,无须密钥

+

触发webhook:选中自定义事件,勾选 推送,创建,合并请求

+

分支过滤: 默认,无须修改

+
+ : +
+

如需使用PR审阅推荐云功能,请复制以下内容至指定的输入框中:

+

目标URL: + + +

+

webhook密钥:默认,无须密钥

+

触发webhook:选中自定义事件,勾选 合并请求

+

分支过滤: 默认,无须修改

+
+ } + + +
+
+ ) +} +export default CheckModal; \ No newline at end of file diff --git a/src/forge/Sonar/Index.jsx b/src/forge/Sonar/Index.jsx index 7aa0a09ce..f56a598f5 100644 --- a/src/forge/Sonar/Index.jsx +++ b/src/forge/Sonar/Index.jsx @@ -19,7 +19,7 @@ function Index(props) { function getInit() { // MLh8klm46f_ceshi - const url = `http://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}` + 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}` axios.get(url,{ headers:{Authorization:`Basic ${Base64.encode('ecae161ce05add6121c6263f843c76d79fcd953c:')}`} }).then(result=>{