diff --git a/src/App.js b/src/App.js index 7130cc68..57c94765 100644 --- a/src/App.js +++ b/src/App.js @@ -120,7 +120,7 @@ class App extends Component { }); initAxiosInterceptors(this.props); - this.getAppdata(); + this.getSetting(); window.addEventListener('error', (event) => { const msg = `${event.type}: ${event.message}`; @@ -133,67 +133,30 @@ class App extends Component { }) }; - //获取数据为空的时候 - gettablogourlnull = () => { - this.setState({ - mygetHelmetapi: undefined - }); - document.title = "Forge"; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = "/react/build/./favicon.ico"; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - }; - //获取数据的时候 + getSetting=()=>{ + const url = `/setting.json`; + axios.get(url).then(result=>{ + if(result){ + this.setState({ + headData:result.data.data + }) + this.gettablogourldata(result.data.data) + } + }).catch(error=>{}) + } + gettablogourldata = (response) => { - document.title = response.data.setting.name; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); + document.title = response.name; + var link = document.createElement('link'),oldLink = document.getElementById('dynamic-favicon'); link.id = 'dynamic-favicon'; link.rel = 'shortcut icon'; - link.href = '/' + response.data.setting.tab_logo_url; + link.href = '/' + response.tab_logo_url; if (oldLink) { document.head.removeChild(oldLink); } document.head.appendChild(link); } - //获取当前定制信息 - getAppdata = () => { - let url = "/setting.json"; - axios.get(url).then((response) => { - if (response) { - if (response.data) { - this.setState({ - mygetHelmetapi: response.data.setting - }); - //存储配置到游览器 - localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse', JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } - } else { - this.gettablogourlnull(); - } - } else { - this.gettablogourlnull(); - } - }).catch((error) => { - this.gettablogourlnull(); - }); - }; render() { return ( diff --git a/src/AppConfig.js b/src/AppConfig.js index 3b223f44..1f87e949 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -34,7 +34,7 @@ function clearAllCookie() { cookie.remove('autologin_trustie', { path: '/' }); setpostcookie() } -clearAllCookie(); +// clearAllCookie(); function setpostcookie() { const str = window.location.pathname; if (str.indexOf("/wxcode") !== -1) { @@ -50,13 +50,13 @@ function setpostcookie() { } } } -setpostcookie(); +// setpostcookie(); window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener(); var proxy = "http://localhost:3000"; - proxy = "http://192.168.1.37:3000"; + proxy = "https://mulan.trustie.net"; const requestMap = {}; window.setfalseInRequestMap = function (keyName) { @@ -65,10 +65,10 @@ export function initAxiosInterceptors(props) { //响应前的设置 axios.interceptors.request.use( config => { - setpostcookie() - clearAllCookie() + // clearAllCookie() + // setpostcookie() - if (config.url.indexOf(proxy) !== -1) { + if (config.url.indexOf("http") !== -1) { return config } requestProxy(config) @@ -79,20 +79,20 @@ export function initAxiosInterceptors(props) { if (window.location.port === "3007") { config.url = `${proxy}${url}`; if (config.url.indexOf('?') === -1) { - config.url = `${config.url}?debug=${debugType}`; + config.url = `${config.url}`; } else { - config.url = `${config.url}&debug=${debugType}`; + config.url = `${config.url}`; } } else { config.url = url; } - setpostcookie(); + // setpostcookie(); } - if (config.url.indexOf('update_file') === -1) { - requestMap[config.url] = true; + // if (config.url.indexOf('update_file') === -1) { + // requestMap[config.url] = true; - window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900) - } + // window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900) + // } return config; }, err => { @@ -147,7 +147,7 @@ export function initAxiosInterceptors(props) { }, 2000); } requestMap[response.config.url] = false; - setpostcookie(); + // setpostcookie(); return response; }, function (error) { return Promise.reject(error); diff --git a/src/indexEduplus2RequestProxy.js b/src/indexEduplus2RequestProxy.js index 81cfba0e..fc3e2111 100644 --- a/src/indexEduplus2RequestProxy.js +++ b/src/indexEduplus2RequestProxy.js @@ -66,19 +66,3 @@ export function requestProxy(config) { } return config; } - -/** - ('/api/v1/careers/qweqw/edit/').match(/\/api\/v1\/careers\/(\w*)\/edit/i) - 0: "/api/v1/careers/qweqw/edit" - 1: "qweqw" - - example: - `/api/v1/games/${this.props.game.identifier}/answer_grade` -> - `/tasks/${this.props.game.identifier}/answer_grade.json` - - - https://testeduplus2.educoder.net/api/v1/games/feguz4tiqpvx/rep_content - ?path=src/step2/CLnkQueue.cpp&shixun_gpid=2791&status=0&retry=0 -> - http://testeduplus2.educoder.net/tasks/tonblikwzj78/rep_content.json - ?path=1-4.py&shixun_gpid=2448&status=0 - */ \ No newline at end of file diff --git a/src/mulan/Components/Login/Index.scss b/src/mulan/Components/Login/Index.scss index 2995c97e..3bb708f6 100644 --- a/src/mulan/Components/Login/Index.scss +++ b/src/mulan/Components/Login/Index.scss @@ -1,4 +1,11 @@ .loginModal{ + .ant-modal-close{ + top:0px!important; + height: 48px; + line-height: 48px; + display: flex; + align-items: center; + } .ant-modal-body{ padding:0px; .ant-menu{ diff --git a/src/mulan/Components/Login/Login.jsx b/src/mulan/Components/Login/Login.jsx index debbbd0c..fb479702 100644 --- a/src/mulan/Components/Login/Login.jsx +++ b/src/mulan/Components/Login/Login.jsx @@ -1,24 +1,48 @@ -import React, { useState , forwardRef } from 'react'; -import { Form , Input , Checkbox } from 'antd'; +import React, { useState , forwardRef, useEffect } from 'react'; +import { Form , Input , Checkbox, Button } from 'antd'; import "./Index.scss"; +import axios from 'axios'; -function LoginModal({form}){ +function LoginModal({form , successFunc , visible}){ const [ active , setActive ] = useState(false); + const [ loading , setLoading ] = useState(false); const { getFieldDecorator, validateFields , setFieldsValue , getFieldsValue } = form; + function changeInput(){ - const { account , password } = getFieldsValue(); - if(account && password){ + const { login , password } = getFieldsValue(); + if(login && password){ setActive(true); }else{ setActive(false); } } + function loginFunc() { + validateFields((error,values)=>{ + if(!error){ + setLoading(true); + const url = `/accounts/login.json`; + axios.post(url,{ + ...values + }).then(result=>{ + successFunc(result.data.data); + setLoading(false); + if(!values.savePass){ + setFieldsValue({ + login:undefined, + password:undefined, + savePass:false + }) + } + }).catch(error=>{}) + } + }) + } return(
- {getFieldDecorator("account",{ + {getFieldDecorator("login",{ rules:[{required:true,message:"请输入登录账号"}] })( @@ -28,19 +52,19 @@ function LoginModal({form}){ {getFieldDecorator("password",{ rules:[{required:true,message:"请输入登录密码"}] })( - + )} { active ? - 登录 + : 登录 } - {getFieldDecorator("savePass",{ - rules:[] - })( + {getFieldDecorator("savePass", + {rules:[]},{valuePropName:"checked"} + )( 记住密码 )} diff --git a/src/mulan/Components/Login/LoginModal.jsx b/src/mulan/Components/Login/LoginModal.jsx index 7adf2f87..8215ec54 100644 --- a/src/mulan/Components/Login/LoginModal.jsx +++ b/src/mulan/Components/Login/LoginModal.jsx @@ -4,17 +4,19 @@ import "./Index.scss"; import Login from './Login'; import Register from './Register'; -function LoginModal({visible,}){ +function LoginModal({visible,onCancel,successFunc}){ const [ n , setN ] = useState("0"); + return( setN(e.key)}>登录 @@ -23,9 +25,9 @@ function LoginModal({visible,}){
{ n === "0"? - + : - + }
diff --git a/src/mulan/Components/Login/Register.jsx b/src/mulan/Components/Login/Register.jsx index 6762d961..0e6c8134 100644 --- a/src/mulan/Components/Login/Register.jsx +++ b/src/mulan/Components/Login/Register.jsx @@ -1,39 +1,95 @@ -import React, { useState , forwardRef } from 'react'; -import { Form , Input } from 'antd'; +import React, { useState , forwardRef , useEffect } from 'react'; +import { Form , Input , Button } from 'antd'; import "./Index.scss"; +import axios from 'axios'; -function Register({form}){ +function Register({ form , successFunc , visible }){ const [ active , setActive ] = useState(false); + const [ loading , setLoading ] = useState(false); const { getFieldDecorator, validateFields , setFieldsValue , getFieldsValue } = form; + useEffect(()=>{ + if(!visible){ + setFieldsValue({ + mail:undefined, + password:undefined, + passwordAgain:undefined + }) + } + },[visible]) + function changeInput(){ - const { account , password } = getFieldsValue(); - if(account && password){ + const { mail , password , passwordAgain } = getFieldsValue(); + if(mail && password && passwordAgain){ setActive(true); }else{ setActive(false); } } + + function registerFunc(){ + validateFields((error,values)=>{ + if(!error){ + setLoading(true); + const url = `/accounts/register.json`; + axios.post(url,{ + ...values + }).then(result=>{ + if(result && result.data && result.data.status === 0){ + successFunc(result.data.data); + setLoading(false); + setFieldsValue({ + mail:undefined, + password:undefined, + passwordAgain:undefined + }) + } + }).catch(error=>{}) + } + }) + } + + function checkRepeat(rule, value, callback){ + const { password } = getFieldsValue(); + if(!value){ + callback(); + }else if(value !== password){ + callback("两次输入的密码不一致!"); + }else{ + callback(); + } + callback(); + } return( - {getFieldDecorator("account",{ + {getFieldDecorator("mail",{ rules:[{required:true,message:"请输入注册账号"}] })( - + )} {getFieldDecorator("password",{ rules:[{required:true,message:"请输入注册密码"}] })( - + + )} + + + {getFieldDecorator("passwordAgain",{ + rules:[ + {required:true,message:"请再次输入密码"}, + {validator:checkRepeat} + ] + })( + )} { active ? - 注册 + : 注册 } diff --git a/src/mulan/Data/getUrl.jsx b/src/mulan/Data/getUrl.jsx new file mode 100644 index 00000000..2f03c866 --- /dev/null +++ b/src/mulan/Data/getUrl.jsx @@ -0,0 +1,10 @@ + +const local = 'https://mulan.trustie.net'; +const isDev = window.location.port === "3007"; + +export function getUrlHead(path) { + if (isDev) { + return `${local}/${path}`; + } + return `${path}`; +} \ No newline at end of file diff --git a/src/mulan/HOC/Footer.jsx b/src/mulan/HOC/Footer.jsx index 7cc5e07c..3ee1e6f5 100644 --- a/src/mulan/HOC/Footer.jsx +++ b/src/mulan/HOC/Footer.jsx @@ -1,8 +1,20 @@ import React from 'react'; +import { Link } from 'react-router-dom'; function Footer(props){ return( -
Copyright © 中国开源云联盟 京ICP备05013730号-37
+
+
    +
  • 关于我们
  • +
  • 帮助中心
  • +
  • 合作伙伴
  • +
  • 服务协议
  • +
+
+ 木兰开源社区版权所有 ©2020 技术支持:长沙智擎科技 + 粤ICP备12009483号 +
+
) } export default Footer; \ No newline at end of file diff --git a/src/mulan/HOC/Header.jsx b/src/mulan/HOC/Header.jsx index f7430259..abff030d 100644 --- a/src/mulan/HOC/Header.jsx +++ b/src/mulan/HOC/Header.jsx @@ -1,10 +1,16 @@ import React from 'react'; import Nav from './Nav'; -function Header({users}){ +function Header({ users,headData, successFunc , quitFunc , match }){ return(
-
) } diff --git a/src/mulan/HOC/HomeHeader.jsx b/src/mulan/HOC/HomeHeader.jsx deleted file mode 100644 index 39fa2a0d..00000000 --- a/src/mulan/HOC/HomeHeader.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import Nav from './Nav'; - -function HomeHeader({users}){ - return( -
-
- ) -} -export default HomeHeader; \ No newline at end of file diff --git a/src/mulan/HOC/HomeHoc.jsx b/src/mulan/HOC/HomeHoc.jsx index d2aa14f9..f89b4b02 100644 --- a/src/mulan/HOC/HomeHoc.jsx +++ b/src/mulan/HOC/HomeHoc.jsx @@ -1,6 +1,8 @@ import React, { Component, useState } from 'react'; -import Header from './HomeHeader'; +import Header from './Header'; +import Footer from './Footer'; import './Index.scss'; +import axios from 'axios'; export function HomeHoc(Sub){ return class II extends Component { @@ -10,14 +12,53 @@ export function HomeHoc(Sub){ users:undefined } } + + componentDidMount=()=>{ + this.getUser(); + } + + getUser=()=>{ + const url = `/users/get_user_info.json`; + axios.get(url).then(result=>{ + if(result){ + this.setState({ + users:result.data.data + }) + } + }).catch(error=>{}) + } + + successFunc=(data)=> { + if(data){ + this.setState({ + users:data + }) + }else{ + this.getUser(); + } + } + + quitFunc =()=>{ + const url = `/accounts/logout.json`; + axios.get(url).then(result=>{ + if(result && result.data){ + this.setState({ + users:undefined + }) + } + }).catch(error=>{}) + } + render(){ const { users } = this.state; + const { headData } = this.props; return( -
-
-
+
+
+
+
) } diff --git a/src/mulan/HOC/Index.scss b/src/mulan/HOC/Index.scss index c944b2b4..b564693d 100644 --- a/src/mulan/HOC/Index.scss +++ b/src/mulan/HOC/Index.scss @@ -18,20 +18,20 @@ line-height: 60px; z-index: 100; box-shadow: 0px 0px 3px rgba(0,0,0,0.1); - background: #312b2b; + background: #fff; ul{ li{ a{ - color: #fff; + color: #333; } } } } .headDiv{ - width:1200px; margin: 0px auto; + padding:0px 60px; display: flex; justify-content: space-between; .headerNav{ @@ -46,13 +46,14 @@ } .headUserInfo{ a{ - color: #fff; + color: #666666; } } } .homebody{ padding-top: 60px; + min-height: 100%; } .footsnav{ position: absolute; @@ -63,4 +64,44 @@ padding-bottom:10px; background-color: #fff; color: #999; +} + +.homefooterbase{ + background: #DEDEDE; + line-height: 38px; + font-size: 12px; + color: #666; + text-align: center; + padding:30px 0px; + .homeFooterUl{ + display: flex; + align-items: center; + justify-content: center; + margin:0px; + li{ + padding:0px 40px; + a{ + color: #666666; + display: block; + } + } + } +} +.menuItems{ + .ant-dropdown-menu-item{ + text-align: center; + border-bottom: 1px solid #eee; + color: #333; + } + .ant-dropdown-menu-item:last-child{ + border-bottom: none; + } + .ant-dropdown-menu-item:first-child:hover{ + color: #333; + cursor: default; + } + .ant-dropdown-menu-item:hover{ + background-color: #fff; + color: #aac5fd; + } } \ No newline at end of file diff --git a/src/mulan/HOC/Nav.jsx b/src/mulan/HOC/Nav.jsx index ab6d69a1..c8bb639b 100644 --- a/src/mulan/HOC/Nav.jsx +++ b/src/mulan/HOC/Nav.jsx @@ -1,25 +1,50 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; +import { getUrlHead } from '../Data/getUrl'; +import { Dropdown , Menu } from 'antd'; import logo from '../images/logo.png'; import LoginModal from '../Components/Login/LoginModal'; -function Nav({users}){ +function Nav({ users, headData , successFunc , quitFunc , match }){ const [ visible ,setVisible ] = useState(false); + const [ navs , setNavs ] = useState(undefined); + useEffect(()=>{ + if(headData){ + setNavs(headData.navbar); + } + },[headData]) + function success(data) { + setVisible(false); + successFunc(data); + } + + const menus =( + + {users && users.real_name} + 退出 + + ) return(
- + setVisible(false)} successFunc={success}/>
    -
  • -
  • 首页
  • -
  • 开源软件
  • -
  • 开源许可证
  • +
  • + { + navs && navs.length>0 && navs.map((i,k)=>{ + return( +
  • {i.name}
  • + ) + }) + }
{ users && users.login ? - + + + : setVisible(true)}>登录/注册 } diff --git a/src/mulan/Index.jsx b/src/mulan/Index.jsx index 617d7750..e3827ac1 100644 --- a/src/mulan/Index.jsx +++ b/src/mulan/Index.jsx @@ -2,216 +2,211 @@ import React, { useEffect, useState } from 'react'; import { HomeHoc } from './HOC/HomeHoc'; import { Link } from 'react-router-dom'; import './Index.scss'; -import logo1 from './images/coscl.jpg'; -import logo2 from './images/openeuler.jpg'; -import logo3 from './images/opengcc.jpg'; -import logo4 from './images/openlooKeng.png'; +import main from './images/320.jpg'; import icon1 from './images/icon1.png'; import icon2 from './images/icon2.png'; import active1 from './images/active1.jpg'; import active2 from './images/active2.png'; import DefaultImg from './images/default.png'; -import perl from './images/perl.png'; -import deno from './images/deno.png'; -import go7c from './images/go7c.png'; -// import axios from 'axios'; +import { Carousel } from 'antd'; +import { getUrlHead } from './Data/getUrl'; +import axios from 'axios'; function Index(props){ - // const [ recommand ,setRecommand ] =useState(undefined); - // useEffect(()=>{ - // getRecommand(); - // },[]) + const [ about ,setAbout ] =useState(undefined); + const [ covers ,setCovers ] =useState(undefined); + const [ recommand ,setRecommand ] =useState(undefined); + const [ news ,setNews ] =useState(undefined); + const [ activity ,setActivity ] =useState(undefined); + const [ cooperaters ,setCooperaters ] =useState(undefined); + useEffect(()=>{ + getRecommand(); + getAbout(); + getNews(); + getActivity(); + getCooperaters(); + },[]) - // function getRecommand(){ - // const url = `/projects/recommand.json`; - // axios.get(url).then(result=>{ - // if(result && result.data){ - // setRecommand(result.data.data); - // } - // }).catch(error=>{}) - // } + // 关于我们 + function getAbout(){ + const url = `/helps/about.json`; + axios.get(url).then(result=>{ + if(result && result.data){ + setAbout(result.data.data); + setCovers(result.data.data.covers); + } + }).catch(error=>{}) + } + // 开源软件推荐 + function getRecommand(){ + const url = `/projects/recommend.json`; + axios.get(url).then(result=>{ + if(result && result.data){ + setRecommand(result.data.data); + } + }).catch(error=>{}) + } + // 开源活动 + function getNews(){ + const url = `/topics.json`; + axios.get(url,{ + params:{type:"activity"} + }).then(result=>{ + if(result && result.data){ + setNews(result.data.data); + } + }).catch(error=>{}) + } + // 开源资讯 + function getActivity(){ + const url = `/topics.json`; + axios.get(url,{ + params:{type:"news"} + }).then(result=>{ + if(result && result.data){ + setActivity(result.data.data); + } + }).catch(error=>{}) + } + // 合作伙伴 + function getCooperaters(){ + const url = `/cooperaters.json`; + axios.get(url).then(result=>{ + if(result && result.data){ + setCooperaters(result.data.data); + } + }).catch(error=>{}) + } return(
-
-

木兰开源社区

-

开放共享打造开源生态

+ + { + covers && covers.length>0? + covers.map((i,k)=>{ + return( + + ) + }) + : + } + +
+ { + recommand && recommand.length > 0 && +
+
开源软件推荐
+
    + { + recommand.map((item,key)=>{ + return( +
  • + +
    +

    {item.full_name}

    + +
    +
    +

    {item.author && item.author.name}

    +

    {item.description}

    +
  • + ) + }) + } +
+ 查看更多
-
-
-
开源软件推荐
-
    -
  • - -
    -

    云对象存储系统

    - + } + + { + about && +
    +
    +
    +
    {about.name}
    +
    + {about.content}
    -
    -

    清华大学

    -

    云对象存储系统作为云操作系统的重要组成部分,主要负责非结构化数据的储存 和管理,用户通过REST API与系统进行交互。云对象存储系统支持服务端加密、 访问权限控制、静态网站托管和大对象分段上传等功能。这些API均与Amazon S3 和阿里云 OSS 标准兼容,以便于现有的云应用向中国云迁移。

    -
  • -
  • - -
    -

    CCDemon

    - -
    -
    -

    复旦大学

    -

    基于相似代码分析的代码辅助完成工具。

    -
  • -
  • - -
    -

    UserPortrait

    - -
    -
    -

    国防科技大学

    -

    面向群体化协同开发的用户画像系统,从社区影响力、社区活跃度、社区贡献度 、项目经验、语言能力五个维度评估开发者能力,综合利用基本属性数据、行为 数据、社交数据构建用户画像。

    -
  • -
  • - -
    -

    RETO

    - -
    -
    -

    北京理工大学

    -

    该项目由北京理工大学智能化软件工程实验室负责,主要设计并实现了Rename重 构机会的推荐、Move Method重构机会的推荐以及运行过程中动态地对阈值进行 优化这三个功能。

    -
  • -
  • - -
    -

    OC-BlueStore

    - -
    -
    -

    中科院计算所

    -

    面向云计算场景分布式存储系统单机引擎,基于开放SSD实现软件定义和租户感知 的数据布局,支持软件触发垃圾回收。

    -
  • -
  • - -
    -

    Labeled Risc-V

    - -
    -
    -

    中科院计算所

    -

    基于精简指令集(RISC)原则的开源指令集架构,用于允许任何人设计、制造和 销售RISC-V芯片和软件。

    -
  • -
  • - -
    -

    SGX-Migration

    - -
    -
    -

    上海交通大学

    -

    致力于在异构云平台之间,实现Enclave的实时跨云迁移。

    -
  • -
  • - -
    -

    HCloud

    - -
    -
    -

    上海交通大学

    -

    致力于跨云环境下的可信数据融合与机密计算。

    -
  • -
-
-
-
-
-
关于我们
-
- 木兰开源社区建立于2019年8月,是国家重点研发计划重点专项“云计算和大数据开源社区生态系统”的重要成果之一。旨在促进开源领域的交流,建立科教界和产业界开源交流互动平台,加强企业和行业用户之间的沟通,推进企业和个人开发者利用开源软件不断提升技术水平。从开源学习到商业代码托管,您可以从众多的开源开发项目中进行开发学习、主持和审查代码、管理项目和构建软件。 +
    +
  • + + 开源项目总数 + {about.total_projects_count} +
  • +
  • + + 科技项目开源成果 + {about.science_projects_count} +
  • +
-
    -
  • - - 918 - 开源项目总数 -
  • -
  • - - 10 - 科技项目开源成果 -
  • -
-
+ } +
-
开源活动
-
-
  • -
  • -
    +
    开源活动
    + { + news && news.length>0 ? +
    + { + news.map((item,key)=>{ + return( + key < 2 && + ) + }) + } +
    + : +
    +
  • +
  • +
    + } + + {/* 查看更多 */}
    -
    开源资讯
    +
    开源资讯
    -
      -
    • - {/*
      */} -
      -

      木兰重生:更多 $ 的妙用,self 的拓展语义

      -
      本项目旨在重现「木兰」编程语言的语法和功能。所有例程演示的语法可以用原始的木兰可执行文件 ulang-0.2.2.exe 检验。如发现有异烦请告知,定将礼谢。 上篇演示了 $ 在木兰中的部分用途
      -
      2020/10/02 05:06
      -
      -
    • -
    • -
      -
      -

      官方宣布 Perl 7 计划

      -
      Perl 官方宣布了 Perl 7 计划。Perl 7 目前已经在开发中,但是在代码与语法上不会有太大的改变,其本质上是具有现代默认设置的 Perl 5,并为之后进行更大的更改奠定了基础。
      -
      2020/06/25 09:09
      -
      -
    • -
    • -
      -
      -

      Deno 继颠覆 Node 之后,又“内部”拒绝了 TypeScript

      -
      Deno 团队计划删除所有内部代码构建时的 TS 类型检查与捆绑。打算将所有运行时代码转移到同一个 JavaScript 文件当中,但仍将使用随附的 d.ts 文件保存类型定义与说明文档。
      -
      2020/06/22 15:48
      -
      -
    • -
    • -
      -
      -

      Go 泛型草案更新,明年8月发布的 Go 1.17 将引入

      -
      Go 团队近日在博客介绍了 Go 泛型的最新进展。 Go 团队表示他们一直在完善泛型的设计草案,并为此编写了一个类型检查器——可按照设计草案中的说明,解析使用泛型的 Go 代码并报告任何类
      -
      2020/06/18 07:56
      -
      -
    • -
    + { + activity && activity.length> 0 && +
      + { + activity.map((item,key)=>{ + return( +
    • +
      +
      +

      {item.title}

      +
      {item.content}
      +
      {item.created_at}
      +
      +
    • + ) + }) + } +
    + }
    - -
    + { + cooperaters && cooperaters.length > 0 &&
      -
    • -
    • -
    • -
    • + { + cooperaters.map((i,k)=>{ + return( +
    • + ) + }) + }
    -
      -
    • 关于我们
    • -
    • 帮助中心
    • -
    • 合作伙伴
    • -
    • 服务协议
    • -
    -
    - 木兰开源社区版权所有 ©2020 技术支持:长沙智擎科技 - 粤ICP备12009483号 -
    -
    + }
    ) } diff --git a/src/mulan/Index.scss b/src/mulan/Index.scss index efa9cf87..e66f3356 100644 --- a/src/mulan/Index.scss +++ b/src/mulan/Index.scss @@ -1,14 +1,14 @@ .homeFirst{ background:url(./images/bg2.jpg)center center no-repeat; - min-height: 450px; + min-height: 480px; position: relative; margin-bottom: 90px; .firstPanel{ position: absolute; - top:70px; + top:60px; width: 100%; .firstPanelBox{ - width: 1200px; + width: 1300px; margin:0px auto; background-color: #fff; box-shadow: 0px 0px 10px rgba(0,0,0,0.1); @@ -16,16 +16,16 @@ align-items: center; justify-content: center; flex-direction: column; - min-height: 400px; + min-height: 498px; border-radius: 4px; - padding:30px 0px ; + padding-top:50px; background:url(./images/1_1.png) no-repeat; .desc{ - margin:20px auto 50px; + margin:0px auto 50px; line-height: 22px; font-size: 16px; color: #666; - width: 880px; + width: 1030px; text-indent: 2em; text-align: justify; } @@ -42,48 +42,49 @@ font-size: 28px; line-height: 42px; font-weight: bold; + color: #1890FF; } font{ - color: #999; + color: #666; } } } } } } -.homeFooter{ - background: #fff; - .homeFooterParter{ - padding:30px 0px; - width: 1200px; - margin:0px auto; - } - .homeFooterUl{ - display: flex; - align-items: center; - justify-content: center; - padding:15px; - li{ - padding:0px 40px; - a{ - color: #ccc; - display: block; - } +.homeFooterParter{ + padding:30px 0px; + width: 1200px; + margin:0px auto!important; +} +.homeFooterUl{ + display: flex; + align-items: center; + justify-content: center; + margin:0px; + li{ + padding:0px 40px; + a{ + color: #666666; + display: block; } } +} +.homeFooter{ + background: #fff; .homefooterbase{ - height: 38px; - background: #333; + background: #DEDEDE; line-height: 38px; font-size: 12px; color: #666; text-align: center; + padding:30px 0px; } } .homebase{ position: relative; min-height: 480px; - background-image:url(./images/320.jpeg); + background-size: 100% 100%; background-repeat: no-repeat; background-position: center; @@ -94,6 +95,9 @@ flex-direction: column; align-items: center; justify-content: center; + .ant-carousel{ + width: 100%; + } p{ margin-bottom:20px; text-align: center; @@ -107,7 +111,8 @@ } } .homeproject{ - padding:60px 0px; + padding:60px 0px 100px 0px; + text-align: center; ul{ display: flex; flex-wrap: wrap; @@ -119,11 +124,12 @@ border-radius: 6px; box-shadow: 0px 0px 4px rgba(0,0,0,0.1); margin-bottom: 40px; + text-align: left; .p_head{ padding:25px 20px; display: flex; align-items: flex-start; - background-image: linear-gradient(#118af3, #8dcaf5); + background-image: url('./images/cards.png'); border-radius: 6px 6px 0px 0px; justify-content: space-between; } @@ -151,13 +157,14 @@ } } .sourceAbout{ - padding:60px 0px; + padding:60px 0px 100px 0px; + text-align: center; .sourceactive{ display: flex; align-items: center; justify-content: center; margin:40px 0px; - li{ + a{ width: 600px; height: 300px; background-size: cover; @@ -173,7 +180,7 @@ font-size: 22px; color: #444; font-weight: bold; - margin-bottom: 45px; + margin-bottom: 60px; text-align: center; em{ display: block; diff --git a/src/mulan/Projects/Index.jsx b/src/mulan/Projects/Index.jsx index cb9e0fa3..78fb22a5 100644 --- a/src/mulan/Projects/Index.jsx +++ b/src/mulan/Projects/Index.jsx @@ -1,103 +1,148 @@ import React, { useEffect, useState } from 'react'; -import { HOC } from '../HOC/Index'; -import {Link} from 'react-router-dom'; -import Title from '../../forge/Component/Title'; -import { AlignCenter } from '../../forge/Component/layout'; +import { HomeHoc } from '../HOC/HomeHoc'; +import { Box , Long , Short , Gap } from '../../forge/Component/layout'; +import { AlignCenter ,FlexAJ } from '../../forge/Component/layout'; import './Index.scss'; import DefaultImg from '../images/default.png'; +import { getUrlHead } from '../Data/getUrl'; +import axios from 'axios'; +import { Skeleton , Pagination } from 'antd'; +import Ranking from './Ranking'; + const data =[ { - name:"Mini-Kernel", - desc:"中国云操作系统最小内核开源项目,基于中国云标准API。 中国云OS最小内核定 位于打造成一个标准的最小化核心的基础云平台,功能组件包括计算、存储、网 络、认证。", - tags:["Java"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/G-Cloud/mini-kernel" + index:1, + name:"Trustie社区 / Mini-Kernel", + count:123223123 }, { - name:"gRemote", - desc:" 提供一种细粒度的异构云端GPU共享服务,在提供良好GPU隔离效果的同时,提高 GPU的利用率。", - tags:["C/C++"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/shanyd/Tstore" + index:2, + name:"Trustie社区 / Mini-Kernel", + count:123223122 }, { - name:"Mini-Kernel", - desc:"中国云操作系统最小内核开源项目,基于中国云标准API。 中国云OS最小内核定 位于打造成一个标准的最小化核心的基础云平台,功能组件包括计算、存储、网 络、认证。", - tags:["Java"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/gremote/gRemote" - }, - { - name:"分布式文件系统", - desc:"基于 GlusterFS 开发的分布式存储系统。", - tags:["C"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/shanyd/Tstore" - }, - { - name:"Coordinator", - desc:"基于RDMA的高性能协同系统。", - tags:["C+/C++"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/haoba1992/Coordinator" - }, - { - name:"容器热迁移 container_migrate", - desc:"容器热迁移项目主要面向数据中心。Docker+k8s已成为云计算环境的一种广泛使 用方式,以容器作为服务载体的服务方式也成为主流。在资源调度过程中,会出 现容器重新调度到新节点上的情况,而现在服务变得轻量化,实时性要求变高, 无法忍受长时间的服务中断问题,因此在线迁移成为了需求。本项目提供一种 Docker在线迁移尝试与解决方案,并将其应用于k8s中,实现对pod的在线迁移的 尝试。", - tags:["Python"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/haoba1992/Coordinator" - }, - { - name:"容器热迁移 container_migrate", - desc:"容器热迁移项目主要面向数据中心。Docker+k8s已成为云计算环境的一种广泛使 用方式,以容器作为服务载体的服务方式也成为主流。在资源调度过程中,会出 现容器重新调度到新节点上的情况,而现在服务变得轻量化,实时性要求变高, 无法忍受长时间的服务中断问题,因此在线迁移成为了需求。本项目提供一种 Docker在线迁移尝试与解决方案,并将其应用于k8s中,实现对pod的在线迁移的 尝试。", - tags:["Python"], - imageurl:"", - link:"https://forgeplus.trustie.net/projects/hustguoyun/container_migrate" + index:3, + name:"Trustie社区 / Mini-Kernel", + count:123223121 } ] +const limit = 12; function Index(props){ - const [ list , setList ] = useState(undefined); + const [ list , setList ] = useState([]); + const [ date ,setDate ] = useState("week"); + const [ page ,setPage ] = useState(1); + const [ total ,setTotal ] = useState(0); + const [ rankList ,setRankList ] = useState([]); + useEffect(()=>{ - setList(data); - },[]) + getData(); + },[page]) + + useEffect(()=>{ + getRank(); + },[date]) + + // 获取项目列表 + function getData() { + const url = `/projects/science.josn`; + axios.get(url,{ + params:{page,limit} + }).then(result=>{ + if(result){ + setList(result.data.data); + setTotal(result.data.total_count); + } + }).catch(error=>{}) + } + + // 获取排行列表 + function getRank(){ + const url = `/projects/liveness.json`; + axios.get(url,{ + params:{time_type:date,type:"commits"} + }).then(result=>{ + if(result){ + setRankList(result.data.data); + } + }).catch(error=>{}) + } + return( -
    -
    - 基础类开源软件 + + +
    +

    基础类开源软件

    { list && list.length > 0 ? :"" } + { + list && list.length === 0 && + } + { + total > limit && +
    + {setPage(p)}}/> +
    + } +
    -
    + + + + +

    活跃度排名

    + +
    + +
    +
    + ) } -export default HOC(Index); \ No newline at end of file +export default HomeHoc(Index); \ No newline at end of file diff --git a/src/mulan/Projects/Index.scss b/src/mulan/Projects/Index.scss index 1c193d3e..e11a1d66 100644 --- a/src/mulan/Projects/Index.scss +++ b/src/mulan/Projects/Index.scss @@ -1,16 +1,13 @@ .panels{ width: 1200px; - margin:20px auto 60px; + margin:40px auto 60px; .projectsList{ - margin:20px; - box-shadow: 0px 0px 10px rgba(0,0,0,0.1); .lists{ min-height:500px; - padding:20px 30px; display: flex; flex-wrap: wrap; align-items: flex-start;; - & > li{ + & >a{ margin-right: 2%; border: 1px solid #eee; width: 32%; @@ -25,33 +22,67 @@ &:nth-child(3n){ margin-right: 0px; } - .listName{ + .listinfo{ display: flex; + flex-direction: column; align-items: center; justify-content: center; - padding:10px 20px; + padding:0px 20px; height: 90px; - background-image: linear-gradient(to right, #118af3, #8dcaf5); + background-image: url('../images/cards.png'); color: #fff; - font-size: 18px; border-radius: 4px 4px 0px 0px; - cursor: pointer; + .listName{ + font-size: 18px; + margin:0px; + height: 22px; + line-height: 22px; + margin-bottom: 10px; + word-break: break-all; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width:100% + } + .listNum{ + display: flex; + flex-wrap: wrap; + width: 100%; + span{ + display:block; + width: 50%; + font-size: 12px; + color: #fff; + height: 18px; + line-height: 18px; + &:nth-child(2n){ + text-align: right; + } + } + } } - .listInfo{ - padding:12px 20px 0px 20px; + .listMain{ + display: flex; + justify-content: space-between; + padding:10px 20px 0px 20px; + align-items: center; .listInfoDesc{ line-height: 20px; margin:0px; - color:#999; + color:#666666; + max-width: 182px; + word-break: break-all; } } .listTag{ - padding:10px 20px; + padding:10px 0px; + margin:0px 20px; + border-bottom: 1px solid #F1F1F1; span{ display: inline-block; margin-right: 5px; - background-color: #c5c5c5; - color: #fff; + background-color: #B9DDFF; + color: #1890FF; padding:0px 5px; border-radius: 4px; height: 20px; @@ -59,6 +90,59 @@ font-size: 12px; } } + .projectNum{ + display: flex; + justify-content: space-between; + color:#999999; + font-size: 12px; + padding:10px 20px; + i{ + margin-right: 3px; + color: #666666!important; + } + } + } + } + } +} +.arrayList{ + padding:20px 20px 20px 10px; + box-shadow: 0px 0px 8px 0px #F1F1F1; + min-height: 400px; + ul { + margin:0px; + &>li{ + display: flex; + align-items: center; + height: 36px; + line-height: 36px; + &:first-child .index{ + color: #E53333; + } + &:nth-child(2) .index{ + color: #FF8C29; + } + &:nth-child(3) .index{ + color: #F7B500; + } + .index{ + display: block; + width: 20px; + text-align: center; + color: #999999; + } + .name{ + margin-left: 10px; + flex:1; + text-align: left; + color: #333; + margin-bottom: 0px; + max-width: 170px; + } + .num{ + text-align: right; + margin-left: 15px; + color: #999999; } } } diff --git a/src/mulan/Projects/Ranking.jsx b/src/mulan/Projects/Ranking.jsx new file mode 100644 index 00000000..af8ac189 --- /dev/null +++ b/src/mulan/Projects/Ranking.jsx @@ -0,0 +1,33 @@ +import React, { useEffect, useState } from 'react'; +import {Skeleton} from 'antd'; + +function Ranking({data}){ + const [list ,setList ]= useState([]); + + useEffect(()=>{ + setList(data); + },[data]) + + return( +
    + { + list && list.length >0? +
      + { + list.map((i,k)=>{ + return( +
    • + {i.no} +

      {i.project_full_name}

      + {i.commits} +
    • + ) + }) + } +
    + : + } +
    + ) +} +export default Ranking; \ No newline at end of file diff --git a/src/mulan/images/1_1.png b/src/mulan/images/1_1.png index e4fd05d8..eadb707a 100644 Binary files a/src/mulan/images/1_1.png and b/src/mulan/images/1_1.png differ diff --git a/src/mulan/images/320.jpeg b/src/mulan/images/320.jpeg deleted file mode 100644 index b4c3a18a..00000000 Binary files a/src/mulan/images/320.jpeg and /dev/null differ diff --git a/src/mulan/images/320.jpg b/src/mulan/images/320.jpg new file mode 100644 index 00000000..329796e8 Binary files /dev/null and b/src/mulan/images/320.jpg differ diff --git a/src/mulan/images/bg2.jpg b/src/mulan/images/bg2.jpg index 178e1b49..1680b606 100644 Binary files a/src/mulan/images/bg2.jpg and b/src/mulan/images/bg2.jpg differ diff --git a/src/mulan/images/cards.png b/src/mulan/images/cards.png new file mode 100644 index 00000000..95ace48a Binary files /dev/null and b/src/mulan/images/cards.png differ diff --git a/src/mulan/images/icon1.png b/src/mulan/images/icon1.png index 801bad9f..9cbc8e33 100644 Binary files a/src/mulan/images/icon1.png and b/src/mulan/images/icon1.png differ diff --git a/src/mulan/images/icon2.png b/src/mulan/images/icon2.png index 0d3d4545..3993ee7f 100644 Binary files a/src/mulan/images/icon2.png and b/src/mulan/images/icon2.png differ diff --git a/src/mulan/license/FAQ.jsx b/src/mulan/license/FAQ.jsx index 5ab732a0..aee2107e 100644 --- a/src/mulan/license/FAQ.jsx +++ b/src/mulan/license/FAQ.jsx @@ -1,104 +1,31 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import Title from '../../forge/Component/Title'; import RenderHtml from '../../components/render-html'; +import { Skeleton } from 'antd'; +import Axios from 'axios'; function FAQ(props){ - const value = `
    -

    木兰宽松许可证,第1版(Mulan PSL v1)的主要特点是什么?

    -

    Mulan PSL v1许可证采用中英文表达,中英文表述具有同等法律效力,简化了中国使用者进行法律解释时的复杂度;许可证针对现有诉讼问题更清晰地明确版权、专利和商标授权,提供更完善的法律保护;许可证遵从表述简洁原则,去除冗余,条款简洁,容易理解,兼容性好。

    - -

    木兰宽松许可证,第1版(Mulan PSL v1)与业界主流许可证的主要异同是什么?

    -

    Mulan PSL v1与BSD 3-clause License与Apache License V2.0在声明义务、专利许可、对用户专利维权限制及版权许可上均有差异,在商标许可上无差异,见下表:

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Mulan PSL v1BSD 3-clause LicenseApache License V2.0
    声明义务 -

    1,分发时附带许可证,保留免责等声明

    -
    -

    1,分发时附带许可证,保留免责等声明;

    -

    2,其他使用时附带许可证,保留免责等声明

    -
    -

    1,分发时附带许可证;

    -

    2,分发修改版时应明显声明已修改的文件;

    -

    3,分发修改版源代码时保留各种声明;

    -

    4,如许可软件含Notice文件,则分发修改版时应带其中的归属声明

    -
    专利许可 -

    1,原始许可人及其关联实体提供专利许可;

    -

    2,后续贡献者及其关联实体提供专利许可;

    -
    -

    无明确专利许可

    -
    -

    1,原始许可人提供专利许可;

    -

    2,后续贡献者及其关联实体提供专利许可;

    -
    对用户专利维权的限制 -

    1,用户及其关联实体如直接对许可软件发起专利诉讼,专利许可终止;

    -

    2,发起非诉讼维权(如行政维权)专利许可终止;

    -

    3,通过间接方式实施上述行为,专利许可终止

    -
    -

    1,用户及其关联实体如直接对许可软件发起专利诉讼,专利许可终止;

    -
    版权许可 -

    1,原始版权人及其关联公司提供版权许可;

    -

    2,后续贡献者及其关联实体提供版权许可;

    -
    -

    所有贡献者授予版权许可

    -
    -

    1,原始许可人提供版权许可;

    -

    2,后续贡献者及其关联实体提供版权许可;

    -
    商标许可
    - -
    - -

    木兰宽松许可证,第1版(Mulan PSL v1)与业界主流许可证兼容情况如何?

    -

    许可证的兼容性评判并无统一标准。我们从Mulan PSL v1的条款及目的出发,认为Mulan PSL v1与BSD类许可证类似,兼容性很好。BSD、MIT类宽松许可证兼容Mulan PSL v1许可证;Mulan PSL v1兼容Apache License v2.0、L/GPLv2、L/GPLv3等许可证。即,许可在BSD、MIT类许可证下的代码可以贡献到Mulan PSL v1的项目中,许可在Mulan PSL v1下的代码可以贡献到Apache License V2.0、L/GPLv2或L/GPLv3等的项目中。

    -

    注意,许可证A兼容许可证B(A许可证是B许可证 Compatible)是指,A授权的作品与B授权的作品经过修改或合并,可以使用B对作品的整体进行授权。兼容性是有方向的,A兼容B,但B不一定兼容A。

    - - -
    `; + const [ value , setValue ] = useState(undefined); + + useEffect(()=>{ + const url = `/helps/faq.json`; + Axios.get(url).then(result=>{ + if(result){ + setValue(result.data.data.content); + } + }).catch(error=>{}) + },[]) return(
    常见问题 -
    +
    - + { + value ? + + : + + }
    diff --git a/src/mulan/license/Index.jsx b/src/mulan/license/Index.jsx index 12482f42..3e01c99c 100644 --- a/src/mulan/license/Index.jsx +++ b/src/mulan/license/Index.jsx @@ -1,10 +1,11 @@ -import React from 'react'; -import { HOC } from '../HOC/Index'; +import React, { useEffect, useState } from 'react'; +import { HomeHoc } from '../HOC/HomeHoc'; import {Route, Switch , Link } from 'react-router-dom'; import Loadable from 'react-loadable'; import Loading from '../../Loading'; import { Box , Long , Short , Gap } from '../../forge/Component/layout'; import './Index.scss'; +import { Menu } from 'antd'; const Preface = Loadable({ loader: () => import('./Preface'), @@ -23,17 +24,41 @@ const FAQ = Loadable({ loading: Loading, }) function Index(props){ + const [ nav , setNav ] = useState("0"); + const pathname = props.history.location.pathname; + useEffect(()=>{ + if(pathname){ + if(pathname === `/license/preface`){ + setNav("0"); + } + if(pathname === `/license/psl/mulanpsl-v1`){ + setNav("1"); + } + if(pathname === `/license/psl/mulanpsl-v2`){ + setNav("2"); + } + if(pathname === `/license/public/MulanPubL-V1`){ + setNav("3"); + } + if(pathname === `/license/faq`){ + setNav("4"); + } + } + },[pathname]) return(
    -
      -
    • -1 ?"active":""}>引言
    • -
    • -1 ?"active":""}>木兰宽松许可证
    • -
    • -1 ?"active":""}>木兰公共许可证
    • -
    • -1 ?"active":""}>常见问题
    • -
    + + 引言 + + 第一版 + 第二版 + + 木兰公共许可证 + 常见问题 +
    @@ -71,4 +96,4 @@ function Index(props){
    ) } -export default HOC(Index); \ No newline at end of file +export default HomeHoc(Index); \ No newline at end of file diff --git a/src/mulan/license/Index.scss b/src/mulan/license/Index.scss index 8ba0a7d0..812b60ec 100644 --- a/src/mulan/license/Index.scss +++ b/src/mulan/license/Index.scss @@ -1,42 +1,25 @@ .panelsBox{ width: 1200px; margin: 20px auto; - .leftmenus{ - box-shadow: 0px 0px 10px rgba(0,0,0,0.1); - li{ - height: 52px; - line-height: 52px; - border-bottom: 1px solid #eee; - position: relative; - &:last-child{ - border: none; - } - &.active::before{ - position: absolute; - content: ""; - left: 0px; - height: 30px; - width: 3px; - top:50%; - margin-top: -15px; - background-color: #4d9fef; - } - &.active a,a:hover{ - color: #4d9fef; - } - a{ - display: block; - padding:0px 20px; - font-size:16px; - color:#333; - } + .menus.ant-menu-inline{ + border-right: none; + box-shadow: 0px 0px 8px 0px #F1F1F1; + .ant-menu-submenu-arrow{ + display: none; + } + .ant-menu-item-selected{ + background-color: #fff; + color: #1890ff; + } + .ant-menu-item::after{ + display: none; } } } .boxshadow{ box-shadow: 0px 0px 10px rgba(0,0,0,0.1); } -.content{ +.contents{ padding:15px 30px; font-size: 15px; line-height: 24px; diff --git a/src/mulan/license/PSL.jsx b/src/mulan/license/PSL.jsx index 0a1da1f3..dbbb2a18 100644 --- a/src/mulan/license/PSL.jsx +++ b/src/mulan/license/PSL.jsx @@ -1,118 +1,10 @@ import React, { useEffect, useState } from 'react'; import Title from '../../forge/Component/Title'; import RenderHtml from '../../components/render-html'; -import { Dropdown , Menu } from 'antd'; -import { Link } from 'react-router-dom'; +import { Button } from 'antd'; +import { Skeleton } from 'antd'; +import Axios from 'axios'; -const list = { - 1:`

    木兰宽松许可证, 第1版

    -

    2019年8月

    - -

    您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第1版(“本许可证”)的如下条款的约束:

    -

    0.   定义

    -
    -

    “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。

    -

    “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。

    -

    “法人实体”是指提交贡献的机构及其“关联实体”。

    -

    “关联实体”是指,对“本许可证”下的一方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。

    -

    “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。

    -
    - -

    1.   授予版权许可

    -
    -

    每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。

    -
    - -

    2.   授予专利许可

    -
    -

    每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括仅因您或他人修改“贡献”或其他结合而将必然会侵犯到的专利权利要求。如您或您的“关联实体”直接或间接地(包括通过代理、专利被许可人或受让人),就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。

    -
    - -

    3.   无商标许可

    -
    -

    “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。

    -
    - -

    4.   分发限制

    -
    -

    您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。

    -
    - -

    5.   免责声明与责任限制

    -
    -

    “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。

    -
    - -

    条款结束

    -

    如何将木兰宽松许可证,第1版,应用到您的软件

    -

    如果您希望将木兰宽松许可证,第1版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:

    -

    1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;

    -

    2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;

    -

    3, 请将如下声明文本放入每个源文件的头部注释中。

    -
    Copyright (c) [2019] [name of copyright holder]
    -      [Software Name] is licensed under the Mulan PSL v1.
    -      You can use this software according to the terms and conditions of the Mulan PSL v1.
    -      You may obtain a copy of Mulan PSL v1 at:
    -          http://license.coscl.org.cn/MulanPSL
    -      THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
    -      IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
    -      PURPOSE.
    -      See the Mulan PSL v1 for more details.
    `, - 2:`

    木兰宽松许可证, 第2版

    -

    2020年1月

    -

    您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:

    -
    -

    0.   定义

    -

    “软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。

    -

    “贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。

    -

    “贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。

    -

    “法人实体” 是指提交贡献的机构及其“关联实体”。

    -

    “关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。

    -
    -
    -

    1.   授予版权许可

    -

    每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。

    -
    -
    -

    2.   授予专利许可

    -

    每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。

    -
    -
    -

    3.   无商标许可

    -

    “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。

    -
    -
    -

    4.   分发限制

    -

    您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。

    -
    - -
    -

    5.   免责声明与责任限制

    -

    “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。

    -
    - -
    -

    6.   语言

    -

    “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。

    -
    - -

    条款结束

    - -

    如何将木兰宽松许可证,第2版,应用到您的软件

    -

    如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:

    -

    1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;

    -

    2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;

    -

    3, 请将如下声明文本放入每个源文件的头部注释中。

    -
    Copyright (c) [Year] [name of copyright holder]
    -    [Software Name] is licensed under Mulan PSL v2.
    -    You can use this software according to the terms and conditions of the Mulan PSL v2.
    -    You may obtain a copy of Mulan PSL v2 at:
    -            http://license.coscl.org.cn/MulanPSL2
    -    THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
    -    EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
    -    MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
    -    See the Mulan PSL v2 for more details.
    ` -} function PSL(props){ const [value , setValue ] = useState(undefined); const id = props.match.params.id; @@ -120,25 +12,31 @@ function PSL(props){ useEffect(()=>{ if(id && id!==value){ setValue(parseInt(id)); - console.log(id); } },[id]) - const menus = ( - - 第一版 - 第二版 - - ) + useEffect(()=>{ + const url = `/helps/${id}.josn`; + Axios.get(url).then(result=>{ + if(result){ + setValue(result.data.data.content); + } + }).catch(error=>{}) + },[id]) + return(
    - 木兰宽松许可证<Dropdown overlay={menus} placement="bottomRight"><i className="iconfont icon-sandian font-17 color-grey-9"></i></Dropdown> -
    + 木兰宽松许可证 + {/* <Button type={"primary"}>下载</Button> */} + +
    { - value && - + value ? + + : + }
    diff --git a/src/mulan/license/Preface.jsx b/src/mulan/license/Preface.jsx index 541b9b34..d5490fd8 100644 --- a/src/mulan/license/Preface.jsx +++ b/src/mulan/license/Preface.jsx @@ -1,20 +1,30 @@ -import React from 'react'; +import React,{useState,useEffect} from 'react'; import Title from '../../forge/Component/Title'; +import Axios from 'axios'; +import RenderHtml from '../../components/render-html'; +import { Skeleton } from 'antd'; function Preface(props){ + const [ value , setValue ] = useState(undefined); + + useEffect(()=>{ + const url = `/helps/introduction.json`; + Axios.get(url).then(result=>{ + if(result){ + setValue(result.data.data.content); + } + }).catch(error=>{}) + },[]) return(
    引言
    -

    开源(Open Source)是人类在互联网发展进程中探索出的一种面向全球的大规模协作生产方式,它以开放共享、合作共赢为宗旨,有效地推进了全球化进程。当前,我国开发者和企业参与开源的热情不断高涨,开源产业也逐步完善;然而,我国面向开源的环境、技术、人才、生态等方面还存在诸多问题。推动国内外开源的交流与合作,促进产学研用结合,保护广大开源参与者的利益,造就有影响力、可持续发展的开源生态系统,是相关行业当前的一项重要任务。

    -

    开源许可证是对开源软件的使用、复制、修改和分发等行为进行规范和约束的一种具有法律效力的格式合同,是开源运动的基石。目前,经开源促进会(OSI)认证的开源软件许可证共有 80 多个,它们都由国外或国际组织机构使用英文发布。对于来自世界各地的广大开源参与者而言,现有许可证中的条款的表述比较晦涩,容易因理解有误而违约。同时,很多许可证对被许可方责任和义务的表述不够完善,容易导致难以解决的法律纠纷。此外,当前国际形势需要来自全球不同地方的更多声音和力量来倡导开源。

    -

    基于以上考虑,北京大学作为国家重点研发计划“云计算和大数据开源社区生态系统”的子任务牵头单位,依托全国信标委云计算标准工作组和中国开源云联盟,联合国内开源生态圈产学研各界优势团队、开源社区以及拥有丰富知识产权相关经验的众多律师,在对现有主流开源协议全面分析的基础上,共同起草、修订并发布了木兰系列开源许可证。

    -

    第一发,木兰宽松许可证(Mulan PSL v1),具有以下特点:

    -

    1,许可证内容以中英文双语表述,中英文版本具有同等法律效力,方便更多的开源参与者阅读使用,简化了中国使用者进行法律解释时的复杂度。

    -

    2,许可证明确授予用户永久性、全球性、免费的、非独占的、不可撤销的版权和专利许可,并针对目前专利联盟存在的互诉漏洞问题,明确规定禁止“贡献者”或“关联实体”直接或间接地(通过代理、专利被许可人或受让人)进行专利诉讼或其他维权行动,否则终止专利授权。

    -

    3,许可证明确不提供对“贡献者”的商品名称、商标、服务标志等的商标许可,保护“贡献者”的切身利益。

    -

    4,许可证经技术专家和法律专家共同修订,在明确合同双方行为约束的前提下尽可能地精简条款、优化表述,降低产生法律纠纷的风险。

    -

    贡献单位:北京大学,中国电子技术标准化研究院,西南大学,中国科学院软件所,开源社,中移(苏州)软件技术有限公司,华为技术有限公司,华云数据集团有限公司,普元信息技术股份有限公司,中兴通讯股份有限公司,中标软件有限公司等

    + { + value ? + + : + + }
    ) diff --git a/src/mulan/license/Public.jsx b/src/mulan/license/Public.jsx index a6fccabf..c738c91c 100644 --- a/src/mulan/license/Public.jsx +++ b/src/mulan/license/Public.jsx @@ -1,92 +1,10 @@ import React, { useEffect, useState } from 'react'; import Title from '../../forge/Component/Title'; import RenderHtml from '../../components/render-html'; -import { Dropdown , Menu } from 'antd'; -import { Link } from 'react-router-dom'; +import { Button } from 'antd'; +import { Skeleton } from 'antd'; +import Axios from 'axios'; -const list = { - 1:`

    木兰公共许可证,第1版

    -

    2020年12月

    - -

    您对“贡献”的复制、使用、修改及分发受木兰公共许可证, 第1版(“本许可证”)的如下条款的约束:

    -

    0.   定义

    -
    -

    “贡献”是指由“贡献者”许可在“本许可证”下的受版权法保护的作品,包括最初“贡献者”许可在“本许可证”下的作品及后续“贡献者”许可在“本许可证”下的“衍生作品”。

    -

    “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。

    -

    “法人实体”是指提交贡献的机构及其“关联实体”。

    -

    “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。

    -

    “衍生作品”是指基于“贡献”创作的作品,具体包括对全部或部分“贡献”进行修改、重写、翻译、注释、组合或与之链接(包括动态链接或静态链接)而形成的作品。仅与“贡献”进行进程间通信或系统调用的作品是独立作品,不属于“衍生作品”。

    -

    “对应源代码”是指生成、安装和(对于可执行作品)运行目标代码所需的所有源文件和与之关联的接口定义文件,以及控制这些活动的脚本,但不包括编译环境、编译工具、云服务平台(如果有)。

    -

    “分发”是指通过任何媒介向他人提供“贡献”或“衍生作品”的行为,以及利用“贡献”或“衍生作品”通过网络远程给用户提供服务的行为,例如通过利用“贡献”或“衍生作品”搭建的云服务平台提供在线服务的行为。

    -
    - -

    1.   授予版权许可

    -
    -

    每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、“分发”其“贡献”或“衍生作品”,不论修改与否。

    -
    - -

    2.   授予专利许可

    -
    -

    每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”中的专利权利要求,不包括仅因您或他人修改“贡献”而将必然会侵犯到的专利权利要求。如果您或您的“关联实体”直接或间接地,就“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则本许可证授予您对“贡献”的专利许可自您提起诉讼或发起维权行动之日终止。

    -
    - -

    3.   无商标许可

    -
    -

    “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。

    -
    - -

    4.   分发限制

    -
    -

    您可以在任何媒介中将您接收到的“贡献”或您的“衍生作品”以源程序形式或可执行形式重新“分发”,但必须满足下列条件:

    -

    (1)您必须向接收者提供“本许可证”的副本,并保留“贡献”中的版权、商标、专利及免责声明;并且,

    -

    (2)如果您“分发”您接收到的“贡献”,您必须使用“本许可证”提供该“贡献”的源代码副本;如果您 “分发”您的“衍生作品”,您必须:

    -

    (i)随“衍生作品”向接收者提供使用“本许可证”“分发”的您的“衍生作品”的“对应源代码”。如果您通过下载链接提供前述“对应源代码”,则您应将下载链接地址置于“衍生作品”或其随附文档中的明显位置,有效期不少于自该“衍生作品”“分发”之日起三年,并确保接收者可以获得“对应源代码”;或者,

    -

    (ii)随“衍生作品”向接收者提供一个书面要约,表明您愿意提供使用“本许可证”“分发”的您“衍生作品”的“对应源代码”。书面要约应放在“衍生作品”中的明显位置,并确保接收者根据书面要约可获取“对应源代码”的时间从您接到该请求之日起不得超过三个月,且有效期不少于自该“衍生作品”“分发”之日起三年。

    -
    - -

    5.   违约与终止

    -
    -

    如果您违反“本许可证”,任何“贡献者”有权书面通知您终止其依据“本许可证”授予您的许可。该“贡献者”授予您的许可从您接到其终止通知之日起终止。但在如下两种情形下,即使您收到“贡献者”的通知也并不终止您的许可:

    -

    (1)您在接到终止通知之前已停止所有违反行为;

    -

    (2)您是首次收到该“贡献者”根据“本许可证”发出的书面终止通知,您在收到该通知后30天内停止所有违反行为。

    -

    只要下游接收者遵守“本许可证”的相关规定,您在“本许可证”下的许可终止,不影响下游接收者根据“本许可证”享有的权利。

    -
    - -

    6.   例外

    -
    -

    如果您将“贡献”或您的“衍生作品”与采用GPLv3、AGPLv3、或前述许可证的后续版本(以下简称“GPL类许可证”)的作品结合,且根据“GPL类许可证”的要求您有义务将形成的结合作品以对应的“GPL类许可证”许可的,您可以根据对应的“GPL类许可证”许可结合作品,只要您在分发该结合作品的同时向接收者提供“本许可证”的副本,并保留“贡献”中的版权、商标、专利及免责声明。任何“贡献者”不会因您根据前述原因选择“GPL类许可证”许可而授予该结合作品的接收者更多权利。

    -
    - -

    7.   免责声明与责任限制

    -
    -

    “贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。

    -
    - -

    8.   语言

    -
    -

    “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。

    -
    - -

    条款结束

    - -

     

    - -

    如何将木兰公共许可证,第1版,应用到您的软件

    -

    如果您希望将木兰公共许可证,第1版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:

    -

    1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;

    -

    2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;

    -

    3, 请将如下声明文本放入每个源文件的头部注释中。

    -
    Copyright (c) [Year] [name of copyright holder]
    -    [Software Name] is licensed under Mulan PubL v1.
    -    You can use this software according to the terms and conditions of the Mulan PubL v1.
    -    You may obtain a copy of Mulan PubL v1 at:
    -    http://license.coscl.org.cn/MulanPubL-1.0
    -    THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
    -    EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
    -    MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
    -    See the Mulan PubL v1 for more details.
    -    
    ` -} function Public(props){ const [value , setValue ] = useState(undefined); const id = props.match.params.id; @@ -98,22 +16,27 @@ function Public(props){ } },[id]) - const menus = ( - - 第一版 - - ) + useEffect(()=>{ + const url = `/helps/${id}.josn`; + Axios.get(url).then(result=>{ + if(result){ + setValue(result.data.data.content); + } + }).catch(error=>{}) + },[id]) return(
    - 木兰公共许可证<Dropdown overlay={menus} placement="bottomRight"><i className="iconfont icon-sandian font-17 color-grey-9"></i></Dropdown> -
    + {/* */} + 木兰公共许可证 +
    { - value && - + value ? + + : + } -