kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
Support to upload log to HamZone.cn
rodzic
6bccc51cad
commit
0b0b831d73
|
@ -2355,6 +2355,28 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
</td>
|
</td>
|
||||||
<td id="lotwTestResult"></td>
|
<td id="lotwTestResult"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td data-i18n="settings.logging.HamZone.source">HamZone.cn</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" checked="false" id="logHamZoneqsoCheckBox"
|
||||||
|
onclick="adifLogQsoCheckBoxChanged(this);" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<label data-i18n="settings.logging.HamZone.details.apiKey" for="HamZoneApiKey">API Key</label>
|
||||||
|
<input id="HamZoneApiKey" type="password" class="inputTextValue" size="21"
|
||||||
|
oninput=" ValidateText(this); adifTextValueChange(this);" />
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div data-i18n="settings.logging.HamZone.test.button" class="button"
|
||||||
|
onclick="if ( ValidateText(HamZoneApiKey) ) HamZoneTest(true);">
|
||||||
|
Test
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td id="HamZoneTestResult"></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td data-i18n="settings.logging.N1MM.source">N1MM Logger+</td>
|
<td data-i18n="settings.logging.N1MM.source">N1MM Logger+</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
|
@ -335,6 +335,9 @@
|
||||||
"settings.logging.LoTW.details.station": "台站位置",
|
"settings.logging.LoTW.details.station": "台站位置",
|
||||||
"settings.logging.LoTW.test.downloadButton": "測試下載",
|
"settings.logging.LoTW.test.downloadButton": "測試下載",
|
||||||
"settings.logging.LoTW.test.TQSLButton": "測試TQSL",
|
"settings.logging.LoTW.test.TQSLButton": "測試TQSL",
|
||||||
|
"settings.logging.HamZone.source": "HamZone.cn",
|
||||||
|
"settings.logging.HamZone.details.apiKey": "API密鑰",
|
||||||
|
"settings.logging.HamZone.test.button": "測試",
|
||||||
"settings.logging.N1MM.source": "N1MM Logger+",
|
"settings.logging.N1MM.source": "N1MM Logger+",
|
||||||
"settings.logging.N1MM.details.IP": "IP地址",
|
"settings.logging.N1MM.details.IP": "IP地址",
|
||||||
"settings.logging.N1MM.details.Port": "埠號",
|
"settings.logging.N1MM.details.Port": "埠號",
|
||||||
|
|
|
@ -334,6 +334,9 @@
|
||||||
"settings.logging.LoTW.details.station": "台站位置",
|
"settings.logging.LoTW.details.station": "台站位置",
|
||||||
"settings.logging.LoTW.test.downloadButton": "测试下载",
|
"settings.logging.LoTW.test.downloadButton": "测试下载",
|
||||||
"settings.logging.LoTW.test.TQSLButton": "测试TQSL",
|
"settings.logging.LoTW.test.TQSLButton": "测试TQSL",
|
||||||
|
"settings.logging.HamZone.source": "HamZone.cn",
|
||||||
|
"settings.logging.HamZone.details.apiKey": "API密钥",
|
||||||
|
"settings.logging.HamZone.test.button": "测试",
|
||||||
"settings.logging.N1MM.source": "N1MM Logger+",
|
"settings.logging.N1MM.source": "N1MM Logger+",
|
||||||
"settings.logging.N1MM.details.IP": "IP地址",
|
"settings.logging.N1MM.details.IP": "IP地址",
|
||||||
"settings.logging.N1MM.details.Port": "端口",
|
"settings.logging.N1MM.details.Port": "端口",
|
||||||
|
|
|
@ -333,6 +333,9 @@
|
||||||
"settings.logging.LoTW.details.station": "Station Name",
|
"settings.logging.LoTW.details.station": "Station Name",
|
||||||
"settings.logging.LoTW.test.downloadButton":"Test Download",
|
"settings.logging.LoTW.test.downloadButton":"Test Download",
|
||||||
"settings.logging.LoTW.test.TQSLButton": "Test TQSL",
|
"settings.logging.LoTW.test.TQSLButton": "Test TQSL",
|
||||||
|
"settings.logging.HamZone.source": "HamZone.cn",
|
||||||
|
"settings.logging.HamZone.details.apiKey": "API Key",
|
||||||
|
"settings.logging.HamZone.test.button": "Test",
|
||||||
"settings.logging.N1MM.source": "N1MM Logger+",
|
"settings.logging.N1MM.source": "N1MM Logger+",
|
||||||
"settings.logging.N1MM.details.IP": "IP",
|
"settings.logging.N1MM.details.IP": "IP",
|
||||||
"settings.logging.N1MM.details.Port": "Port",
|
"settings.logging.N1MM.details.Port": "Port",
|
||||||
|
|
|
@ -2170,6 +2170,16 @@ function finishSendingReport(record, localMode)
|
||||||
addLastTraffic("<font style='color:red'>Exception LoTW Log</font>");
|
addLastTraffic("<font style='color:red'>Exception LoTW Log</font>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sendHamZoneEntry(report);
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
addLastTraffic("<font style='color:red'>Exception HamZone Log</font>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
logeQSLQSOCheckBox.checked == true &&
|
logeQSLQSOCheckBox.checked == true &&
|
||||||
nicknameeQSLCheckBox.checked == true &&
|
nicknameeQSLCheckBox.checked == true &&
|
||||||
|
@ -2788,6 +2798,96 @@ function ClublogTest(test)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function HamZoneTest(test)
|
||||||
|
{
|
||||||
|
if (test && test == true)
|
||||||
|
{
|
||||||
|
HamZoneTestResult.innerHTML = "Testing";
|
||||||
|
|
||||||
|
var postData = { key: HamZoneApiKey.value };
|
||||||
|
getPostJSONBuffer(
|
||||||
|
"http://127.0.0.1:5100/v1/logbook?from=gridtracker",
|
||||||
|
HamZoneSendResult,
|
||||||
|
test,
|
||||||
|
"https",
|
||||||
|
443,
|
||||||
|
postData,
|
||||||
|
10000,
|
||||||
|
HamZoneErrorCallback,
|
||||||
|
"Failed"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function HamZoneErrorCallback(
|
||||||
|
file_url,
|
||||||
|
callback,
|
||||||
|
flag,
|
||||||
|
mode,
|
||||||
|
port,
|
||||||
|
theData,
|
||||||
|
timeoutMs,
|
||||||
|
timeoutCallback,
|
||||||
|
message
|
||||||
|
)
|
||||||
|
{
|
||||||
|
HamZoneTestResult.innerHTML = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
function HamZoneSendResult(buffer, flag)
|
||||||
|
{
|
||||||
|
if (flag && flag == true)
|
||||||
|
{
|
||||||
|
if (buffer)
|
||||||
|
{
|
||||||
|
if (buffer.indexOf("Invalid") > -1)
|
||||||
|
{
|
||||||
|
HamZoneTestResult.innerHTML = "Invalid";
|
||||||
|
}
|
||||||
|
else if (buffer.indexOf("Pass") > -1)
|
||||||
|
{
|
||||||
|
HamZoneTestResult.innerHTML = "Passed";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HamZoneTestResult.innerHTML = "Unknown Error";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HamZoneTestResult.innerHTML = "Resp Err";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendHamZoneEntry(report)
|
||||||
|
{
|
||||||
|
if (g_mapSettings.offlineMode == true) return;
|
||||||
|
|
||||||
|
if (logHamZoneqsoCheckBox.checked == true)
|
||||||
|
{
|
||||||
|
if (typeof nw != "undefined")
|
||||||
|
{
|
||||||
|
var postData = {
|
||||||
|
key: HamZoneApiKey.value,
|
||||||
|
app: "GridTracker " + gtVersion,
|
||||||
|
adif: report
|
||||||
|
};
|
||||||
|
getPostBuffer(
|
||||||
|
"http://127.0.0.1:5100/v1/logbook?from=gridtracker",
|
||||||
|
HamZoneSendResult,
|
||||||
|
null,
|
||||||
|
"https",
|
||||||
|
443,
|
||||||
|
postData,
|
||||||
|
30000,
|
||||||
|
postRetryErrorCallaback,
|
||||||
|
"HamZone.cn"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getPostJSONBuffer(
|
function getPostJSONBuffer(
|
||||||
file_url,
|
file_url,
|
||||||
callback,
|
callback,
|
||||||
|
|
Ładowanie…
Reference in New Issue