题目详情页的样式修补
This commit is contained in:
parent
3bd888dcde
commit
814c135e4c
|
@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
/**
|
/**
|
||||||
* @Author: Himit_ZH
|
* @Author: Himit_ZH
|
||||||
* @Date: 2020/10/30 10:21
|
* @Date: 2020/10/30 10:21
|
||||||
* @Description:
|
* @Description: 调用判题服务器的方法的容错机制,调用失败会走到以下方法进行执行
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@RefreshScope
|
@RefreshScope
|
||||||
|
@ -34,9 +34,9 @@ public class CloudHandler implements ToJudgeService {
|
||||||
@Override
|
@Override
|
||||||
public CommonResult submitProblemJudge(ToJudge toJudge) {
|
public CommonResult submitProblemJudge(ToJudge toJudge) {
|
||||||
|
|
||||||
// 线程沉睡两秒,再将任务重新发布,避免过快问题,同时判题服务过多,导致的失败
|
// 线程沉睡一秒,再将任务重新发布,避免过快问题,同时判题服务过多,导致的失败
|
||||||
try {
|
try {
|
||||||
TimeUnit.SECONDS.sleep(2);
|
TimeUnit.SECONDS.sleep(1);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,7 @@ import top.hcode.hoj.dao.JudgeMapper;
|
||||||
import top.hcode.hoj.pojo.entity.ContestRecord;
|
import top.hcode.hoj.pojo.entity.ContestRecord;
|
||||||
import top.hcode.hoj.pojo.entity.Judge;
|
import top.hcode.hoj.pojo.entity.Judge;
|
||||||
import top.hcode.hoj.pojo.entity.ProblemCount;
|
import top.hcode.hoj.pojo.entity.ProblemCount;
|
||||||
import top.hcode.hoj.pojo.entity.ToJudge;
|
|
||||||
import top.hcode.hoj.service.impl.ContestRecordServiceImpl;
|
import top.hcode.hoj.service.impl.ContestRecordServiceImpl;
|
||||||
import top.hcode.hoj.service.impl.JudgeServiceImpl;
|
|
||||||
import top.hcode.hoj.service.impl.ProblemCountServiceImpl;
|
import top.hcode.hoj.service.impl.ProblemCountServiceImpl;
|
||||||
import top.hcode.hoj.utils.Constants;
|
import top.hcode.hoj.utils.Constants;
|
||||||
import top.hcode.hoj.utils.RedisUtils;
|
import top.hcode.hoj.utils.RedisUtils;
|
||||||
|
@ -21,7 +19,7 @@ import top.hcode.hoj.utils.RedisUtils;
|
||||||
/**
|
/**
|
||||||
* @Author: Himit_ZH
|
* @Author: Himit_ZH
|
||||||
* @Date: 2021/2/5 16:44
|
* @Date: 2021/2/5 16:44
|
||||||
* @Description:
|
* @Description: 判题信息的发布者,通过主题发布到特定频道内
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -51,7 +49,6 @@ public class JudgeDispatcher {
|
||||||
redisUtils.sendMessage(Constants.Judge.STATUS_JUDGE_WAITING.getName(), JSONUtil.toJsonStr(task));
|
redisUtils.sendMessage(Constants.Judge.STATUS_JUDGE_WAITING.getName(), JSONUtil.toJsonStr(task));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("调用redis消息发布异常,此次判题任务判为系统错误--------------->{}", e.getMessage());
|
log.error("调用redis消息发布异常,此次判题任务判为系统错误--------------->{}", e.getMessage());
|
||||||
|
|
||||||
UpdateWrapper<Judge> judgeUpdateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<Judge> judgeUpdateWrapper = new UpdateWrapper<>();
|
||||||
judgeUpdateWrapper.eq("submit_id", submitId)
|
judgeUpdateWrapper.eq("submit_id", submitId)
|
||||||
.set("error_message", "The something has gone wrong with the data Backup server. Please report this to administrator.")
|
.set("error_message", "The something has gone wrong with the data Backup server. Please report this to administrator.")
|
||||||
|
|
|
@ -19,6 +19,9 @@ import top.hcode.hoj.service.impl.JudgeServiceImpl;
|
||||||
* @Author: Himit_ZH
|
* @Author: Himit_ZH
|
||||||
* @Date: 2021/2/5 16:43
|
* @Date: 2021/2/5 16:43
|
||||||
* @Description:
|
* @Description:
|
||||||
|
* 1. 判题信息的接受者,调用判题服务,对提交代码进行判断,
|
||||||
|
* 2. 若无空闲判题服务器,会自动进入熔断机制,重新将该判题信息发布到频道内,
|
||||||
|
* 3. 再次接受到信息,再次查询是否有空闲判题服务器,若有则进行判题,否则回到2
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class JudgeReceiver implements MessageListener {
|
public class JudgeReceiver implements MessageListener {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-backtop :right="10"></el-backtop>
|
||||||
<div v-if="!isAdminView">
|
<div v-if="!isAdminView">
|
||||||
<NavBar></NavBar>
|
<NavBar></NavBar>
|
||||||
<div id="oj-content">
|
<div id="oj-content">
|
||||||
|
@ -7,12 +9,16 @@
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<a style="color:#1E9FFF" :href="websiteConfig.recordUrl">{{websiteConfig.recordName}}</a>
|
<a style="color:#1E9FFF" :href="websiteConfig.recordUrl">{{
|
||||||
|
websiteConfig.recordName
|
||||||
|
}}</a>
|
||||||
<p>
|
<p>
|
||||||
Powered by <a :href="websiteConfig.projectUrl" style="color:#1E9FFF">{{websiteConfig.projectName}}</a>
|
Powered by
|
||||||
|
<a :href="websiteConfig.projectUrl" style="color:#1E9FFF">{{
|
||||||
|
websiteConfig.projectName
|
||||||
|
}}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div id="admin-content">
|
<div id="admin-content">
|
||||||
|
@ -21,13 +27,14 @@
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NavBar from "@/components/oj/common/NavBar";
|
import NavBar from '@/components/oj/common/NavBar';
|
||||||
import { mapActions, mapState } from "vuex";
|
import { mapActions, mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
name: "app-content",
|
name: 'app-content',
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
},
|
},
|
||||||
|
@ -37,33 +44,33 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['changeDomTitle','getWebsiteConfig'])
|
...mapActions(['changeDomTitle', 'getWebsiteConfig']),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
this.changeDomTitle();
|
this.changeDomTitle();
|
||||||
},
|
},
|
||||||
'websiteConfig' () {
|
websiteConfig() {
|
||||||
this.changeDomTitle();
|
this.changeDomTitle();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['websiteConfig'])
|
...mapState(['websiteConfig']),
|
||||||
},
|
},
|
||||||
created: function() {
|
created: function() {
|
||||||
try {
|
try {
|
||||||
document.body.removeChild(document.getElementById("app-loader"));
|
document.body.removeChild(document.getElementById('app-loader'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
if (this.$route.path.split("/")[1] != "admin") {
|
if (this.$route.path.split('/')[1] != 'admin') {
|
||||||
this.isAdminView = false;
|
this.isAdminView = false;
|
||||||
} else {
|
} else {
|
||||||
this.isAdminView = true;
|
this.isAdminView = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getWebsiteConfig()
|
this.getWebsiteConfig();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -89,14 +96,14 @@ samp {
|
||||||
font-family: Consolas, Menlo, Courier, monospace;
|
font-family: Consolas, Menlo, Courier, monospace;
|
||||||
}
|
}
|
||||||
#admin-content {
|
#admin-content {
|
||||||
background-color: #1E9FFF;
|
background-color: #1e9fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.mobile-menu-active {
|
.mobile-menu-active {
|
||||||
background-color: rgba(0,0,0,.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
.mobile-menu-active .mu-item-title {
|
.mobile-menu-active .mu-item-title {
|
||||||
color: #2d8cf0 !important;
|
color: #2d8cf0 !important;
|
||||||
|
@ -255,6 +262,6 @@ a:hover {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.el-tag--dark {
|
.el-tag--dark {
|
||||||
border-color: #FFF!important;
|
border-color: #fff !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -239,7 +239,7 @@ export default {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
min-height: 520px;
|
min-height: 549px;
|
||||||
max-height: 520px;
|
max-height: 1000px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -9,7 +9,12 @@ const rootState = {
|
||||||
mode: 'Login', // or 'register',
|
mode: 'Login', // or 'register',
|
||||||
visible: false
|
visible: false
|
||||||
},
|
},
|
||||||
websiteConfig:{},
|
websiteConfig:{
|
||||||
|
recordName:'粤ICP备×××××××号-1',
|
||||||
|
projectName:'HOJ',
|
||||||
|
recordUrl:'#',
|
||||||
|
projectUrl:'#'
|
||||||
|
},
|
||||||
registerTimeOut: 60,
|
registerTimeOut: 60,
|
||||||
resetTimeOut: 90,
|
resetTimeOut: 90,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<div id="problem-main">
|
<div id="problem-main">
|
||||||
<!--problem main-->
|
<!--problem main-->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :sm="24" :md="24" :lg="12" class="problem-detail">
|
<el-col :sm="24" :md="24" :lg="12">
|
||||||
<el-card :padding="10" shadow>
|
<el-card :padding="10" shadow class="problem-detail">
|
||||||
<div slot="header" class="panel-title">
|
<div slot="header" class="panel-title">
|
||||||
<span>{{ problemData.problem.title }}</span
|
<span>{{ problemData.problem.title }}</span
|
||||||
><br />
|
><br />
|
||||||
|
@ -124,8 +124,13 @@
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :sm="24" :md="24" :lg="12" class="submit-detail">
|
<el-col :sm="24" :md="24" :lg="12">
|
||||||
<el-card :padding="10" id="submit-code" shadow="always">
|
<el-card
|
||||||
|
:padding="10"
|
||||||
|
id="submit-code"
|
||||||
|
shadow="always"
|
||||||
|
class="submit-detail"
|
||||||
|
>
|
||||||
<CodeMirror
|
<CodeMirror
|
||||||
:value.sync="code"
|
:value.sync="code"
|
||||||
:languages="problemData.problem.languages"
|
:languages="problemData.problem.languages"
|
||||||
|
@ -725,11 +730,11 @@ export default {
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
@media screen and (min-width: 768px) {
|
||||||
.problem-detail {
|
.problem-detail {
|
||||||
height: 672px;
|
height: 700px !important;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.submit-detail {
|
.submit-detail {
|
||||||
height: 672px;
|
height: 700px !important;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.problem-menu span {
|
.problem-menu span {
|
||||||
|
|
Loading…
Reference in New Issue