更新时间+首页获取专区文章
This commit is contained in:
commit
5462a8bc73
|
@ -51,6 +51,7 @@ function SystemNotice({system_notification,history}){
|
|||
centered={true}
|
||||
closable={false}
|
||||
wrapClassName={'systemBox'}
|
||||
onCancel={()=>{sureContinue()}}
|
||||
>
|
||||
<div className="sysBox">
|
||||
<div className="sysnoticeBox">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Dropdown , Menu , Divider , Spin, Button } from 'antd';
|
||||
import { Dropdown , Menu , Divider , Spin, Button, Tooltip } from 'antd';
|
||||
import { getImageUrl , turnbar , returnbar } from "educoder";
|
||||
import { Link } from 'react-router-dom';
|
||||
import { connect } from 'react-redux';
|
||||
|
@ -27,7 +27,9 @@ import Loadable from 'react-loadable';
|
|||
import Loading from '../../Loading';
|
||||
import ProjectPortrait from '../Component/projectPortrait';
|
||||
import imNoneImg from './img/importNone.png';
|
||||
import moment from 'moment';
|
||||
|
||||
const format = "YYYY-MM-DD HH:mm"
|
||||
const CoderRootFileDetail = Loadable({
|
||||
loader: () => import("./CoderRootFileDetail"),
|
||||
loading: Loading,
|
||||
|
@ -566,7 +568,7 @@ function CoderDepot(props){
|
|||
}
|
||||
{ hideBtn && __CLIENT__ && <div className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></div> }
|
||||
|
||||
<span className="ml20 color-grey-6 font-12 mt3">{lastCommit.time_from_now}</span>
|
||||
<Tooltip title={lastCommit.committer && moment(lastCommit.committer.date).format(format)}><span className="ml20 color-grey-6 font-12 mt3">{lastCommit.time_from_now}</span></Tooltip>
|
||||
{
|
||||
commitCount ?
|
||||
<Link to={`/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml20 color-grey-3"style={{height:"28px",lineHeight:"28px"}}>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React , { useEffect } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { truncateCommitId } from '../common/util';
|
||||
import {Tooltip} from 'antd';
|
||||
import {getEmoji} from './emoji';
|
||||
const typeIco = {
|
||||
"submodule":"icon-file-submodule font-17",
|
||||
|
@ -53,11 +54,13 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform
|
|||
}
|
||||
</span>
|
||||
<span title="init project">
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
||||
{getEmoji(getMessage(item.commit && item.commit.message.split('\n')[0]))}
|
||||
</Link>
|
||||
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
||||
{getEmoji(getMessage(item.commit && item.commit.message.split('\n')[0]))}
|
||||
</Link>
|
||||
|
||||
</span>
|
||||
<span title={item.commit && item.commit.created_at}>{item.commit && item.commit.time_from_now}</span>
|
||||
<Tooltip title={item.commit && item.commit.created_at} placement="right"><span>{item.commit && item.commit.time_from_now}</span></Tooltip>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ class Detail extends Component {
|
|||
|
||||
if (!this.props.projectBase) {
|
||||
const data = await getProjectFunc(owner, projectsId);
|
||||
if (data.data) {
|
||||
if (data && data.data) {
|
||||
this.getProject(data.data)
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -75,7 +75,7 @@ class IndexItem extends Component {
|
|||
</div>}
|
||||
<div className="p-r-about">
|
||||
<span className="p-r-detail">
|
||||
{item.last_update_time ? <span><label>更新于</label>{item.time_ago}</span> : ""}
|
||||
{item.last_update_time ? <Tooltip placement='bottom' title={item.full_last_update_time && moment(item.full_last_update_time).format("YYYY-MM-DD HH:mm")}><span><label>更新于</label>{item.time_ago}</span></Tooltip> : ""}
|
||||
{item.language && item.language.id ? <span className="color-grey-3">{item.language.name}</span> : ""}
|
||||
</span>
|
||||
{/* <span>
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import './Index.scss';
|
||||
import SubBanner from './SubBanner';
|
||||
import SubUnitBanner from './SubUnitBanner';
|
||||
import Icon from '../img/index/icon.png';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Spin , Input } from 'antd';
|
||||
import { Spin , Input, Tooltip } from 'antd';
|
||||
import SubList from './SubList';
|
||||
import more from '../img/index/more.png';
|
||||
import axios from 'axios';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import Nodata from '../../Nodata';
|
||||
import moment from 'moment';
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
|
@ -128,7 +128,7 @@ function Index() {
|
|||
<div className="item-data">
|
||||
{i.category && i.category.id ? <span className="category">{i.category.name}</span> :"" }
|
||||
{i.language && i.language.id ? <span className={`language mr30 ${i.category && i.category.id ? 'hasCate' : ''}`}>{i.language.name}</span> :""}
|
||||
<span style={{lineHeight:"15px",display:"flex"}}><i className="iconfont icon-shijian font-15 mr5"></i>更新于{i.time_ago}</span>
|
||||
<span style={{lineHeight:"15px",display:"flex"}}><Tooltip placement='bottom' title={i.full_last_update_time && moment(i.full_last_update_time).format("YYYY-MM-DD HH:mm")}><i className="iconfont icon-shijian font-15 mr5"></i>更新于{i.time_ago}</Tooltip></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -78,7 +78,7 @@ function Tags(props) {
|
|||
}
|
||||
</Tooltip>
|
||||
}
|
||||
<span>最后一次提交于{item.time_ago}</span>
|
||||
<Tooltip placement="right" title={moment(item.created_time).format("YYYY-MM-DD HH:mm")}><span>最后一次提交于{item.time_ago}</span></Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -6,10 +6,13 @@ import { getImageUrl , turnbar } from 'educoder';
|
|||
import { Button, Dropdown , Input, Menu , message, Modal, Select, Spin, Table, Tooltip , Radio , Popover } from 'antd';
|
||||
import Modals from '../../Component/PublicModal/Index';
|
||||
import './Index.scss';
|
||||
import moment from 'moment';
|
||||
|
||||
import Tree from '../img/tree.png';
|
||||
import Axios from 'axios';
|
||||
|
||||
const format = "YYYY-MM-DD HH:mm";
|
||||
|
||||
function Index(props) {
|
||||
const [ reload, setReload] = useState(undefined);
|
||||
const [ list , setList ] = useState([]);
|
||||
|
@ -87,7 +90,7 @@ function Index(props) {
|
|||
<span style={{fontWeight:"500"}}>{txt && txt.committer && txt.committer.name}</span>
|
||||
</React.Fragment>
|
||||
}
|
||||
<span className="color-grey-3">更新于{txt && txt.time_ago}</span>
|
||||
<Tooltip title={item && item.commit_time && moment(item.commit_time).format(format)} placement='right'><span className="color-grey-3">更新于{txt && txt.time_ago}</span></Tooltip>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class MergeItem extends Component {
|
|||
? "合并于"
|
||||
: "更新于"}
|
||||
</span>
|
||||
<span className="color-grey-8">{item.pr_time}</span>
|
||||
<Tooltip placement="bottom" title={moment(item.pr_full_time).format("YYYY-MM-DD HH:mm")}><span className="color-grey-8">{item.pr_time}</span></Tooltip>
|
||||
<span className="ml15">
|
||||
{
|
||||
item.pull_request_head &&
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
Menu,
|
||||
Tag,
|
||||
Button,
|
||||
Alert,
|
||||
Alert,Tooltip
|
||||
} from "antd";
|
||||
import "./merge.css";
|
||||
import RenderHtml from "../../components/render-html";
|
||||
|
@ -447,7 +447,7 @@ class MessageCount extends Component {
|
|||
? "合并于"
|
||||
: "更新于"}
|
||||
</span>
|
||||
<span className="color-grey-8 ml5">{data.pr_time}</span>
|
||||
<Tooltip placement="bottom" title={data.issue && data.issue.created_at}><span className="color-grey-8 ml5">{data.pr_time}</span></Tooltip>
|
||||
{
|
||||
open_blockchain && data.attached_issues && data.attached_issues.length>0 ?
|
||||
<span className="color-grey-8 ml25">关联issue:
|
||||
|
|
|
@ -2,6 +2,8 @@ import React from 'react';
|
|||
import ListCount from '../Component/ListCount';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Tooltip } from 'antd';
|
||||
import moment from 'moment';
|
||||
|
||||
function ListItem({item,key,OIdentifier}) {
|
||||
return(
|
||||
<div className="team_project" key={key}>
|
||||
|
@ -23,7 +25,7 @@ function ListItem({item,key,OIdentifier}) {
|
|||
{item.description}
|
||||
</div>
|
||||
<div className="infos">
|
||||
<span className="font-12 color-grey-8">更新于{item.time_ago}</span>
|
||||
<Tooltip title={item.full_last_update_time && moment(item.full_last_update_time).format("YYYY-MM-DD HH:mm")} placement='bottom'><span className="font-12 color-grey-8">更新于{item.time_ago}</span></Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -10,11 +10,14 @@ import F44 from './Img/4-4.png';
|
|||
import SecondEdition from './SecondEdition';
|
||||
import FifthEdition from './FifthEdition';
|
||||
import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC';
|
||||
|
||||
import Axios from 'axios';
|
||||
const ZoneInfo = {id:4,identify:"CCF-ODC",httpUrl:"https://gateway.gitlink.org.cn"}
|
||||
|
||||
function Index(props) {
|
||||
const [ value , setValue ] = useState("");
|
||||
const [ flag , setFlag ] = useState(true);
|
||||
const pathname = props.history.location;
|
||||
|
||||
const [ bannerTab , setBannerTab ] = useState(undefined);
|
||||
const register = props && props.mygetHelmetapi && props.mygetHelmetapi.common && props.mygetHelmetapi.common.register;
|
||||
|
@ -23,7 +26,8 @@ function Index(props) {
|
|||
|
||||
useEffect(()=>{
|
||||
window.addEventListener("scroll",scrollListener);
|
||||
getTab();
|
||||
// getTab();
|
||||
getNewsList();
|
||||
return ComponentWillUnmount;
|
||||
},[])
|
||||
|
||||
|
@ -35,6 +39,16 @@ function Index(props) {
|
|||
window.removeEventListener("scroll",scrollListener);
|
||||
}
|
||||
|
||||
function getNewsList(){
|
||||
const url = `${ZoneInfo.httpUrl}/api/cms/doc/open/zone/${ZoneInfo.id}/homePageDocList`;
|
||||
Axios.get(url).then(result=>{
|
||||
if(result){
|
||||
let rows = result.data.rows;
|
||||
setBannerTab(rows);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getTab() {
|
||||
const url = `/topics.json?topic_type=card`;
|
||||
Axios.get(url,{
|
||||
|
@ -83,9 +97,9 @@ function Index(props) {
|
|||
{
|
||||
bannerTab.map((i,k)=>{
|
||||
return(
|
||||
<a href={i.url} target="_blank" className="font-18">
|
||||
k < 3 && <a href={`${!window.location.hostname.indexOf("gitlink.org.cn")>-1 ? "https://www.gitlink.org.cn":""}/zone/${ZoneInfo.identify}/newdetail/${i.id}`} target="_blank" className="font-18">
|
||||
<li>
|
||||
{i.title}
|
||||
{i.name}
|
||||
</li>
|
||||
</a>
|
||||
)
|
||||
|
|
|
@ -13,6 +13,20 @@ if (__CLIENT__ ) {
|
|||
const axiosInstance = axios.create({
|
||||
withCredentials: true
|
||||
});
|
||||
axiosInstance.interceptors.request.use(
|
||||
config => {
|
||||
if (window.location.port === "3007") {
|
||||
if (config.url.indexOf('?') === -1) {
|
||||
config.url = `${config.url}?debug=admin`;
|
||||
} else {
|
||||
config.url = `${config.url}&debug=admin`;
|
||||
}
|
||||
}
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
return Promise.reject(err);
|
||||
});
|
||||
|
||||
axiosInstance.interceptors.response.use(
|
||||
response => {
|
||||
|
|
Loading…
Reference in New Issue