-
{last_build_at && window.open(url)}}>{item.site_name}
-
{last_build_at ? "已部署" : "未部署"}
+ {last_build_at && state ?
{window.open(url)}}>{item.site_name} :
{item.site_name}}
+
{state ? last_build_at ? "已部署" : "未部署" : '被关闭'}
主题: {item.theme}
|
@@ -63,6 +70,16 @@ function MySiteList(props){
})}
+
+
{setPage(page)}}
+ total = {total}
+ hideOnSinglePage
+ >
+
}
}
diff --git a/src/forge/Server/Index.jsx b/src/forge/Server/Index.jsx
index d50d49adb..6fe24bea5 100644
--- a/src/forge/Server/Index.jsx
+++ b/src/forge/Server/Index.jsx
@@ -24,6 +24,7 @@ const Pages = Loadable({
loading: Loading,
})
function ServerIndex(props){
+ const { projectDetail } = props;
return(
@@ -38,11 +39,11 @@ function ServerIndex(props){
}
>
{/* 个人建站服务 */}
- ()
}
- >
+ >}
(
)
diff --git a/src/forge/Server/List.jsx b/src/forge/Server/List.jsx
index bbee0d608..a9ad6184f 100644
--- a/src/forge/Server/List.jsx
+++ b/src/forge/Server/List.jsx
@@ -7,7 +7,7 @@ function Main(props){
const { owner , projectsId } = props.match.params;
const [ has_trace_user , setHas_trace_user ] = useState(false);
- const { current_user , resetUserInfo, projectDetail, showNotification } = props;
+ const { current_user , resetUserInfo, projectDetail, showNotification, isDeveloper, isManager, isReporter } = props;
useEffect(()=>{
// 更新网页标题
@@ -15,6 +15,10 @@ function Main(props){
const { author, name} = projectDetail;
document.title = `服务-${author.name}/${name}`;
}
+ // 非项目协作者不可进入服务tab (3397)
+ if(projectDetail && !(isDeveloper || isManager || isReporter)){
+ props.history.push(`/${owner}/${projectsId}`);
+ }
}, [projectDetail])
useEffect(()=>{
@@ -64,7 +68,7 @@ function Main(props){
查看详情
*/}
-
+ {projectDetail && projectDetail.author.type === "User" &&
个人建站服务
@@ -73,7 +77,7 @@ function Main(props){
查看详情
-
+ }
)
diff --git a/src/forge/Server/pages/index.jsx b/src/forge/Server/pages/index.jsx
index e7f9ac05c..edc56d4a1 100644
--- a/src/forge/Server/pages/index.jsx
+++ b/src/forge/Server/pages/index.jsx
@@ -1,12 +1,12 @@
import React, { Fragment, useEffect, useState } from 'react';
-import { Spin, message, Button, Form, Input, Select, Descriptions } from 'antd';
+import { Spin, message, Button, Form, Input, Select, Descriptions, Alert } from 'antd';
import axios from 'axios';
import SelectBranch from '../../../forge/Branch/Select';
import './index.scss';
import { Link } from 'react-router-dom';
function Pages(props) {
- const {current_user, history, form, projectDetail, defaultBranch} = props;
+ const {current_user, history, form, projectDetail, defaultBranch, isManager} = props;
const { owner , projectsId } = props.match.params;
const {id_card_verify} = current_user;
const { getFieldDecorator, validateFieldsAndScroll } = form;
@@ -72,6 +72,8 @@ function Pages(props) {
}else{
message.error((res && res.data && res.data.message) || "部署失败,请稍后重试");
}
+ setReload(Math.random());
+ setIsBuild(false);
setBuilding(false);
})
}
@@ -79,16 +81,16 @@ function Pages(props) {
return (
- 个人建站服务{!pageInfo && !loading && id_card_verify && ' - 新建站点'}
+ 个人建站服务{!pageInfo && !loading && id_card_verify && isManager && ' - 新建站点'}
{/* 未通过实名认证 */}
{!id_card_verify &&
您尚未通过实名认证,无法使用此服务,如需使用,请先进行实名认证。
}
- {id_card_verify &&
+ {id_card_verify && isManager &&
{/* 未开通 */}
- {!pageInfo &&
{getFieldDecorator("site_name", {
- rules: [{ required: true, message: "请输入站点名称" }],
+ rules: [{ required: true, message: "请输入站点名称" },
+ {type: 'string', max: 50, min: 1, message: "长度1-50"}],
})()}
{getFieldDecorator("identifier", {
- rules: [{ required: true, message: "请输入站点标识" }],
+ rules: [{ required: true, message: "请输入站点标识" },
+ {pattern: /^[a-zA-Z0-9]{2,100}$/, message: '长度2-100,只能包含数字和字母'}],
})(
{
@@ -118,7 +122,7 @@ function Pages(props) {
placeholder="请输入站点标识"
/>
)}
-
+
http://{current_user.login}.kingchan.cn/{tag}
@@ -143,13 +147,12 @@ function Pages(props) {
取消
- }
- {/* 已开通 */}
- {pageInfo &&
+ : pageInfo.state ?
+ {/* 已开通 */}
- {window.open(pageInfo.url)}} className='theme-btn'>{pageInfo.site_name}
- {pageInfo.url}
- {pageInfo.language_frame}
+ {pageInfo.last_build_at && window.open(pageInfo.url)}} className= {pageInfo.last_build_at && 'theme-btn'}>{pageInfo.site_name}
+ {pageInfo.last_build_at && window.open(pageInfo.url)}} className= {pageInfo.last_build_at && 'theme-btn'}>{pageInfo.url}
+ {pageInfo.language_frame}
{pageInfo.created_at}
{pageInfo.last_build_at && {pageInfo.last_build_at}}
@@ -175,12 +178,25 @@ function Pages(props) {
}
+ :
}
{result &&
部署结果
{result.map(item=>
{item}
)}
}
}
+ {!isManager &&
+ {/* 非管理员权限 */}
+ {pageInfo && pageInfo.state &&
+ {pageInfo.last_build_at && window.open(pageInfo.url)}} className= {pageInfo.last_build_at && 'theme-btn'}>{pageInfo.site_name}
+ {pageInfo.last_build_at && window.open(pageInfo.url)}} className= {pageInfo.last_build_at && 'theme-btn'}>{pageInfo.url}
+ {pageInfo.language_frame}
+ {pageInfo.created_at}
+ {pageInfo.last_build_at && {pageInfo.last_build_at}}
+ }
+
}
)
}
diff --git a/src/forge/Server/pages/index.scss b/src/forge/Server/pages/index.scss
index 24c4d753a..f715198a1 100644
--- a/src/forge/Server/pages/index.scss
+++ b/src/forge/Server/pages/index.scss
@@ -5,4 +5,5 @@
}
.theme-btn{
color: $primary-color;
+ cursor: pointer;
}
\ No newline at end of file
diff --git a/src/forge/users/Material/Index.jsx b/src/forge/users/Material/Index.jsx
index 68a0fa4e5..c15036842 100644
--- a/src/forge/users/Material/Index.jsx
+++ b/src/forge/users/Material/Index.jsx
@@ -35,7 +35,7 @@ function Index(props){
break;
case '/settings/verification':
setType('4');
- documentTitle = "身份认证";
+ documentTitle = "实名认证";
break;
default:
setType('2');
@@ -55,7 +55,7 @@ function Index(props){