Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

merge aliyun
dev_tpm_ui
tangjiang 5 years ago
commit 4b02c4b5da

@ -232,6 +232,11 @@ class HacksController < ApplicationController
hacks = hacks.where(category: params[:category]) hacks = hacks.where(category: params[:category])
end end
# 语言
if params[:language]
hacks = hacks.joins(:hack_codes).where(hack_codes: {language: params[:language]})
end
# 排序 # 排序
sort_by = params[:sort_by] || "hack_user_lastest_codes_count" sort_by = params[:sort_by] || "hack_user_lastest_codes_count"
sort_direction = params[:sort_direction] || "desc" sort_direction = params[:sort_direction] || "desc"

@ -53,11 +53,11 @@ class Discuss < ApplicationRecord
def send_tiding def send_tiding
if dis_type == 'Shixun' if dis_type == 'Shixun'
user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id send_user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
parent_container_type = 'Challenge' parent_container_type = 'Challenge'
challenge_id = challenge_id challenge_id = challenge_id
elsif dis_type == 'Hack' elsif dis_type == 'Hack'
user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id send_user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id
parent_container_type = 'Hack' parent_container_type = 'Hack'
challenge_id = dis_id challenge_id = dis_id
end end
@ -65,6 +65,6 @@ class Discuss < ApplicationRecord
trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type, trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type,
belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment' belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment'
} }
tidings.create!(base_attrs.merge(user_id: user_id)) tidings.create!(base_attrs.merge(user_id: send_user_id))
end end
end end

@ -310,7 +310,7 @@ function JupyterTPI (props) {
}); });
const oUl = ( const oUl = (
<ul className="jupyter_data_list"> <ul className="jupyter_data_list" >
{ oList } { oList }
</ul> </ul>
); );
@ -412,7 +412,7 @@ function JupyterTPI (props) {
<h2 className="borbottom17212F jupyterfilepaths"> <h2 className="borbottom17212F jupyterfilepaths">
<span className={"ml50"}>文件路径</span> <span className={"ml50"}>文件路径</span>
<div className="sortinxdirection"> <div className="sortinxdirection">
<a className="jupyter_name ml50 maxnamewidth200 lineheighttaj colorlineheighttaj">{jupyter_folder_name}</a> <a className="jupyter_name ml50 maxnamewidth186JUPYTER lineheighttaj colorlineheighttaj">{jupyter_folder_name}</a>
<a className={"fr color-blue lineheighttaj font-14"} <a className={"fr color-blue lineheighttaj font-14"}
onClick={() => { onClick={() => {
jsCopy("jupyter_folder_name") jsCopy("jupyter_folder_name")

@ -215,13 +215,13 @@ line-height: 50px !important;
background: #070F1A !important; background: #070F1A !important;
} }
.maxnamewidth200{ .maxnamewidth186JUPYTER{
max-width: 200px; max-width: 186px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
cursor: default; cursor: default;
width: 200px; width: 186px;
} }
.maxnamewidth181{ .maxnamewidth181{

@ -7,7 +7,7 @@
* @LastEditTime: 2019-12-13 23:03:27 * @LastEditTime: 2019-12-13 23:03:27
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { message } from 'antd'; import { message ,Modal} from 'antd';
import { import {
fetchJupyterTpiDataSet, fetchJupyterTpiDataSet,
fetchJupyterTpiUrl, fetchJupyterTpiUrl,
@ -78,8 +78,8 @@ export const getJupyterTpiUrl = (obj) => {
if (res.status === 200) { if (res.status === 200) {
const { status, url = '', port } = res.data; const { status, url = '', port } = res.data;
dispatch(updataspinning(false)) dispatch(updataspinning(false))
setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500) //setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
// timeinfo_with_tpi(id,dispatch) timeinfo_with_tpi(id,dispatch)
dispatch({ dispatch({
type: types.GET_JUPYTER_TPI_URL, type: types.GET_JUPYTER_TPI_URL,
payload: { payload: {
@ -240,27 +240,26 @@ export const updataspinning=(type)=>{
// 获取重置实训后的时间 // 获取重置实训后的时间
export const timeinfo_with_tpi = (identifier, dispatch) => { export const timeinfo_with_tpi = (identifier, dispatch) => {
debugger
const params = { const params = {
identifier: identifier identifier: identifier
}; };
debugger
timeinfo_with_tpis(params).then(res => { timeinfo_with_tpis(params).then(res => {
debugger
console.log('同步时间成功: ', res);
if (res.data.status === 401) return; if (res.data.status === 401) return;
if (res.status === 200) { if (res.status === 200) {
const {status} = res.data if(res.data.status===0){
console.log(status) if(res.data.useSeconds===null){
// dispatch(addjypertime(Date.now() +3600 * 1000)) Modal.warning({
// setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500) title: '提示',
// if (status === 0) { content: '因为这个实训pod不在了无法获取倒计时请联系系统管理人员',
// message.success(msg); });
// dispatch(updataspinning(false)) }else{
// setTimeout(() => { let useSeconds=res.data.useSeconds;
// window.location.reload(); let summain=3600 * 1000;
// }, 300); let sums= useSeconds * 1000;
// } let sum=summain-sums;
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sum))},500);
}
}
} }
}) })
} }
Loading…
Cancel
Save