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="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">-->
@ -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

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

Loading…
Cancel
Save