评测列表实时更新&评测机接口更换为socket

This commit is contained in:
masnn committed 2020-04-09 22:56:22 +08:00
1 parent f055d79fef
commit ec727d58aa
7 files changed
+107 -50

No files matched your search

+6
View File
@@ -8,6 +8,12 @@ const page = new NamedPage('record_main', async () => {
const sock = new SockJs(Context.socketUrl);
const dd = new DiffDOM();
sock.onopen = () => {
sock.send(document.cookie);
setTimeout(() => {
sock.send(JSON.stringify({ rdocs: Context.rids }));
}, 300);
};
sock.onmessage = (message) => {
const msg = JSON.parse(message.data);
const $newTr = $(msg.html);