feat: web files

This commit is contained in:
SQ2CPA 2024-02-24 14:08:42 +01:00
parent b1bf6fe61f
commit d069c201d9
12 changed files with 18194 additions and 99 deletions

View file

@ -3,23 +3,29 @@
"stationMode": 2,
"iGateComment": "LoRa_APRS_iGate",
"wifi": {
"autoAP": {
"password": "1234567890",
"powerOff": 10
},
"AP": [
{ "ssid": "WIFI_1",
{
"ssid": "WIFI_1",
"password": "WIFI_1_password",
"latitude": 0.0000000,
"longitude": 0.0000000
"latitude": 0.0,
"longitude": 0.0
},
{ "ssid": "WIFI_2",
{
"ssid": "WIFI_2",
"password": "WIFI_2_password",
"latitude": 0.0000000,
"longitude": 0.0000000
"latitude": 0.0,
"longitude": 0.0
}
]
},
"digi": {
"comment": "LoRa_APRS_Digirepeater",
"latitude": 0.0000000,
"longitude": 0.0000000
"latitude": 0.0,
"longitude": 0.0
},
"aprs_is": {
"passcode": "XYZVW",
@ -39,7 +45,7 @@
"display": {
"alwaysOn": true,
"timeout": 4,
"turn180" : false
"turn180": false
},
"syslog": {
"active": false,
@ -50,7 +56,7 @@
"active": false
},
"ota": {
"username":"",
"username": "",
"password": ""
},
"other": {
@ -59,7 +65,7 @@
"igateRepeatsLoRaPackets": false,
"rememberStationTime": 30,
"sendBatteryVoltage": false,
"externalVoltageMeasurement" : false,
"externalVoltageMeasurement": false,
"externalVoltagePin": 34
}
}
}
}

View file

@ -1,19 +0,0 @@
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$data = [
'name' => $_POST['name'],
'email' => $_POST['email']
];
// Convert the data array to JSON format
$json_data = json_encode($data);
// Specify the path where you want to save the JSON file
$file_path = 'userdata.json';
// Save the JSON data to the file
file_put_contents($file_path, $json_data);
echo "Data saved as JSON successfully.";
}
?>

View file

@ -1,34 +0,0 @@
// Retrieve JSON data from the JSON file in SPIFFS
fetch('igate_conf.json')
.then(response => response.json())
.then(data => {
// Process the JSON data
//displayJSONData(data);
const jsonDataDiv = document.getElementById('json-container');
jsonDataDiv.innerHTML = ''; // Clear the previous content
if (Array.isArray(data)) {
// If data is an array, iterate through it
data.forEach(item => {
const itemDiv = document.createElement('div');
itemDiv.textContent = JSON.stringify(item, null, 2);
jsonDataDiv.appendChild(itemDiv);
});
} else {
// If data is not an array, display it directly
const itemDiv = document.createElement('div');
itemDiv.textContent = JSON.stringify(data, null, 2);
jsonDataDiv.appendChild(itemDiv);
}
})
.catch(error => {
console.error('There was a problem fetching the JSON data:', error);
});
// Display JSON data in the HTML
function displayJSONData(data) {
//const jsonContainer = document.getElementById('json-container');
//jsonContainer.innerHTML = JSON.stringify(data, null, 2);
}

View file

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Save Form Data to JSON</title>
</head>
<body>
<h1>Save Form Data to JSON</h1>
<form method="POST" action="process_form.php">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<input type="submit" value="Save as JSON">
</form>
</body>
</html>

View file

@ -1,10 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>JSON Data Example</title>
</head>
<body>
<div id="json-container"></div>
<script src="script.js"></script>
</body>
</html>