题目详情页的样式修补

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 * @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();
} }

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.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.")

View File

@ -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 {

View File

@ -1,33 +1,40 @@
<template> <template>
<div v-if="!isAdminView"> <div>
<NavBar></NavBar> <el-backtop :right="10"></el-backtop>
<div id="oj-content"> <div v-if="!isAdminView">
<transition name="el-zoom-in-bottom"> <NavBar></NavBar>
<router-view></router-view> <div id="oj-content">
</transition> <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>
<div class="footer"> <div v-else>
<a style="color:#1E9FFF" :href="websiteConfig.recordUrl">{{websiteConfig.recordName}}</a> <div id="admin-content">
<p> <transition name="el-zoom-in-bottom">
Powered by <a :href="websiteConfig.projectUrl" style="color:#1E9FFF">{{websiteConfig.projectName}}</a> <router-view></router-view>
</p> </transition>
</div> </div>
</div>
<div v-else>
<div id="admin-content">
<transition name="el-zoom-in-bottom">
<router-view></router-view>
</transition>
</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>
@ -88,25 +95,25 @@ pre,
samp { 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;
} }
.mobile-menu-active .mu-icon{ .mobile-menu-active .mu-icon {
color: #2d8cf0!important; color: #2d8cf0 !important;
} }
#particles-js{ #particles-js {
position:fixed; position: fixed;
z-index:0; z-index: 0;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
@ -121,7 +128,7 @@ a {
transition: color 0.2s ease; transition: color 0.2s ease;
} }
a:hover { a:hover {
color: #2196f3!important; color: #2196f3 !important;
} }
.panel-title { .panel-title {
font-size: 21px; font-size: 21px;
@ -181,9 +188,9 @@ a:hover {
font-size: 12px !important; font-size: 12px !important;
font-weight: 500 !important; font-weight: 500 !important;
} }
.row--hover{ .row--hover {
cursor: pointer; cursor: pointer;
background-color: #ebf7ff!important; background-color: #ebf7ff !important;
} }
.vxe-table .vxe-body--column:not(.col--ellipsis), .vxe-table .vxe-body--column:not(.col--ellipsis),
.vxe-table .vxe-footer--column:not(.col--ellipsis), .vxe-table .vxe-footer--column:not(.col--ellipsis),
@ -198,8 +205,8 @@ a:hover {
margin-top: 80px; margin-top: 80px;
padding: 0 4%; padding: 0 4%;
} }
.vxe-table--body-wrapper{ .vxe-table--body-wrapper {
overflow-x: hidden!important; overflow-x: hidden !important;
} }
} }
.markdown-body img { .markdown-body img {
@ -250,11 +257,11 @@ a:hover {
min-width: 120px !important; min-width: 120px !important;
text-align: center; text-align: center;
} }
.panel-options{ .panel-options {
margin-top:10px; margin-top: 10px;
text-align: center; text-align: center;
} }
.el-tag--dark{ .el-tag--dark {
border-color: #FFF!important; border-color: #fff !important;
} }
</style> </style>

View File

@ -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>

View File

@ -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,
} }

View File

@ -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 {