update
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
-->
|
||||
<div class="row mb-3">
|
||||
|
||||
<div class="col-sm-3">
|
||||
<div class="col-sm-2">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
@@ -252,6 +252,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<p class="card-text">Setup PSD connection.</p>
|
||||
<button class="btn btn-primary" onclick="PSD_setup()">Start</button>
|
||||
<div id="loading_PSD" class="spinner-border spinner-border-sm" style="display: none;" role="status"></div>
|
||||
<div id="response_psd_setup"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<p class="card-text">Setup Server Hostname.</p>
|
||||
<div class="input-group input-group-sm mb-3">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">Server name</span>
|
||||
<input type="text" id="messageInput_server" class="form-control" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm">
|
||||
</div>
|
||||
<button class="btn btn-primary" onclick="setupServerHostname('ttyAMA2', document.getElementById('messageInput_server').value, 0)">Set</button>
|
||||
<div id="loading_serverHostname" class="spinner-border spinner-border-sm" style="display: none;" role="status"></div>
|
||||
<div id="response_serverHostname"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -558,6 +586,28 @@ function connectNetwork_saraR4(port, networkID, timeout){
|
||||
});
|
||||
}
|
||||
|
||||
function setupServerHostname(port, serverName, timeout){
|
||||
console.log(" Setupt server hostname "+serverName+"):");
|
||||
$("#loading_serverHostname").show();
|
||||
$.ajax({
|
||||
url: 'launcher.php?type=sara_setupHostname&port='+port+'&networkID='+encodeURIComponent(serverName)+'&profileID=0',
|
||||
dataType:'text',
|
||||
//dataType: 'json', // Specify that you expect a JSON response
|
||||
method: 'GET', // Use GET or POST depending on your needs
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$("#loading_serverHostname").hide();
|
||||
// Replace newline characters with <br> tags
|
||||
const formattedResponse = response.replace(/\n/g, "<br>");
|
||||
$("#response_serverHostname").html(formattedResponse);
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX request failed:', status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function mqtt_getConfig_saraR4(port, timeout){
|
||||
console.log("GET MQTT config (port "+port+"):");
|
||||
$("#loading_mqtt_getConfig").show();
|
||||
@@ -690,6 +740,27 @@ function ping_test(port, url){
|
||||
});
|
||||
}
|
||||
|
||||
function PSD_setup(port, url){
|
||||
console.log("Setup PSD connection:");
|
||||
$("#loading_PSD").show();
|
||||
$.ajax({
|
||||
url: 'launcher.php?type=sara_psd_setup',
|
||||
dataType: 'text',
|
||||
//dataType: 'json', // Specify that you expect a JSON response
|
||||
method: 'GET', // Use GET or POST depending on your needs
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$("#loading_PSD").hide();
|
||||
// Replace newline characters with <br> tags
|
||||
const formattedResponse = response.replace(/\n/g, "<br>");
|
||||
$("#response_psd_setup").html(formattedResponse);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX request failed:', status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function writeMessage_saraR4(port, message, type){
|
||||
console.log(type +" message to SARA R4 memory (port "+port+" and message "+message+"):");
|
||||
$("#loading_"+port+"_message_write").show();
|
||||
|
||||
Reference in New Issue
Block a user