This commit is contained in:
谢思 2023-02-01 09:32:19 +08:00
parent 7e30ffbc1c
commit cfd120e1f5
27 changed files with 1357 additions and 1220 deletions

2264
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1673243764843') format('woff2'),
url('iconfont.woff?t=1673243764843') format('woff'),
url('iconfont.ttf?t=1673243764843') format('truetype');
src: url('iconfont.woff2?t=1673486678957') format('woff2'),
url('iconfont.woff?t=1673486678957') format('woff'),
url('iconfont.ttf?t=1673486678957') format('truetype');
}
.iconfont {
@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-BOTpeizhi:before {
content: "\e942";
}
.icon-kaifabot:before {
content: "\e943";
}
.icon-jiqiren:before {
content: "\e940";
}
.icon-a-jiqirenzhineng-02:before {
content: "\e941";
}
.icon-yuyue-lishi-shijian:before {
content: "\e93f";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,34 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "33731642",
"name": "BOT配置",
"font_class": "BOTpeizhi",
"unicode": "e942",
"unicode_decimal": 59714
},
{
"icon_id": "33731643",
"name": "开发bot",
"font_class": "kaifabot",
"unicode": "e943",
"unicode_decimal": 59715
},
{
"icon_id": "19591156",
"name": "机器人",
"font_class": "jiqiren",
"unicode": "e940",
"unicode_decimal": 59712
},
{
"icon_id": "25885545",
"name": "机器人、智能-02",
"font_class": "a-jiqirenzhineng-02",
"unicode": "e941",
"unicode_decimal": 59713
},
{
"icon_id": "6978097",
"name": "预约-历史-时间",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -110,7 +110,7 @@ body {
/* 图片点击放大的场景,隐藏图片链接 */
.editormd-image-click-expand .editormd-image-dialog {
height: 234px !important;
height: 244px !important;
}
.editormd-image-click-expand .editormd-image-dialog .image-link {

View File

@ -110,8 +110,8 @@ function Index(props){
</ul>
{notice_url && <ul className="securityUl ul-border-buttom">
<li>消息通知</li>
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={"/settings/notice"}><i className="iconfont icon-wodetongzhi"></i><span className="text-shodow-bold">我的通知</span></Link></li>
<li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli"></i><span className="text-shodow-bold">通知管理</span></Link></li>
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={"/settings/notice"}><i className="iconfont icon-wodetongzhi font-14"></i><span className="text-shodow-bold">我的通知</span></Link></li>
<li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli font-14"></i><span className="text-shodow-bold">通知管理</span></Link></li>
</ul>}
<ul className="securityUl ul-border-buttom">
<li>安全设置</li>
@ -119,8 +119,8 @@ function Index(props){
</ul>
<ul className="securityUl">
<li>Bot开发</li>
<li className={pathname.indexOf("/settings/exploitBot")>-1 ?"active":""}><Link to={`/settings/exploitBot`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i><span className="text-shodow-bold">开发Bot</span></Link></li>
<li className={pathname.indexOf("/settings/dispositionBot")>-1 ?"active":""}><Link to={`/settings/dispositionBot`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i><span className="text-shodow-bold">Bot配置</span></Link></li>
<li className={pathname.indexOf("/settings/exploitBot")>-1 ?"active":""}><Link to={`/settings/exploitBot`}><i className="iconfont icon-kaifabot mr5 font-18"></i><span className="text-shodow-bold">开发Bot</span></Link></li>
<li className={pathname.indexOf("/settings/dispositionBot")>-1 ?"active":""}><Link to={`/settings/dispositionBot`}><i className="iconfont icon-BOTpeizhi mr5 font-17"></i><span className="text-shodow-bold">Bot配置</span></Link></li>
</ul>
</div>
<LongWidth>

View File

@ -59,7 +59,7 @@
a{color: $primary-color;}
}
i{
font-size: 14px !important;
// font-size: 14px !important;
margin-right: 8px;
}
}

View File

@ -109,13 +109,13 @@ function DispositionDetail(props){
<div className="ml40 font-16">
<div className="font-22">{botDetail && botDetail.market_name}</div>
<span className="mr30 color88">{botDetail && botDetail.register_id}</span>
<span className="color88">{botDetail && botDetail.market_time && moment(botDetail.market_time).format('YYYY-MM-DD hh:mm:ss')}</span>
<span className="color88">{botDetail && botDetail.create_time && moment(botDetail.create_time).format('YYYY-MM-DD hh:mm:ss')}</span>
</div>
</div>
<Button style={{width: '53px', padding: '0'}} className="grayBorBut"><Link to={`/settings/dispositionBot`}>返回</Link></Button>
</div>
{botDetail && <div className="mb10"><Checkbox className="greenCol font-16" checked={botDetail.limit_vo.juris_diction_code !== 2}>代码库{botDetail.limit_vo.juris_diction_code === 2 ? '无' : botDetail.limit_vo.juris_diction_code === 1 ? '读写' : '只读'}权限</Checkbox></div>}
{botDetail && <div className="mb20"><Checkbox className="greenCol font-16" checked={botDetail.limit_vo.juris_diction_pr !== 2}>合并请求(PR){botDetail.limit_vo.juris_diction_pr === 2 ? '无' : botDetail.limit_vo.juris_diction_pr === 1 ? '读写' : '只读'}权限</Checkbox></div>}
{botDetail && <div className="mb10 greenCol font-16"><i className={`mr8 iconfont icon- ${botDetail.limit_vo.juris_diction_code !== 2 ? 'icon-chenggongicon' : 'icon-tishi1'}`}></i>代码库{botDetail.limit_vo.juris_diction_code === 2 ? '无' : botDetail.limit_vo.juris_diction_code === 1 ? '读写' : '只读'}权限</div>}
{botDetail && <div className="mb20 greenCol font-16"><i className={`mr8 iconfont icon- ${botDetail.limit_vo.juris_diction_pr !== 2 ? 'icon-chenggongicon' : 'icon-tishi1'}`}></i>合并请求(PR){botDetail.limit_vo.juris_diction_pr === 2 ? '无' : botDetail.limit_vo.juris_diction_pr === 1 ? '读写' : '只读'}权限</div>}
<div className="detailTil font-16">更改安装位置</div>
<div>
<Radio.Group onChange={(e)=>{setCheckValue(e.target.value)}} value={checkValue}>

View File

@ -43,10 +43,10 @@ function DispositionBot(props){
{/* bot列表显示区域 */}
{botList && (botList.length > 0 ? <div className="setBotListBox">
{botList.map((item, index)=>{return <div className="disBotItem" key={index}>
<div>
<div className="botNameLeft">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr20"/>
<span className="font-15">{item.bot_name}</span>
<span className={`statusBox font-12 ml10 ${item.state === '0' ? '' : 'active'}`}>{item.state === '0' ? '挂起' : '启用'}</span>
<Link className="font-15 botName" to={`/settings/dispositionBot/${item.bot_id}`}>{item.bot_name}</Link>
<span className={`statusBox font-12 ml10 ${item.state === 0 ? '' : 'active'}`}>{item.state === 0 ? '挂起' : '启用'}</span>
</div>
<div>
<Button className="themeCorBorBut" style={{width: '68px', height: '36px'}}><Link to={`/settings/dispositionBot/${item.bot_id}`}>配置</Link></Button>

View File

@ -12,6 +12,18 @@
.disBotItem{
border-bottom: 1px dashed #e0e6f5;
padding: 20px 0 15px;
.botNameLeft{
display: flex;
align-items: center;
width: 80%;
}
.botName{
display: inline-block;
max-width: 80%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.setBotListBox{
margin-top: 16px;
@ -22,6 +34,7 @@
color:#f92d2d;
border-radius:4px;
padding: 4px 6px;
line-height: 11px;
&.active{
background-color:rgba(58, 213, 115, 0.08);
border-color:#25c589;
@ -45,21 +58,11 @@
}
.greenCol{
color:#202d40;
.ant-checkbox-inner, .ant-checkbox-checked::after{
border-radius: 50%;
.icon-tishi1{
color:#f60011;
}
.ant-checkbox-checked::after, .ant-checkbox:hover .ant-checkbox-inner, &.ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-checkbox-inner{
border-color:#00bb75;
}
.ant-checkbox-checked .ant-checkbox-inner{
background-color:#00bb75;
border-color:#00bb75;
&::after{
border: 1px solid #fff;
border-top: 1px;
border-left: 1px;
top: 45%;
}
.icon-chenggongicon{
color:#00bb75;
}
}
.detailTil{

View File

@ -64,10 +64,30 @@ function BasicInformation(props){
})
})
}
//
function saveUpdateImage(){
if(imageId){
const params = {
...botDetail,
bot_id: parseInt(id),
logo: '/api/attachments/'+imageId
}
registerUpdateBot(params).then(res=>{
if(res && res.code === 200){
message.success("成功修改头像");
setReload(Math.random());
}
})
}else{
message.error('请先上传图片');
}
}
return <Box>
{botDetail && <div className="basicInformationBox">
<p className="informationHead pb15 mb10">注册信息</p>
<div className="labelBox"><span className="label">Bot所有者</span>59897989liccha</div>
<div className="labelBox"><span className="label">Bot所有者</span>{current_user.username}</div>
<div className="labelBox"><span className="label">Bot ID</span>{id}</div>
<div className="labelBox"><span className="label">客户端ID</span>{botDetail.client_id}</div>
<div className="labelBox"><span className="label">主页URL</span><Link to={`/softbot/${id}`} className="blueSpan">{window.location.origin + `/softbot/${id}`}</Link></div>
@ -123,18 +143,9 @@ function BasicInformation(props){
</Form>
</div>}
<div className="headPortraitBox">
<UploadImage url={image && image.startsWith('/api/attachments/') ? getImageUrl(`/${image}`) : image} getImage={getImage} getImageId = {getImageId}/>
<Button className="themeCorBorBut ml5">修改头像</Button>
<UploadImage url={image && image.startsWith('/api/attachments/') ? getImageUrl(`${image}`) : image} getImage={getImage} getImageId = {getImageId}/>
<Button className="themeCorBorBut ml5" onClick={saveUpdateImage}>保存头像</Button>
</div>
{/* {
avatarVisible &&
<Avatar
onCancel={onCancelAvatar}
avatarImg={getImageUrl(`/${current_user && current_user.image_url}`)}
id={current_user && current_user.user_id}
botDetail={botDetail}
/>
} */}
</Box>
}
export default Form.create()(BasicInformation);

View File

@ -4,14 +4,23 @@ import { useState } from "react";
import '../../new/index.scss';
import './index.scss';
import { registerUpdateBot } from "../../../../../../softbot/api";
import { useEffect } from "react";
const {Option} = Select;
// Bot
function Jurisdiction(props){
const {form, botDetail, setReload, match:{params:{id}}} = props;
const {getFieldDecorator, validateFields , setFieldsValue } = form;
const resource = [{value: 2, name: '无权限'}, {value: 0, name: '只读'}, {value: 1, name: '读写'}];
const [codeSelectValue , setCodeSelectValue ] = useState(botDetail && botDetail.limit_and_events.juris_diction_code);
const [prSelectValue , setPrSelectValue ] = useState(botDetail && botDetail.limit_and_events.juris_diction_pr);
const [codeSelectValue , setCodeSelectValue ] = useState(undefined);
const [prSelectValue , setPrSelectValue ] = useState(undefined);
useEffect(()=>{
if(botDetail){
const {limit_and_events:{juris_diction_code, juris_diction_pr}} = botDetail
setCodeSelectValue(juris_diction_code);
setPrSelectValue(juris_diction_pr);
}
}, [botDetail])
function codeControl(e){
setCodeSelectValue(e);
@ -71,7 +80,10 @@ function Jurisdiction(props){
</Form.Item>
{(codeSelectValue !== resource[0].value || prSelectValue !== resource[0].value) && <div className="resourceTitle font-16 pb15 mb10">订阅事件</div>}
{codeSelectValue !== resource[0].value && <Form.Item label="代码库事件" className="botItem width50 checkBox three dashedBorder">
{getFieldDecorator("event_code", {initialValue: botDetail.limit_and_events.event_code})(
{getFieldDecorator("event_code", {
initialValue: botDetail.limit_and_events.event_code,
rules:[{required:codeSelectValue !== resource[0].value,message:"请选择订阅事件!"}]
})(
<Checkbox.Group>
<Checkbox value={0}>推送<br/><span className="color-99">git推送到存储库</span></Checkbox>
<Checkbox value={1}>创建<br/><span className="color-99">创建分支或标签</span></Checkbox>
@ -81,7 +93,10 @@ function Jurisdiction(props){
</Form.Item>}
{(codeSelectValue !== resource[0].value && prSelectValue !== resource[0].value) && <div className="dashedBor"></div>}
{prSelectValue !== resource[0].value && <Form.Item label="合并请求事件" className="botItem width50 checkBox">
{getFieldDecorator("event_pr", {initialValue: botDetail.limit_and_events.event_pr})(
{getFieldDecorator("event_pr", {
initialValue: botDetail.limit_and_events.event_pr,
rules:[{required:prSelectValue !== resource[0].value,message:"请选择订阅事件!"}]
})(
<Checkbox.Group>
<Checkbox value={3}>合并请求<br/><span className="color-99">合并请求被打开被关闭被重新打开或被编辑</span></Checkbox>
<Checkbox value={4}>合并请求分配<br/><span className="color-99">合并请求被分配或取消分配</span></Checkbox>

View File

@ -109,7 +109,7 @@ function Putaway(props){
message.error(res.data);
}else{
message.success("成功上架市场");
props.history.push('/settings/dispositionBot');
props.history.push('/softbot/'+id);
}
})
}
@ -170,6 +170,7 @@ function Putaway(props){
initValue={content}
onChange={onContentChange}
className="mt20"
imageExpand={false}
></MdEditor>
)}
</Form.Item>

View File

@ -6,7 +6,7 @@ import { Link } from "react-router-dom";
import { TPMIndexHOC } from "../../../../../modules/tpm/TPMIndexHOC";
import { Box } from "../../../../Component/layout";
import './index.scss';
import { Button } from "antd";
import { Button, message } from "antd";
import { getRegisterBot } from "../../../../../softbot/api";
const BasicInformation = Loadable({
@ -28,7 +28,7 @@ const Putaway = Loadable({
// bot
function ConfigurateBot(props){
const {match:{params:{id}}, current_user, location:{pathname}} = props;
const {match:{params:{id}}, current_user, location:{pathname}, history} = props;
const [reload, setReload] = useState(undefined);
const [botDetail, setBotDetail] = useState(undefined);
@ -39,6 +39,9 @@ function ConfigurateBot(props){
}).then(res=>{
if(res && res.code === 200){
setBotDetail(res.data.bot_output_vo);
}else if(res && res.code === 500){
message.error("您没有权限访问该bot");
history.push('/settings/exploitBot/configuration');
}
})
}, [reload])

View File

@ -88,9 +88,10 @@ function ExploitBot(props){
{/* bot列表显示区域 */}
{botList && (botList.length > 0 ? <div className="softBotListBox">
{botList.map((item, index)=>{return <div className="softBotItem" key={index}>
<div className="botOneLine">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr10"/>
<span className="font-15">{item.bot_name}</span>
<div className="botOneLine botNameWarpBox">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr20" object-fit="fill"/>
<Link className="font-15 botOneLine botNameBox" to={`/settings/exploitBot/configuration/${item.bot_id}`}>{item.bot_name}</Link>
<span className={`font-12 ml10 statusBot ${item.is_public ? item.is_market ? 'market' : 'public' : 'private'}`}>{item.is_public ? item.is_market ? '上架' : '公开' : '私有'}</span>
</div>
<Button className="themeCorBorBut ml30" style={{width: '68px', height: '36px'}}><Link to={`/settings/exploitBot/configuration/${item.bot_id}`}>编辑</Link></Button>
</div>})}

View File

@ -61,6 +61,7 @@
width: 44px;
height: 44px;
border-radius: 50%;
object-fit: cover;
}
}
.nullBotsBox{
@ -78,4 +79,30 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&.botNameWarpBox{
display: flex;
align-items: center;
}
}
.botNameBox{
max-width: 80%;
display: inline-block;
}
.statusBot{
border: 1px solid $primary-color;
border-radius: 5px;
color: $primary-color;
padding: 4px 6px 4px;
background-color: rgba(70, 106, 255, 0.09);
line-height: 12px;
&.public{
background-color: rgba(58, 213, 115, 0.08);
border-color: #25c589;
color: #25c589;
}
&.private{
background-color: rgba(230, 126, 34, 0.08);
border-color: rgba(230, 126, 34, 1);
color: rgba(230, 126, 34, 1);
}
}

View File

@ -68,7 +68,7 @@ function Disposition(props){
{getFieldDecorator("bot_name",{
rules:[{required:true,message:"请输入Bot名称"}]
})(
<Input.TextArea placeholder="请输入Bot名称" maxLength={200} className="height36" autoSize={true}/>
<Input.TextArea placeholder="请输入Bot名称" maxLength={50} className="height36" autoSize={true}/>
)}
</Form.Item>
<Form.Item label="详细介绍" className="botItem introduce">
@ -112,7 +112,9 @@ function Disposition(props){
</Form.Item>
{(codeSelectValue !== resource[0].value || prSelectValue !== resource[0].value) && <div className="resourceTitle font-16 pb15 mb10">订阅事件</div>}
{codeSelectValue !== resource[0].value && <Form.Item label="代码库事件" className="botItem width50 checkBox three dashedBorder">
{getFieldDecorator("event_code")(
{getFieldDecorator("event_code",{
rules:[{required:codeSelectValue !== resource[0].value,message:"请选择订阅事件!"}]
})(
<Checkbox.Group>
<Checkbox value={0}>推送<br/><span className="color-99">git推送到存储库</span></Checkbox>
<Checkbox value={1}>创建<br/><span className="color-99">创建分支或标签</span></Checkbox>
@ -122,7 +124,9 @@ function Disposition(props){
</Form.Item>}
{(codeSelectValue !== resource[0].value && prSelectValue !== resource[0].value) && <div className="dashedBor"></div>}
{prSelectValue !== resource[0].value && <Form.Item label="合并请求事件" className="botItem width50 checkBox">
{getFieldDecorator("event_pr")(
{getFieldDecorator("event_pr",{
rules:[{required:prSelectValue !== resource[0].value,message:"请选择订阅事件!"}]
})(
<Checkbox.Group>
<Checkbox value={3}>合并请求<br/><span className="color-99">合并请求被打开被关闭被重新打开或被编辑</span></Checkbox>
<Checkbox value={4}>合并请求分配<br/><span className="color-99">合并请求被分配或取消分配</span></Checkbox>
@ -130,7 +134,7 @@ function Disposition(props){
)}
</Form.Item>}
<Form.Item label="公/私有设置" className="botItem resourceTitleItem">
{getFieldDecorator("is_public")(
{getFieldDecorator("is_public",{initialValue: 0})(
<Radio.Group>
<Radio value={1}>公开</Radio>
<Radio value={0}>私有</Radio>

View File

@ -116,7 +116,7 @@ class Index extends Component {
>
<p>
<Link to={`/${owner}/${projectsId}/settings/softbot`} className="w-100">
<i className="iconfont icon-xiangmubiaoqian font-15 mr10 color-grey-6"></i>
<i className="iconfont icon-a-jiqirenzhineng-02 font-18 mr10 color-grey-6"></i>
已安装Bot
</Link>
</p>

View File

@ -299,6 +299,7 @@
color:#f92d2d;
border-radius:4px;
padding: 4px 6px;
line-height: normal;
&.active{
background-color:rgba(58, 213, 115, 0.08);
border-color:#25c589;
@ -312,10 +313,22 @@
border-bottom: 1px dashed #e0e6f5;
padding: 20px 0 15px;
}
.flexCenter{
display: inline-flex;
align-items: center;
}
.botName{
display: inline-block;
max-width: 600px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.imgBox{
width: 44px;
height: 44px;
border-radius: 50%;
object-fit: cover;
}
}
.nullBotBox{

View File

@ -27,9 +27,9 @@ function SoftBot(props){
{/* bot列表显示区域 */}
{botList && (botList.length > 0 ? <div className="botListBox">
{botList.map((item, index)=>{return <div className="disBotItem" key={index}>
<div>
<div className="flexCenter">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr20"/>
<span className="font-15">{item.bot_name}</span>
<span className="font-15 botName">{item.bot_name}</span>
<span className={`statusBox font-12 ml10 ${item.state === 0 ? '' : 'active'}`}>{item.state === 0 ? '挂起' : '启用'}</span>
</div>
<Button className="themeCorBorBut" style={{width: '68px', height: '36px'}}><Link to={`/settings/dispositionBot/${item.bot_id}`}>配置</Link></Button>

View File

@ -4,9 +4,10 @@ import {getBotDetail, installMarketBot, judgeIsIntallBot} from '../api';
import { getImageUrl } from 'educoder';
import './index.scss';
import axios from "axios";
import RenderHtml from "../../components/render-html";
function SoftBotDEtail(props){
const {match:{params:{id}}, current_user} = props;
const {match:{params:{id}}, current_user, history, showLoginDialog} = props;
const [detail, setDetail] = useState(undefined);
const [visible, setVisible] = useState(false);
const [checkValue, setCheckValue] = useState(1);
@ -56,6 +57,13 @@ function SoftBotDEtail(props){
user_id: 36480
}).then(res=>{
if(res && res.code === 200){
const {is_public, developer_id} = res.data;
const {user_id, login} = current_user
if((login && !is_public && developer_id !== user_id) || (!login && !is_public)){
message.error("私有bot无权限访问");
history.push('/softbot');
return;
}
setDetail(res.data);
}
})
@ -77,8 +85,12 @@ function SoftBotDEtail(props){
if(isInstall){
props.history.push(`/settings/dispositionBot/${id}`)
}else{
// bot
setVisible(true);
if(current_user && current_user.login){
// bot
setVisible(true);
}else{
showLoginDialog();
}
}
}
@ -127,13 +139,13 @@ function SoftBotDEtail(props){
<div className="userBox font-16">{detail.first_func && <span className="typeBox font-15 mr15">{detail.first_func}</span>}{detail.developer_id}</div>
<div>{detail.market_desc}</div>
</div>
<Button type="primary" style={{width: '114px', height: '40px'}} className="font-15" onClick={click}>{isInstall ? '查看详情' : '安装此Bot'}</Button>
{((current_user && !current_user.login) || detail.is_public || (!detail.is_public && detail.developer_id === current_user.user_id))&&<Button type="primary" style={{width: '114px', height: '40px'}} className="font-15" onClick={click}>{isInstall ? '查看详情' : '安装此Bot'}</Button>}
</div>
</div>}
<div className="detailIntroBox">
<div className="detailIntroCont">
<div className="detailIntroTitle font-20 mb10">Bot详细介绍</div>
<div dangerouslySetInnerHTML={{__html: detail && detail.bot_des}} className="detailIntro font-15"></div>
<RenderHtml value={detail && detail.bot_des} className="detailIntro font-15"/>
</div>
</div>
<Modal
@ -163,8 +175,8 @@ function SoftBotDEtail(props){
</Select>}
{checkValue === 1 && selectValue.map((item, index)=>{return <div key={index} className="selectValueBox font-14"><i className="iconfont icon-daimakuicon1 font-14 mr5"></i><span className="selectValue">{item.name}</span><i className="iconfont icon-guanbi font-12 close ml30" onClick={()=>{deleteSelect(item)}}></i></div>})}
<div className="installTil font-18 mt20 mb10">权限信息</div>
{detail && <div className="mb10"><Checkbox className="greenCol font-16" checked={detail.limit_and_events.juris_diction_code !== 2}>代码库{detail.limit_and_events.juris_diction_code === 2 ? '无' : detail.limit_and_events.juris_diction_code === 1 ? '读写' : '只读'}权限</Checkbox></div>}
{detail && <div className="mb20"><Checkbox className="greenCol font-16" checked={detail.limit_and_events.juris_diction_pr !== 2}>合并请求(PR){detail.limit_and_events.juris_diction_pr === 2 ? '无' : detail.limit_and_events.juris_diction_pr === 1 ? '读写' : '只读'}权限</Checkbox></div>}
{detail && <div className="mb10 font-16 greenCol"><i className={`mr8 iconfont icon- ${detail.limit_and_events.juris_diction_code !== 2 ? 'icon-chenggongicon' : 'icon-tishi1'}`}></i>代码库{detail.limit_and_events.juris_diction_code === 2 ? '无' : detail.limit_and_events.juris_diction_code === 1 ? '读写' : '只读'}权限</div>}
{detail && <div className="mb20 font-16 greenCol"><i className={`mr8 iconfont icon- ${detail.limit_and_events.juris_diction_pr !== 2 ? 'icon-chenggongicon' : 'icon-shanchu_tc_icon1'}`}></i>合并请求(PR){detail.limit_and_events.juris_diction_pr === 2 ? '无' : detail.limit_and_events.juris_diction_pr === 1 ? '读写' : '只读'}权限</div>}
</div>
</Modal>
</div>

View File

@ -9,7 +9,7 @@
}
.botDetailHead{
width: 100%;
height:217px;
min-height:217px;
background-size: 100% 100%;
background-image: url('../image/softDetailHeadBg.png');
.botDetailHeadCont{
@ -22,6 +22,7 @@
line-height: 86px;
border-radius: 50%;
border: 1px solid white;
overflow: hidden;
img{
max-width: 100%;
}
@ -70,6 +71,7 @@
top: -50px;
left: 50%;
transform: translate(-50%, 0);
overflow: hidden;
.installBotImg{
max-width: 100%;
}
@ -141,21 +143,11 @@
}
.greenCol{
color:#202d40;
.ant-checkbox-inner, .ant-checkbox-checked::after{
border-radius: 50%;
.icon-tishi1{
color:#f60011;
}
.ant-checkbox-checked::after, .ant-checkbox:hover .ant-checkbox-inner, &.ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-checkbox-inner{
border-color:#00bb75;
}
.ant-checkbox-checked .ant-checkbox-inner{
background-color:#00bb75;
border-color:#00bb75;
&::after{
border: 1px solid #fff;
border-top: 1px;
border-left: 1px;
top: 45%;
}
.icon-chenggongicon{
color:#00bb75;
}
}
}

View File

@ -7,7 +7,7 @@ import {getAllBotCategory, getContentsLikeNameAndFunc} from '../api.js';
import Nodata from '../../forge/Nodata'
function SoftBot(props){
const {mygetHelmetapi} = props;
const {mygetHelmetapi, current_user, history, showLoginDialog} = props;
const [current, setCurrent] = useState(1);
const [pageSize, setPageSize] = useState(12);
const [total, setTotal] = useState(500);
@ -55,13 +55,22 @@ function SoftBot(props){
function onChange(pageNumber) {
setCurrent(pageNumber);
}
//
function registerBot(){
if(current_user && current_user.login){
history.push('/settings/exploitBot/new');
}else{
showLoginDialog();
}
}
return <div className="softbotBox">
<div className="softbotHead">
<div className="softheadContent">
<img src={getImageUrl(mygetHelmetapi.login_logo_url)} alt="" width={180}/>
<div className="bigTit mt30">欢迎来到Bot市场</div>
<div className="bigTit">快来挑选一个心仪的Bot加入到您的项目吧!</div>
<Button type="primary" style={{width: '152px', height:'40px'}} className="font-18 gotoRegister"><Link to={'/settings/exploitBot/new'}>立即注册<i className="iconfont icon-youjiantou font-15"></i></Link></Button>
<Button type="primary" style={{width: '152px', height:'40px'}} className="font-18 gotoRegister" onClick={registerBot}>立即注册<i className="iconfont icon-youjiantou font-15"></i></Button>
</div>
</div>
<div className="botListBox">
@ -78,7 +87,7 @@ function SoftBot(props){
<div className="oneBotImgBox"><img src={getImageUrl(item.logo)} alt="" className="oneBotImg"/></div>
<div className="oneBotLine">
<p className="font-16 oneBotName oneBotLine">{item.market_name}</p>
<p>{item.user}</p>
<p>{item.user || '开发者名称'}</p>
</div>
</div>
<div className="botIntro">{item.market_desc}</div>
@ -90,7 +99,7 @@ function SoftBot(props){
</div>
</div>
</div>
<Pagination showSizeChanger onShowSizeChange={onShowSizeChange} showQuickJumper current={current} total={total} pageSize={pageSize} onChange={onChange} className="botListPagination mt30"/>
<Pagination showSizeChanger onShowSizeChange={onShowSizeChange} showQuickJumper current={current} total={total} pageSize={pageSize} pageSizeOptions={['12','24','36','48']} onChange={onChange} className="botListPagination mt30"/>
</div>
}
export default SoftBot;

View File

@ -91,17 +91,18 @@
align-items: center;
background-image: url('../image/botOneBg.png');
color:rgba(13, 22, 71, 0.65);
padding: 20px 0 25px 12px;
padding: 15px 0 16px 12px;
.oneBotName{
color:#151d40;
}
.oneBotImgBox{
width: 42px;
height: 42px;
width: 50px;
height: 50px;
line-height: 42px;
border-radius: 50%;
border:1px solid #ffffff;
margin-right: 15px;
overflow: hidden;
img{
max-width: 100%;
}
@ -117,6 +118,7 @@
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
min-height: 56px;
}
.degreeBox{
color:#151d40;