diff --git a/src/forge/Information/Pages/headerPagebyCCF.jsx b/src/forge/Information/Pages/headerPagebyCCF.jsx index ddc3f0bc4..59b6d9c0c 100644 --- a/src/forge/Information/Pages/headerPagebyCCF.jsx +++ b/src/forge/Information/Pages/headerPagebyCCF.jsx @@ -16,21 +16,6 @@ import Slider from 'react-slick'; import Left from '../../../home/Img/left.png'; import Right from '../../../home/Img/right.png'; -const setting = { - dots: true, - infinite: true, - speed: 2000, - slidesToShow: 1, - slidesToScroll: 1, - pauseOnDotsHover: true, - autoplaySpeed: 5000, - pauseOnFocus: true, - autoplay: true, - arrows: true, - prevArrow: , - nextArrow: -} - function HeaderPageCCF(props) { const [projectList, setProjectList] = useState(undefined); const [personList, setPersonList] = useState(undefined); @@ -39,6 +24,22 @@ function HeaderPageCCF(props) { const { deptId, cateId } = props.match.params; const { data, id, temp } = props; const [mainList, setMainList] = useState(undefined); + const [tag,setTag] = useState(0); + const setting = { + dots: true, + infinite: true, + speed: 2000, + slidesToShow: 1, + slidesToScroll: 1, + pauseOnDotsHover: true, + autoplaySpeed: 5000, + pauseOnFocus: true, + autoplay: true, + arrows: true, + prevArrow: , + nextArrow: , + afterChange: (index)=> setTag(index) + } useEffect(() => { if (id||cateId) { @@ -109,6 +110,7 @@ function HeaderPageCCF(props) { } }).catch(error => { }) } + console.log(tag) return (
{ @@ -140,13 +142,13 @@ function HeaderPageCCF(props) { newsList.map((i, k) => { return (
  • - {i.name} + {i.name}

    {i.publishTime} -

    {i.visits}

    +

    {i.visits}

  • ) @@ -165,7 +167,7 @@ function HeaderPageCCF(props) {

    {i.name} - {window.location.href=`/zone/${deptId}/news/${i.id}`}}>

    +

    { i.cmsDocList && i.cmsDocList.length > 0 ? i.cmsDocList.map((j, k) => { diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index f775fc9f5..053b07ad9 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -121,7 +121,6 @@ function Index(props){ } }).catch(error=>{}) } - console.log(deptId) return(
    { !sourcedetail && (id ? :
    )} diff --git a/src/forge/Information/indexZonebyCCF.scss b/src/forge/Information/indexZonebyCCF.scss index 1259c54af..e5a4298e7 100644 --- a/src/forge/Information/indexZonebyCCF.scss +++ b/src/forge/Information/indexZonebyCCF.scss @@ -175,6 +175,9 @@ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; + &:hover{ + color: #466aff !important; + } } } diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index a21a616af..4c7003740 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -8,7 +8,7 @@ import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC" import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC"; import Loadable from "react-loadable"; import Loading from "../../Loading"; -import { Box , Gap , LongWidth } from '../Component/layout'; +import { Box, Gap, LongWidth } from '../Component/layout'; import { getImageUrl } from 'educoder'; import { Link } from 'react-router-dom'; import Avatar from '../users/Avatar/Index'; @@ -16,6 +16,8 @@ import Avatar from '../users/Avatar/Index'; import './Index.scss'; import { useEffect } from "react"; +import axios from "axios"; + const MyNoticeIndex = Loadable({ loader: () => import("./notice/myNotice/Index"), loading: Loading, @@ -70,51 +72,57 @@ const Mysite = Loadable({ loader: () => import("./website/mySiteList"), loading: Loading, }); +const Createsite = Loadable({ + loader: () => import("./website/new"), + loading: Loading, +}); -function Index(props){ - const { current_user,mygetHelmetapi , checkIfLogin } = props; + + +function Index(props) { + const { current_user, mygetHelmetapi, checkIfLogin } = props; const { pathname } = props.location; const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice; - const [ avatarVisible , setAvatarVisible ] = useState(false); + const [avatarVisible, setAvatarVisible] = useState(false); const [active, setActive] = useState(1); console.log('active', active); - useEffect(()=>{ - if(checkIfLogin() === false){ + useEffect(() => { + if (checkIfLogin() === false) { props.history.push('/login'); } - },[]) + }, []) - useEffect(()=>{ + useEffect(() => { console.log('pathname', pathname, ["/settings/profile"].indexOf(pathname)); - if(["/settings/profile"].indexOf(pathname) !== -1){ + if (["/settings/profile"].indexOf(pathname) !== -1) { setActive(1); - }else if(["/settings/emails", "/settings/phone", "/settings/password", "/settings/cancel"].indexOf(pathname) !== -1){ + } else if (["/settings/emails", "/settings/phone", "/settings/password", "/settings/cancel"].indexOf(pathname) !== -1) { setActive(2); - }else if(["/settings/notice/config"].indexOf(pathname) !== -1){ + } else if (["/settings/notice/config"].indexOf(pathname) !== -1) { setActive(4); - }else if(["/settings/notice"].indexOf(pathname) !== -1){ + } else if (["/settings/notice"].indexOf(pathname) !== -1) { setActive(3); - }else if(["/settings/SSH"].indexOf(pathname) !== -1){ + } else if (["/settings/SSH"].indexOf(pathname) !== -1) { setActive(5); - }else if(["/settings/CLA"].indexOf(pathname) !== -1){ + } else if (["/settings/CLA"].indexOf(pathname) !== -1) { setActive(6); - }else if(["/settings/mybot"].indexOf(pathname) !== -1){ + } else if (["/settings/mybot"].indexOf(pathname) !== -1) { setActive(7); - }else if(["/settings/installbot"].indexOf(pathname) !== -1){ + } else if (["/settings/installbot"].indexOf(pathname) !== -1) { setActive(8); - }else if(["/settings/mysite"].indexOf(pathname) !== -1){ + } else if (["/settings/mysite"].indexOf(pathname) !== -1) { setActive(9); } }, [pathname]) - function onCancelAvatar(){ + function onCancelAvatar() { setAvatarVisible(false); const { resetUserInfo } = props; resetUserInfo && resetUserInfo(); } - return( + return (
    { avatarVisible && @@ -129,35 +137,40 @@ function Index(props){
    - - setAvatarVisible(true)}>修改头像 + + setAvatarVisible(true)}>修改头像
    {current_user && current_user.username}
    • 个人信息
    • -
    • 基本资料
    • -
    • 账号管理
    • +
    • 基本资料
    • +
    • 账号管理
    {notice_url &&
    • 消息通知
    • -
    • 我的通知
    • -
    • 通知管理
    • +
    • 我的通知
    • +
    • 通知管理
    }
    • 安全设置
    • -
    • SSH密钥
    • -
    • 我的CLA
    • +
    • SSH密钥
    • +
    • 我的CLA
    • Bot开发
    • -
    • 我的Bot
    • -
    • Bot安装
    • +
    • 我的Bot
    • +
    • Bot安装
    {/*
    • 个人建站
    • +<<<<<<< HEAD +
    • 我的站点
    • +
    +=======
  • 我的站点
  • */} +>>>>>>> 4913bc56a825315e970989217acf13cdd115a53f
    @@ -165,108 +178,117 @@ function Index(props){ ( - + )} > ( - + render={(p) => ( + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( - + )} > {/* 创建一个新的bot */} ( - + )} > {/* 开发bot */} ( - + )} > {/* bot配置页面 */} ( - + )} > {/* bot配置 */} ( - + )} > + {/* 新建站点 */} + + ( + + )} + > + {/* 个人建站 */} ( - + )} > diff --git a/src/forge/SecuritySetting/website/index.scss b/src/forge/SecuritySetting/website/index.scss index 89b9d18c0..aefe8aeca 100644 --- a/src/forge/SecuritySetting/website/index.scss +++ b/src/forge/SecuritySetting/website/index.scss @@ -1,8 +1,32 @@ -.default_head{ +.default_head { height: 65px; line-height: 64px; border-bottom: 1px solid rgba(224, 230, 245, 1); - color:#151d40; - font-size:17px; - padding-bottom:20px; + color: #151d40; + font-size: 17px; + padding-bottom: 20px; + + Button { + float: right; + width: 100px; + height: 36px; + margin-top: 8px; + color: #fff; + background-color: #466aff; + border-color: #466aff; + } +} +.bushu { + border-radius: 4px; + background-color: rgba(164, 173, 179, 1); + color: rgba(255, 255, 255, 1); + font-size: 20px; + text-align: center; + float: right; + top:-40px; +} +.form{ + border: 1px solid rgba(164, 173, 179, 1); + padding: 10px; + border-radius: 4px; } \ No newline at end of file diff --git a/src/forge/SecuritySetting/website/mySiteList.jsx b/src/forge/SecuritySetting/website/mySiteList.jsx index 4c2417778..b7cf9f9bf 100644 --- a/src/forge/SecuritySetting/website/mySiteList.jsx +++ b/src/forge/SecuritySetting/website/mySiteList.jsx @@ -1,16 +1,44 @@ import React, { useState, useEffect, Fragment } from "react"; -import { Button, Icon, message, Modal } from "antd"; +import { Button, Icon, message, Modal, Form, Drawer } from "antd"; import './index.scss'; +import axios from "axios"; -function MySiteList(props){ - const {current_user} = props; +function MySiteList(props) { + const { form, current_user } = props; + const [sitelist, setSitelist] = useState(undefined); - useEffect(()=>{ - document.title='我的站点'; + useEffect(() => { + document.title = '我的站点'; + axios.get('/site_pages.json').then(result => { + if (result) { + setSitelist(result.data.pages); + } + }) }, []) - return -
    我的站点
    -
    + + + return ( +
    +
    + 我的站点 + +
    +
    + { + sitelist && sitelist.length > 0 && + sitelist.map((i, k) => { + return ( +
    + 站点名称: {i.site_name}

    建站工具: {i.language_frame}

    + 建站时间: {i.created_at}

    上次部署时间: {i.last_build_at}

    + +
    + ) + }) + } +
    +
    + ) } export default MySiteList; \ No newline at end of file diff --git a/src/forge/SecuritySetting/website/new/index.jsx b/src/forge/SecuritySetting/website/new/index.jsx new file mode 100644 index 000000000..65f7ee509 --- /dev/null +++ b/src/forge/SecuritySetting/website/new/index.jsx @@ -0,0 +1,148 @@ +import React, { Fragment, forwardRef, useEffect, useState } from "react"; +import { Form, Input, Select, Space, Button, message, Radio } from "antd"; +import axios from "axios"; +import "./index.scss" +import { Link } from "react-router-dom"; + + + +function createSite(props) { + const { form, current_user } = props; + const [content, setContent] = useState(undefined); + const [addr, setAddr] = useState(undefined); + const [tag, setTag] = useState(""); + const [proname, setProname] = useState(""); + const [protag, setProtag] = useState(""); + const [themename, setThemename] = useState([""]); + const { TextArea } = Input; + const { getFieldDecorator, validateFields } = props && props.form; + const [pagetheme, setPagetheme] = useState(undefined); + + + useEffect(() => { + document.title = '注册新的站点'; + axios.get('/site_pages/themes.json').then(res => { + if (res) { + setPagetheme(res.data.themes); + } + }) + }, []) + function onContentChange(value) { + setContent(value); + }; + + function ChangeAddr(e) { + setTag(e.target.value); + } + + function checkAddr(rule, value, callback) { + let reg = /^[0-9a-zA-Z]+$/; + if (!value) { + callback(); + } + if (!reg.test(value)) { + callback("请输入有效的名称"); + } + setAddr(value); + callback(); + } + + function submit(e) { + e.preventDefault(); + validateFields((err, fieldsValue) => { + if (err) { + console.log("error"); + return; + } + const { site_name, identifier, theme, name, repository_name, clone_addr } = fieldsValue; + const prame = { site_name, identifier, language_frame: "hugo", theme:themename[0], user_id: current_user.user_id, name, repository_name, clone_addr:themename[1] }; + axios.post(`/projects/page_migrate.json`, prame).then(response => { + if (response && response.status === 200) { + message.success("创建成功"); + props.history.push(`/settings/mysite`) + } else { + message.error("创建失败"); + } + }) + }) + } + console.log(themename); + + return ( +
    +
    + 我的站点创建新的站点 +
    +
    +

    新建站点

    +
    +
    +
    + + {getFieldDecorator("site_name", { + rules: [{ required: true, message: "请输入站点名称" }, { validator: checkAddr }] + }) + ()} + + + {getFieldDecorator("identifier", { + rules: [{ required: true, message: "请输入站点标识" }] + }) + ()} + http://{current_user.login}.kingchan.cn/{tag} + + + + + + {getFieldDecorator("name", { + rules: [{ required: true, message: "请输入项目名称" }] + }) + ( { setProname(e.target.value) }} placeholder="请输入项目名称" />)} + +
    + + + {getFieldDecorator("repository_name", { + rules: [{ required: true, message: "请输入项目标识" }] + }) + ( { setProtag(e.target.value) }} placeholder="请输入项目标识" />)} + + +