hjm 6 years ago
commit 49a9f6648f

@ -114,21 +114,21 @@ module.exports = {
// First, run the linter. // First, run the linter.
// It's important to do this before Babel processes the JS. // It's important to do this before Babel processes the JS.
// 上线然后要注释回来 // 上线然后要注释回来
// { {
// test: /\.(js|jsx|mjs)$/, test: /\.(js|jsx|mjs)$/,
// enforce: 'pre', enforce: 'pre',
// use: [ use: [
// { {
// options: { options: {
// formatter: eslintFormatter, formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'), eslintPath: require.resolve('eslint'),
//
// }, },
// loader: require.resolve('eslint-loader'), loader: require.resolve('eslint-loader'),
// }, },
// ], ],
// include: paths.appSrc, include: paths.appSrc,
// }, },
{ {
// "oneOf" will traverse all following loaders until one will // "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall // match the requirements. When no loader matches it will fall

@ -148,12 +148,12 @@
(function() { // Scoping function to avoid globals (function() { // Scoping function to avoid globals
var href = location.href; var href = location.href;
if (href.indexOf('/tasks/') != -1) { if (href.indexOf('/tasks/') != -1) {
document.write('<script type="text/javascript" src="https://testeduplus2.educoder.net/assets/kindeditor/kindeditor.js"><\/script>'); document.write('<script type="text/javascript" src="/assets/kindeditor/kindeditor.js"><\/script>');
// build.js中会将这个url附加一个前缀 react/build // build.js中会将这个url附加一个前缀 react/build
document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>'); document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>');
document.write('<script type="text/javascript" src="https://testeduplus2.educoder.net/javascripts/educoder/edu_application.js"><\/script>'); document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>');
} else if (href.indexOf('/paths/') != -1) { } else if (href.indexOf('/paths/') != -1) {
document.write('<script type="text/javascript" src="https://testeduplus2.educoder.net/javascripts/educoder/edu_application.js"><\/script>'); document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>');
} }
})(); })();

@ -38,7 +38,7 @@
<link rel="stylesheet" type="text/css" href="/css/css_min_all.css"> <link rel="stylesheet" type="text/css" href="/css/css_min_all.css">
<link href="https://testeduplus2.educoder.net/stylesheets/educoder/edu-all.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/educoder/edu-all.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_653600_qa9lwwv74z.css"> <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_653600_qa9lwwv74z.css">

@ -1,51 +1,52 @@
const isDev = window.location.port == 3007; const isDev = window.location.port == 3007;
export function getImageUrl(path) { export function getImageUrl(path) {
// https://www.educoder.net // https://www.educoder.net
// https://testbdweb.trustie.net // https://testbdweb.trustie.net
// const local = 'http://localhost:3000' // const local = 'http://localhost:3000'
const local = 'https://testeduplus2.educoder.net' const local = 'https://testeduplus2.educoder.net'
if (isDev) { if (isDev) {
return `${local}/${path}` return `${local}/${path}`
} }
return `/${path}`; return `/${path}`;
} }
export function setImagesUrl(path){ export function setImagesUrl(path){
const local = 'http://47.96.87.25:48080' const local = 'http://47.96.87.25:48080'
let firstStr=path.substr(0,1); let firstStr=path.substr(0,1);
console.log(firstStr); console.log(firstStr);
if(firstStr=="/"){ if(firstStr=="/"){
return isDev?`${local}${path}`:`${path}`; return isDev?`${local}${path}`:`${path}`;
}else{ }else{
return isDev?`${local}/${path}`:`/${path}`; return isDev?`${local}/${path}`:`/${path}`;
} }
} }
export function getUrl(path, goTest) { export function getUrl(path, goTest) {
// https://www.educoder.net // https://www.educoder.net
// https://testbdweb.trustie.net // https://testbdweb.trustie.net
// 如果想所有url定位到测试版可以反注释掉下面这行 // 如果想所有url定位到测试版可以反注释掉下面这行
//goTest = true //goTest = true
// testbdweb.educoder.net testbdweb.trustie.net // testbdweb.educoder.net testbdweb.trustie.net
// const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000' // const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000'
const local = 'https://testeduplus2.educoder.net' // const local = 'https://testeduplus2.educoder.net'
if (isDev) { const local = 'http://47.96.87.25:48080'
return `${local}${path?path:''}` if (isDev) {
} return `${local}${path?path:''}`
return `${path ? path: ''}`; }
} return `${path ? path: ''}`;
export function getUploadActionUrl(path, goTest) { }
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}` export function getUploadActionUrl(path, goTest) {
} return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}`
}
export function test(path) {
return `${path}`; export function test(path) {
} return `${path}`;
}
export function toPath(path) {
window.open(path, '_blank'); export function toPath(path) {
} window.open(path, '_blank');
}
// export default queryString // export default queryString

