mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-03 20:12:59 +00:00
Add files via upload
This commit is contained in:
+9
-21
@@ -552,33 +552,21 @@
|
||||
try {
|
||||
showMessage('Odesílání záznamu...', 'info');
|
||||
|
||||
const res = await fetch('/api/trips', {
|
||||
const res = await fetch('/submit', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
const text = await res.text();
|
||||
const result = await res.json();
|
||||
showMessage(result.message, 'success');
|
||||
|
||||
// Validate JSON response
|
||||
try {
|
||||
const result = JSON.parse(text);
|
||||
if (res.ok) {
|
||||
showMessage(result.message || 'Záznam úspěšně uložen', 'success');
|
||||
|
||||
// Reset form but keep today's date
|
||||
form.reset();
|
||||
dateStart.value = todayStr;
|
||||
dateEnd.value = todayStr;
|
||||
totalDistance.textContent = '0 km';
|
||||
totalTime.textContent = '0:00';
|
||||
} else {
|
||||
showMessage(result.error || 'Chyba při ukládání', 'error');
|
||||
}
|
||||
} catch (jsonError) {
|
||||
console.error('Invalid JSON response:', text);
|
||||
showMessage('Neplatná odpověď ze serveru', 'error');
|
||||
}
|
||||
// Reset form but keep today's date
|
||||
form.reset();
|
||||
dateStart.value = todayStr;
|
||||
dateEnd.value = todayStr;
|
||||
totalDistance.textContent = '0 km';
|
||||
totalTime.textContent = '0:00';
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
showMessage('Nepodařilo se odeslat záznam. Zkontrolujte připojení k internetu.', 'error');
|
||||
|
||||
@@ -34,7 +34,7 @@ type ContactData struct {
|
||||
var (
|
||||
currentData *ContactData
|
||||
dataFile = "data/contacts.json"
|
||||
xlsxFile = "TelefonniSeznamWeb.xlsx"
|
||||
xlsxFile = "/mnt/telefony/TelefonniSeznamWeb.xlsx"
|
||||
)
|
||||
|
||||
func startAutoReload() {
|
||||
|
||||
Reference in New Issue
Block a user