题目详情页的样式修补

This commit is contained in:
Himit_ZH 2021-02-10 00:03:54 +08:00
parent 3bd888dcde
commit 814c135e4c
9 changed files with 84 additions and 67 deletions

View File

@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
/**
* @Author: Himit_ZH
* @Date: 2020/10/30 10:21
* @Description:
* @Description: 调用判题服务器的方法的容错机制调用失败会走到以下方法进行执行
*/
@Component
@RefreshScope
@ -34,9 +34,9 @@ public class CloudHandler implements ToJudgeService {
@Override
public CommonResult submitProblemJudge(ToJudge toJudge) {
// 线程沉睡再将任务重新发布避免过快问题同时判题服务过多导致的失败
// 线程沉睡再将任务重新发布避免过快问题同时判题服务过多导致的失败
try {
TimeUnit.SECONDS.sleep(2);
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}

View File

@ -11,9 +11,7 @@ import top.hcode.hoj.dao.JudgeMapper;
import top.hcode.hoj.pojo.entity.ContestRecord;
import top.hcode.hoj.pojo.entity.Judge;
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.JudgeServiceImpl;
import top.hcode.hoj.service.impl.ProblemCountServiceImpl;
import top.hcode.hoj.utils.Constants;
import top.hcode.hoj.utils.RedisUtils;
@ -21,7 +19,7 @@ import top.hcode.hoj.utils.RedisUtils;
/**
* @Author: Himit_ZH
* @Date: 2021/2/5 16:44
* @Description:
* @Description: 判题信息的发布者通过主题发布到特定频道内
*/
@Component
@Slf4j
@ -51,7 +49,6 @@ public class JudgeDispatcher {
redisUtils.sendMessage(Constants.Judge.STATUS_JUDGE_WAITING.getName(), JSONUtil.toJsonStr(task));
} catch (Exception e) {
log.error("调用redis消息发布异常,此次判题任务判为系统错误--------------->{}", e.getMessage());
UpdateWrapper<Judge> judgeUpdateWrapper = new UpdateWrapper<>();
judgeUpdateWrapper.eq("submit_id", submitId)
.set("error_message", "The something has gone wrong with the data Backup server. Please report this to administrator.")

View File

@ -19,6 +19,9 @@ import top.hcode.hoj.service.impl.JudgeServiceImpl;
* @Author: Himit_ZH
* @Date: 2021/2/5 16:43
* @Description:
* 1. 判题信息的接受者调用判题服务对提交代码进行判断
* 2. 若无空闲判题服务器会自动进入熔断机制重新将该判题信息发布到频道内
* 3. 再次接受到信息再次查询是否有空闲判题服务器若有则进行判题否则回到2
*/
@Component
public class JudgeReceiver implements MessageListener {

View File

@ -1,33 +1,40 @@
<template>
<div v-if="!isAdminView">
<NavBar></NavBar>
<div id="oj-content">
<transition name="el-zoom-in-bottom">
<router-view></router-view>
</transition>
<div>
<el-backtop :right="10"></el-backtop>
<div v-if="!isAdminView">
<NavBar></NavBar>
<div id="oj-content">
<transition name="el-zoom-in-bottom">
<router-view></router-view>
</transition>
</div>
<div class="footer">
<a style="color:#1E9FFF" :href="websiteConfig.recordUrl">{{
websiteConfig.recordName
}}</a>
<p>
Powered by
<a :href="websiteConfig.projectUrl" style="color:#1E9FFF">{{
websiteConfig.projectName
}}</a>
</p>
</div>
</div>
<div class="footer">
<a style="color:#1E9FFF" :href="websiteConfig.recordUrl">{{websiteConfig.recordName}}</a>
<p>
Powered by <a :href="websiteConfig.projectUrl" style="color:#1E9FFF">{{websiteConfig.projectName}}</a>
</p>
</div>
</div>
<div v-else>
<div id="admin-content">
<transition name="el-zoom-in-bottom">
<router-view></router-view>
</transition>
<div v-else>
<div id="admin-content">
<transition name="el-zoom-in-bottom">
<router-view></router-view>
</transition>
</div>
</div>
</div>
</template>
<script>
import NavBar from "@/components/oj/common/NavBar";
import { mapActions, mapState } from "vuex";
import NavBar from '@/components/oj/common/NavBar';
import { mapActions, mapState } from 'vuex';
export default {
name: "app-content",
name: 'app-content',
components: {
NavBar,
},
@ -37,33 +44,33 @@ export default {
};
},
methods: {
...mapActions(['changeDomTitle','getWebsiteConfig'])
...mapActions(['changeDomTitle', 'getWebsiteConfig']),
},
watch: {
$route() {
this.changeDomTitle();
},
'websiteConfig' () {
websiteConfig() {
this.changeDomTitle();
},
},
computed: {
...mapState(['websiteConfig'])
...mapState(['websiteConfig']),
},
created: function () {
created: function() {
try {
document.body.removeChild(document.getElementById("app-loader"));
document.body.removeChild(document.getElementById('app-loader'));
} catch (e) {
console.log(e);
}
if (this.$route.path.split("/")[1] != "admin") {
if (this.$route.path.split('/')[1] != 'admin') {
this.isAdminView = false;
} else {
this.isAdminView = true;
}
},
mounted () {
this.getWebsiteConfig()
mounted() {
this.getWebsiteConfig();
},
};
</script>
@ -88,25 +95,25 @@ pre,
samp {
font-family: Consolas, Menlo, Courier, monospace;
}
#admin-content{
background-color: #1E9FFF;
position:absolute;
#admin-content {
background-color: #1e9fff;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.mobile-menu-active{
background-color: rgba(0,0,0,.1);
.mobile-menu-active {
background-color: rgba(0, 0, 0, 0.1);
}
.mobile-menu-active .mu-item-title{
color: #2d8cf0!important;
.mobile-menu-active .mu-item-title {
color: #2d8cf0 !important;
}
.mobile-menu-active .mu-icon{
color: #2d8cf0!important;
.mobile-menu-active .mu-icon {
color: #2d8cf0 !important;
}
#particles-js{
position:fixed;
z-index:0;
#particles-js {
position: fixed;
z-index: 0;
top: 0;
left: 0;
right: 0;
@ -121,7 +128,7 @@ a {
transition: color 0.2s ease;
}
a:hover {
color: #2196f3!important;
color: #2196f3 !important;
}
.panel-title {
font-size: 21px;
@ -181,9 +188,9 @@ a:hover {
font-size: 12px !important;
font-weight: 500 !important;
}
.row--hover{
.row--hover {
cursor: pointer;
background-color: #ebf7ff!important;
background-color: #ebf7ff !important;
}
.vxe-table .vxe-body--column:not(.col--ellipsis),
.vxe-table .vxe-footer--column:not(.col--ellipsis),
@ -198,8 +205,8 @@ a:hover {
margin-top: 80px;
padding: 0 4%;
}
.vxe-table--body-wrapper{
overflow-x: hidden!important;
.vxe-table--body-wrapper {
overflow-x: hidden !important;
}
}
.markdown-body img {
@ -250,11 +257,11 @@ a:hover {
min-width: 120px !important;
text-align: center;
}
.panel-options{
margin-top:10px;
.panel-options {
margin-top: 10px;
text-align: center;
}
.el-tag--dark{
border-color: #FFF!important;
.el-tag--dark {
border-color: #fff !important;
}
</style>

View File

@ -239,7 +239,7 @@ export default {
height: auto !important;
}
.CodeMirror-scroll {
min-height: 520px;
max-height: 520px;
min-height: 549px;
max-height: 1000px;
}
</style>

View File

@ -9,7 +9,12 @@ const rootState = {
mode: 'Login', // or 'register',
visible: false
},
websiteConfig:{},
websiteConfig:{
recordName:'粤ICP备×××××××号-1',
projectName:'HOJ',
recordUrl:'#',
projectUrl:'#'
},
registerTimeOut: 60,
resetTimeOut: 90,
}

View File

@ -3,8 +3,8 @@
<div id="problem-main">
<!--problem main-->
<el-row>
<el-col :sm="24" :md="24" :lg="12" class="problem-detail">
<el-card :padding="10" shadow>
<el-col :sm="24" :md="24" :lg="12">
<el-card :padding="10" shadow class="problem-detail">
<div slot="header" class="panel-title">
<span>{{ problemData.problem.title }}</span
><br />
@ -124,8 +124,13 @@
</div>
</el-card>
</el-col>
<el-col :sm="24" :md="24" :lg="12" class="submit-detail">
<el-card :padding="10" id="submit-code" shadow="always">
<el-col :sm="24" :md="24" :lg="12">
<el-card
:padding="10"
id="submit-code"
shadow="always"
class="submit-detail"
>
<CodeMirror
:value.sync="code"
:languages="problemData.problem.languages"
@ -725,11 +730,11 @@ export default {
@media screen and (min-width: 768px) {
.problem-detail {
height: 672px;
height: 700px !important;
overflow-y: auto;
}
.submit-detail {
height: 672px;
height: 700px !important;
overflow-y: auto;
}
.problem-menu span {