forked from Gitlink/forgeplus-react
webpack
This commit is contained in:
parent
38002c767c
commit
3cc907f6de
|
@ -86,7 +86,7 @@ module.exports = {
|
|||
externals: {
|
||||
"react": "React",
|
||||
"react-dom": "ReactDOM",
|
||||
"alex": "Alex",
|
||||
// "alex": "Alex",
|
||||
},
|
||||
resolve: {
|
||||
// This allows you to set a fallback for where Webpack should look for modules.
|
||||
|
|
|
@ -83,7 +83,7 @@ module.exports = {
|
|||
.replace(/\\/g, "/"),
|
||||
},
|
||||
externals: {
|
||||
'alex': 'Alex',
|
||||
// 'alex': 'Alex',
|
||||
"react": "React",
|
||||
"react-dom": "ReactDOM",
|
||||
},
|
||||
|
|
|
@ -5,7 +5,6 @@ const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMi
|
|||
const ignoredFiles = require('react-dev-utils/ignoredFiles');
|
||||
const config = require('./webpack.config.dev');
|
||||
const paths = require('./paths');
|
||||
|
||||
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
||||
const host = process.env.HOST || '0.0.0.0';
|
||||
|
||||
|
|
|
@ -152,7 +152,10 @@
|
|||
"babel": {
|
||||
"presets": [
|
||||
"react",
|
||||
"react-app"
|
||||
"react-app",
|
||||
{
|
||||
"runtime": "automatic"
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<meta name="octolytics-dimension-repository_nwo" content="GitLink"></meta>
|
||||
<meta name="octolytics-dimension-repository_network_root_nwo" content="GitLink"></meta>
|
||||
<meta name="theme-color" content="#000000">
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
|
||||
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> -->
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
||||
<meta name="twitter:image:src" content="https://www.gitlink.org.cn/images/logo.png">
|
||||
<meta name="twitter:site" content="@gitlink">
|
||||
|
@ -51,20 +51,21 @@
|
|||
<script src="%PUBLIC_URL%js/codemirror/codemirror.js"></script>
|
||||
<script src="%PUBLIC_URL%js/editormd/editormd.min.js"></script>
|
||||
<script src="%PUBLIC_URL%js/codemirror/merge/merge.js"></script>
|
||||
<script src="%PUBLIC_URL%js/react.production.min.js"></script>
|
||||
<script src="%PUBLIC_URL%js/react-dom.production.min.js"></script>
|
||||
<!-- <script src="https://gw.alipayobjects.com/os/lib/react/16.14.0/umd/react.%REACT_URL%.js"></script>
|
||||
<script src="https://gw.alipayobjects.com/os/lib/react-dom/16.14.0/umd/react-dom.%REACT_URL%.js"></script> -->
|
||||
<script src="%PUBLIC_URL%js/alex/moment.js"></script>
|
||||
<script src="https://gw.alipayobjects.com/os/lib/react/16.14.0/umd/react.%REACT_URL%.js"></script>
|
||||
<script src="https://gw.alipayobjects.com/os/lib/react-dom/16.14.0/umd/react-dom.%REACT_URL%.js"></script>
|
||||
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.19/bundle/alex.all.global.min.js"></script>
|
||||
<%= htmlWebpackPlugin.tags.bodyTags %>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?7e2def1fe918f15f9f1c5c061f69b256";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
// var _hmt = _hmt || [];
|
||||
// (function() {
|
||||
// var hm = document.createElement("script");
|
||||
// hm.src = "https://hm.baidu.com/hm.js?7e2def1fe918f15f9f1c5c061f69b256";
|
||||
// var s = document.getElementsByTagName("script")[0];
|
||||
// s.parentNode.insertBefore(hm, s);
|
||||
|
||||
})();
|
||||
// })();
|
||||
window.onload=function(){
|
||||
$(".newContainer").delegate("a.anchors","click",function(){
|
||||
let h = $(this).offset().top - 180;
|
||||
|
|
|
@ -2087,11 +2087,8 @@
|
|||
// We need to temporarily unset name to avoid disrupting radio button groups.
|
||||
|
||||
|
||||
var name = node.name;
|
||||
var name = node.name || "";
|
||||
|
||||
if (name !== '') {
|
||||
node.name = '';
|
||||
}
|
||||
|
||||
{
|
||||
// When syncing the checked attribute, both the checked property and
|
||||
|
|
12
src/App.js
12
src/App.js
|
@ -136,10 +136,10 @@ const SoftBot = Loadable({
|
|||
loading: Loading,
|
||||
})
|
||||
|
||||
const WebIDE = Loadable({
|
||||
loader: () => import('./forge/Newfile/webIDE'),
|
||||
loading: Loading,
|
||||
});
|
||||
// const WebIDE = Loadable({
|
||||
// loader: () => import('./forge/Newfile/webIDE'),
|
||||
// loading: Loading,
|
||||
// });
|
||||
|
||||
const Badge = Loadable({
|
||||
loader: () => import('./forge/Badge/Index'),
|
||||
|
@ -353,11 +353,11 @@ class App extends Component {
|
|||
} />
|
||||
|
||||
{/* webIDE */}
|
||||
<Route path="/:owner/:projectsId/webIDE/tree/:branchName"
|
||||
{/* <Route path="/:owner/:projectsId/webIDE/tree/:branchName"
|
||||
render={
|
||||
(props) => (<WebIDE {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
></Route> */}
|
||||
|
||||
{/* 项目PR */}
|
||||
<Route path="/:owner/:projectsId/compare"
|
||||
|
|
|
@ -70,7 +70,7 @@ export function getcdnImageUrl(path) {
|
|||
// https://testbdweb.trustie.net
|
||||
// const local = 'http://localhost:3000'
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local='https://ali-cdn.educoder.net'
|
||||
const local='https://pre.gitlink.org.cn/'
|
||||
let firstStr=path.substr(0,1);
|
||||
if (isdev2) {
|
||||
return `${local}/${path}`;
|
||||
|
@ -86,7 +86,7 @@ export function getcdnImageUrl(path) {
|
|||
|
||||
export function setcndImagesUrl(path){
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local='https://ali-cdn.educoder.net'
|
||||
const local='https://pre.gitlink.org.cn/'
|
||||
let firstStr=path.substr(0,1);
|
||||
if(firstStr=="/"){
|
||||
if (!isdev2) {
|
||||
|
@ -107,7 +107,7 @@ export function setcndImagesUrl(path){
|
|||
|
||||
export function setImagesUrl(path){
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local='https://ali-cdn.educoder.net'
|
||||
const local='https://pre.gitlink.org.cn/'
|
||||
let firstStr=path.substr(0,1);
|
||||
if(firstStr=="/"){
|
||||
if (!isdev2) {
|
||||
|
|
|
@ -32,7 +32,7 @@ export default ({ list = [] }) => {
|
|||
</div>
|
||||
}
|
||||
<Link to={"/shixuns/" + identifier + "/challenges"} className="square-img" target="_blank">
|
||||
<img src={setImagesUrl(`${pic}`)} />
|
||||
{/* <img src={setImagesUrl(`${pic}`)} /> */}
|
||||
</Link>
|
||||
|
||||
<div className="square-main">
|
||||
|
|
|
@ -173,20 +173,20 @@ class NewHeader extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
geturlsdata = () => {
|
||||
let url = "/setting.json";
|
||||
axios.get(url).then((response) => {
|
||||
if (response && response.data) {
|
||||
this.setState({ settings: response.data.setting });
|
||||
localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
||||
localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.gettablogourlnull();
|
||||
});
|
||||
}
|
||||
// geturlsdata = () => {
|
||||
// let url = "/setting.json";
|
||||
// axios.get(url).then((response) => {
|
||||
// if (response && response.data) {
|
||||
// this.setState({ settings: response.data.setting });
|
||||
// localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
||||
// localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
||||
// } else {
|
||||
// this.gettablogourlnull();
|
||||
// }
|
||||
// }).catch((error) => {
|
||||
// this.gettablogourlnull();
|
||||
// });
|
||||
// }
|
||||
|
||||
matchpaths = (url) => {
|
||||
const { match } = this.props;
|
||||
|
@ -262,7 +262,7 @@ class NewHeader extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { resetUserInfo ,showNotification,publicNav,mygetHelmetapi} = this.props;
|
||||
const { resetUserInfo ,showNotification,publicNav,mygetHelmetapi} = this.props;
|
||||
let settings = mygetHelmetapi;
|
||||
let current_user = this.props.user;
|
||||
let {
|
||||
|
|
|
@ -128,10 +128,10 @@ const Invite = Loadable({
|
|||
loader: () => import('../Invite/Index'),
|
||||
loading: Loading,
|
||||
});
|
||||
const Review = Loadable({
|
||||
loader: () => import('../Newfile/codeReview'),
|
||||
loading: Loading,
|
||||
});
|
||||
// const Review = Loadable({
|
||||
// loader: () => import('../Newfile/codeReview'),
|
||||
// loading: Loading,
|
||||
// });
|
||||
/**
|
||||
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
|
||||
*/
|
||||
|
@ -785,11 +785,11 @@ class Detail extends Component {
|
|||
}
|
||||
></Route>
|
||||
{/* review */}
|
||||
<Route path="/:owner/:projectsId/pulls/:mergeId/review"
|
||||
{/* <Route path="/:owner/:projectsId/pulls/:mergeId/review"
|
||||
render={
|
||||
(props) => (<Review {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
></Route> */}
|
||||
<Route path="/:owner/:projectsId/pulls/:mergeId"
|
||||
render={
|
||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
||||
|
|
|
@ -13,7 +13,7 @@ import { getUrl, returnbar } from 'educoder';
|
|||
import changeThemePlugin from './changeTheme';
|
||||
import IDEPlugin, { ExtensionCommand } from './plugins/idePlugin';
|
||||
// import { FileOperationArea } from './components/file-operation-area';
|
||||
import { repoService } from './codeReview/mock/repo.service';
|
||||
// import { repoService } from './codeReview/mock/repo.service';
|
||||
|
||||
|
||||
function CloudIDE({ download_url, params: { owner, projectsId, branchName }, filepath , value }) {
|
||||
|
@ -89,15 +89,15 @@ function CloudIDE({ download_url, params: { owner, projectsId, branchName }, fil
|
|||
)
|
||||
);
|
||||
// blame
|
||||
const onBlame = async (e) => {
|
||||
setBlameChecked(e.target.checked);
|
||||
if (!e.target.checked ) {
|
||||
plugin.current.commands && plugin.current.commands.executeCommand(ExtensionCommand.toggleBlame);
|
||||
} else {
|
||||
const res = await repoService.getCodeBlame(projectsId, owner, { sha:decodeURIComponent(branchName), filepath })
|
||||
plugin.current.commands && plugin.current.commands.executeCommand(ExtensionCommand.toggleBlame, res);
|
||||
}
|
||||
};
|
||||
// const onBlame = async (e) => {
|
||||
// setBlameChecked(e.target.checked);
|
||||
// if (!e.target.checked ) {
|
||||
// plugin.current.commands && plugin.current.commands.executeCommand(ExtensionCommand.toggleBlame);
|
||||
// } else {
|
||||
// const res = await repoService.getCodeBlame(projectsId, owner, { sha:decodeURIComponent(branchName), filepath })
|
||||
// plugin.current.commands && plugin.current.commands.executeCommand(ExtensionCommand.toggleBlame, res);
|
||||
// }
|
||||
// };
|
||||
const [wordWrap, setWordWrap] = useState(false);
|
||||
const onWordWrapChange = (value) => {
|
||||
const preference = value ? 'on' : 'off';
|
||||
|
@ -274,7 +274,8 @@ function CloudIDE({ download_url, params: { owner, projectsId, branchName }, fil
|
|||
}
|
||||
},
|
||||
}}
|
||||
/>:
|
||||
/>
|
||||
:
|
||||
<div className="pl20">空文件</div>
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useState, useMemo } from 'react';
|
||||
// import { default as AntcodeCR } from 'acr';
|
||||
import { ACR } from 'alex';
|
||||
// import { ACR } from 'alex';
|
||||
import { Button, Switch, Spin, Icon } from 'antd';
|
||||
// blame worker扩展
|
||||
import CodeBlame from './extensions/alex-ext-public.editor-plugin-blame.js';
|
||||
|
@ -27,8 +27,8 @@ import {
|
|||
} from './mock/component/index';
|
||||
import { projectService } from './mock/project.service';
|
||||
import { lsifService } from './mock/lsif.service';
|
||||
import { useFileReadMarkChange$ } from './hooks';
|
||||
import { repoService } from './mock/repo.service';
|
||||
// import { useFileReadMarkChange$ } from './hooks';
|
||||
// import { repoService } from './mock/repo.service';
|
||||
import ideLogo from './ideLogo.svg';
|
||||
|
||||
|
||||
|
@ -52,35 +52,35 @@ const CodeReview = (props) => {
|
|||
// todo
|
||||
const getFileReadStatus = usePersistFn(_getFileReadStatus);
|
||||
// const getFileReadStatus = _getFileReadStatus;
|
||||
const {
|
||||
diffsPack,
|
||||
getDiffById,
|
||||
getFileContent,
|
||||
IDEMode,
|
||||
toggleViewerType,
|
||||
annotationPacks,
|
||||
setAcrFlag,
|
||||
} = useAcr();
|
||||
const fileReadMarkChange$ = useFileReadMarkChange$(
|
||||
diffsPack && diffsPack.diffs || [],
|
||||
readMarks
|
||||
);
|
||||
// const {
|
||||
// diffsPack,
|
||||
// getDiffById,
|
||||
// getFileContent,
|
||||
// IDEMode,
|
||||
// toggleViewerType,
|
||||
// annotationPacks,
|
||||
// setAcrFlag,
|
||||
// } = useAcr();
|
||||
// const fileReadMarkChange$ = useFileReadMarkChange$(
|
||||
// diffsPack && diffsPack.diffs || [],
|
||||
// readMarks
|
||||
// );
|
||||
|
||||
// 插件激活
|
||||
const [pluginActivated, setPluginActivated] = useState(false);
|
||||
const blamePlugin = useMemo(() => {
|
||||
return new CodeBlamePlugin(
|
||||
() => setPluginActivated(true),
|
||||
(commitId) => {
|
||||
window.open(
|
||||
`/${owner}/${projectsId}/commit/${commitId}`
|
||||
)
|
||||
},
|
||||
// 获取blame数据
|
||||
(projectId, commitId, filepath) =>
|
||||
repoService.getCodeBlame(projectsId, owner, { sha: commitId, filepath })
|
||||
);
|
||||
}, []);
|
||||
// const blamePlugin = useMemo(() => {
|
||||
// return new CodeBlamePlugin(
|
||||
// () => setPluginActivated(true),
|
||||
// (commitId) => {
|
||||
// window.open(
|
||||
// `/${owner}/${projectsId}/commit/${commitId}`
|
||||
// )
|
||||
// },
|
||||
// // 获取blame数据
|
||||
// (projectId, commitId, filepath) =>
|
||||
// repoService.getCodeBlame(projectsId, owner, { sha: commitId, filepath })
|
||||
// );
|
||||
// }, []);
|
||||
|
||||
useEffect(()=>{
|
||||
// 设置网页标题
|
||||
|
@ -91,26 +91,26 @@ const CodeReview = (props) => {
|
|||
}
|
||||
}, [pr, projectDetail])
|
||||
|
||||
useEffect(() => {
|
||||
if (!pluginActivated) {
|
||||
return;
|
||||
}
|
||||
const projectData = {
|
||||
projectId: projectsId,
|
||||
prevSha: diffsPack.fromVersion && diffsPack.fromVersion.headCommitSha || diffsPack.toVersion.baseCommitSha,
|
||||
nextSha: diffsPack.toVersion.headCommitSha,
|
||||
};
|
||||
blamePlugin.commands && blamePlugin.commands.executeCommand(
|
||||
ExtensionCommand.setProjectData,
|
||||
projectData
|
||||
);
|
||||
// 取消语言服务
|
||||
blamePlugin.commands && blamePlugin.commands.executeCommand(
|
||||
'alex.setDefaultPreference',
|
||||
'acr.lsifEnabled',
|
||||
false
|
||||
);
|
||||
}, [pluginActivated, diffsPack]);
|
||||
// useEffect(() => {
|
||||
// if (!pluginActivated) {
|
||||
// return;
|
||||
// }
|
||||
// const projectData = {
|
||||
// projectId: projectsId,
|
||||
// prevSha: diffsPack.fromVersion && diffsPack.fromVersion.headCommitSha || diffsPack.toVersion.baseCommitSha,
|
||||
// nextSha: diffsPack.toVersion.headCommitSha,
|
||||
// };
|
||||
// blamePlugin.commands && blamePlugin.commands.executeCommand(
|
||||
// ExtensionCommand.setProjectData,
|
||||
// projectData
|
||||
// );
|
||||
// // 取消语言服务
|
||||
// blamePlugin.commands && blamePlugin.commands.executeCommand(
|
||||
// 'alex.setDefaultPreference',
|
||||
// 'acr.lsifEnabled',
|
||||
// false
|
||||
// );
|
||||
// }, [pluginActivated, diffsPack]);
|
||||
|
||||
if (!diffsPack) {
|
||||
return <Spin style={{ height: "100vh" }} spinning={true}></Spin>
|
||||
|
@ -262,7 +262,7 @@ const CodeReview = (props) => {
|
|||
<div style={{ height: '100%', lineHeight: '1.4' }}>
|
||||
{IDEMode && (
|
||||
<div style={IDEContainerStyle}>
|
||||
{visible && <ACR {...propsIDE} key={count} />}
|
||||
{/* {visible && <ACR {...propsIDE} key={count} />} */}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import React, { Component, Fragment } from "react";
|
||||
import { UnControlled as CodeMirror } from 'react-codemirror2';
|
||||
import 'codemirror/addon/selection/active-line.js';
|
||||
import 'codemirror/mode/javascript/javascript.js';
|
||||
import 'codemirror/mode/clike/clike';
|
||||
import 'codemirror/mode/css/css';
|
||||
// import { UnControlled as CodeMirror } from 'react-codemirror2';
|
||||
// import 'codemirror/addon/selection/active-line.js';
|
||||
// import 'codemirror/mode/javascript/javascript.js';
|
||||
// import 'codemirror/mode/clike/clike';
|
||||
// import 'codemirror/mode/css/css';
|
||||
import UserSubmitComponent from "./UserSubmitComponent";
|
||||
import CloudIDE from "./cloudIDE";
|
||||
// import CloudIDE from "./cloudIDE";
|
||||
import Editor from "react-monaco-editor";
|
||||
|
||||
import "./index.css";
|
||||
import "./editor.css";
|
||||
|
@ -35,7 +36,7 @@ class m_editor extends Component {
|
|||
render() {
|
||||
const { editorValue, changeValue } = this.state;
|
||||
console.log("editorValue:",editorValue)
|
||||
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath,ideTheme } = this.props;
|
||||
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail , language , match: { params },filepath,ideTheme } = this.props;
|
||||
const editor_options = {
|
||||
lineNumbers: "on",
|
||||
lineWrapping: true, //强制换行
|
||||
|
@ -61,16 +62,17 @@ class m_editor extends Component {
|
|||
let download_url = detail && detail.download_url;
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="editorBorderBox">
|
||||
{!readOnly ?
|
||||
<CodeMirror
|
||||
placeholder="请输入内容"
|
||||
value={editorValue}
|
||||
options={editor_options}
|
||||
onChange={this.changeEditor}
|
||||
/> :
|
||||
<CloudIDE download_url={download_url} value={editorValue} params={params} filepath={filepath&&filepath.startsWith('/')?filepath.slice(1):filepath}/>
|
||||
}
|
||||
<div className="branchTable" style={{border:"1px solid #eee"}}>
|
||||
<Editor
|
||||
height="400px"
|
||||
language={language ? language : "plaintext"}
|
||||
theme={"vs-grey"}
|
||||
placeholder="请输入内容"
|
||||
value={editorValue}
|
||||
options={editor_options}
|
||||
onChange={this.changeEditor}
|
||||
editorWillMount={this.editorWillMount}
|
||||
/>
|
||||
</div>
|
||||
{!readOnly && (
|
||||
<div className="editorBorderSubmitBox" style={{ padding: "20px" }}>
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
import React , { useEffect, useState, useMemo }from 'react';
|
||||
import { AppRenderer, requireModule } from 'alex';
|
||||
import { SlotLocation } from './plugins/idePlugin';
|
||||
// import { AppRenderer, requireModule } from 'alex';
|
||||
// import { SlotLocation } from './plugins/idePlugin';
|
||||
|
||||
import css from './extensions/alex-ext-public.css-language-features-worker.js';
|
||||
import html from './extensions/alex-ext-public.html-language-features-worker.js';
|
||||
import json from './extensions/alex-ext-public.json-language-features-worker.js';
|
||||
import markdown from './extensions/alex-ext-public.markdown-language-features-worker.js';
|
||||
import typescript from './extensions/alex-ext-public.typescript-language-features-worker.js';
|
||||
import anycode from './extensions/alex-ext-public.anycode.js';
|
||||
import anycodeCSharp from './extensions/alex-ext-public.anycode-c-sharp.js';
|
||||
import anycodeCpp from './extensions/alex-ext-public.anycode-cpp.js';
|
||||
import anycodeGo from './extensions/alex-ext-public.anycode-go.js';
|
||||
import anycodeJava from './extensions/alex-ext-public.anycode-java.js';
|
||||
import anycodePhp from './extensions/alex-ext-public.anycode-php.js';
|
||||
import anycodePython from './extensions/alex-ext-public.anycode-python.js';
|
||||
import anycodeRust from './extensions/alex-ext-public.anycode-rust.js';
|
||||
import anycodeTypescript from './extensions/alex-ext-public.anycode-typescript.js';
|
||||
import codeRunner from './extensions/alex-ext-public.code-runner-for-web.js';
|
||||
import emmet from './extensions/alex-ext-public.emmet.js';
|
||||
import codeswing from './extensions/alex-ext-public.codeswing.js';
|
||||
import referencesView from './extensions/alex-ext-public.references-view.js';
|
||||
import gitlens from './extensions/alex-ext-public.gitlens.js';
|
||||
import graph from './extensions/alex-ext-public.git-graph.js';
|
||||
import imagePreview from './extensions/alex-ext-public.image-preview.js';
|
||||
import webSCM from './extensions/alex-ext-public.web-scm.js';
|
||||
import * as SCMPlugin from './plugins/web-scm.plugin';
|
||||
import * as AlexApp from './plugins/alex-app.plugin';
|
||||
// import css from './extensions/alex-ext-public.css-language-features-worker.js';
|
||||
// import html from './extensions/alex-ext-public.html-language-features-worker.js';
|
||||
// import json from './extensions/alex-ext-public.json-language-features-worker.js';
|
||||
// import markdown from './extensions/alex-ext-public.markdown-language-features-worker.js';
|
||||
// import typescript from './extensions/alex-ext-public.typescript-language-features-worker.js';
|
||||
// import anycode from './extensions/alex-ext-public.anycode.js';
|
||||
// import anycodeCSharp from './extensions/alex-ext-public.anycode-c-sharp.js';
|
||||
// import anycodeCpp from './extensions/alex-ext-public.anycode-cpp.js';
|
||||
// import anycodeGo from './extensions/alex-ext-public.anycode-go.js';
|
||||
// import anycodeJava from './extensions/alex-ext-public.anycode-java.js';
|
||||
// import anycodePhp from './extensions/alex-ext-public.anycode-php.js';
|
||||
// import anycodePython from './extensions/alex-ext-public.anycode-python.js';
|
||||
// import anycodeRust from './extensions/alex-ext-public.anycode-rust.js';
|
||||
// import anycodeTypescript from './extensions/alex-ext-public.anycode-typescript.js';
|
||||
// import codeRunner from './extensions/alex-ext-public.code-runner-for-web.js';
|
||||
// import emmet from './extensions/alex-ext-public.emmet.js';
|
||||
// import codeswing from './extensions/alex-ext-public.codeswing.js';
|
||||
// import referencesView from './extensions/alex-ext-public.references-view.js';
|
||||
// import gitlens from './extensions/alex-ext-public.gitlens.js';
|
||||
// import graph from './extensions/alex-ext-public.git-graph.js';
|
||||
// import imagePreview from './extensions/alex-ext-public.image-preview.js';
|
||||
// import webSCM from './extensions/alex-ext-public.web-scm.js';
|
||||
// import * as SCMPlugin from './plugins/web-scm.plugin';
|
||||
// import * as AlexApp from './plugins/alex-app.plugin';
|
||||
|
||||
|
||||
import Welcome from './module/Welcome';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const CodeServiceModule = requireModule(
|
||||
'@alipay/alex-code-service'
|
||||
).CodeServiceModule;
|
||||
const CodeAPIModule = requireModule('@alipay/alex-code-api').CodeAPIModule;
|
||||
// const CodeServiceModule = requireModule(
|
||||
// '@alipay/alex-code-service'
|
||||
// ).CodeServiceModule;
|
||||
// const CodeAPIModule = requireModule('@alipay/alex-code-api').CodeAPIModule;
|
||||
|
||||
const layoutConfig = {
|
||||
[SlotLocation.top]: {
|
||||
modules: ['@opensumi/ide-menu-bar'],
|
||||
},
|
||||
[SlotLocation.action]: {
|
||||
modules: [''],
|
||||
},
|
||||
[SlotLocation.left]: {
|
||||
modules: [
|
||||
'@opensumi/ide-explorer',
|
||||
// 暂时移除搜索能力
|
||||
// '@opensumi/ide-search',
|
||||
'@opensumi/ide-extension-manager',
|
||||
'@opensumi/ide-scm',
|
||||
],
|
||||
},
|
||||
[SlotLocation.main]: {
|
||||
modules: ['@opensumi/ide-editor'],
|
||||
},
|
||||
[SlotLocation.bottom]: {
|
||||
modules: ['@opensumi/ide-output', '@opensumi/ide-markers'],
|
||||
},
|
||||
[SlotLocation.statusBar]: {
|
||||
modules: ['@opensumi/ide-status-bar'],
|
||||
},
|
||||
[SlotLocation.extra]: {
|
||||
modules: ['breadcrumb-menu'],
|
||||
},
|
||||
[SlotLocation.action]: {
|
||||
modules: ['@opensumi/ide-toolbar-action'],
|
||||
},
|
||||
};
|
||||
// const layoutConfig = {
|
||||
// [SlotLocation.top]: {
|
||||
// modules: ['@opensumi/ide-menu-bar'],
|
||||
// },
|
||||
// [SlotLocation.action]: {
|
||||
// modules: [''],
|
||||
// },
|
||||
// [SlotLocation.left]: {
|
||||
// modules: [
|
||||
// '@opensumi/ide-explorer',
|
||||
// // 暂时移除搜索能力
|
||||
// // '@opensumi/ide-search',
|
||||
// '@opensumi/ide-extension-manager',
|
||||
// '@opensumi/ide-scm',
|
||||
// ],
|
||||
// },
|
||||
// [SlotLocation.main]: {
|
||||
// modules: ['@opensumi/ide-editor'],
|
||||
// },
|
||||
// [SlotLocation.bottom]: {
|
||||
// modules: ['@opensumi/ide-output', '@opensumi/ide-markers'],
|
||||
// },
|
||||
// [SlotLocation.statusBar]: {
|
||||
// modules: ['@opensumi/ide-status-bar'],
|
||||
// },
|
||||
// [SlotLocation.extra]: {
|
||||
// modules: ['breadcrumb-menu'],
|
||||
// },
|
||||
// [SlotLocation.action]: {
|
||||
// modules: ['@opensumi/ide-toolbar-action'],
|
||||
// },
|
||||
// };
|
||||
|
||||
|
||||
const platform = 'gitlink';
|
||||
|
@ -86,68 +86,70 @@ const WebIDE = ( props) => {
|
|||
}
|
||||
},[mygetHelmetapi])
|
||||
|
||||
return (<AppRenderer
|
||||
appConfig={{
|
||||
plugins: [SCMPlugin, AlexApp],
|
||||
modules: [
|
||||
CodeServiceModule.Config({
|
||||
platform: platform,
|
||||
owner: owner,
|
||||
name: projectsId,
|
||||
refPath: 'tree/'+branchName,
|
||||
commit: '',
|
||||
hash: window.location.hash,
|
||||
gitlink: {
|
||||
// webpack 代理转发
|
||||
// 使用代理本地开发时 因为接口返回头像为地址为相对地址 内部做了拼接
|
||||
// gitlens插件的头像在本地开发会无法展示
|
||||
// endpoint: '/code-service',
|
||||
// endpoint:''
|
||||
origin: origin,
|
||||
endpoint: origin
|
||||
},
|
||||
}),
|
||||
CodeAPIModule,
|
||||
],
|
||||
extensionMetadata: [
|
||||
css,
|
||||
html,
|
||||
json,
|
||||
markdown,
|
||||
typescript,
|
||||
// TODO 后续增加插件 这些插件暂时还没有在公网发布
|
||||
gitlens,
|
||||
graph,
|
||||
imagePreview,
|
||||
webSCM,
|
||||
referencesView,
|
||||
codeswing,
|
||||
emmet,
|
||||
anycodeCSharp,
|
||||
anycodeCpp,
|
||||
anycodeGo,
|
||||
anycodeJava,
|
||||
anycodePhp,
|
||||
anycodePython,
|
||||
anycodeRust,
|
||||
anycodeTypescript,
|
||||
anycode,
|
||||
codeRunner,
|
||||
],
|
||||
workspaceDir: `${platform}/${owner}/${projectsId}`,
|
||||
layoutConfig,
|
||||
defaultPreferences: {
|
||||
'general.theme': 'opensumi-light',
|
||||
},
|
||||
}}
|
||||
runtimeConfig={{
|
||||
biz: 'alex',
|
||||
// scm文件树
|
||||
scmFileTree: true,
|
||||
EditorEmpty: Welcome,
|
||||
WelcomePage: Welcome
|
||||
}}
|
||||
/>
|
||||
return (
|
||||
// <AppRenderer
|
||||
// appConfig={{
|
||||
// plugins: [SCMPlugin, AlexApp],
|
||||
// modules: [
|
||||
// CodeServiceModule.Config({
|
||||
// platform: platform,
|
||||
// owner: owner,
|
||||
// name: projectsId,
|
||||
// refPath: 'tree/'+branchName,
|
||||
// commit: '',
|
||||
// hash: window.location.hash,
|
||||
// gitlink: {
|
||||
// // webpack 代理转发
|
||||
// // 使用代理本地开发时 因为接口返回头像为地址为相对地址 内部做了拼接
|
||||
// // gitlens插件的头像在本地开发会无法展示
|
||||
// // endpoint: '/code-service',
|
||||
// // endpoint:''
|
||||
// origin: origin,
|
||||
// endpoint: origin
|
||||
// },
|
||||
// }),
|
||||
// CodeAPIModule,
|
||||
// ],
|
||||
// extensionMetadata: [
|
||||
// css,
|
||||
// html,
|
||||
// json,
|
||||
// markdown,
|
||||
// typescript,
|
||||
// // TODO 后续增加插件 这些插件暂时还没有在公网发布
|
||||
// gitlens,
|
||||
// graph,
|
||||
// imagePreview,
|
||||
// webSCM,
|
||||
// referencesView,
|
||||
// codeswing,
|
||||
// emmet,
|
||||
// anycodeCSharp,
|
||||
// anycodeCpp,
|
||||
// anycodeGo,
|
||||
// anycodeJava,
|
||||
// anycodePhp,
|
||||
// anycodePython,
|
||||
// anycodeRust,
|
||||
// anycodeTypescript,
|
||||
// anycode,
|
||||
// codeRunner,
|
||||
// ],
|
||||
// workspaceDir: `${platform}/${owner}/${projectsId}`,
|
||||
// layoutConfig,
|
||||
// defaultPreferences: {
|
||||
// 'general.theme': 'opensumi-light',
|
||||
// },
|
||||
// }}
|
||||
// runtimeConfig={{
|
||||
// biz: 'alex',
|
||||
// // scm文件树
|
||||
// scmFileTree: true,
|
||||
// EditorEmpty: Welcome,
|
||||
// WelcomePage: Welcome
|
||||
// }}
|
||||
// />
|
||||
<div></div>
|
||||
)};
|
||||
|
||||
export default WebIDE;
|
||||
|
|
|
@ -18,7 +18,8 @@ function Index(props) {
|
|||
|
||||
const [ bannerTab , setBannerTab ] = useState(undefined);
|
||||
const register = props && props.mygetHelmetapi && props.mygetHelmetapi.common && props.mygetHelmetapi.common.register;
|
||||
const {mygetHelmetapi:{name}} = props
|
||||
const {mygetHelmetapi:{name}} = props;
|
||||
console.log("ddd:",props && props.mygetHelmetapi);
|
||||
const { current_user } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import React from 'react';
|
||||
import './Index.scss';
|
||||
import Slider from 'react-slick';
|
||||
import Back from './Img/xing-threeEdition.png';
|
||||
import com1 from './Img/com-1.png';
|
||||
import com2 from './Img/com-2.png';
|
||||
import com3 from './Img/com-3.png';
|
||||
|
|
|
@ -117,7 +117,7 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
if (chromesettingArray.tab_logo_url) {
|
||||
this.gettablogourldata(chromesettingresponseArray);
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
// this.gettablogourlnull();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("hoc获取游览器配置失败 重新请求开始读取配置");
|
||||
|
@ -138,16 +138,16 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
if (response.data.setting.tab_logo_url) {
|
||||
this.gettablogourldata(response);
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
// this.gettablogourlnull();
|
||||
}
|
||||
} catch (e) {
|
||||
this.gettablogourlnull();
|
||||
// this.gettablogourlnull();
|
||||
}
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
// this.gettablogourlnull();
|
||||
}
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
// this.gettablogourlnull();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.gettablogourlnull();
|
||||
|
|
|
@ -418,7 +418,7 @@ class InfosShixun extends Component {
|
|||
|
||||
|
||||
<a className="square-img">
|
||||
<img src={setImagesUrl(`${item.image_url}`)} />
|
||||
{/* <img src={setImagesUrl(`${item.image_url}`)} /> */}
|
||||
</a>
|
||||
<div className="square-main">
|
||||
<p className="task-hide">
|
||||
|
|
Loading…
Reference in New Issue