commit
0af155697a
@ -1,4 +1,6 @@
|
||||
class ShixunServiceConfig < ApplicationRecord
|
||||
belongs_to :shixun
|
||||
belongs_to :mirror_repository
|
||||
|
||||
validates_presence_of :shixun_id, :mirror_repository_id
|
||||
end
|
||||
|
@ -0,0 +1,104 @@
|
||||
class CreateShixunService < ApplicationService
|
||||
attr_reader :user, :params, :permit_params
|
||||
|
||||
def initialize(user, permit_params, params)
|
||||
@user = user
|
||||
@params = params
|
||||
@permit_params = permit_params
|
||||
end
|
||||
|
||||
def call
|
||||
shixun = Shixun.new(permit_params)
|
||||
identifier = Util::UUID.generate_identifier(Shixun, 8)
|
||||
shixun.identifier= identifier
|
||||
shixun.user_id = user.id
|
||||
main_mirror = MirrorRepository.find params[:main_type]
|
||||
sub_mirrors = MirrorRepository.where(id: params[:sub_type])
|
||||
ActiveRecord::Base.transaction do
|
||||
shixun.save!
|
||||
# 获取脚本内容
|
||||
shixun_script = get_shixun_script(shixun, main_mirror, sub_mirrors)
|
||||
# 创建额外信息
|
||||
ShixunInfo.create!(shixun_id: shixun.id, evaluate_script: shixun_script, description: params[:description])
|
||||
# 创建合作者
|
||||
shixun.shixun_members.create!(user_id: user.id, role: 1)
|
||||
# 创建镜像
|
||||
ShixunMirrorRepository.create!(:shixun_id => shixun.id, :mirror_repository_id => main_mirror.id)
|
||||
# 创建主服务配置
|
||||
ShixunServiceConfig.create!(:shixun_id => shixun.id, :mirror_repository_id => main_mirror.id)
|
||||
# 创建子镜像相关数据(实训镜像关联表,子镜像服务配置)
|
||||
sub_mirrors.each do |sub|
|
||||
ShixunMirrorRepository.create!(:shixun_id => shixun.id, :mirror_repository_id => sub.id)
|
||||
# 实训子镜像服务配置
|
||||
name = sub.name #查看镜像是否有名称,如果没有名称就不用服务配置
|
||||
ShixunServiceConfig.create!(:shixun_id => shixun.id, :mirror_repository_id => sub.id) if name.present?
|
||||
end
|
||||
# 创建版本库
|
||||
repo_path = repo_namespace(user.login, shixun.identifier)
|
||||
GitService.add_repository(repo_path: repo_path)
|
||||
shixun.update_column(:repo_name, repo_path.split(".")[0])
|
||||
# 如果是云上实验室,创建相关记录
|
||||
if !Laboratory.current.main_site?
|
||||
Laboratory.current.laboratory_shixuns.create!(shixun: shixun, ownership: true)
|
||||
end
|
||||
return shixun
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_shixun_script shixun, main_mirror, sub_mirrors
|
||||
if !shixun.is_jupyter?
|
||||
mirror = main_mirror.mirror_scripts
|
||||
if main_mirror.blank?
|
||||
modify_shixun_script shixun, mirror.first&.(:script)
|
||||
else
|
||||
sub_name = sub_mirrors.pluck(:type_name)
|
||||
if main_mirror.type_name == "Java" && sub_name.include?("Mysql")
|
||||
mirror.last.try(:script)
|
||||
else
|
||||
shixun_script = mirror.first&.script
|
||||
modify_shixun_script shixun, shixun_script
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def modify_shixun_script shixun, script
|
||||
if script.present?
|
||||
source_class_name = []
|
||||
challenge_program_name = []
|
||||
shixun.challenges.map(&:exec_path).each do |exec_path|
|
||||
challenge_program_name << "\"#{exec_path}\""
|
||||
if shixun.main_mirror_name == "Java"
|
||||
if exec_path.nil? || exec_path.split("src/")[1].nil?
|
||||
source = "\"\""
|
||||
else
|
||||
source = "\"#{exec_path.split("src/")[1].split(".java")[0]}\""
|
||||
end
|
||||
logger.info("----source: #{source}")
|
||||
source_class_name << source.gsub("/", ".") if source.present?
|
||||
elsif shixun.main_mirror_name.try(:first) == "C#"
|
||||
if exec_path.nil? || exec_path.split(".")[1].nil?
|
||||
source = "\"\""
|
||||
else
|
||||
source = "\"#{exec_path.split(".")[0]}.exe\""
|
||||
end
|
||||
source_class_name << source if source.present?
|
||||
end
|
||||
end
|
||||
script = if script.include?("sourceClassName") && script.include?("challengeProgramName")
|
||||
script.gsub(/challengeProgramNames=\(.*\)/,"challengeProgramNames=\(#{challenge_program_name.reject(&:blank?).join(" ")}\)").gsub(/sourceClassNames=\(.*\)/, "sourceClassNames=\(#{source_class_name.reject(&:blank?).join(" ")}\)")
|
||||
else
|
||||
script.gsub(/challengeProgramNames=\(.*\)/,"challengeProgramNames=\(#{challenge_program_name.reject(&:blank?).join(" ")}\)").gsub(/sourceClassNames=\(.*\)/, "sourceClassNames=\(#{challenge_program_name.reject(&:blank?).join(" ")}\)")
|
||||
end
|
||||
end
|
||||
return script
|
||||
end
|
||||
|
||||
# 版本库目录空间
|
||||
def repo_namespace(user, shixun_identifier)
|
||||
"#{user}/#{shixun_identifier}.git"
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
json.data_sets do
|
||||
json.array! @data_sets do |set|
|
||||
json.id set.id
|
||||
json.title set.title
|
||||
json.author set.author.real_name
|
||||
json.created_on set.created_on
|
||||
json.filesize number_to_human_size(set.filesize)
|
||||
end
|
||||
end
|
||||
json.data_sets_count @data_count
|
@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env ruby
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||
load Gem.bin_path('bundler', 'bundle')
|
||||
#!/usr/bin/env ruby
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||
load Gem.bin_path('bundler', 'bundle')
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env ruby
|
||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
#!/usr/bin/env ruby
|
||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
|
@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
require_relative '../config/boot'
|
||||
require 'rake'
|
||||
Rake.application.run
|
||||
#!/usr/bin/env ruby
|
||||
require_relative '../config/boot'
|
||||
|
||||
|
||||
require 'rake'
|
||||
Rake.application.run
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddIsJupyterForShixuns < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :shixuns, :is_jupyter, :boolean, :default => false
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
class AddIndexForShixunSecretRepositories < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
shixun_ids = ShixunSecretRepository.pluck(:shixun_id).uniq
|
||||
shixuns = Shixun.where(id: shixun_ids)
|
||||
shixuns.find_each do |shixun|
|
||||
id = shixun.shixun_secret_repository.id
|
||||
shixun_secret_repositories = ShixunSecretRepository.where(shixun_id: shixun.id).where.not(id: id)
|
||||
shixun_secret_repositories.destroy_all
|
||||
end
|
||||
|
||||
remove_index :shixun_secret_repositories, :shixun_id
|
||||
add_index :shixun_secret_repositories, :shixun_id, unique: true
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class ModifyTypeForTestSets < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
change_column :test_sets, :input, :longtext
|
||||
change_column :test_sets, :output, :longtext
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,35 @@
|
||||
version: '3'
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7.17
|
||||
command: --sql-mode=""
|
||||
restart: always
|
||||
volumes:
|
||||
- ./mysql_data/:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 123456789
|
||||
MYSQL_DATABASE: educoder
|
||||
|
||||
redis:
|
||||
image: redis:3.2
|
||||
container_name: redis
|
||||
restart: always
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- ./redis_data:/data
|
||||
|
||||
web:
|
||||
image: guange/educoder:latest
|
||||
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 4000 -b '0.0.0.0'"
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
- "4000:4000"
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
Binary file not shown.
@ -1,114 +1,114 @@
|
||||
'use strict';
|
||||
|
||||
// Do this as the first thing so that any code reading it knows the right env.
|
||||
process.env.BABEL_ENV = 'development';
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
|
||||
// Makes the script crash on unhandled rejections instead of silently
|
||||
// ignoring them. In the future, promise rejections that are not handled will
|
||||
// terminate the Node.js process with a non-zero exit code.
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
// Ensure environment variables are read.
|
||||
require('../config/env');
|
||||
|
||||
const fs = require('fs');
|
||||
const chalk = require('chalk');
|
||||
const webpack = require('webpack');
|
||||
const WebpackDevServer = require('webpack-dev-server');
|
||||
const clearConsole = require('react-dev-utils/clearConsole');
|
||||
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
||||
const {
|
||||
choosePort,
|
||||
createCompiler,
|
||||
prepareProxy,
|
||||
prepareUrls,
|
||||
} = require('react-dev-utils/WebpackDevServerUtils');
|
||||
const openBrowser = require('react-dev-utils/openBrowser');
|
||||
const paths = require('../config/paths');
|
||||
const config = require('../config/webpack.config.dev');
|
||||
const createDevServerConfig = require('../config/webpackDevServer.config');
|
||||
|
||||
const useYarn = fs.existsSync(paths.yarnLockFile);
|
||||
const isInteractive = process.stdout.isTTY;
|
||||
|
||||
const portSetting = require(paths.appPackageJson).port
|
||||
if ( portSetting ) {
|
||||
process.env.port = portSetting
|
||||
}
|
||||
|
||||
// Warn and crash if required files are missing
|
||||
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Tools like Cloud9 rely on this.
|
||||
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3007;
|
||||
const HOST = process.env.HOST || '0.0.0.0';
|
||||
|
||||
if (process.env.HOST) {
|
||||
console.log(
|
||||
chalk.cyan(
|
||||
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
||||
chalk.bold(process.env.HOST)
|
||||
)}`
|
||||
)
|
||||
);
|
||||
console.log(
|
||||
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
|
||||
);
|
||||
console.log(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`);
|
||||
console.log();
|
||||
}
|
||||
|
||||
// We attempt to use the default port but if it is busy, we offer the user to
|
||||
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
||||
choosePort(HOST, DEFAULT_PORT)
|
||||
.then(port => {
|
||||
if (port == null) {
|
||||
// We have not found a port.
|
||||
return;
|
||||
}
|
||||
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
||||
const appName = require(paths.appPackageJson).name;
|
||||
const urls = prepareUrls(protocol, HOST, port);
|
||||
// Create a webpack compiler that is configured with custom messages.
|
||||
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
|
||||
// Load proxy config
|
||||
const proxySetting = require(paths.appPackageJson).proxy;
|
||||
console.log('-------------------------proxySetting:', proxySetting)
|
||||
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
|
||||
// Serve webpack assets generated by the compiler over a web sever.
|
||||
const serverConfig = createDevServerConfig(
|
||||
proxyConfig,
|
||||
urls.lanUrlForConfig
|
||||
);
|
||||
const devServer = new WebpackDevServer(compiler, serverConfig);
|
||||
// Launch WebpackDevServer.
|
||||
devServer.listen(port, HOST, err => {
|
||||
if (err) {
|
||||
return console.log(err);
|
||||
}
|
||||
if (isInteractive) {
|
||||
clearConsole();
|
||||
}
|
||||
console.log(chalk.cyan('Starting the development server...\n'));
|
||||
openBrowser(urls.localUrlForBrowser);
|
||||
});
|
||||
|
||||
['SIGINT', 'SIGTERM'].forEach(function(sig) {
|
||||
process.on(sig, function() {
|
||||
devServer.close();
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
if (err && err.message) {
|
||||
console.log(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
'use strict';
|
||||
|
||||
// Do this as the first thing so that any code reading it knows the right env.
|
||||
process.env.BABEL_ENV = 'development';
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
|
||||
// Makes the script crash on unhandled rejections instead of silently
|
||||
// ignoring them. In the future, promise rejections that are not handled will
|
||||
// terminate the Node.js process with a non-zero exit code.
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
// Ensure environment variables are read.
|
||||
require('../config/env');
|
||||
|
||||
const fs = require('fs');
|
||||
const chalk = require('chalk');
|
||||
const webpack = require('webpack');
|
||||
const WebpackDevServer = require('webpack-dev-server');
|
||||
const clearConsole = require('react-dev-utils/clearConsole');
|
||||
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
||||
const {
|
||||
choosePort,
|
||||
createCompiler,
|
||||
prepareProxy,
|
||||
prepareUrls,
|
||||
} = require('react-dev-utils/WebpackDevServerUtils');
|
||||
const openBrowser = require('react-dev-utils/openBrowser');
|
||||
const paths = require('../config/paths');
|
||||
const config = require('../config/webpack.config.dev');
|
||||
const createDevServerConfig = require('../config/webpackDevServer.config');
|
||||
|
||||
const useYarn = fs.existsSync(paths.yarnLockFile);
|
||||
const isInteractive = process.stdout.isTTY;
|
||||
|
||||
const portSetting = require(paths.appPackageJson).port
|
||||
if ( portSetting ) {
|
||||
process.env.port = portSetting
|
||||
}
|
||||
|
||||
// Warn and crash if required files are missing
|
||||
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Tools like Cloud9 rely on this.
|
||||
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3007;
|
||||
const HOST = process.env.HOST || '0.0.0.0';
|
||||
|
||||
if (process.env.HOST) {
|
||||
console.log(
|
||||
chalk.cyan(
|
||||
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
||||
chalk.bold(process.env.HOST)
|
||||
)}`
|
||||
)
|
||||
);
|
||||
console.log(
|
||||
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
|
||||
);
|
||||
console.log(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`);
|
||||
console.log();
|
||||
}
|
||||
|
||||
// We attempt to use the default port but if it is busy, we offer the user to
|
||||
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
||||
choosePort(HOST, DEFAULT_PORT)
|
||||
.then(port => {
|
||||
if (port == null) {
|
||||
// We have not found a port.
|
||||
return;
|
||||
}
|
||||
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
||||
const appName = require(paths.appPackageJson).name;
|
||||
const urls = prepareUrls(protocol, HOST, port);
|
||||
// Create a webpack compiler that is configured with custom messages.
|
||||
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
|
||||
// Load proxy config
|
||||
const proxySetting = require(paths.appPackageJson).proxy;
|
||||
console.log('-------------------------proxySetting:', proxySetting)
|
||||
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
|
||||
// Serve webpack assets generated by the compiler over a web sever.
|
||||
const serverConfig = createDevServerConfig(
|
||||
proxyConfig,
|
||||
urls.lanUrlForConfig
|
||||
);
|
||||
const devServer = new WebpackDevServer(compiler, serverConfig);
|
||||
// Launch WebpackDevServer.
|
||||
devServer.listen(port, HOST, err => {
|
||||
if (err) {
|
||||
return console.log(err);
|
||||
}
|
||||
if (isInteractive) {
|
||||
clearConsole();
|
||||
}
|
||||
console.log(chalk.cyan('Starting the development server...\n'));
|
||||
openBrowser(urls.localUrlForBrowser);
|
||||
});
|
||||
|
||||
['SIGINT', 'SIGTERM'].forEach(function(sig) {
|
||||
process.on(sig, function() {
|
||||
devServer.close();
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
if (err && err.message) {
|
||||
console.log(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -1,8 +1,8 @@
|
||||
export function isDev() {
|
||||
return window.location.port === "3007";
|
||||
}
|
||||
|
||||
// const isMobile
|
||||
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
||||
|
||||
// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
|
||||
export function isDev() {
|
||||
return window.location.port === "3007";
|
||||
}
|
||||
|
||||
// const isMobile
|
||||
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
||||
|
||||
// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,53 +1,54 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Collaborators from './shixunchild/Collaborators/Collaborators'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMCollaborators extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
></TPMNav>
|
||||
<Collaborators
|
||||
{...this.props}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMCollaborators;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Collaborators from './shixunchild/Collaborators/Collaborators'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMCollaborators extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
<Collaborators
|
||||
{...this.props}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMCollaborators;
|
||||
|
@ -1,47 +1,47 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMCollaborators from './TPMCollaborators'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMChallengeContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// this.props.showShixun();
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMCollaborators
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
|
||||
>
|
||||
</TPMCollaborators>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMChallengeContainer;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMCollaborators from './TPMCollaborators'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMChallengeContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// this.props.showShixun();
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMCollaborators
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
>
|
||||
</TPMCollaborators>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMChallengeContainer;
|
||||
|
@ -1,50 +1,50 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMForklist from './TPMForklist'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMRanking_listContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
tpmLoading: true,
|
||||
creator: {
|
||||
owner_id: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.showShixun();
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMForklist
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
|
||||
>
|
||||
</TPMForklist>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRanking_listContainer;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMForklist from './TPMForklist'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMRanking_listContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
tpmLoading: true,
|
||||
creator: {
|
||||
owner_id: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.showShixun();
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMForklist
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
>
|
||||
</TPMForklist>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRanking_listContainer;
|
||||
|
@ -1,63 +1,64 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Shixunfork_list from './shixunchild/Shixunfork_list'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMForklist extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
></TPMNav>
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||
|
||||
<Shixunfork_list/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMForklist;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Shixunfork_list from './shixunchild/Shixunfork_list'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMForklist extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||
|
||||
<Shixunfork_list/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMForklist;
|
||||
|
@ -1,74 +1,75 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Propaedeutics from './shixunchild/Propaedeutics/Propaedeu_tics'
|
||||
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMPropaedeutics extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
shixunId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
// <Comments
|
||||
// {...this.props}
|
||||
// user={_user}
|
||||
// onPaginationChange={this.onPaginationChange}
|
||||
// ></Comments>
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.state}
|
||||
{...this.props}
|
||||
/>
|
||||
|
||||
<Propaedeutics
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMPropaedeutics;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Propaedeutics from './shixunchild/Propaedeutics/Propaedeu_tics'
|
||||
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMPropaedeutics extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
shixunId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
// <Comments
|
||||
// {...this.props}
|
||||
// user={_user}
|
||||
// onPaginationChange={this.onPaginationChange}
|
||||
// ></Comments>
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.state}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
/>
|
||||
|
||||
<Propaedeutics
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMPropaedeutics;
|
||||
|
@ -1,39 +1,40 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMPropaedeutics from './TPMPropaedeutics'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMPropaedeuticsComponent extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
// tpmLoading: true,
|
||||
// creator: {
|
||||
// owner_id: ''
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMPropaedeutics
|
||||
{...this.props}
|
||||
>
|
||||
</TPMPropaedeutics>
|
||||
}
|
||||
</React.Fragment>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMPropaedeuticsComponent ;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMPropaedeutics from './TPMPropaedeutics'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMPropaedeuticsComponent extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
// tpmLoading: true,
|
||||
// creator: {
|
||||
// owner_id: ''
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMPropaedeutics
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
>
|
||||
</TPMPropaedeutics>
|
||||
}
|
||||
</React.Fragment>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMPropaedeuticsComponent ;
|
||||
|
@ -1,59 +1,60 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Ranking_list from './shixunchild/Ranking_list/Ranking_list'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMRanking_list extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
|
||||
// <Comments
|
||||
// {...this.props}
|
||||
// user={_user}
|
||||
// onPaginationChange={this.onPaginationChange}
|
||||
// ></Comments>
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
></TPMNav>
|
||||
|
||||
<Ranking_list
|
||||
{...this.props}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRanking_list;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Ranking_list from './shixunchild/Ranking_list/Ranking_list'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMRanking_list extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
|
||||
// <Comments
|
||||
// {...this.props}
|
||||
// user={_user}
|
||||
// onPaginationChange={this.onPaginationChange}
|
||||
// ></Comments>
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
|
||||
<Ranking_list
|
||||
{...this.props}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRanking_list;
|
||||
|
@ -1,37 +1,40 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMRanking_list from './TPMRanking_list'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMRanking_listContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMRanking_list
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
>
|
||||
</TPMRanking_list>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRanking_listContainer;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMRanking_list from './TPMRanking_list'
|
||||
|
||||
import axios from 'axios';
|
||||
import TPMNav from "./component/TPMNav";
|
||||
|
||||
class TPMRanking_listContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMRanking_list
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
|
||||
>
|
||||
</TPMRanking_list>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRanking_listContainer;
|
||||
|
@ -1,58 +1,59 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Repository from './shixunchild/Repository/Repository'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
// import RepositoryChooseModal from './component/modal/RepositoryChooseModal'
|
||||
|
||||
class TPMRepository extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match, isContentWidth100
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
||||
<div className={`${isContentWidth100 ? 'width100': 'with65'} fl edu-back-white`}
|
||||
style={{background: 'transparent'}}>
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
></TPMNav>
|
||||
{/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */}
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||
<Repository
|
||||
{...this.props}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
|
||||
{ !isContentWidth100 && <div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRepository;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import Repository from './shixunchild/Repository/Repository'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
// import RepositoryChooseModal from './component/modal/RepositoryChooseModal'
|
||||
|
||||
class TPMRepository extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match, isContentWidth100
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
||||
<div className={`${isContentWidth100 ? 'width100': 'with65'} fl edu-back-white`}
|
||||
style={{background: 'transparent'}}>
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
{/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */}
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||
<Repository
|
||||
{...this.props}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
|
||||
{ !isContentWidth100 && <div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMRepository;
|
||||
|
@ -1,72 +1,73 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import ShixunDiscuss from './shixunchild/ShixunDiscuss/ShixunDiscuss'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
import Comments from '../comment/Comments'
|
||||
import { commentHOC } from '../comment/CommentsHOC'
|
||||
|
||||
class TPMShixunDiscuss extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// TODO 加了HOC后 mount了两次
|
||||
this.props.fetchCommentIfNotFetched &&
|
||||
this.props.fetchCommentIfNotFetched();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
></TPMNav>
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||
<Comments
|
||||
{...this.props}
|
||||
user={user}
|
||||
showHiddenButton={true}
|
||||
></Comments>
|
||||
// onPaginationChange={this.onPaginationChange}
|
||||
// <ShixunDiscuss
|
||||
// {...this.props}
|
||||
// />
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default commentHOC ( TPMShixunDiscuss );
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import './TPMShixunDiscuss.css'
|
||||
|
||||
import ShixunDiscuss from './shixunchild/ShixunDiscuss/ShixunDiscuss'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
import Comments from '../comment/Comments'
|
||||
import { commentHOC } from '../comment/CommentsHOC'
|
||||
|
||||
class TPMShixunDiscuss extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// TODO 加了HOC后 mount了两次
|
||||
this.props.fetchCommentIfNotFetched &&
|
||||
this.props.fetchCommentIfNotFetched();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||
<Comments
|
||||
{...this.props}
|
||||
user={user}
|
||||
showHiddenButton={true}
|
||||
></Comments>
|
||||
// onPaginationChange={this.onPaginationChange}
|
||||
// <ShixunDiscuss
|
||||
// {...this.props}
|
||||
// />
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default commentHOC ( TPMShixunDiscuss );
|
||||
|
@ -1,45 +1,45 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMShixunDiscuss from './TPMShixunDiscuss'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMShixunDiscussContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMShixunDiscuss
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
|
||||
>
|
||||
</TPMShixunDiscuss>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMShixunDiscussContainer;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import TPMShixunDiscuss from './TPMShixunDiscuss'
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
class TPMShixunDiscussContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps, newContext) {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { tpmLoading } = this.props;
|
||||
const user = this.props.current_user;
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||
<TPMShixunDiscuss
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
user={user}
|
||||
aboutFocus={this.props.aboutFocus}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
>
|
||||
</TPMShixunDiscuss>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMShixunDiscussContainer;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,145 +1,146 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
import TPMNav from '../../component/TPMNav'
|
||||
import TPMRightSection from '../../component/TPMRightSection'
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import { trace_collapse } from 'educoder'
|
||||
const $ = window.$;
|
||||
|
||||
// 点击按钮复制功能
|
||||
function jsCopy(){
|
||||
var e = document.getElementById("copy_rep_content");
|
||||
e.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
class TPMRepositoryCommits extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
RepositoryList: undefined,
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
let id = this.props.match.params.shixunId;
|
||||
|
||||
let collaborators=`/shixuns/`+id+`/commits.json`;
|
||||
axios.post(collaborators, {
|
||||
secret_repository: this.props.secret_repository_tab
|
||||
}).then((response)=> {
|
||||
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
RepositoryList: response.data
|
||||
});
|
||||
}
|
||||
trace_collapse('repo commits res', response.data)
|
||||
|
||||
}).catch((error)=>{
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
}
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
let { RepositoryList } = this.state;
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent"
|
||||
style={{background: 'transparent'}}>
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
></TPMNav>
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3}
|
||||
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/>
|
||||
:
|
||||
|
||||
<div className="" >
|
||||
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
||||
<span className="fl"><i className="iconfont icon-tijiaojilu mr5"></i>
|
||||
提交记录
|
||||
</span>
|
||||
{/* 35 */}
|
||||
<span className="color-grey-9 fr">
|
||||
<Link to={`/shixuns/${match.params.shixunId}/repository/${match.params.repoId}`}
|
||||
className="font-14 color-grey-9">返回</Link>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
{`
|
||||
a.pullreques_name:hover {
|
||||
color: #666 !important
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
||||
<ul className="pullreques_pull_list">
|
||||
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
||||
return (
|
||||
<li className="clear" key={ key }>
|
||||
<a
|
||||
style={{ cursor: 'inherit' }}
|
||||
className="fl color-grey-6 font-16 pullreques_name task-hide"
|
||||
target="_blank">{item.email}</a>
|
||||
<p className="pullreques_pull_txt ml10 fl" style={{lineHeight: '32px'}}>
|
||||
{item.title}
|
||||
</p>
|
||||
<a style={{ cursor: 'inherit' }}
|
||||
className="fr mr15 color-blue">{item.time}</a>
|
||||
|
||||
<div className="cl"></div>
|
||||
</li>)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
||||
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
|
||||
return (
|
||||
<div>
|
||||
<div>{item.email}</div>
|
||||
<div>{item.title}</div>
|
||||
<div>{item.id}</div>
|
||||
<div>{item.time}</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
*/
|
||||
export default TPMRepositoryCommits;
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
import TPMNav from '../../component/TPMNav'
|
||||
import TPMRightSection from '../../component/TPMRightSection'
|
||||
import { CircularProgress } from 'material-ui/Progress';
|
||||
|
||||
import { trace_collapse } from 'educoder'
|
||||
const $ = window.$;
|
||||
|
||||
// 点击按钮复制功能
|
||||
function jsCopy(){
|
||||
var e = document.getElementById("copy_rep_content");
|
||||
e.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
class TPMRepositoryCommits extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
RepositoryList: undefined,
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
let id = this.props.match.params.shixunId;
|
||||
|
||||
let collaborators=`/shixuns/`+id+`/commits.json`;
|
||||
axios.post(collaborators, {
|
||||
secret_repository: this.props.secret_repository_tab
|
||||
}).then((response)=> {
|
||||
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
RepositoryList: response.data
|
||||
});
|
||||
}
|
||||
trace_collapse('repo commits res', response.data)
|
||||
|
||||
}).catch((error)=>{
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
}
|
||||
render() {
|
||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||
aboutFocus, user, match
|
||||
} = this.props;
|
||||
let { RepositoryList } = this.state;
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent"
|
||||
style={{background: 'transparent'}}>
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
{ loadingContent ?
|
||||
<CircularProgress size={40} thickness={3}
|
||||
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/>
|
||||
:
|
||||
|
||||
<div className="" >
|
||||
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
||||
<span className="fl"><i className="iconfont icon-tijiaojilu mr5"></i>
|
||||
提交记录
|
||||
</span>
|
||||
{/* 35 */}
|
||||
<span className="color-grey-9 fr">
|
||||
<Link to={`/shixuns/${match.params.shixunId}/repository/${match.params.repoId}`}
|
||||
className="font-14 color-grey-9">返回</Link>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
{`
|
||||
a.pullreques_name:hover {
|
||||
color: #666 !important
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
||||
<ul className="pullreques_pull_list">
|
||||
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
||||
return (
|
||||
<li className="clear" key={ key }>
|
||||
<a
|
||||
style={{ cursor: 'inherit' }}
|
||||
className="fl color-grey-6 font-16 pullreques_name task-hide"
|
||||
target="_blank">{item.email}</a>
|
||||
<p className="pullreques_pull_txt ml10 fl" style={{lineHeight: '32px'}}>
|
||||
{item.title}
|
||||
</p>
|
||||
<a style={{ cursor: 'inherit' }}
|
||||
className="fr mr15 color-blue">{item.time}</a>
|
||||
|
||||
<div className="cl"></div>
|
||||
</li>)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection {...this.props}></TPMRightSection>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
||||
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
|
||||
return (
|
||||
<div>
|
||||
<div>{item.email}</div>
|
||||
<div>{item.title}</div>
|
||||
<div>{item.id}</div>
|
||||
<div>{item.time}</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
*/
|
||||
export default TPMRepositoryCommits;
|
||||
|
Loading…
Reference in new issue