dev_forum
杨树明 5 years ago
parent 743ff88d01
commit f2e7ebb376

@ -55,7 +55,7 @@
<!-- <link href="/react/build/css/iconfont.css" rel="stylesheet" type="text/css"> --> <!-- <link href="/react/build/css/iconfont.css" rel="stylesheet" type="text/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 href="https://pandao.github.io/editor.md/examples/css/style.css" rel="stylesheet" type="text/css">--> <!--<link href="https://pandao.github.io/editor.md/examples/css/style.css" rel="stylesheet" type="text/css">-->
@ -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

@ -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`));

Loading…
Cancel
Save