commit
96f43439d2
@ -0,0 +1,46 @@
|
||||
|
||||
class JupytersController < ApplicationController
|
||||
include JupyterService
|
||||
|
||||
before_action :shixun, only: [:open, :open1, :test, :save]
|
||||
|
||||
def save_with_tpi
|
||||
myshixun = Myshixun.find_by(identifier: params[:identifier])
|
||||
jupyter_save_with_game(myshixun, params[:jupyter_port])
|
||||
render json: {status: 0}
|
||||
end
|
||||
|
||||
def save_with_tpm
|
||||
shixun = Shixun.find_by(identifier: params[:identifier])
|
||||
jupyter_save_with_shixun(shixun, params[:jupyter_port])
|
||||
render json: {status: 0}
|
||||
end
|
||||
|
||||
def get_info_with_tpi
|
||||
myshixun = Myshixun.find_by(identifier: params[:identifier])
|
||||
url = jupyter_url_with_game(myshixun)
|
||||
port = jupyter_port_with_game(myshixun)
|
||||
render json: {status: 0, url: url, port: port}
|
||||
end
|
||||
|
||||
def get_info_with_tpm
|
||||
shixun = Shixun.find_by(identifier: params[:identifier])
|
||||
url = jupyter_url_with_shixun(shixun)
|
||||
port = jupyter_port_with_shixun(shixun)
|
||||
render json: {status: 0, url: url, port: port}
|
||||
end
|
||||
|
||||
def reset_with_tpi
|
||||
myshixun = Myshixun.find_by(identifier: params[:identifier])
|
||||
info = jupyter_tpi_reset(myshixun)
|
||||
render json: {status: 0, url: info[:url], port: info[:port]}
|
||||
end
|
||||
|
||||
def reset_with_tpm
|
||||
shixun = Shixun.find_by(identifier: params[:identifier])
|
||||
info = jupyter_tpm_reset(shixun)
|
||||
render json: {status: 0, url: info[:url], port: info[:port]}
|
||||
end
|
||||
|
||||
|
||||
end
|
@ -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,7 @@
|
||||
json.user do
|
||||
json.partial! 'users/user', user: current_user
|
||||
end
|
||||
|
||||
json.(@shixun, :id, :identifier, :status, :name)
|
||||
json.myshixun_identifier @myshixun.identifier
|
||||
json.tpm_modified @tpm_modified
|
@ -0,0 +1,11 @@
|
||||
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)
|
||||
json.file_path "#{@absolute_folder}/#{set.relative_path_filename}"
|
||||
end
|
||||
end
|
||||
json.data_sets_count @data_count
|
@ -0,0 +1 @@
|
||||
json.identifier @myshixun.identifier
|
@ -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,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.
File diff suppressed because one or more lines are too long
@ -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()));
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: tangjiang
|
||||
* @Github:
|
||||
* @Date: 2019-12-13 10:28:15
|
||||
* @LastEditors: tangjiang
|
||||
* @LastEditTime: 2019-12-13 10:37:17
|
||||
*/
|
||||
import { Modal } from 'antd';
|
||||
|
||||
export function ModalConfirm (
|
||||
title,
|
||||
content,
|
||||
handleOk,
|
||||
handleCancel
|
||||
) {
|
||||
|
||||
Modal.confirm({
|
||||
title,
|
||||
content,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk () {
|
||||
handleOk && handleOk();
|
||||
},
|
||||
onCancel () {
|
||||
handleCancel && handleCancel();
|
||||
}
|
||||
});
|
||||
}
|
After Width: | Height: | Size: 112 KiB |
@ -0,0 +1,54 @@
|
||||
import React, {Component} from 'react';
|
||||
import {
|
||||
Button,
|
||||
} from 'antd';
|
||||
|
||||
class Bottomsubmit extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
this.state = {}
|
||||
}
|
||||
|
||||
cannelfun = () => {
|
||||
// window.location.href=
|
||||
this.props.history.replace(this.props.url);
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.newFooter{
|
||||
display:none;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<div className="clearfix bor-bottom-greyE edu-back-white orderingbox newshixunbottombtn">
|
||||
<div className=" edu-txt-center padding13-30">
|
||||
<button type="button" className="ant-btn mr20 newshixunmode backgroundFFF" onClick={() => this.cannelfun()}>
|
||||
<span>取 消</span></button>
|
||||
<Button type="button" className="ant-btn newshixunmode mr40 ant-btn-primary" type="primary"
|
||||
htmlType="submit" onClick={() => this.props.onSubmits()}
|
||||
loading={this.props.loadings}><span>{this.props.bottomvalue===undefined?"确 定":this.props.bottomvalue}</span></Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default Bottomsubmit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,54 +1,63 @@
|
||||
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 Challenges from './shixunchild/Challenges/Challenges'
|
||||
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMChallenge extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loadingContent, shixun, 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>
|
||||
<Challenges
|
||||
{...this.props}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMChallenge;
|
||||
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 Challenges from './shixunchild/Challenges/Challenges'
|
||||
import Challengesjupyter from './shixunchild/Challenges/Challengesjupyter'
|
||||
import TPMRightSection from './component/TPMRightSection'
|
||||
|
||||
import TPMNav from './component/TPMNav'
|
||||
|
||||
class TPMChallenge extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loadingContent, shixun, user, match,jupyterbool,is_jupyter
|
||||
} = 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>
|
||||
{
|
||||
is_jupyter===true?
|
||||
<Challengesjupyter
|
||||
{...this.props}
|
||||
/>
|
||||
:
|
||||
<Challenges
|
||||
{...this.props}
|
||||
/>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMChallenge;
|
||||
|
@ -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;
|
||||
|
@ -0,0 +1,630 @@
|
||||
import React, {Component} from 'react';
|
||||
import {Redirect} from 'react-router';
|
||||
import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,notification} from 'antd';
|
||||
import { NoneData } from 'educoder'
|
||||
|
||||
import TPMRightSection from './component/TPMRightSection';
|
||||
import TPMNav from './component/TPMNav';
|
||||
import axios from 'axios';
|
||||
import './tpmmodel/tpmmodel.css'
|
||||
import {getUploadActionUrltwo,appendFileSizeToUploadFileAll} from 'educoder';
|
||||
import moment from 'moment';
|
||||
import Tpmdatasetmodel from "./tpmmodel/Tpmdatasetmodel";
|
||||
|
||||
const confirm = Modal.confirm;
|
||||
|
||||
class TPMDataset extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
value: undefined,
|
||||
columns: [
|
||||
{
|
||||
title: '文件',
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
align: 'left',
|
||||
className: " font-14 wenjiantit",
|
||||
width: '220px',
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{record.title}
|
||||
</div>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: '最后修改时间',
|
||||
dataIndex: 'timedata',
|
||||
key: 'timedata',
|
||||
align: 'center',
|
||||
className: "edu-txt-center font-14 zuihoushijian",
|
||||
width: '150px',
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{record.timedata}
|
||||
</div>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: '最后修改人',
|
||||
dataIndex: 'author',
|
||||
key: 'author',
|
||||
align: 'center',
|
||||
className: "edu-txt-center font-14 ",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{record.author}
|
||||
</div>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: '文件大小',
|
||||
dataIndex: 'filesize',
|
||||
key: 'filesize',
|
||||
align: 'center',
|
||||
className: "edu-txt-center font-14 ",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{record.filesize}
|
||||
</div>
|
||||
)
|
||||
},
|
||||
],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
selectedRowKeys: [],
|
||||
mylistansum:30,
|
||||
collaboratorList:[],
|
||||
fileList:[],
|
||||
fileListimgs:[],
|
||||
file:null,
|
||||
datalist:[],
|
||||
data_sets_count:0,
|
||||
selectedRowKeysdata:[],
|
||||
loadingstate:false,
|
||||
checked: false,
|
||||
showmodel:false,
|
||||
itemtypebool:false,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({
|
||||
loadingstate:true,
|
||||
})
|
||||
this.getdatas()
|
||||
|
||||
}
|
||||
|
||||
mysonChange = (e) => {
|
||||
// console.log(`全选checked = ${e.target.checked}`);
|
||||
if (e.target.checked === true) {
|
||||
let mydata=[];
|
||||
let datas=[];
|
||||
for(let i=0;i<this.state.collaboratorList.data_sets.length;i++){
|
||||
mydata.push(this.state.collaboratorList.data_sets[i].id);
|
||||
datas.push(i);
|
||||
|
||||
}
|
||||
this.setState({
|
||||
selectedRowKeysdata:mydata,
|
||||
selectedRowKeys: datas,
|
||||
checked:true,
|
||||
})
|
||||
// console.log(mydata);
|
||||
// console.log(datas);
|
||||
} else {
|
||||
this.setState({
|
||||
selectedRowKeysdata:[],
|
||||
selectedRowKeys: [],
|
||||
checked:false,
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getdatas = () => {
|
||||
let id=this.props.match.params.shixunId;
|
||||
|
||||
let collaborators=`/shixuns/${id}/get_data_sets.json`;
|
||||
axios.get(collaborators,{params:{
|
||||
page:1,
|
||||
limit:10,
|
||||
}}).then((response)=> {
|
||||
if(response.status===200){
|
||||
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
||||
|
||||
}else{
|
||||
let datalists=[];
|
||||
for(let i=0;i<response.data.data_sets.length;i++){
|
||||
const datas=response.data.data_sets;
|
||||
var timedata = moment(datas[i].created_on).format('YYYY-MM-DD HH:mm');
|
||||
datalists.push({
|
||||
timedata:timedata,
|
||||
author:datas[i].author,
|
||||
filesize:datas[i].filesize,
|
||||
id:datas[i].id,
|
||||
title:datas[i].title,
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
collaboratorList: response.data,
|
||||
data_sets_count:response.data.data_sets_count,
|
||||
datalist:datalists,
|
||||
selectedRowKeysdata:[],
|
||||
selectedRowKeys: [],
|
||||
checked:false,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
loadingstate:false,
|
||||
})
|
||||
}, 500)
|
||||
|
||||
}).catch((error)=>{
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
loadingstate:false,
|
||||
})
|
||||
}, 500)
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
getdatastwo = (page,limit) => {
|
||||
let id=this.props.match.params.shixunId;
|
||||
|
||||
let collaborators=`/shixuns/${id}/jupyter_data_sets.json`;
|
||||
axios.get(collaborators,{params:{
|
||||
page:page,
|
||||
limit:limit,
|
||||
}}).then((response)=> {
|
||||
if(response.status===200){
|
||||
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
||||
|
||||
}else{
|
||||
let datalists=[];
|
||||
for(let i=0;i<response.data.data_sets.length;i++){
|
||||
const datas=response.data.data_sets;
|
||||
var timedata = moment(datas[i].created_on).format('YYYY-MM-DD HH:mm');
|
||||
datalists.push({
|
||||
timedata:timedata,
|
||||
author:datas[i].author,
|
||||
filesize:datas[i].filesize,
|
||||
id:datas[i].id,
|
||||
title:datas[i].title,
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
collaboratorList: response.data,
|
||||
data_sets_count:response.data.data_sets_count,
|
||||
datalist:datalists,
|
||||
selectedRowKeysdata:[],
|
||||
selectedRowKeys: [],
|
||||
checked:false,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
loadingstate:false,
|
||||
})
|
||||
}, 500)
|
||||
}).catch((error)=>{
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
loadingstate:false,
|
||||
})
|
||||
}, 500)
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
getdatasthree = (page,limit) => {
|
||||
let id=this.props.match.params.shixunId;
|
||||
|
||||
let collaborators=`/shixuns/${id}/jupyter_data_sets.json`;
|
||||
axios.get(collaborators,{params:{
|
||||
page:page,
|
||||
limit:limit,
|
||||
}}).then((response)=> {
|
||||
if(response.status===200){
|
||||
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}).catch((error)=>{
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
paginationonChanges = (pageNumber) => {
|
||||
// //console.log('Page: ');
|
||||
this.setState({
|
||||
page: pageNumber,
|
||||
loadingstate:true,
|
||||
})
|
||||
|
||||
this.getdatastwo(pageNumber,10);
|
||||
}
|
||||
|
||||
onSelectChange = (selectedRowKeys, selectedRows) => {
|
||||
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
|
||||
this.setState(
|
||||
{
|
||||
selectedRowKeys
|
||||
}
|
||||
);
|
||||
let mydata=[];
|
||||
for(let i=0;i<selectedRows.length;i++){
|
||||
mydata.push(selectedRows[i].id);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
selectedRowKeysdata:mydata,
|
||||
})
|
||||
// console.log(mydata);
|
||||
|
||||
|
||||
|
||||
}
|
||||
rowClassName = (record, index) => {
|
||||
let className = 'light-row';
|
||||
if (index % 2 === 1) className = 'dark-row';
|
||||
return className;
|
||||
}
|
||||
handleChange = (info) => {
|
||||
// console.log("handleChange123123");
|
||||
// console.log(info);
|
||||
// debugger
|
||||
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
|
||||
let fileList = info.fileList;
|
||||
this.setState({
|
||||
fileList: appendFileSizeToUploadFileAll(fileList),
|
||||
});
|
||||
if(info.file.status === 'done'){
|
||||
//done 成功就会调用这个方法
|
||||
this.getdatas();
|
||||
}
|
||||
if(info.file.response){
|
||||
if(info.file.response.status===-1||info.file.response.status==="-1"){
|
||||
// console.log("准备显示弹框了");
|
||||
// console.log(info);false
|
||||
let itemtype=-1;
|
||||
try {
|
||||
itemtype=info.file.response.message.indexOf('文件名已经存在'.toLowerCase());
|
||||
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
this.setState({
|
||||
showmodel:true,
|
||||
tittest:info.file.response.message,
|
||||
itemtypebool:itemtype>-1?true:itemtype<=-1?false:false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onAttachmentRemove = (file) => {
|
||||
// debugger
|
||||
if(!file.percent || file.percent == 100){
|
||||
confirm({
|
||||
title: '确定要删除这个附件吗?',
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
// content: 'Some descriptions',
|
||||
onOk: () => {
|
||||
console.log("665")
|
||||
this.deleteAttachment(file)
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deleteRemovedata(){
|
||||
|
||||
if(this.state.selectedRowKeysdata===undefined || this.state.selectedRowKeysdata===null ||this.state.selectedRowKeysdata.length===0){
|
||||
|
||||
this.props.showNotification(`请选择要删除的文件`);
|
||||
|
||||
return
|
||||
}
|
||||
let id=this.props.match.params.shixunId;
|
||||
|
||||
confirm({
|
||||
title: '确定要删除文件吗?',
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
// content: 'Some descriptions',
|
||||
onOk: () => {
|
||||
const url = `/shixuns/${id}/destroy_data_sets.json`;
|
||||
axios.delete(url,
|
||||
{ params: {
|
||||
id:this.state.selectedRowKeysdata,
|
||||
}}
|
||||
)
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
const { status } = response.data;
|
||||
if (status == 0) {
|
||||
this.props.showNotification(`删除成功`);
|
||||
|
||||
this.getdatas()
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
deleteAttachment = (file) => {
|
||||
// console.log(file);
|
||||
let id=file.response ==undefined ? file.id : file.response.id
|
||||
const url = `/attachements/destroy_files.json`
|
||||
axios.delete(url, {
|
||||
id:[id],
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
const { status } = response.data;
|
||||
if (status == 0) {
|
||||
// console.log('--- success')
|
||||
|
||||
this.setState((state) => {
|
||||
|
||||
const index = state.fileList.indexOf(file);
|
||||
const newFileList = state.fileList.slice();
|
||||
newFileList.splice(index, 1);
|
||||
return {
|
||||
fileList: newFileList,
|
||||
deleteisnot:true
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
ModalCancel = () => {
|
||||
this.setState({
|
||||
showmodel: false,
|
||||
})
|
||||
}
|
||||
|
||||
ModalSave=()=>{
|
||||
this.setState({
|
||||
showmodel: false,
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {tpmLoading, shixun, user, match} = this.props;
|
||||
const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
// getCheckboxProps: record => ({
|
||||
// disabled: record.name === 'Disabled User', // Column configuration not to be checked
|
||||
// name: record.name,
|
||||
// }),
|
||||
let id=this.props.match.params.shixunId;
|
||||
const uploadProps = {
|
||||
width: 600,
|
||||
fileList,
|
||||
multiple: false,
|
||||
//multiple 是否支持多选 查重的时候不能多选 不然弹许多框出来
|
||||
// https://github.com/ant-design/ant-design/issues/15505
|
||||
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
|
||||
// showUploadList: false,
|
||||
action: `${getUploadActionUrltwo(id)}`,
|
||||
showUploadList:false,
|
||||
onChange: this.handleChange,
|
||||
onRemove: this.onAttachmentRemove,
|
||||
beforeUpload: (file) => {
|
||||
//上传前的操作
|
||||
// console.log('beforeUpload', file.name);
|
||||
const isLt150M = file.size / 1024 / 1024 < 150;
|
||||
if (!isLt150M) {
|
||||
this.props.showNotification('文件大小必须小于150MB!');
|
||||
}
|
||||
return isLt150M;
|
||||
},
|
||||
};
|
||||
// console.log("showmodelshowmodel");
|
||||
// console.log(this.state.showmodel);
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="tpmComment educontent clearfix mt30 mb80">
|
||||
|
||||
<div className="with65 fl edu-back-white commentsDelegateParent">
|
||||
{
|
||||
this.state.showmodel===true?
|
||||
<Tpmdatasetmodel itemtypebool={this.state.itemtypebool} modalCancel={()=>this.ModalSave()} tittest={this.state.tittest} modalsType={this.state.showmodel}></Tpmdatasetmodel>
|
||||
:""
|
||||
}
|
||||
<TPMNav
|
||||
match={match}
|
||||
user={user}
|
||||
shixun={shixun}
|
||||
{...this.props}
|
||||
is_jupyter={this.props.is_jupyter}
|
||||
></TPMNav>
|
||||
|
||||
<div className="padding20 edu-back-white mt20 " style={{minHeight: '463px'}}>
|
||||
<div className="sortinxdirection">
|
||||
|
||||
<div className="tpmwidth">
|
||||
<Checkbox checked={this.state.checked} onChange={this.mysonChange}>全选</Checkbox>
|
||||
</div>
|
||||
|
||||
<div className="tpmwidth xaxisreverseorder">
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-upload-list{
|
||||
display:none
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest" type="upload">
|
||||
|
||||
上传文件</p> </Upload></div>
|
||||
{
|
||||
data_sets_count>0?
|
||||
<div
|
||||
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"} onClick={()=>this.deleteRemovedata()}>
|
||||
<p className="deletebutomtext" >删除</p></div>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt24">
|
||||
<style>{`
|
||||
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
|
||||
top: 72%;}
|
||||
}
|
||||
.edu-table .ant-table-tbody > tr > td {
|
||||
height: 42px;
|
||||
}
|
||||
.edu-table .ant-table-thead > tr > th{
|
||||
height: 42px;
|
||||
}
|
||||
.ysltableowss .ant-table-thead > tr > th{
|
||||
height: 42px;
|
||||
}
|
||||
.ysltableowss .ant-table-tbody > tr > td{
|
||||
height: 42px;
|
||||
}
|
||||
.ysltableowss .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
|
||||
padding: 9px;
|
||||
}
|
||||
.mysjysltable4 .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
|
||||
padding: 0px;
|
||||
}
|
||||
.ant-table-thead .ant-table-selection-column span{
|
||||
visibility:hidden;
|
||||
}
|
||||
.ant-table-thead > tr > th {
|
||||
background:#FFFFFF !important;
|
||||
}
|
||||
.ant-table table {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
border-radius: 4px 4px 0 0;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
border-left: 1px solid #eeeeee;
|
||||
border-top: 1px solid #eeeeee;
|
||||
border-right: 1px solid #eeeeee;
|
||||
}
|
||||
`}</style>
|
||||
{data_sets_count===0?
|
||||
<div className="edu-table edu-back-white ysltableowss">
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-table-tbody{
|
||||
display:none;
|
||||
}
|
||||
.ant-table-placeholder{
|
||||
display:none;
|
||||
}
|
||||
.ant-table table {
|
||||
border-bottom: 1px solid #eeeeee !important;
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<Table
|
||||
columns={columns}
|
||||
pagination={false}
|
||||
className="mysjysltable4"
|
||||
rowSelection={rowSelection}
|
||||
rowClassName={this.rowClassName}
|
||||
/>
|
||||
</div>
|
||||
:
|
||||
<div className="edu-table edu-back-white ysltableowss">
|
||||
<Table
|
||||
dataSource={datalist}
|
||||
columns={columns}
|
||||
pagination={false}
|
||||
className="mysjysltable4"
|
||||
rowSelection={rowSelection}
|
||||
rowClassName={this.rowClassName}
|
||||
loading={loadingstate}
|
||||
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
{
|
||||
data_sets_count>=11?
|
||||
<div className="edu-txt-center mt40 mb20">
|
||||
<Pagination showQuickJumper current={page}
|
||||
onChange={this.paginationonChanges} pageSize={limit}
|
||||
total={data_sets_count}
|
||||
></Pagination>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
|
||||
{ data_sets_count===0?
|
||||
<NoneData style={{width: '100%'}}></NoneData>:""
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="with35 fr pl20">
|
||||
<TPMRightSection
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TPMDataset;
|
@ -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;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue