This commit is contained in:
caishi 2023-05-30 18:21:10 +08:00
parent fd13bbff33
commit 9293b80edb
2 changed files with 29 additions and 2 deletions

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || ''
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -29,6 +29,7 @@ class Setting extends Component {
CategoryList: undefined,
LanguageList: undefined,
private_check: undefined,
prview_check:undefined,
loading:true,
project_units:['home',"activity","code"],
divertVisible:false,
@ -93,6 +94,7 @@ class Setting extends Component {
this.setState({
projectName:result.data.project_name,
private_check: result.data.private,
prview_check:result.data.pr_view_admin,
loading:false,
project_units:units,
transfer:result.data.transfer,
@ -224,6 +226,11 @@ class Setting extends Component {
});
};
changePrview=(e) => {
this.setState({
prview_check: e.target.checked,
});
};
// 转移仓库
DivertProject=()=>{
this.setState({
@ -266,7 +273,7 @@ class Setting extends Component {
const { projectsId , owner } = this.props.match.params;
const { projectDetail } = this.props;
const { CategoryList, LanguageList, private_check ,loading , divertVisible , is_transfering, transfer } = this.state;
const { CategoryList, LanguageList, private_check , prview_check ,loading , divertVisible , is_transfering, transfer } = this.state;
let mirror = projectDetail && projectDetail.mirror;
let type = projectDetail && projectDetail.type;
const forked_from_project_id = this.props && this.props.projectDetail && this.props.projectDetail.forked_from_project_id;
@ -361,6 +368,26 @@ class Setting extends Component {
</Select>
)}
</Form.Item>
<span className="mb15">访问权限:</span>
<div className="df" style={{ alignItems: "center" }}>
<span className="mr20 mb15 font-16">合并请求(PR)</span>
<Form.Item label="">
{getFieldDecorator("pr_view_admin", {
rules: [],
})(
<Checkbox
checked={prview_check}
onChange={this.changePrview}
disabled={forked_from_project_id}
>
<span className="color-grey-3">仅管理员可见</span>
{/* <span className="color-grey-6">
合并请求(PR)
</span> */}
</Checkbox>
)}
</Form.Item>
</div>
<Form.Item label="项目导航">
{getFieldDecorator("project_units", {
rules: [],