commit
0af155697a
@ -1,4 +1,6 @@
|
|||||||
class ShixunServiceConfig < ApplicationRecord
|
class ShixunServiceConfig < ApplicationRecord
|
||||||
belongs_to :shixun
|
belongs_to :shixun
|
||||||
belongs_to :mirror_repository
|
belongs_to :mirror_repository
|
||||||
|
|
||||||
|
validates_presence_of :shixun_id, :mirror_repository_id
|
||||||
end
|
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
|
#!/usr/bin/env ruby
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||||
load Gem.bin_path('bundler', 'bundle')
|
load Gem.bin_path('bundler', 'bundle')
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||||
require_relative '../config/boot'
|
require_relative '../config/boot'
|
||||||
require 'rails/commands'
|
require 'rails/commands'
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require_relative '../config/boot'
|
require_relative '../config/boot'
|
||||||
require 'rake'
|
|
||||||
Rake.application.run
|
|
||||||
|
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';
|
'use strict';
|
||||||
|
|
||||||
// Do this as the first thing so that any code reading it knows the right env.
|
// Do this as the first thing so that any code reading it knows the right env.
|
||||||
process.env.BABEL_ENV = 'development';
|
process.env.BABEL_ENV = 'development';
|
||||||
process.env.NODE_ENV = 'development';
|
process.env.NODE_ENV = 'development';
|
||||||
|
|
||||||
|
|
||||||
// Makes the script crash on unhandled rejections instead of silently
|
// Makes the script crash on unhandled rejections instead of silently
|
||||||
// ignoring them. In the future, promise rejections that are not handled will
|
// ignoring them. In the future, promise rejections that are not handled will
|
||||||
// terminate the Node.js process with a non-zero exit code.
|
// terminate the Node.js process with a non-zero exit code.
|
||||||
process.on('unhandledRejection', err => {
|
process.on('unhandledRejection', err => {
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ensure environment variables are read.
|
// Ensure environment variables are read.
|
||||||
require('../config/env');
|
require('../config/env');
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const WebpackDevServer = require('webpack-dev-server');
|
const WebpackDevServer = require('webpack-dev-server');
|
||||||
const clearConsole = require('react-dev-utils/clearConsole');
|
const clearConsole = require('react-dev-utils/clearConsole');
|
||||||
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
||||||
const {
|
const {
|
||||||
choosePort,
|
choosePort,
|
||||||
createCompiler,
|
createCompiler,
|
||||||
prepareProxy,
|
prepareProxy,
|
||||||
prepareUrls,
|
prepareUrls,
|
||||||
} = require('react-dev-utils/WebpackDevServerUtils');
|
} = require('react-dev-utils/WebpackDevServerUtils');
|
||||||
const openBrowser = require('react-dev-utils/openBrowser');
|
const openBrowser = require('react-dev-utils/openBrowser');
|
||||||
const paths = require('../config/paths');
|
const paths = require('../config/paths');
|
||||||
const config = require('../config/webpack.config.dev');
|
const config = require('../config/webpack.config.dev');
|
||||||
const createDevServerConfig = require('../config/webpackDevServer.config');
|
const createDevServerConfig = require('../config/webpackDevServer.config');
|
||||||
|
|
||||||
const useYarn = fs.existsSync(paths.yarnLockFile);
|
const useYarn = fs.existsSync(paths.yarnLockFile);
|
||||||
const isInteractive = process.stdout.isTTY;
|
const isInteractive = process.stdout.isTTY;
|
||||||
|
|
||||||
const portSetting = require(paths.appPackageJson).port
|
const portSetting = require(paths.appPackageJson).port
|
||||||
if ( portSetting ) {
|
if ( portSetting ) {
|
||||||
process.env.port = portSetting
|
process.env.port = portSetting
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warn and crash if required files are missing
|
// Warn and crash if required files are missing
|
||||||
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tools like Cloud9 rely on this.
|
// Tools like Cloud9 rely on this.
|
||||||
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3007;
|
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3007;
|
||||||
const HOST = process.env.HOST || '0.0.0.0';
|
const HOST = process.env.HOST || '0.0.0.0';
|
||||||
|
|
||||||
if (process.env.HOST) {
|
if (process.env.HOST) {
|
||||||
console.log(
|
console.log(
|
||||||
chalk.cyan(
|
chalk.cyan(
|
||||||
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
||||||
chalk.bold(process.env.HOST)
|
chalk.bold(process.env.HOST)
|
||||||
)}`
|
)}`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
console.log(
|
console.log(
|
||||||
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
|
`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(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`);
|
||||||
console.log();
|
console.log();
|
||||||
}
|
}
|
||||||
|
|
||||||
// We attempt to use the default port but if it is busy, we offer the user to
|
// 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.
|
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
||||||
choosePort(HOST, DEFAULT_PORT)
|
choosePort(HOST, DEFAULT_PORT)
|
||||||
.then(port => {
|
.then(port => {
|
||||||
if (port == null) {
|
if (port == null) {
|
||||||
// We have not found a port.
|
// We have not found a port.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
||||||
const appName = require(paths.appPackageJson).name;
|
const appName = require(paths.appPackageJson).name;
|
||||||
const urls = prepareUrls(protocol, HOST, port);
|
const urls = prepareUrls(protocol, HOST, port);
|
||||||
// Create a webpack compiler that is configured with custom messages.
|
// Create a webpack compiler that is configured with custom messages.
|
||||||
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
|
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
|
||||||
// Load proxy config
|
// Load proxy config
|
||||||
const proxySetting = require(paths.appPackageJson).proxy;
|
const proxySetting = require(paths.appPackageJson).proxy;
|
||||||
console.log('-------------------------proxySetting:', proxySetting)
|
console.log('-------------------------proxySetting:', proxySetting)
|
||||||
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
|
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
|
||||||
// Serve webpack assets generated by the compiler over a web sever.
|
// Serve webpack assets generated by the compiler over a web sever.
|
||||||
const serverConfig = createDevServerConfig(
|
const serverConfig = createDevServerConfig(
|
||||||
proxyConfig,
|
proxyConfig,
|
||||||
urls.lanUrlForConfig
|
urls.lanUrlForConfig
|
||||||
);
|
);
|
||||||
const devServer = new WebpackDevServer(compiler, serverConfig);
|
const devServer = new WebpackDevServer(compiler, serverConfig);
|
||||||
// Launch WebpackDevServer.
|
// Launch WebpackDevServer.
|
||||||
devServer.listen(port, HOST, err => {
|
devServer.listen(port, HOST, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return console.log(err);
|
return console.log(err);
|
||||||
}
|
}
|
||||||
if (isInteractive) {
|
if (isInteractive) {
|
||||||
clearConsole();
|
clearConsole();
|
||||||
}
|
}
|
||||||
console.log(chalk.cyan('Starting the development server...\n'));
|
console.log(chalk.cyan('Starting the development server...\n'));
|
||||||
openBrowser(urls.localUrlForBrowser);
|
openBrowser(urls.localUrlForBrowser);
|
||||||
});
|
});
|
||||||
|
|
||||||
['SIGINT', 'SIGTERM'].forEach(function(sig) {
|
['SIGINT', 'SIGTERM'].forEach(function(sig) {
|
||||||
process.on(sig, function() {
|
process.on(sig, function() {
|
||||||
devServer.close();
|
devServer.close();
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (err && err.message) {
|
if (err && err.message) {
|
||||||
console.log(err.message);
|
console.log(err.message);
|
||||||
}
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
export function isDev() {
|
export function isDev() {
|
||||||
return window.location.port === "3007";
|
return window.location.port === "3007";
|
||||||
}
|
}
|
||||||
|
|
||||||
// const isMobile
|
// const isMobile
|
||||||
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
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()));
|
// 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 React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import './TPMShixunDiscuss.css'
|
import './TPMShixunDiscuss.css'
|
||||||
|
|
||||||
import Collaborators from './shixunchild/Collaborators/Collaborators'
|
import Collaborators from './shixunchild/Collaborators/Collaborators'
|
||||||
import TPMRightSection from './component/TPMRightSection'
|
import TPMRightSection from './component/TPMRightSection'
|
||||||
import TPMNav from './component/TPMNav'
|
import TPMNav from './component/TPMNav'
|
||||||
|
|
||||||
class TPMCollaborators extends Component {
|
class TPMCollaborators extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match
|
aboutFocus, user, match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="educontent clearfix mt30 mb80">
|
<div className="educontent clearfix mt30 mb80">
|
||||||
|
|
||||||
<div className="with65 fl edu-back-white" >
|
<div className="with65 fl edu-back-white" >
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
></TPMNav>
|
is_jupyter={this.props.is_jupyter}
|
||||||
<Collaborators
|
></TPMNav>
|
||||||
{...this.props}
|
<Collaborators
|
||||||
/>
|
{...this.props}
|
||||||
|
/>
|
||||||
</div>
|
|
||||||
|
</div>
|
||||||
<div className="with35 fr pl20">
|
|
||||||
<TPMRightSection
|
<div className="with35 fr pl20">
|
||||||
{...this.props}
|
<TPMRightSection
|
||||||
/>
|
{...this.props}
|
||||||
</div>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default TPMCollaborators;
|
|
||||||
|
export default TPMCollaborators;
|
||||||
|
@ -1,47 +1,47 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import TPMCollaborators from './TPMCollaborators'
|
import TPMCollaborators from './TPMCollaborators'
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
class TPMChallengeContainer extends Component {
|
class TPMChallengeContainer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// this.props.showShixun();
|
// this.props.showShixun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { tpmLoading } = this.props;
|
const { tpmLoading } = this.props;
|
||||||
const user = this.props.current_user;
|
const user = this.props.current_user;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||||
<TPMCollaborators
|
<TPMCollaborators
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
user={user}
|
user={user}
|
||||||
aboutFocus={this.props.aboutFocus}
|
aboutFocus={this.props.aboutFocus}
|
||||||
|
is_jupyter={this.props.is_jupyter}
|
||||||
>
|
>
|
||||||
</TPMCollaborators>
|
</TPMCollaborators>
|
||||||
}
|
}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TPMChallengeContainer;
|
export default TPMChallengeContainer;
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import TPMForklist from './TPMForklist'
|
import TPMForklist from './TPMForklist'
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
class TPMRanking_listContainer extends Component {
|
class TPMRanking_listContainer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
tpmLoading: true,
|
tpmLoading: true,
|
||||||
creator: {
|
creator: {
|
||||||
owner_id: ''
|
owner_id: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.showShixun();
|
this.props.showShixun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { tpmLoading } = this.props;
|
const { tpmLoading } = this.props;
|
||||||
const user = this.props.current_user;
|
const user = this.props.current_user;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||||
<TPMForklist
|
<TPMForklist
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
user={user}
|
user={user}
|
||||||
aboutFocus={this.props.aboutFocus}
|
aboutFocus={this.props.aboutFocus}
|
||||||
|
is_jupyter={this.props.is_jupyter}
|
||||||
>
|
>
|
||||||
</TPMForklist>
|
</TPMForklist>
|
||||||
}
|
}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TPMRanking_listContainer;
|
export default TPMRanking_listContainer;
|
||||||
|
@ -1,63 +1,64 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import './TPMShixunDiscuss.css'
|
import './TPMShixunDiscuss.css'
|
||||||
|
|
||||||
import Shixunfork_list from './shixunchild/Shixunfork_list'
|
import Shixunfork_list from './shixunchild/Shixunfork_list'
|
||||||
import TPMRightSection from './component/TPMRightSection'
|
import TPMRightSection from './component/TPMRightSection'
|
||||||
import TPMNav from './component/TPMNav'
|
import TPMNav from './component/TPMNav'
|
||||||
|
|
||||||
class TPMForklist extends Component {
|
class TPMForklist extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match
|
aboutFocus, user, match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||||
|
|
||||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
></TPMNav>
|
is_jupyter={this.props.is_jupyter}
|
||||||
{ loadingContent ?
|
></TPMNav>
|
||||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
{ loadingContent ?
|
||||||
|
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||||
<Shixunfork_list/>
|
|
||||||
}
|
<Shixunfork_list/>
|
||||||
</div>
|
}
|
||||||
|
</div>
|
||||||
<div className="with35 fr pl20">
|
|
||||||
<TPMRightSection {...this.props}></TPMRightSection>
|
<div className="with35 fr pl20">
|
||||||
</div>
|
<TPMRightSection {...this.props}></TPMRightSection>
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default TPMForklist;
|
|
||||||
|
export default TPMForklist;
|
||||||
|
@ -1,74 +1,75 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import './TPMShixunDiscuss.css'
|
import './TPMShixunDiscuss.css'
|
||||||
|
|
||||||
import Propaedeutics from './shixunchild/Propaedeutics/Propaedeu_tics'
|
import Propaedeutics from './shixunchild/Propaedeutics/Propaedeu_tics'
|
||||||
|
|
||||||
import TPMRightSection from './component/TPMRightSection'
|
import TPMRightSection from './component/TPMRightSection'
|
||||||
|
|
||||||
import TPMNav from './component/TPMNav'
|
import TPMNav from './component/TPMNav'
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
class TPMPropaedeutics extends Component {
|
class TPMPropaedeutics extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
shixunId: undefined
|
shixunId: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match
|
aboutFocus, user, match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
// <Comments
|
// <Comments
|
||||||
// {...this.props}
|
// {...this.props}
|
||||||
// user={_user}
|
// user={_user}
|
||||||
// onPaginationChange={this.onPaginationChange}
|
// onPaginationChange={this.onPaginationChange}
|
||||||
// ></Comments>
|
// ></Comments>
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||||
|
|
||||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
/>
|
is_jupyter={this.props.is_jupyter}
|
||||||
|
/>
|
||||||
<Propaedeutics
|
|
||||||
{...this.props}
|
<Propaedeutics
|
||||||
{...this.state}
|
{...this.props}
|
||||||
/>
|
{...this.state}
|
||||||
|
/>
|
||||||
</div>
|
|
||||||
|
</div>
|
||||||
<div className="with35 fr pl20">
|
|
||||||
<TPMRightSection {...this.props}></TPMRightSection>
|
<div className="with35 fr pl20">
|
||||||
</div>
|
<TPMRightSection {...this.props}></TPMRightSection>
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default TPMPropaedeutics;
|
|
||||||
|
export default TPMPropaedeutics;
|
||||||
|
@ -1,39 +1,40 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import TPMPropaedeutics from './TPMPropaedeutics'
|
import TPMPropaedeutics from './TPMPropaedeutics'
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
class TPMPropaedeuticsComponent extends Component {
|
class TPMPropaedeuticsComponent extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
// tpmLoading: true,
|
// tpmLoading: true,
|
||||||
// creator: {
|
// creator: {
|
||||||
// owner_id: ''
|
// owner_id: ''
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { tpmLoading } = this.props;
|
const { tpmLoading } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||||
<TPMPropaedeutics
|
<TPMPropaedeutics
|
||||||
{...this.props}
|
{...this.props}
|
||||||
>
|
is_jupyter={this.props.is_jupyter}
|
||||||
</TPMPropaedeutics>
|
>
|
||||||
}
|
</TPMPropaedeutics>
|
||||||
</React.Fragment>
|
}
|
||||||
|
</React.Fragment>
|
||||||
|
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default TPMPropaedeuticsComponent ;
|
|
||||||
|
export default TPMPropaedeuticsComponent ;
|
||||||
|
@ -1,59 +1,60 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import './TPMShixunDiscuss.css'
|
import './TPMShixunDiscuss.css'
|
||||||
|
|
||||||
import Ranking_list from './shixunchild/Ranking_list/Ranking_list'
|
import Ranking_list from './shixunchild/Ranking_list/Ranking_list'
|
||||||
import TPMRightSection from './component/TPMRightSection'
|
import TPMRightSection from './component/TPMRightSection'
|
||||||
import TPMNav from './component/TPMNav'
|
import TPMNav from './component/TPMNav'
|
||||||
|
|
||||||
class TPMRanking_list extends Component {
|
class TPMRanking_list extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match
|
aboutFocus, user, match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
// <Comments
|
// <Comments
|
||||||
// {...this.props}
|
// {...this.props}
|
||||||
// user={_user}
|
// user={_user}
|
||||||
// onPaginationChange={this.onPaginationChange}
|
// onPaginationChange={this.onPaginationChange}
|
||||||
// ></Comments>
|
// ></Comments>
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||||
|
|
||||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||||
|
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
></TPMNav>
|
is_jupyter={this.props.is_jupyter}
|
||||||
|
></TPMNav>
|
||||||
<Ranking_list
|
|
||||||
{...this.props}
|
<Ranking_list
|
||||||
/>
|
{...this.props}
|
||||||
|
/>
|
||||||
</div>
|
|
||||||
|
</div>
|
||||||
<div className="with35 fr pl20">
|
|
||||||
<TPMRightSection {...this.props}></TPMRightSection>
|
<div className="with35 fr pl20">
|
||||||
</div>
|
<TPMRightSection {...this.props}></TPMRightSection>
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default TPMRanking_list;
|
|
||||||
|
export default TPMRanking_list;
|
||||||
|
@ -1,37 +1,40 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import TPMRanking_list from './TPMRanking_list'
|
import TPMRanking_list from './TPMRanking_list'
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import TPMNav from "./component/TPMNav";
|
||||||
class TPMRanking_listContainer extends Component {
|
|
||||||
constructor(props) {
|
class TPMRanking_listContainer extends Component {
|
||||||
super(props)
|
constructor(props) {
|
||||||
this.state = {
|
super(props)
|
||||||
}
|
this.state = {
|
||||||
}
|
}
|
||||||
|
}
|
||||||
render() {
|
|
||||||
const { tpmLoading } = this.props;
|
render() {
|
||||||
const user = this.props.current_user;
|
const { tpmLoading } = this.props;
|
||||||
|
const user = this.props.current_user;
|
||||||
return (
|
|
||||||
<React.Fragment>
|
return (
|
||||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
<React.Fragment>
|
||||||
<TPMRanking_list
|
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||||
{...this.props}
|
<TPMRanking_list
|
||||||
{...this.state}
|
{...this.props}
|
||||||
user={user}
|
{...this.state}
|
||||||
aboutFocus={this.props.aboutFocus}
|
user={user}
|
||||||
>
|
aboutFocus={this.props.aboutFocus}
|
||||||
</TPMRanking_list>
|
is_jupyter={this.props.is_jupyter}
|
||||||
}
|
|
||||||
</React.Fragment>
|
>
|
||||||
);
|
</TPMRanking_list>
|
||||||
}
|
}
|
||||||
}
|
</React.Fragment>
|
||||||
|
);
|
||||||
export default TPMRanking_listContainer;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TPMRanking_listContainer;
|
||||||
|
@ -1,58 +1,59 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import './TPMShixunDiscuss.css'
|
import './TPMShixunDiscuss.css'
|
||||||
|
|
||||||
import Repository from './shixunchild/Repository/Repository'
|
import Repository from './shixunchild/Repository/Repository'
|
||||||
import TPMRightSection from './component/TPMRightSection'
|
import TPMRightSection from './component/TPMRightSection'
|
||||||
import TPMNav from './component/TPMNav'
|
import TPMNav from './component/TPMNav'
|
||||||
|
|
||||||
// import RepositoryChooseModal from './component/modal/RepositoryChooseModal'
|
// import RepositoryChooseModal from './component/modal/RepositoryChooseModal'
|
||||||
|
|
||||||
class TPMRepository extends Component {
|
class TPMRepository extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match, isContentWidth100
|
aboutFocus, user, match, isContentWidth100
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||||
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
||||||
<div className={`${isContentWidth100 ? 'width100': 'with65'} fl edu-back-white`}
|
<div className={`${isContentWidth100 ? 'width100': 'with65'} fl edu-back-white`}
|
||||||
style={{background: 'transparent'}}>
|
style={{background: 'transparent'}}>
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
></TPMNav>
|
is_jupyter={this.props.is_jupyter}
|
||||||
{/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */}
|
></TPMNav>
|
||||||
{ loadingContent ?
|
{/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */}
|
||||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
{ loadingContent ?
|
||||||
<Repository
|
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||||
{...this.props}
|
<Repository
|
||||||
/>
|
{...this.props}
|
||||||
}
|
/>
|
||||||
</div>
|
}
|
||||||
|
</div>
|
||||||
{ !isContentWidth100 && <div className="with35 fr pl20">
|
|
||||||
<TPMRightSection {...this.props}></TPMRightSection>
|
{ !isContentWidth100 && <div className="with35 fr pl20">
|
||||||
</div>}
|
<TPMRightSection {...this.props}></TPMRightSection>
|
||||||
</div>
|
</div>}
|
||||||
</React.Fragment>
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default TPMRepository;
|
|
||||||
|
export default TPMRepository;
|
||||||
|
@ -1,72 +1,73 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import './TPMShixunDiscuss.css'
|
import './TPMShixunDiscuss.css'
|
||||||
|
|
||||||
import ShixunDiscuss from './shixunchild/ShixunDiscuss/ShixunDiscuss'
|
import ShixunDiscuss from './shixunchild/ShixunDiscuss/ShixunDiscuss'
|
||||||
import TPMRightSection from './component/TPMRightSection'
|
import TPMRightSection from './component/TPMRightSection'
|
||||||
import TPMNav from './component/TPMNav'
|
import TPMNav from './component/TPMNav'
|
||||||
|
|
||||||
import Comments from '../comment/Comments'
|
import Comments from '../comment/Comments'
|
||||||
import { commentHOC } from '../comment/CommentsHOC'
|
import { commentHOC } from '../comment/CommentsHOC'
|
||||||
|
|
||||||
class TPMShixunDiscuss extends Component {
|
class TPMShixunDiscuss extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// TODO 加了HOC后 mount了两次
|
// TODO 加了HOC后 mount了两次
|
||||||
this.props.fetchCommentIfNotFetched &&
|
this.props.fetchCommentIfNotFetched &&
|
||||||
this.props.fetchCommentIfNotFetched();
|
this.props.fetchCommentIfNotFetched();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match
|
aboutFocus, user, match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||||
|
|
||||||
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
<div className="with65 fl edu-back-white commentsDelegateParent" >
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
></TPMNav>
|
is_jupyter={this.props.is_jupyter}
|
||||||
{ loadingContent ?
|
></TPMNav>
|
||||||
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
{ loadingContent ?
|
||||||
<Comments
|
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
|
||||||
{...this.props}
|
<Comments
|
||||||
user={user}
|
{...this.props}
|
||||||
showHiddenButton={true}
|
user={user}
|
||||||
></Comments>
|
showHiddenButton={true}
|
||||||
// onPaginationChange={this.onPaginationChange}
|
></Comments>
|
||||||
// <ShixunDiscuss
|
// onPaginationChange={this.onPaginationChange}
|
||||||
// {...this.props}
|
// <ShixunDiscuss
|
||||||
// />
|
// {...this.props}
|
||||||
}
|
// />
|
||||||
</div>
|
}
|
||||||
|
</div>
|
||||||
<div className="with35 fr pl20">
|
|
||||||
<TPMRightSection {...this.props}></TPMRightSection>
|
<div className="with35 fr pl20">
|
||||||
</div>
|
<TPMRightSection {...this.props}></TPMRightSection>
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default commentHOC ( TPMShixunDiscuss );
|
|
||||||
|
export default commentHOC ( TPMShixunDiscuss );
|
||||||
|
@ -1,45 +1,45 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import TPMShixunDiscuss from './TPMShixunDiscuss'
|
import TPMShixunDiscuss from './TPMShixunDiscuss'
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
class TPMShixunDiscussContainer extends Component {
|
class TPMShixunDiscussContainer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { tpmLoading } = this.props;
|
const { tpmLoading } = this.props;
|
||||||
const user = this.props.current_user;
|
const user = this.props.current_user;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
|
||||||
<TPMShixunDiscuss
|
<TPMShixunDiscuss
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
user={user}
|
user={user}
|
||||||
aboutFocus={this.props.aboutFocus}
|
aboutFocus={this.props.aboutFocus}
|
||||||
|
is_jupyter={this.props.is_jupyter}
|
||||||
>
|
>
|
||||||
</TPMShixunDiscuss>
|
</TPMShixunDiscuss>
|
||||||
}
|
}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TPMShixunDiscussContainer;
|
export default TPMShixunDiscussContainer;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,145 +1,146 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
|
|
||||||
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import TPMNav from '../../component/TPMNav'
|
import TPMNav from '../../component/TPMNav'
|
||||||
import TPMRightSection from '../../component/TPMRightSection'
|
import TPMRightSection from '../../component/TPMRightSection'
|
||||||
import { CircularProgress } from 'material-ui/Progress';
|
import { CircularProgress } from 'material-ui/Progress';
|
||||||
|
|
||||||
import { trace_collapse } from 'educoder'
|
import { trace_collapse } from 'educoder'
|
||||||
const $ = window.$;
|
const $ = window.$;
|
||||||
|
|
||||||
// 点击按钮复制功能
|
// 点击按钮复制功能
|
||||||
function jsCopy(){
|
function jsCopy(){
|
||||||
var e = document.getElementById("copy_rep_content");
|
var e = document.getElementById("copy_rep_content");
|
||||||
e.select();
|
e.select();
|
||||||
document.execCommand("Copy");
|
document.execCommand("Copy");
|
||||||
}
|
}
|
||||||
class TPMRepositoryCommits extends Component {
|
class TPMRepositoryCommits extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
RepositoryList: undefined,
|
RepositoryList: undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
let id = this.props.match.params.shixunId;
|
let id = this.props.match.params.shixunId;
|
||||||
|
|
||||||
let collaborators=`/shixuns/`+id+`/commits.json`;
|
let collaborators=`/shixuns/`+id+`/commits.json`;
|
||||||
axios.post(collaborators, {
|
axios.post(collaborators, {
|
||||||
secret_repository: this.props.secret_repository_tab
|
secret_repository: this.props.secret_repository_tab
|
||||||
}).then((response)=> {
|
}).then((response)=> {
|
||||||
|
|
||||||
if(response.status===200){
|
if(response.status===200){
|
||||||
this.setState({
|
this.setState({
|
||||||
RepositoryList: response.data
|
RepositoryList: response.data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
trace_collapse('repo commits res', response.data)
|
trace_collapse('repo commits res', response.data)
|
||||||
|
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
console.log(error)
|
console.log(error)
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
|
||||||
aboutFocus, user, match
|
aboutFocus, user, match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
let { RepositoryList } = this.state;
|
let { RepositoryList } = this.state;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
|
||||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||||
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
{/* 可能会影响到其他页面的样式,需要测试、协商 */}
|
||||||
<div className="with65 fl edu-back-white commentsDelegateParent"
|
<div className="with65 fl edu-back-white commentsDelegateParent"
|
||||||
style={{background: 'transparent'}}>
|
style={{background: 'transparent'}}>
|
||||||
<TPMNav
|
<TPMNav
|
||||||
match={match}
|
match={match}
|
||||||
user={user}
|
user={user}
|
||||||
shixun={shixun}
|
shixun={shixun}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
></TPMNav>
|
is_jupyter={this.props.is_jupyter}
|
||||||
{ loadingContent ?
|
></TPMNav>
|
||||||
<CircularProgress size={40} thickness={3}
|
{ loadingContent ?
|
||||||
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/>
|
<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">
|
<div className="" >
|
||||||
<span className="fl"><i className="iconfont icon-tijiaojilu mr5"></i>
|
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
||||||
提交记录
|
<span className="fl"><i className="iconfont icon-tijiaojilu mr5"></i>
|
||||||
</span>
|
提交记录
|
||||||
{/* 35 */}
|
</span>
|
||||||
<span className="color-grey-9 fr">
|
{/* 35 */}
|
||||||
<Link to={`/shixuns/${match.params.shixunId}/repository/${match.params.repoId}`}
|
<span className="color-grey-9 fr">
|
||||||
className="font-14 color-grey-9">返回</Link>
|
<Link to={`/shixuns/${match.params.shixunId}/repository/${match.params.repoId}`}
|
||||||
</span>
|
className="font-14 color-grey-9">返回</Link>
|
||||||
</div>
|
</span>
|
||||||
|
</div>
|
||||||
<style>
|
|
||||||
{`
|
<style>
|
||||||
a.pullreques_name:hover {
|
{`
|
||||||
color: #666 !important
|
a.pullreques_name:hover {
|
||||||
}
|
color: #666 !important
|
||||||
`}
|
}
|
||||||
</style>
|
`}
|
||||||
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
</style>
|
||||||
<ul className="pullreques_pull_list">
|
<div className="edu-back-white font-16 mb10 clearfix padding20">
|
||||||
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
<ul className="pullreques_pull_list">
|
||||||
return (
|
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
||||||
<li className="clear" key={ key }>
|
return (
|
||||||
<a
|
<li className="clear" key={ key }>
|
||||||
style={{ cursor: 'inherit' }}
|
<a
|
||||||
className="fl color-grey-6 font-16 pullreques_name task-hide"
|
style={{ cursor: 'inherit' }}
|
||||||
target="_blank">{item.email}</a>
|
className="fl color-grey-6 font-16 pullreques_name task-hide"
|
||||||
<p className="pullreques_pull_txt ml10 fl" style={{lineHeight: '32px'}}>
|
target="_blank">{item.email}</a>
|
||||||
{item.title}
|
<p className="pullreques_pull_txt ml10 fl" style={{lineHeight: '32px'}}>
|
||||||
</p>
|
{item.title}
|
||||||
<a style={{ cursor: 'inherit' }}
|
</p>
|
||||||
className="fr mr15 color-blue">{item.time}</a>
|
<a style={{ cursor: 'inherit' }}
|
||||||
|
className="fr mr15 color-blue">{item.time}</a>
|
||||||
<div className="cl"></div>
|
|
||||||
</li>)
|
<div className="cl"></div>
|
||||||
})
|
</li>)
|
||||||
}
|
})
|
||||||
</ul>
|
}
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</div>
|
}
|
||||||
|
</div>
|
||||||
<div className="with35 fr pl20">
|
|
||||||
<TPMRightSection {...this.props}></TPMRightSection>
|
<div className="with35 fr pl20">
|
||||||
</div>
|
<TPMRightSection {...this.props}></TPMRightSection>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</React.Fragment>
|
|
||||||
|
</React.Fragment>
|
||||||
);
|
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
/**
|
||||||
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
|
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
|
||||||
return (
|
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
|
||||||
<div>
|
return (
|
||||||
<div>{item.email}</div>
|
<div>
|
||||||
<div>{item.title}</div>
|
<div>{item.email}</div>
|
||||||
<div>{item.id}</div>
|
<div>{item.title}</div>
|
||||||
<div>{item.time}</div>
|
<div>{item.id}</div>
|
||||||
</div>
|
<div>{item.time}</div>
|
||||||
)
|
</div>
|
||||||
})
|
)
|
||||||
*/
|
})
|
||||||
export default TPMRepositoryCommits;
|
*/
|
||||||
|
export default TPMRepositoryCommits;
|
||||||
|
Loading…
Reference in new issue