forked from Gitlink/forgeplus-react
issue-2021-12-22
This commit is contained in:
parent
91338c863c
commit
2f25643fcc
|
@ -250,3 +250,36 @@ export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings)
|
|||
allowClear={true}
|
||||
></Search>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function turnbar(str){
|
||||
let s = str;
|
||||
if(s && s.length>0){
|
||||
if(s.indexOf("%")>-1){
|
||||
s = s.replaceAll('%','55');
|
||||
}
|
||||
if(s.indexOf("#")>-1){
|
||||
s = s.replaceAll('#','%23');
|
||||
}
|
||||
if(s.indexOf("/")>-1){
|
||||
s = s.replaceAll('/','%2F');
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
export function returnbar(str){
|
||||
let s = str;
|
||||
if(s && s.length>0){
|
||||
if(str.indexOf("55")>-1){
|
||||
s = s.replaceAll('55','%');
|
||||
}
|
||||
if(s.indexOf("%23")>-1){
|
||||
s = s.replaceAll('%23','#');
|
||||
}
|
||||
if(s.indexOf("%2F")>-1){
|
||||
s = s.replaceAll('%2F','/');
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
|
@ -6,7 +6,8 @@ export {
|
|||
getUploadLogoActionUrl as getUploadLogoActionUrl,numFormat as numFormat,
|
||||
getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
|
||||
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
|
||||
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl
|
||||
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,
|
||||
turnbar,returnbar
|
||||
} from './UrlTool';
|
||||
|
||||
export { setmiyah as setmiyah } from './Component';
|
||||
|
|
|
@ -76,7 +76,6 @@ const tokenizer = {
|
|||
if (cap) {
|
||||
const raw = cap[0]
|
||||
let text = indentCodeCompensation(raw, cap[3] || '')
|
||||
console.log(text);
|
||||
const lang = cap[2] ? cap[2].trim() : cap[2]
|
||||
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
||||
const id = next_id()
|
||||
|
|
|
@ -3,6 +3,7 @@ import { Dropdown} from 'antd';
|
|||
import './branch.scss';
|
||||
import SelectOverlay from './SelectOverlay';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import { turnbar } from 'educoder';
|
||||
|
||||
export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{
|
||||
const [ showValue , setShowValue ] = useState(branch);
|
||||
|
@ -35,7 +36,8 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag
|
|||
|
||||
function ChangeB(params) {
|
||||
setVisible(false);
|
||||
changeBranch(params);
|
||||
let en = turnbar(params);
|
||||
changeBranch(en);
|
||||
}
|
||||
|
||||
const menu = (
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Drawer , Tree , Spin } from 'antd';
|
||||
import { turnbar} from 'educoder';
|
||||
import './Component.scss';
|
||||
import axios from 'axios';
|
||||
const { TreeNode , DirectoryTree } = Tree;
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , list}){
|
||||
const [ treeData , setTreeData ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import { Table , Popconfirm } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { turnbar } from "educoder";
|
||||
|
||||
// const STATUS = {
|
||||
// running:"运行中",
|
||||
|
@ -10,12 +11,6 @@ import { Link } from 'react-router-dom';
|
|||
// killed:"已撤销",
|
||||
// pending:"准备中"
|
||||
// }
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function renderTableStatus(status) {
|
||||
switch (status) {
|
||||
case "running":
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { Dropdown , Menu , Divider , Spin, Button , Typography } from 'antd';
|
||||
import { getImageUrl } from "educoder";
|
||||
import { getImageUrl , turnbar , returnbar } from "educoder";
|
||||
import { Link } from 'react-router-dom';
|
||||
import { truncateCommitId } from "../common/util";
|
||||
import CloneAddress from '../Branch/CloneAddress';
|
||||
|
@ -23,24 +23,9 @@ import Nodata from '../Nodata';
|
|||
import Invite from './sub/Invite';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
import RenderHtml from '../../components/render-html';
|
||||
import { Base64 } from 'js-base64';
|
||||
/**
|
||||
* projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能)
|
||||
*/
|
||||
const { Paragraph } = Typography;
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function returnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("%2F")>-1){
|
||||
return str.replaceAll('%2F','/');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function CoderDepot(props){
|
||||
const [ projectDetail , setProjectDetail ]= useState(undefined);
|
||||
const [ inviteCode , setInviteCode ] = useState(undefined);
|
||||
|
@ -123,13 +108,10 @@ function CoderDepot(props){
|
|||
setTreeValue(url);
|
||||
getFileInfo(url,branchName);
|
||||
setType("file");
|
||||
// getReadmeInfo(url,branchName);
|
||||
// setReadme(undefined);
|
||||
}else{
|
||||
setTreeValue(undefined);
|
||||
getDirInfo(branchName || defaultBranch);
|
||||
setType("dir");
|
||||
// getReadmeInfo('', branchName || defaultBranch);
|
||||
}
|
||||
}
|
||||
},[projectsId,owner,pathname,defaultBranch])
|
||||
|
@ -170,7 +152,7 @@ function CoderDepot(props){
|
|||
const url = `/${owner}/${projectsId}/entries.json`;
|
||||
|
||||
axios.get(url, {
|
||||
params: { ref: branch }
|
||||
params: { ref:branch}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
setCommitCount(result.data.commits_count);
|
||||
|
@ -240,9 +222,9 @@ function CoderDepot(props){
|
|||
|
||||
// 切换分支或者标签
|
||||
function changeBranch(value){
|
||||
let checkvalue = turnbar(value);
|
||||
let url = `/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
|
||||
props.history.push(url);
|
||||
let checkvalue = value;
|
||||
let u = `/${owner}/${projectsId}${checkvalue && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
|
||||
props.history.push(u);
|
||||
}
|
||||
|
||||
// 文件相关的下拉项
|
||||
|
@ -574,7 +556,7 @@ function CoderDepot(props){
|
|||
projectDetail && projectDetail.license_name &&
|
||||
<div className="pinfos">
|
||||
<i className="iconfont icon-xieyiicon font-16 mr10"></i>
|
||||
<Link to={`/${owner}/${projectsId}/tree/${branchName || defaultBranch}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/tree/${turnbar(branchName || defaultBranch)}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
@ -3,15 +3,10 @@ import { Link } from "react-router-dom";
|
|||
import { Dropdown , Menu , Icon , Tooltip , Spin } from 'antd';
|
||||
import { truncateCommitId } from '../common/util';
|
||||
import { getBranch } from '../GetData/getData';
|
||||
import { turnbar } from "educoder";
|
||||
import Nodata from '../Nodata';
|
||||
import './list.scss';
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
export default ((props)=>{
|
||||
const [ data , setData ] =useState(undefined);
|
||||
const [ isSpin , setIsSpin ] =useState(true);
|
||||
|
|
|
@ -46,12 +46,6 @@ const Infos = styled.div`
|
|||
}
|
||||
}
|
||||
`;
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
//提交详情页
|
||||
export default (props) => {
|
||||
const {match , history } = props;
|
||||
|
|
|
@ -279,26 +279,26 @@ class Index extends Component {
|
|||
isSpin, total, search, limit, page, typeList, categoryList ,
|
||||
recommendOriList , CategoryList , category_id } = this.state;
|
||||
|
||||
const setting={
|
||||
dots: true,
|
||||
infinite: true,
|
||||
speed: 500,
|
||||
slidesToShow: 5,
|
||||
slidesToScroll: 5,
|
||||
autoplay:false,
|
||||
arrows:false,
|
||||
adaptiveHeight:true
|
||||
}
|
||||
const settings={
|
||||
dots: true,
|
||||
infinite: true,
|
||||
speed: 500,
|
||||
slidesToShow: 6,
|
||||
slidesToScroll: 6,
|
||||
autoplay:false,
|
||||
arrows:false,
|
||||
adaptiveHeight:true
|
||||
}
|
||||
// const setting={
|
||||
// dots: true,
|
||||
// infinite: true,
|
||||
// speed: 500,
|
||||
// slidesToShow: 5,
|
||||
// slidesToScroll: 5,
|
||||
// autoplay:false,
|
||||
// arrows:false,
|
||||
// adaptiveHeight:true
|
||||
// }
|
||||
// const settings={
|
||||
// dots: true,
|
||||
// infinite: true,
|
||||
// speed: 500,
|
||||
// slidesToShow: 6,
|
||||
// slidesToScroll: 6,
|
||||
// autoplay:false,
|
||||
// arrows:false,
|
||||
// adaptiveHeight:true
|
||||
// }
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
|
@ -2,20 +2,13 @@ import React , { useEffect , useState } from 'react';
|
|||
import CopyTool from '../../Component/CopyTool';
|
||||
import { truncateCommitId } from '../../common/util';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import { getImageUrl , turnbar } from 'educoder';
|
||||
import { Dropdown , Menu , Spin } from 'antd';
|
||||
import './Index.scss';
|
||||
import { Base64 } from 'js-base64';
|
||||
|
||||
import Tree from '../img/tree.png';
|
||||
import Axios from 'axios';
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function Index(props) {
|
||||
const [ list , setList ] = useState([]);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
|
|
|
@ -2,15 +2,8 @@ import React, { Component } from "react";
|
|||
import { Link } from "react-router-dom";
|
||||
import { Tag } from "antd";
|
||||
import { AlignCenter } from '../Component/layout';
|
||||
import { getImageUrl } from "educoder";
|
||||
import { getImageUrl, turnbar } from "educoder";
|
||||
import "./merge.css";
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
class MergeItem extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { Component } from "react";
|
|||
import { Tabs } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import axios from "axios";
|
||||
import { getImageUrl } from "educoder";
|
||||
import { getImageUrl , turnbar } from "educoder";
|
||||
import {
|
||||
Form,
|
||||
Input,
|
||||
|
@ -20,13 +20,6 @@ import "../Order/order.css";
|
|||
import MergeLinkFooter from "./MergeLinkFooter";
|
||||
|
||||
const TextArea = Input.TextArea;
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
class MessageCount extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
|
@ -3,23 +3,11 @@ import { getImageUrl } from "educoder";
|
|||
import { Form, Input, Button, Radio, Icon, Spin } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
import "./index.css";
|
||||
import { turnbar , returnbar } from 'educoder';
|
||||
|
||||
import axios from "axios";
|
||||
const TextArea = Input.TextArea;
|
||||
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function returnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("%2F")>-1){
|
||||
return str.replaceAll('%2F','/');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
class UserSubmitComponent extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
|
@ -106,6 +106,7 @@ class order extends Component {
|
|||
isSpin: true
|
||||
})
|
||||
const { select_params } = this.state;
|
||||
console.log(select_params);
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
const url = `/${owner }/${projectsId}/issues.json`;
|
||||
axios
|
||||
|
@ -246,10 +247,11 @@ class order extends Component {
|
|||
checkedValue:[],
|
||||
all:undefined
|
||||
});
|
||||
const { status_type } = this.state;
|
||||
const { status_type , select_params } = this.state;
|
||||
|
||||
this.setState({
|
||||
select_params:{
|
||||
...select_params,
|
||||
search:value,
|
||||
page:1
|
||||
}
|
||||
|
|
|
@ -33,6 +33,10 @@ const Profile = Loadable({
|
|||
loader: () => import("../users/Material/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Password = Loadable({
|
||||
loader: () => import("../users/Material/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
const SSHIndex = Loadable({
|
||||
loader: () => import("./sub/SSH"),
|
||||
loading: Loading,
|
||||
|
@ -65,6 +69,7 @@ function Index(props){
|
|||
<ul className="securityUl ul-border-buttom">
|
||||
<li>个人信息</li>
|
||||
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i><span className="text-shodow-bold">基本资料</span></Link></li>
|
||||
<li className={pathname.indexOf("/settings/password")>-1 ?"active":""}><Link to={`/settings/password`}><i className="iconfont icon-xuanzhonganquanshezhi_icon mr5 font-14"></i><span className="text-shodow-bold">密码管理</span></Link></li>
|
||||
</ul>
|
||||
{notice_url && <ul className="securityUl ul-border-buttom">
|
||||
<li>消息通知</li>
|
||||
|
@ -109,6 +114,12 @@ function Index(props){
|
|||
<Profile {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/settings/password"
|
||||
render={(p) => (
|
||||
<Password {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/settings/SSH"
|
||||
render={(p) => (
|
||||
|
|
|
@ -13,30 +13,19 @@ const Img = styled.img`{
|
|||
height:30px;
|
||||
border-radius:50%;
|
||||
}`
|
||||
|
||||
const demoData = [
|
||||
{
|
||||
img:"images/avatars/User/g",
|
||||
name:"蔡世",
|
||||
email:"1149225589@qq.com",
|
||||
team:"caicaizi",
|
||||
role:"管理者",
|
||||
operation:"移除成员",
|
||||
}
|
||||
]
|
||||
const limit = 15;
|
||||
export default (({organizeDetail})=>{
|
||||
const [ choiceId , serChoiceId ] = useState(undefined);
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ limit , setLimit ] = useState(15);
|
||||
const [ total , setTotal ] = useState(0);
|
||||
const [ search , setSearch ] = useState(undefined);
|
||||
const [ data , setData ] = useState(demoData);
|
||||
const [ data , setData ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
if(organizeDetail && organizeDetail.id){
|
||||
getData(search);
|
||||
}
|
||||
},[organizeDetail,search])
|
||||
},[organizeDetail,search,page])
|
||||
|
||||
|
||||
function getData(search){
|
||||
const url = `/organizations/${organizeDetail.id}/organization_users.json`;
|
||||
|
|
|
@ -2490,7 +2490,7 @@ function initVueComponents(){
|
|||
},
|
||||
|
||||
showRepo: function(repo, filter) {
|
||||
switch (filter) {
|
||||
(filter) {
|
||||
case 'sources':
|
||||
return repo.owner.id == this.uid && !repo.mirror && !repo.fork;
|
||||
case 'forks':
|
||||
|
|
|
@ -5,6 +5,19 @@ import { TagInfo } from '../../Utils/TagColor';
|
|||
import { getImageUrl } from 'educoder';
|
||||
|
||||
function Activity({list}) {
|
||||
function typeForUrl(trend_type,project,id){
|
||||
const { owner , identifier } = project;
|
||||
switch(trend_type){
|
||||
case 'Issue':
|
||||
return `/${owner && owner.login}/${identifier}/issues/${id}`;
|
||||
case 'VersionRelease':
|
||||
return `/${owner && owner.login}/${identifier}/releases`;
|
||||
case 'PullRequest':
|
||||
return `/${owner && owner.login}/${identifier}/pulls/${id}`;
|
||||
default :
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return(
|
||||
<ul className="infosActivity">
|
||||
{
|
||||
|
@ -19,7 +32,7 @@ function Activity({list}) {
|
|||
{i.priority && TagInfo(`${i.priority}`,"")}
|
||||
{i.issue_status && <span className="status">{i.issue_status}</span> }
|
||||
</AlignCenter>
|
||||
<p className="aDesc">{i.action_type}:{i.name}</p>
|
||||
<p className="aDesc"><Link to={typeForUrl(i.trend_type,i.project,i.trend_id)}>{i.action_type}:{i.name}</Link></p>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Menu } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Base from './Base';
|
||||
import Password from './Password';
|
||||
import './Index.scss';
|
||||
import '../../SecuritySetting/notice/manager/Index.scss';
|
||||
|
||||
function Index(props){
|
||||
// const { username } = props && props.match && props.match.params;
|
||||
const { pathname } = props && props.location;
|
||||
const { current_user } = props;
|
||||
|
||||
|
||||
const [ key , setKey ] = useState("0");
|
||||
|
@ -28,10 +25,13 @@ function Index(props){
|
|||
return(
|
||||
<div className="notice01">
|
||||
<div className="sshHead">
|
||||
<Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu" onClick={(e)=>setKey(e.key)}>
|
||||
<Menu.Item key="0" className="font-16">基本资料</Menu.Item>
|
||||
{/* <Menu.Item key="0"><Link to={`/settings/profile`}>基本资料</Link></Menu.Item> */}
|
||||
<Menu.Item key="1" className="font-16">密码管理</Menu.Item>
|
||||
<Menu mode={'horizontal'} className="infosRightMenu">
|
||||
{
|
||||
key === "0" ?
|
||||
<Menu.Item key="0" className="font-16">基本资料</Menu.Item>
|
||||
:
|
||||
<Menu.Item key="1" className="font-16">密码管理</Menu.Item>
|
||||
}
|
||||
</Menu>
|
||||
</div>
|
||||
<div style={{padding:"20px"}}>
|
||||
|
|
Loading…
Reference in New Issue