diff --git a/src/App.js b/src/App.js index 4662cc13f..26cbcc44b 100644 --- a/src/App.js +++ b/src/App.js @@ -353,7 +353,7 @@ class App extends Component { {/* 上架bot配置 */} ( )} diff --git a/src/AppConfig.js b/src/AppConfig.js index cf7fe8b6a..9c5fbfd40 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index 8ec3626ae..c20196954 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -119,8 +119,8 @@ function Index(props){ @@ -188,28 +188,28 @@ function Index(props){ > {/* 创建一个新的bot */} ( )} > {/* 开发bot */} ( )} > {/* bot配置页面 */} ( )} > {/* bot配置 */} ( )} diff --git a/src/forge/SecuritySetting/bot/disposition/detail.jsx b/src/forge/SecuritySetting/bot/disposition/detail.jsx index 5daae68ec..88bc4427f 100644 --- a/src/forge/SecuritySetting/bot/disposition/detail.jsx +++ b/src/forge/SecuritySetting/bot/disposition/detail.jsx @@ -125,7 +125,7 @@ function DispositionDetail(props){ {botDetail && botDetail.create_time} } - + {botDetail &&
代码库{botDetail.limit_vo.juris_diction_code === 2 ? '无' : botDetail.limit_vo.juris_diction_code === 1 ? '读写' : '只读'}权限
} {botDetail &&
合并请求(PR){botDetail.limit_vo.juris_diction_pr === 2 ? '无' : botDetail.limit_vo.juris_diction_pr === 1 ? '读写' : '只读'}权限
} @@ -141,7 +141,7 @@ function DispositionDetail(props){ onChange={selectChange} className="radioBox selectBox" > - {filterOption.map(item=>({item.name}))} + {filterOption.map(item=>({`${item.author && item.author.name}/${item.name}`}))} } {checkValue === 1 && selectValue.map((item, index)=>{return
diff --git a/src/forge/SecuritySetting/bot/disposition/index.jsx b/src/forge/SecuritySetting/bot/disposition/index.jsx index b49484488..59e0d55c3 100644 --- a/src/forge/SecuritySetting/bot/disposition/index.jsx +++ b/src/forge/SecuritySetting/bot/disposition/index.jsx @@ -51,11 +51,11 @@ function DispositionBot(props){ {botList.map((item, index)=>{return
- {item.bot_name} + {item.bot_name} {item.state === 0 ? '挂起' : '启用'}
- +
})} diff --git a/src/forge/SecuritySetting/bot/disposition/index.scss b/src/forge/SecuritySetting/bot/disposition/index.scss index f696fce0e..e0c30d932 100644 --- a/src/forge/SecuritySetting/bot/disposition/index.scss +++ b/src/forge/SecuritySetting/bot/disposition/index.scss @@ -84,7 +84,7 @@ } } .selectBox{ - width: 260px; + width: 360px; margin: 10px 0 0 24px; .ant-select-selection{padding-top: 0;} .ant-select-selection__placeholder{ diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx index 5fb53ade1..f7e8bb3b2 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx @@ -134,7 +134,7 @@ function AdvancedInformation(props){ if(res && res.code === 200){ message.success('删除成功'); setVisibleDelete(false); - props.history.push("/settings/exploitBot/configuration"); + props.history.push("/settings/mybot/configuration"); } }) }else{ @@ -202,7 +202,7 @@ function AdvancedInformation(props){

目前您的Bot所有用户都能安装

- +
} @@ -212,7 +212,7 @@ function AdvancedInformation(props){

目前您的Bot所有用户都能安装

- +
} diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx index 510fa667b..a6ab61059 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx @@ -114,13 +114,21 @@ function BasicInformation(props){
-

{botDetail.client_secret}

+
+ {botDetail.client_secret} + {message.success('复制成功')}}> + + +
+
+ {botDetail.private_key} + {message.success('复制成功')}}> + + +
{/*
生成者姓名时间
*/}
- {message.success('复制成功')}}> - -

Bot信息

diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/index.scss b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/index.scss index 55c852906..5c47c10f3 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/index.scss +++ b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/index.scss @@ -35,6 +35,16 @@ padding: 25px 0; border-bottom: 1px dashed #e0e6f5; &:hover{background-color:rgba(125, 148, 246, 0.05);} + .copyBotInfo{ + display: flex; + align-items: center; + } + .oneLineSpan{ + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 680px; + } } .basicInformationForm{ .width80{ diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx index 6b4d22ee4..f6e8dded7 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx @@ -43,7 +43,7 @@ function ConfigurateBot(props){ setBotDetail(res.data.bot_output_vo); }else if(res && res.code === 500){ message.error("您没有权限访问该bot"); - history.push('/settings/exploitBot/configuration'); + history.push('/settings/mybot/configuration'); } }) }, [reload]) @@ -51,42 +51,42 @@ function ConfigurateBot(props){ return
Bot开发者配置 - +
- 基本信息 - -1 ?"active itemBox":"itemBox"}>权限&订阅 - -1 ?"active itemBox":"itemBox"}>高级选项 + 基本信息 + -1 ?"active itemBox":"itemBox"}>权限&订阅 + -1 ?"active itemBox":"itemBox"}>高级选项
{/* bot上架市场 */} ( )} > ( )} > ()} > ()} > ()} > ()} > diff --git a/src/forge/SecuritySetting/bot/exploit/index.jsx b/src/forge/SecuritySetting/bot/exploit/index.jsx index a9e56092e..db4a9667e 100644 --- a/src/forge/SecuritySetting/bot/exploit/index.jsx +++ b/src/forge/SecuritySetting/bot/exploit/index.jsx @@ -75,7 +75,7 @@ function ExploitBot(props){ return
我的Bot - +
{/* bot转让接收按钮显示区域 */} @@ -97,15 +97,15 @@ function ExploitBot(props){ {botList.map((item, index)=>{return
- {item.bot_name} + {item.bot_name} {item.is_public ? item.is_market ? '上架' : '公开' : '私有'}
- +
})}
:

您当前暂未注册任何Bot

-
Bot可以帮助您自动化处理一些繁杂的项目任务,欢迎您 注册一个Bot 基于GitLink API进行开发。
此外您还可以在 Bot市场 中共享或安装他人的Bot
+
Bot可以帮助您自动化处理一些繁杂的项目任务,欢迎您 注册一个Bot 基于GitLink API进行开发。
此外您还可以在 Bot市场 中共享或安装他人的Bot
)} { if(res && res.code === 200){ message.success('注册成功'); - props.history.push('/settings/exploitBot/configuration/'+res.data.bot_id); + props.history.push('/settings/mybot/configuration/'+res.data.bot_id); }else{ message.success('注册失败: '+res.data); } @@ -92,7 +92,7 @@ function Disposition(props){ return
- 我的Bot注册新的Bot + 我的Bot注册新的Bot
diff --git a/src/forge/Settings/softBot.jsx b/src/forge/Settings/softBot.jsx index ecbbd311f..1e25ad5e3 100644 --- a/src/forge/Settings/softBot.jsx +++ b/src/forge/Settings/softBot.jsx @@ -32,7 +32,7 @@ function SoftBot(props){ {item.bot_name} {item.state === 0 ? '挂起' : '启用'}
- +
})} :
diff --git a/src/softbot/softBotDetail/index.jsx b/src/softbot/softBotDetail/index.jsx index 73fd9690e..d1cf3ed4a 100644 --- a/src/softbot/softBotDetail/index.jsx +++ b/src/softbot/softBotDetail/index.jsx @@ -5,6 +5,7 @@ import { getImageUrl } from 'educoder'; import './index.scss'; import axios from "axios"; import RenderHtml from "../../components/render-html"; +import { Link } from "react-router-dom"; function SoftBotDEtail(props){ const {match:{params:{id}}, current_user, history, showLoginDialog} = props; @@ -18,6 +19,8 @@ function SoftBotDEtail(props){ // 是否已安装此bot const [isInstall, setIsInstall] = useState(false); const [reload, setReload] = useState(undefined); + // userLoginMap: 用户白名单 + const userLoginMap = ["wangtao", "wuxiaojun", "durian", "pxicb3wke", "xxq250", "Nigel"]; useEffect(()=>{ if(current_user && current_user.login){ @@ -26,7 +29,7 @@ function SoftBotDEtail(props){ params:{ limit: 1000, page: 1, - category:"manage" + category: userLoginMap.includes(current_user.login) ? "admin" : "manage" } }).then(result=>{ if(result && result.data){ @@ -84,7 +87,7 @@ function SoftBotDEtail(props){ function click(){ if(isInstall){ - props.history.push(`/settings/dispositionBot/${id}`) + props.history.push(`/settings/installbot/${id}`) }else{ if(current_user && current_user.login){ // 安装此bot弹窗 @@ -134,7 +137,17 @@ function SoftBotDEtail(props){ store_list: checkValue ? selectValue.map(item=>{return item.id}) : options.map(item=>{return item.id}), repo_map } - installMarketBot(params).then(res=>{ + let bool = true; + // selectValue:用户选择的仓库 + if(userLoginMap.includes(current_user.login)){ + if(selectValue.length === 1 && selectValue[0].author.type === "Organization"){ + params.login = selectValue[0].author.login; + }else{ + message.error("请选择组织下的一个仓库"); + bool = false; + } + } + bool && installMarketBot(params).then(res=>{ if(res && res.code === 200){ message.success("安装成功"); setVisible(false); @@ -185,12 +198,13 @@ function SoftBotDEtail(props){ onChange={selectChange} className="installSelectBox" dropdownClassName="installDropdownClass" + getPopupContainer={trigger => trigger.parentNode} > - {filterOption.map(item=>({item.name}))} + {filterOption.map(item=>({`${item.author && item.author.name}/${item.name}`}))} } {checkValue === 1 && selectValue.map((item, index)=>{return
- {`${item.author && item.author.name}/${item.name}`} + {`${item.author && item.author.name}/${item.name}`} {deleteSelect(item)}}>
})}
权限信息
diff --git a/src/softbot/softBotList/index.jsx b/src/softbot/softBotList/index.jsx index aae273238..b1ab1423b 100644 --- a/src/softbot/softBotList/index.jsx +++ b/src/softbot/softBotList/index.jsx @@ -60,7 +60,7 @@ function SoftBot(props){ // 立即注册跳转 function registerBot(){ if(current_user && current_user.login){ - history.push('/settings/exploitBot/new'); + history.push('/settings/mybot/new'); }else{ showLoginDialog(); }