hjm 6 years ago
commit 49a9f6648f

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

@ -148,12 +148,12 @@
(function() { // Scoping function to avoid globals
var href = location.href;
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
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) {
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 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">

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

@ -394,7 +394,7 @@ class Listofworksstudentone extends Component {
classroom: game_list[i].score,
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){
boolgalist=false;

@ -52,6 +52,26 @@ class TraineetraininginformationModal extends Component {
// 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)=> {
var str = txt;
if(str.length>25){
@ -61,7 +81,7 @@ class TraineetraininginformationModal extends Component {
}
render() {
var columns;
if(this.props.boolgalis&&this.props.boolgalist === true) {
if(this.state.boolgalist&&this.state.boolgalist === true) {
columns = [
{
title: '关卡',

File diff suppressed because it is too large Load Diff

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

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

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