From 147e9edcc24645863adebf26b3b01a866e9a11c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Thu, 21 Dec 2023 16:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=BB=BA=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Issues/Pages/details.jsx | 2 +- .../SecuritySetting/website/createSite.jsx | 31 +++++++++++++------ src/forge/SecuritySetting/website/index.scss | 1 - .../SecuritySetting/website/mySiteList.jsx | 6 ++-- src/forge/Server/Index.jsx | 2 +- src/forge/Server/List.jsx | 3 +- src/forge/Settings/Setting.js | 6 ++-- 8 files changed, 35 insertions(+), 18 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index c246ad01..1fac21b6 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "http://172.20.32.202:4000"; + var proxy = "https://testforgeplus.trustie.net/"; //响应前的设置 axios.interceptors.request.use( diff --git a/src/forge/Issues/Pages/details.jsx b/src/forge/Issues/Pages/details.jsx index 1bf88144..88c1b693 100644 --- a/src/forge/Issues/Pages/details.jsx +++ b/src/forge/Issues/Pages/details.jsx @@ -308,7 +308,7 @@ function Details(props){ }).then(result=>{ if(result && result.data && result.data.project_issues_index){ window.scrollTo(0,0); - props.showNotification("任务复制成功!"); + props.showNotification("疑修复制成功!"); props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`); } }).catch(error=>{}) diff --git a/src/forge/SecuritySetting/website/createSite.jsx b/src/forge/SecuritySetting/website/createSite.jsx index 1afa9eee..ba12ace0 100644 --- a/src/forge/SecuritySetting/website/createSite.jsx +++ b/src/forge/SecuritySetting/website/createSite.jsx @@ -6,6 +6,8 @@ import axios from "axios"; import { AlignCenter, AlignTop } from "../../Component/layout"; import { Link } from "react-router-dom"; import { getImageUrl } from "../../../common/UrlTool"; +import { ImageLayerOfCommentHOC } from "../../../modules/page/layers/ImageLayerOfCommentHOC"; +import { withRouter } from "react-router"; const { TextArea } = Input; function CreateSite(props) { @@ -18,6 +20,11 @@ function CreateSite(props) { useEffect(() => { document.title = "创建站点"; + setFieldsValue({ + identifier: `http://${current_user.login}.${site_page_deploy_domain || 'gitlink.net'}`, + repository_name: `${current_user.login}.${site_page_deploy_domain || 'gitlink.net'}`, + name: `${current_user.login}.${site_page_deploy_domain || 'gitlink.net'}` + }) }, []); useEffect(()=>{ @@ -56,7 +63,8 @@ function CreateSite(props) { ...values, clone_addr: theme && theme.clone_url, theme: theme && theme.name, - user_id: current_user.user_id + user_id: current_user.user_id, + identifier: values.identifier.split("http://")[1] }).then(res=>{ if(res && res.status === 200){ message.success("新建成功"); @@ -94,18 +102,20 @@ function CreateSite(props) { > {getFieldDecorator("identifier", { rules: [{ required: true, message: "请输入站点标识" }, - {pattern: /^[a-zA-Z0-9]{2,100}$/, message: '长度2-100,只能包含数字和字母'}], + // {pattern: /^[a-zA-Z0-9]{2,100}$/, message: '长度2-100,只能包含数字和字母'} + ], })( { setTag(e.target.value); }} placeholder="请输入站点标识" + disabled /> )} - + {/* http://{current_user.login}.{site_page_deploy_domain}/{tag} - + */} {getFieldDecorator("language_frame", {initialValue: 0})( @@ -124,9 +134,9 @@ function CreateSite(props) { {themes && themes.map(item=>{ const {image, name, clone_url} = item; - return
{setTheme(item)}}> + return
{setTheme(item)}}> - +

{name}

})} @@ -147,7 +157,7 @@ function CreateSite(props) { rules: [{ required: true, message: "请输入项目标识" }, {pattern: /^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,100}[a-zA-Z0-9]$/, message: "长度2-100,只能包含数字、字母、下划线、中划线、英文句号,必须以数字和字母开头,不能以下划线/中划线/英文句号开头和结尾"}], })( - + )} @@ -159,7 +169,7 @@ function CreateSite(props) { rules: [{ required: true, message: "请输入项目名称" }, {type: 'string', max: 50, min: 1, message: "长度1-50"}], })( - + )} @@ -185,4 +195,7 @@ function CreateSite(props) { ); } -export default Form.create()(CreateSite); +export default withRouter(ImageLayerOfCommentHOC({ + imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget", + parentSelector: ".newContainer", +})(Form.create()(CreateSite))); diff --git a/src/forge/SecuritySetting/website/index.scss b/src/forge/SecuritySetting/website/index.scss index 35214ccf..45834b80 100644 --- a/src/forge/SecuritySetting/website/index.scss +++ b/src/forge/SecuritySetting/website/index.scss @@ -1,6 +1,5 @@ .mySites_head{ height: 65px; - line-height: 64px; border-bottom: 1px solid rgba(224, 230, 245, 1); color:#151d40; font-size:17px; diff --git a/src/forge/SecuritySetting/website/mySiteList.jsx b/src/forge/SecuritySetting/website/mySiteList.jsx index 86c9159f..41c94800 100644 --- a/src/forge/SecuritySetting/website/mySiteList.jsx +++ b/src/forge/SecuritySetting/website/mySiteList.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect, Fragment } from "react"; -import { Button, Pagination, Spin } from "antd"; +import { Button, Pagination, Spin, Tooltip } from "antd"; import './index.scss'; import '../../users/Material/Index.scss'; import '../bot/exploit/index.scss' @@ -38,7 +38,9 @@ function MySiteList(props){ return 我的站点 - {id_card_verify && website_permission && } + {id_card_verify && website_permission && total >= 1 ? + + : } {/* 站点权限被管理员关闭 */} {id_card_verify && !website_permission &&
您的站点权限被锁定,请联系平台管理员。
} diff --git a/src/forge/Server/Index.jsx b/src/forge/Server/Index.jsx index 18abf376..9a6f57e4 100644 --- a/src/forge/Server/Index.jsx +++ b/src/forge/Server/Index.jsx @@ -48,7 +48,7 @@ function ServerIndex(props){ } > {/* 个人建站服务 */} - {projectDetail && projectDetail.author.type === "User" && () } diff --git a/src/forge/Server/List.jsx b/src/forge/Server/List.jsx index 14677090..995a621d 100644 --- a/src/forge/Server/List.jsx +++ b/src/forge/Server/List.jsx @@ -64,7 +64,8 @@ function Main(props){ 查看详情 */} - {projectDetail && projectDetail.author.type === "User" &&
  • + {/* 是站点仓库则显示,否则隐藏 */} + {projectDetail && projectDetail.web_site && projectDetail.author.type === "User" &&
  • 个人建站服务 diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index cde5b9b9..00e0b2e0 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -277,6 +277,8 @@ class Setting extends Component { 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; + // 站点仓库不允许修改项目名称和标识 + const isWebSiteRepo = projectDetail && projectDetail.web_site; return (
    )} + })()} { projectDetail && projectDetail.type && projectDetail.type !== 0 ? 该项目导入于 {projectDetail.mirror_url} @@ -335,7 +337,7 @@ class Setting extends Component { }, ], })( - + )}