Reload table after each QSO in case of >1 PC used for logging
这个提交包含在:
父节点
bf213b1773
当前提交
bc76514096
共有 1 个文件被更改,包括 71 次插入 和 66 次删除
|
|
@ -1,8 +1,10 @@
|
|||
// Callsign always has focus on load
|
||||
$("#callsign").focus();
|
||||
|
||||
$(document).ready(function () {
|
||||
getSession().done(restoreContestSession);
|
||||
var sessiondata={};
|
||||
$(document).ready(async function () {
|
||||
sessiondata=await getSession();
|
||||
await restoreContestSession(sessiondata);
|
||||
setRst($("#mode").val());
|
||||
});
|
||||
|
||||
|
|
@ -435,8 +437,6 @@ function logQso() {
|
|||
vuccr,
|
||||
]];
|
||||
|
||||
table.rows.add(data).draw();
|
||||
|
||||
var formdata = new FormData(document.getElementById("qso_input"));
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qso/saveqso',
|
||||
|
|
@ -445,7 +445,7 @@ function logQso() {
|
|||
processData: false,
|
||||
contentType: false,
|
||||
enctype: 'multipart/form-data',
|
||||
success: function (html) {
|
||||
success: async function (html) {
|
||||
var exchangetype = $("#exchangetype").val();
|
||||
if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') {
|
||||
$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1);
|
||||
|
|
@ -462,6 +462,7 @@ function logQso() {
|
|||
$("#callsign").focus();
|
||||
setSession(formdata);
|
||||
|
||||
await refresh_qso_table(sessiondata);
|
||||
var qTable = $('.qsotable').DataTable();
|
||||
qTable.search('').order([0, 'desc']).draw();
|
||||
|
||||
|
|
@ -470,14 +471,14 @@ function logQso() {
|
|||
}
|
||||
}
|
||||
|
||||
function getSession() {
|
||||
return $.ajax({
|
||||
async function getSession() {
|
||||
return await $.ajax({
|
||||
url: base_url + 'index.php/contesting/getSession',
|
||||
type: 'post',
|
||||
});
|
||||
}
|
||||
|
||||
function restoreContestSession(data) {
|
||||
async function restoreContestSession(data) {
|
||||
if (data) {
|
||||
if (data.copytodok == "1") {
|
||||
$('#copyexchangetodok').prop('checked', true);
|
||||
|
|
@ -498,13 +499,21 @@ function restoreContestSession(data) {
|
|||
}
|
||||
|
||||
if (data.qso != "") {
|
||||
await refresh_qso_table(data);
|
||||
}
|
||||
} else {
|
||||
$("#exch_serial_s").val("1");
|
||||
}
|
||||
}
|
||||
|
||||
async function refresh_qso_table(data) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/contesting/getSessionQsos',
|
||||
type: 'post',
|
||||
data: { 'qso': data.qso, },
|
||||
success: function (html) {
|
||||
var mode = '';
|
||||
|
||||
$(".contest_qso_table_contents").empty();
|
||||
$.each(html, function () {
|
||||
if (this.col_submode == null || this.col_submode == '') {
|
||||
mode = this.col_mode;
|
||||
|
|
@ -556,10 +565,6 @@ function restoreContestSession(data) {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$("#exch_serial_s").val("1");
|
||||
}
|
||||
}
|
||||
|
||||
function pad (str, max) {
|
||||
|
|
|
|||
正在加载…
在新工单中引用