From 1108d180b3c44e25477d41cc785d7d963543b05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Dec 2019 11:09:45 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E4=B8=8A=E4=BC=A0=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMDataset.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 55cd8c746..685324a46 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -473,11 +473,11 @@ class TPMDataset extends Component { beforeUpload: (file) => { //上传前的操作 // console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 150; - if (!isLt150M) { - this.props.showNotification('文件大小必须小于150MB!'); + const isLt300M = file.size / 1024 / 1024 <= 300; + if (!isLt300M) { + this.props.showNotification('文件大小必须小于等于300MB!'); } - return isLt150M; + return isLt300M; }, }; // console.log("showmodelshowmodel"); From 3b5988783f5793505a35e0db532a7e363b2324e1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 12:28:58 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 851567c92..80e23c6b2 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -32,7 +32,7 @@ class CommentsController < ApplicationController # 列表 def index - disscusses = @hack.disscusses.where(:root_id => nil) + disscusses = @hack.discusses.where(:root_id => nil) @disscuss_count = disscusses.count @disscusses= paginate disscusses end From 3a26d754943ce67968c0f8f9ecb79cb957fc9223 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 12:36:11 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 6 +++--- app/views/comments/index.json.jbuilder | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 80e23c6b2..348fd7f31 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -32,9 +32,9 @@ class CommentsController < ApplicationController # 列表 def index - disscusses = @hack.discusses.where(:root_id => nil) - @disscuss_count = disscusses.count - @disscusses= paginate disscusses + discusses = @hack.discusses.where(:root_id => nil) + @discusses_count = discusses.count + @discusses= paginate discusses end # 删除 diff --git a/app/views/comments/index.json.jbuilder b/app/views/comments/index.json.jbuilder index 399b144d9..a5bc6cc28 100644 --- a/app/views/comments/index.json.jbuilder +++ b/app/views/comments/index.json.jbuilder @@ -1,4 +1,4 @@ -json.disscuss_count @disscuss_count +json.disscuss_count @discusses json.comments @discusses do |discuss| json.partial! 'comments/discuss', locals: { discuss: discuss} json.children discuss.child_discuss(current_user) do |c_d| From 3d9ca9f214fb111b074c4f77044fd39d8d9f7664 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 12:39:22 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 348fd7f31..cc7c2776a 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -32,7 +32,7 @@ class CommentsController < ApplicationController # 列表 def index - discusses = @hack.discusses.where(:root_id => nil) + discusses = Discuss.where(root_id: nil, dis_id: @hack.id, dis_type: @hack.class.to_s) @discusses_count = discusses.count @discusses= paginate discusses end From 8c96c6212d73b1ce534a8ca414b9c6ee65ba0269 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 12:45:16 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index cc7c2776a..8f0c20669 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -32,6 +32,7 @@ class CommentsController < ApplicationController # 列表 def index + logger.info("##########hack:#{@hack.id}") discusses = Discuss.where(root_id: nil, dis_id: @hack.id, dis_type: @hack.class.to_s) @discusses_count = discusses.count @discusses= paginate discusses @@ -46,7 +47,7 @@ class CommentsController < ApplicationController private def find_hack - @hack = Hack.find_by_identifier params[:identifier] + @hack = Hack.find_by_identifier(params[:identifier]) end def comment_params From a0c07df3608952ee631de04bc82b96056979e0f3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 12:47:19 +0800 Subject: [PATCH 06/10] =?UTF-8?q?hack=E6=A0=87=E8=AF=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 8f0c20669..2157159e2 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -47,7 +47,7 @@ class CommentsController < ApplicationController private def find_hack - @hack = Hack.find_by_identifier(params[:identifier]) + @hack = Hack.find_by_identifier(params[:hack_identifier]) end def comment_params From 5f556264c810cbad55449574ee545c3ac2c90723 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 12:48:13 +0800 Subject: [PATCH 07/10] hack --- app/controllers/comments_controller.rb | 3 +-- app/views/comments/index.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 2157159e2..850886e68 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -32,8 +32,7 @@ class CommentsController < ApplicationController # 列表 def index - logger.info("##########hack:#{@hack.id}") - discusses = Discuss.where(root_id: nil, dis_id: @hack.id, dis_type: @hack.class.to_s) + discusses = @hack.discusses.where(root_id: nil) @discusses_count = discusses.count @discusses= paginate discusses end diff --git a/app/views/comments/index.json.jbuilder b/app/views/comments/index.json.jbuilder index a5bc6cc28..b176d00b9 100644 --- a/app/views/comments/index.json.jbuilder +++ b/app/views/comments/index.json.jbuilder @@ -1,4 +1,4 @@ -json.disscuss_count @discusses +json.disscuss_count @discusses_count json.comments @discusses do |discuss| json.partial! 'comments/discuss', locals: { discuss: discuss} json.children discuss.child_discuss(current_user) do |c_d| From 699a3d35be51295a1143686fb891fcfc035bfa3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Dec 2019 13:03:12 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMDataset.js | 46 +++++++++++++++---- .../src/modules/tpm/tpmmodel/tpmmodel.css | 2 +- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 685324a46..9569c5174 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -1,6 +1,6 @@ import React, {Component} from 'react'; import {Redirect} from 'react-router'; -import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,notification} from 'antd'; +import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,Button} from 'antd'; import { NoneData } from 'educoder' import TPMRightSection from './component/TPMRightSection'; @@ -85,6 +85,7 @@ class TPMDataset extends Component { checked: false, showmodel:false, itemtypebool:false, + Buttonloading:false } } @@ -295,8 +296,12 @@ class TPMDataset extends Component { handleChange = (info) => { // console.log("handleChange123123"); // console.log(info); -// debugger + //debugger + this.setState({ + Buttonloading:true + }) if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ + let fileList = info.fileList; this.setState({ fileList: appendFileSizeToUploadFileAll(fileList), @@ -309,7 +314,10 @@ class TPMDataset extends Component { }else{ this.getdatas(); - + this.setState({ + Buttonloading:false + }) + // this.props.showNotification(`上传成功`); } } } @@ -329,9 +337,13 @@ class TPMDataset extends Component { showmodel:true, tittest:info.file.response.message, itemtypebool:itemtype>-1?true:itemtype<=-1?false:false, + Buttonloading:false }) - }else{ + }else{ + this.setState({ + Buttonloading:false + }) } } @@ -445,7 +457,12 @@ class TPMDataset extends Component { showmodel: false, }) } - + ButtonloadinghandleChange=()=>{ + // this.props.showNotification(`zhzzzzz`); + // this.setState({ + // Buttonloading:true + // }) + } render() { const {tpmLoading, shixun, user, match} = this.props; const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state; @@ -473,8 +490,13 @@ class TPMDataset extends Component { beforeUpload: (file) => { //上传前的操作 // console.log('beforeUpload', file.name); + this.props.showNotification(`文件上传中`); const isLt300M = file.size / 1024 / 1024 <= 300; + if (!isLt300M) { + this.setState({ + Buttonloading:false + }) this.props.showNotification('文件大小必须小于等于300MB!'); } return isLt300M; @@ -514,12 +536,20 @@ class TPMDataset extends Component { .ant-upload-list{ display:none } + .deletebuttom{ + color: #fff !important; + } + .deletebuttom:hover{ + color: #fff !important; + background: #29BD8B !important; + } ` } -

- - 上传文件

+
+ + +
{ data_sets_count>0?
Date: Mon, 23 Dec 2019 13:06:15 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/jupyter/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/tpm/jupyter/index.js b/public/react/src/modules/tpm/jupyter/index.js index ad62d249c..cdaee96bb 100644 --- a/public/react/src/modules/tpm/jupyter/index.js +++ b/public/react/src/modules/tpm/jupyter/index.js @@ -325,13 +325,13 @@ function JupyterTPI (props) {

- {/* sync | poweroff */} - {/*重置实训*/} + {/*sync | poweroff */} + + {/*重置实训*/}