diff --git a/public/react/src/forge/Branch/CloneAddress.js b/public/react/src/forge/Branch/CloneAddress.js new file mode 100644 index 000000000..a983612d5 --- /dev/null +++ b/public/react/src/forge/Branch/CloneAddress.js @@ -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( +
+ this.changeAddress("http")}>HTTP + {/* this.changeAddress("ssh")}>SSH */} + + jsCopy()}> + + + + + + +
+ ) + } +} +export default CloneAddress; \ No newline at end of file diff --git a/public/react/src/forge/Branch/SelectBranch.js b/public/react/src/forge/Branch/SelectBranch.js index ca5ee9413..a3fcff973 100644 --- a/public/react/src/forge/Branch/SelectBranch.js +++ b/public/react/src/forge/Branch/SelectBranch.js @@ -1,6 +1,8 @@ import React , { Component } from 'react'; import { Dropdown , Icon , Menu } from 'antd'; +import "./branch.css" + class SelectBranch extends Component{ render(){ diff --git a/public/react/src/forge/Branch/branch.css b/public/react/src/forge/Branch/branch.css new file mode 100644 index 000000000..f54901088 --- /dev/null +++ b/public/react/src/forge/Branch/branch.css @@ -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; +} \ No newline at end of file diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index 038f841a8..5e6be652e 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -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{
-
- this.changeAddress("http")}>HTTP - {/* this.changeAddress("ssh")}>SSH */} - - jsCopy()}> - - - - - - -
+