dev_forge
caicai8 5 years ago
parent bb2691767b
commit f6b2e1748b

@ -0,0 +1,32 @@
import React , { Component } from 'react';
import { Dropdown , Icon , Menu } from 'antd';
import "./branch.css"
// 点击按钮复制功能
function jsCopy(){
var e = document.getElementById("copy_rep_content");
e.select();
document.execCommand("Copy");
}
class CloneAddress extends Component{
render(){
const { http_url , downloadUrl } = this.props;
return(
<div className="gitAddressClone">
<span className={"addressType active"} onClick={()=>this.changeAddress("http")}>HTTP</span>
{/* <span className={address ==="ssh" ? "addressType active":"addressType"} onClick={()=>this.changeAddress("ssh")}>SSH</span> */}
<input type="text" id="copy_rep_content" value={ http_url }/>
<span onClick={()=>jsCopy()}><i className="iconfont icon-fuzhi"></i></span>
<span>
<Dropdown overlay={downloadUrl} trigger={['click']} placement="bottomRight">
<a className="ant-dropdown-link">
<Icon type="cloud-download" className="font-18 fl"/>
</a>
</Dropdown></span>
</div>
)
}
}
export default CloneAddress;

@ -1,6 +1,8 @@
import React , { Component } from 'react';
import { Dropdown , Icon , Menu } from 'antd';
import "./branch.css"
class SelectBranch extends Component{
render(){

@ -0,0 +1,9 @@
.branchDropdown{
border:1px solid #eee;
border-radius: 4px;
display: flex;
justify-content: center;
padding:0px 10px;
height: 35px;
line-height: 35px;
}

@ -6,13 +6,9 @@ import { getImageUrl } from 'educoder';
import axios from 'axios';
import SelectBranch from '../Branch/SelectBranch'
import CloneAddress from '../Branch/CloneAddress'
// 点击按钮复制功能
function jsCopy(){
var e = document.getElementById("copy_rep_content");
e.select();
document.execCommand("Copy");
}
class CoderRootDirectory extends Component{
constructor(props){
super(props);
@ -163,18 +159,7 @@ class CoderRootDirectory extends Component{
<div className="f-wrap-between mt20">
<SelectBranch branch={branch} branchs={branchs} changeBranch={this.changeBranch}></SelectBranch>
<div className="gitAddressClone">
<span className={"addressType active"} onClick={()=>this.changeAddress("http")}>HTTP</span>
{/* <span className={address ==="ssh" ? "addressType active":"addressType"} onClick={()=>this.changeAddress("ssh")}>SSH</span> */}
<input type="text" id="copy_rep_content" value={ http_url }/>
<span onClick={()=>jsCopy()}><i className="iconfont icon-fuzhi"></i></span>
<span>
<Dropdown overlay={downloadUrl} trigger={['click']} placement="bottomRight">
<a className="ant-dropdown-link">
<Icon type="cloud-download" className="font-18 fl"/>
</a>
</Dropdown></span>
</div>
<CloneAddress http_url={http_url} downloadUrl={downloadUrl}></CloneAddress>
</div>
<Table
className="mt20 wrap-commit-table"

@ -203,15 +203,7 @@ body,#root{
.branch-wrapper span:hover{
color: #4CACFF;
}
.branchDropdown{
border:1px solid #eee;
border-radius: 4px;
display: flex;
justify-content: center;
padding:0px 10px;
height: 35px;
line-height: 35px;
}
.gitAddressClone{
display: flex;

Loading…
Cancel
Save