From 814c135e4cabf94c070c54b4a6f0fc5bf4a4b0fd Mon Sep 17 00:00:00 2001 From: Himit_ZH <372347736@qq.com> Date: Wed, 10 Feb 2021 00:03:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E7=9B=AE=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BF=AE=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hoj/common/exception/CloudHandler.java | 6 +- .../top/hcode/hoj/judge/JudgeDispatcher.java | 5 +- .../top/hcode/hoj/judge/JudgeReceiver.java | 3 + .../top/hcode/hoj/judge/JudgeDispatcher.class | Bin 4703 -> 4703 bytes .../top/hcode/hoj/judge/JudgeReceiver.class | Bin 3505 -> 3505 bytes hoj-vue/src/App.vue | 109 ++++++++++-------- .../src/components/oj/common/CodeMirror.vue | 4 +- hoj-vue/src/store/index.js | 7 +- hoj-vue/src/views/oj/problem/Problem.vue | 17 ++- 9 files changed, 84 insertions(+), 67 deletions(-) diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java index a51442af..f7b9ac1d 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java @@ -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(); } diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java index b32e6b4d..562376ec 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java @@ -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 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.") diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java index b2ca4a65..a5a273f2 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java @@ -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 { diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeDispatcher.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeDispatcher.class index 0556da0da848bcceca9a789efe01ac5f82f5d2c7..98c8c469cf04d1e6c3eb0b612440c6f140acf23f 100644 GIT binary patch delta 152 zcmWN}s|vzk9ES1dYmSBCnhx8SJPf9Dif26G#Ax*n3^tpF*^FPc+J)VNS+EK#Ca=Jz zf8O+j-<#=7-x5a^(~}dcV;PGIE>%2gXna|~hy@es%xJJCWJ8lJ5qnx3Xmh56q05CH sSNfz3xHIG-^2wN&=nqrA^6+D>EMh6xVT%c+mgGd0%qss@1rxabAIy{<6951J delta 152 zcmWN|s}ccG9DwofG&{nMtxG$R#aQDuZtHs3sColI(+D*2R8=>#?;x8|&1{i8fyTdm z;rpdJ)wiRo^2y0H>QKa?ghzl+8BIm1#(*UwLMGH%(O^xJ4J~%G+0)@n7fX)|eXepR p47n5W5cL%GV#pl=44Mq`3|c^zHiI660fQ}rA%hEp5rZ#-F+&)G R2}25l8ACmT`DAh4Spa9<3U>ei delta 63 zcmdley-|9D5f7upWMiJ~x+)A@45|#m3~CJW4C)LTK&Z!{%U}y6T^RHkd>ITF!Wax0 QQW%UG>KRNXi}TI`0Ap+lPyhe` diff --git a/hoj-vue/src/App.vue b/hoj-vue/src/App.vue index 436070a2..a85948a6 100644 --- a/hoj-vue/src/App.vue +++ b/hoj-vue/src/App.vue @@ -1,33 +1,40 @@ @@ -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; } diff --git a/hoj-vue/src/components/oj/common/CodeMirror.vue b/hoj-vue/src/components/oj/common/CodeMirror.vue index 58cbfb3a..d901f202 100644 --- a/hoj-vue/src/components/oj/common/CodeMirror.vue +++ b/hoj-vue/src/components/oj/common/CodeMirror.vue @@ -239,7 +239,7 @@ export default { height: auto !important; } .CodeMirror-scroll { - min-height: 520px; - max-height: 520px; + min-height: 549px; + max-height: 1000px; } diff --git a/hoj-vue/src/store/index.js b/hoj-vue/src/store/index.js index ae20636c..fe0a6a2a 100644 --- a/hoj-vue/src/store/index.js +++ b/hoj-vue/src/store/index.js @@ -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, } diff --git a/hoj-vue/src/views/oj/problem/Problem.vue b/hoj-vue/src/views/oj/problem/Problem.vue index c7351775..beeead30 100644 --- a/hoj-vue/src/views/oj/problem/Problem.vue +++ b/hoj-vue/src/views/oj/problem/Problem.vue @@ -3,8 +3,8 @@
- - + +
{{ problemData.problem.title }}
@@ -124,8 +124,13 @@
- - + +