|
|
@ -28,15 +28,14 @@ |
|
|
|
.accordion > .content > .accordion > .content > :last-child { |
|
|
|
.accordion > .content > .accordion > .content > :last-child { |
|
|
|
margin-bottom: -10px !important; |
|
|
|
margin-bottom: -10px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
.disabled{ |
|
|
|
|
|
|
|
display: none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |
|
|
|
<span id="submission_content"> |
|
|
|
<span id="submission_content"> |
|
|
|
<div class="padding" id="vueAppFuckSafari"> |
|
|
|
<div class="padding" id="vueAppFuckSafari"> |
|
|
|
|
|
|
|
<a href="<%= syzoj.utils.makeUrl(['contest', contest_id]) %>">返回比赛</a> |
|
|
|
<table class="ui very basic center aligned table" id="status_table"> |
|
|
|
<table class="ui very basic center aligned table" id="status_table"> |
|
|
|
<thead> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
|
|
|
|
<th>已分享</th> |
|
|
|
<th>编号</th> |
|
|
|
<th>编号</th> |
|
|
|
<th>题目</th> |
|
|
|
<th>题目</th> |
|
|
|
<th>状态</th> |
|
|
|
<th>状态</th> |
|
|
@ -55,9 +54,6 @@ |
|
|
|
<tr is="submission-item" v-bind:data="roughData" :config="displayConfig" :show-rejudge="showRejudge" :show-share="showShare" :progress="getProgress()" :compiling="detailResult && !detailResult.compile"></tr> |
|
|
|
<tr is="submission-item" v-bind:data="roughData" :config="displayConfig" :show-rejudge="showRejudge" :show-share="showShare" :progress="getProgress()" :compiling="detailResult && !detailResult.compile"></tr> |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
<div id="cid" class="disabled"><%= cid %></div> |
|
|
|
|
|
|
|
<div id="pid" class="disabled"><%= pid %></div> |
|
|
|
|
|
|
|
<div id="sid" class="disabled"><%= sid %></div> |
|
|
|
|
|
|
|
<code-box no-escape v-bind:content="code"> |
|
|
|
<code-box no-escape v-bind:content="code"> |
|
|
|
<% if (formattedCode !== null) { %> |
|
|
|
<% if (formattedCode !== null) { %> |
|
|
|
<a onclick="toggleFormattedCode()" class="ui button" style="position: absolute; top: 0px; right: -4px; border-top-left-radius: 0; border-bottom-right-radius: 0; "> |
|
|
|
<a onclick="toggleFormattedCode()" class="ui button" style="position: absolute; top: 0px; right: -4px; border-top-left-radius: 0; border-bottom-right-radius: 0; "> |
|
|
@ -318,10 +314,6 @@ const vueApp = new Vue({ |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (token != null) { |
|
|
|
if (token != null) { |
|
|
|
const loadSocketIO = function () { |
|
|
|
const loadSocketIO = function () { |
|
|
|
const cid = parseInt(document.getElementById('cid').innerHTML); |
|
|
|
|
|
|
|
const pid = parseInt(document.getElementById('pid').innerHTML); |
|
|
|
|
|
|
|
const sid = parseInt(document.getElementById('sid').innerHTML); |
|
|
|
|
|
|
|
console.log(sid); |
|
|
|
|
|
|
|
let currentVersion = 0; |
|
|
|
let currentVersion = 0; |
|
|
|
const socket = io(socketUrl); |
|
|
|
const socket = io(socketUrl); |
|
|
|
socket.on('connect', function () { |
|
|
|
socket.on('connect', function () { |
|
|
@ -346,68 +338,17 @@ if (token != null) { |
|
|
|
console.log("Judge finished"); |
|
|
|
console.log("Judge finished"); |
|
|
|
vueApp.roughData.running = false; |
|
|
|
vueApp.roughData.running = false; |
|
|
|
vueApp.roughData.result = p.roughResult; |
|
|
|
vueApp.roughData.result = p.roughResult; |
|
|
|
if (p.roughResult.result === 'Accepted') { |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
url: `/api/pass/${cid}/${pid}/${sid}`, |
|
|
|
|
|
|
|
type: 'GET', |
|
|
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) { |
|
|
|
|
|
|
|
alert('练习功能发生故障'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
url: `/api/nopass/${cid}/${pid}/${sid}`, |
|
|
|
|
|
|
|
type: 'GET', |
|
|
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) { |
|
|
|
|
|
|
|
alert('练习功能发生故障'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
vueApp.detailResult = p.result; |
|
|
|
vueApp.detailResult = p.result; |
|
|
|
socket.close(); |
|
|
|
socket.close(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
socket.emit('join', token, function (data) { |
|
|
|
socket.emit('join', token, function (data) { |
|
|
|
console.log("join! ", data); |
|
|
|
console.log("join! ", data); |
|
|
|
// data.ok=true; |
|
|
|
|
|
|
|
// data.finished=true; |
|
|
|
|
|
|
|
// data.roughResult = { |
|
|
|
|
|
|
|
// memory: 7128, |
|
|
|
|
|
|
|
// result: "Accepted", |
|
|
|
|
|
|
|
// score: 100, |
|
|
|
|
|
|
|
// time: 272, |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// data.running=false; |
|
|
|
|
|
|
|
if (data && data.ok) { |
|
|
|
if (data && data.ok) { |
|
|
|
if (data.finished) { |
|
|
|
if (data.finished) { |
|
|
|
vueApp.roughData.result = data.roughResult; |
|
|
|
vueApp.roughData.result = data.roughResult; |
|
|
|
// if (!data.result) location.reload(true); |
|
|
|
// if (!data.result) location.reload(true); |
|
|
|
vueApp.detailResult = data.result; |
|
|
|
vueApp.detailResult = data.result; |
|
|
|
vueApp.roughData.running = false; |
|
|
|
vueApp.roughData.running = false; |
|
|
|
// if (data.roughResult.result === 'Accepted') { |
|
|
|
|
|
|
|
// $.ajax({ |
|
|
|
|
|
|
|
// url: `/api/pass/${cid}/${pid}/${sid}`, |
|
|
|
|
|
|
|
// type: 'GET', |
|
|
|
|
|
|
|
// success: function (data) { |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// error: function (XMLHttpRequest, textStatus, errorThrown) { |
|
|
|
|
|
|
|
// alert('练习功能发生故障'); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// $.ajax({ |
|
|
|
|
|
|
|
// url: `/api/nopass/${cid}/${pid}/${sid}`, |
|
|
|
|
|
|
|
// type: 'GET', |
|
|
|
|
|
|
|
// success: function (data) { |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// error: function (XMLHttpRequest, textStatus, errorThrown) { |
|
|
|
|
|
|
|
// alert('练习功能发生故障'); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
socket.close(); |
|
|
|
socket.close(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (data.running) { |
|
|
|
if (data.running) { |
|
|
|