File diff suppressed because it is too large Load Diff

@ -1377,7 +1377,7 @@ class Listofworks extends Component {
classroom: game_list[i].score, classroom: game_list[i].score,
complete_status: game_list[i].complete_status, complete_status: game_list[i].complete_status,
}) })
experience=game_list[i].complete_status+experience; experience=game_list[i].score+experience;
if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){ if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){
boolgalist=false; boolgalist=false;

@ -394,7 +394,7 @@ class Listofworksstudentone extends Component {
classroom: game_list[i].score, classroom: game_list[i].score,
complete_status: game_list[i].complete_status, complete_status: game_list[i].complete_status,
}) })
experience=game_list[i].complete_status+experience; experience=game_list[i].score+experience;
if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){ if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){
boolgalist=false; boolgalist=false;

@ -52,6 +52,26 @@ class TraineetraininginformationModal extends Component {
// this.seacthdata(); // this.seacthdata();
} }
componentWillReceiveProps(nextProps) {
// console.log("46");
// console.log(nextProps);
// console.log(this.props);
if (nextProps.boolgalist != this.props.boolgalist) {
// console.log("50");
// console.log(nextProps.user);
if (nextProps.boolgalist !== undefined) {
// console.log("53");
// console.log(nextProps.user);
this.setState({
boolgalist: nextProps.boolgalist,
})
}
}
}
LimitNumber=(txt)=> { LimitNumber=(txt)=> {
var str = txt; var str = txt;
if(str.length>25){ if(str.length>25){
@ -61,7 +81,7 @@ class TraineetraininginformationModal extends Component {
} }
render() { render() {
var columns; var columns;
if(this.props.boolgalis&&this.props.boolgalist === true) { if(this.state.boolgalist&&this.state.boolgalist === true) {
columns = [ columns = [
{ {
title: '关卡', title: '关卡',

File diff suppressed because it is too large Load Diff

@ -1,74 +1,75 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
export function loadSshScript(callback) { export function loadSshScript(callback) {
let _url_origin = ``; let _url_origin = ``;
let prefix = 'react/build' let prefix = 'react/build'
if (window.location.port == 3007) { if (window.location.port == 3007) {
prefix = '' prefix = ''
} else { } else {
_url_origin = `https://testeduplus2.educoder.net/`; // _url_origin = `https://testeduplus2.educoder.net/`;
} _url_origin = 'http://47.96.87.25:48080';
const $ = window.$; }
// 未加载过 const $ = window.$;
if (!window['Terminal']) { // 未加载过
// /js/js_min_all. if (!window['Terminal']) {
$('head').append($('<link rel="stylesheet" type="text/css" />') // /js/js_min_all.
.attr('href', `${_url_origin}${prefix}/js/xterm/xterm.css`)); $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}${prefix}/js/xterm/xterm.css`));
// $.getScript(
// `${_url_origin}${prefix}/js/xterm/xterm.js`, // $.getScript(
// (data, textStatus, jqxhr) => { // `${_url_origin}${prefix}/js/xterm/xterm.js`,
// }); // (data, textStatus, jqxhr) => {
// $.getScript( // });
// `${_url_origin}${prefix}/js/jsFromMiddleLayer/base64.js`, // $.getScript(
// (data, textStatus, jqxhr) => { // `${_url_origin}${prefix}/js/jsFromMiddleLayer/base64.js`,
// }); // (data, textStatus, jqxhr) => {
// $.getScript( // });
// `${_url_origin}${prefix}/js/jsFromMiddleLayer/ws.js`, // $.getScript(
// (data, textStatus, jqxhr) => { // `${_url_origin}${prefix}/js/jsFromMiddleLayer/ws.js`,
// $.getScript( // (data, textStatus, jqxhr) => {
// `${_url_origin}${prefix}/js/jsFromMiddleLayer/main.js`, // $.getScript(
// (data, textStatus, jqxhr) => { // `${_url_origin}${prefix}/js/jsFromMiddleLayer/main.js`,
// callback && callback() // (data, textStatus, jqxhr) => {
// }); // callback && callback()
// }); // });
// });
$.when(
$.getScript( `${_url_origin}${prefix}/js/xterm/xterm.js` ), $.when(
$.getScript( `${_url_origin}${prefix}/js/jsFromMiddleLayer/base64.js` ), $.getScript( `${_url_origin}${prefix}/js/xterm/xterm.js` ),
$.getScript( `${_url_origin}${prefix}/js/jsFromMiddleLayer/ws.js` ), $.getScript( `${_url_origin}${prefix}/js/jsFromMiddleLayer/base64.js` ),
$.getScript( `${_url_origin}${prefix}/js/jsFromMiddleLayer/main.js` ), $.getScript( `${_url_origin}${prefix}/js/jsFromMiddleLayer/ws.js` ),
$.Deferred(function( deferred ){ $.getScript( `${_url_origin}${prefix}/js/jsFromMiddleLayer/main.js` ),
$( deferred.resolve ); $.Deferred(function( deferred ){
}) $( deferred.resolve );
).done(function(){ })
//place your code here, the scripts are all loaded ).done(function(){
callback && callback() //place your code here, the scripts are all loaded
}); callback && callback()
} else { });
callback && callback() } else {
} callback && callback()
} }
}
export function openTerminal(props, parentDomId) {
const { game_id, host, password, port, username, webssh_url, ws_url, export function openTerminal(props, parentDomId) {
rows, cols, width, height} = props; const { game_id, host, password, port, username, webssh_url, ws_url,
rows, cols, width, height} = props;
var options = {
host: host, var options = {
port: port, host: host,
username: username, port: port,
secret: password, username: username,
gameid: game_id, secret: password,
rows: rows, gameid: game_id,
columns: cols, rows: rows,
width, columns: cols,
height, width,
parentDomId, height,
// tab: $("#terminalTab").val(), parentDomId,
} // tab: $("#terminalTab").val(),
window.g_websocket_url = ws_url; }
// TODO 加一个parentDomId 来做多ssh tab window.g_websocket_url = ws_url;
window.openTerminal(options) // TODO 加一个parentDomId 来做多ssh tab
} window.openTerminal(options)
}

@ -18,7 +18,7 @@ import Trialapplication from "../login/Trialapplication";
const $ = window.$; const $ = window.$;
const versionNum = '0001'; const versionNum = '0001';
// let _url_origin = getUrl() // let _url_origin = getUrl()
let _url_origin=`https://testeduplus2.educoder.net`; let _url_origin=``;
// let _url_origin=`https://www.educoder.net`; // let _url_origin=`https://www.educoder.net`;
if (!window['indexHOCLoaded']) { if (!window['indexHOCLoaded']) {
@ -28,16 +28,13 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1525440977`)); .attr('href', `/stylesheets/css/edu-common.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1525440977`)); .attr('href', `/stylesheets/educoder/edu-main.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440977`)); .attr('href', `/stylesheets/educoder/edu-all.css?1525440977`));
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/css_min_all.css?1525440977`)); // .attr('href', `${_url_origin}/stylesheets/educoder/css_min_all.css?1525440977`));

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save