Dateien nach "/" hochladen

This commit is contained in:
2025-11-14 10:47:25 +00:00
parent d4a5bf7c0a
commit 39b3ec418f

View File

@@ -8,13 +8,13 @@
], ],
"additionalFields": {} "additionalFields": {}
}, },
"id": "b7769320-830c-4a76-9086-ea4067969ad7", "id": "ddba8065-2681-4767-a8fc-99f3ccdba6ec",
"name": "Telegram Trigger", "name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger", "type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.1, "typeVersion": 1.1,
"position": [ "position": [
0, 80,
16 128
], ],
"webhookId": "telegram-location-webhook", "webhookId": "telegram-location-webhook",
"credentials": { "credentials": {
@@ -35,43 +35,34 @@
] ]
} }
}, },
"id": "57f03b50-3184-4d1e-9d33-f628f93f466b", "id": "3b6cacfd-4fa8-49b5-b7d7-c53e8a38b2b1",
"name": "Hat Location?", "name": "Hat Location?",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
224, 304,
16 128
] ]
}, },
{ {
"parameters": { "parameters": {
"jsCode": "// Extrahiere Location-Daten für NocoDB\nconst items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n const location = item.json.message.location;\n const from = item.json.message.from;\n const messageDate = item.json.message.date;\n \n const timestamp = new Date(messageDate * 1000).toISOString();\n const displayTime = new Date(messageDate * 1000).toLocaleString('de-DE');\n \n results.push({\n json: {\n latitude: location.latitude,\n longitude: location.longitude,\n timestamp: timestamp,\n user_id: from.id,\n first_name: from.first_name || '',\n last_name: from.last_name || '',\n username: from.username || '',\n marker_label: `${from.first_name || ''} ${from.last_name || ''}`.trim(),\n display_time: displayTime,\n chat_id: item.json.message.chat.id\n }\n });\n}\n\nreturn results;" "jsCode": "// Extrahiere Location-Daten für NocoDB\nconst items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n const location = item.json.message.location;\n const from = item.json.message.from;\n const messageDate = item.json.message.date;\n \n const timestamp = new Date(messageDate * 1000).toISOString();\n const displayTime = new Date(messageDate * 1000).toLocaleString('de-DE');\n \n results.push({\n json: {\n latitude: location.latitude,\n longitude: location.longitude,\n timestamp: timestamp,\n user_id: from.id,\n first_name: from.first_name || '',\n last_name: from.last_name || '',\n username: from.username || '',\n marker_label: `${from.first_name || ''} ${from.last_name || ''}`.trim(),\n display_time: displayTime,\n chat_id: item.json.message.chat.id\n }\n });\n}\n\nreturn results;"
}, },
"id": "dafcade6-0563-47b9-bd0d-dff0f61d1dbb", "id": "e6048d6f-f70e-48d2-b9ac-d8e9b666ed06",
"name": "Location verarbeiten", "name": "Location verarbeiten",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
448, 528,
0 112
] ]
}, },
{ {
"parameters": { "parameters": {
"authentication": "nocoDbApiToken",
"operation": "create", "operation": "create",
"projectId": { "projectId": "pdxl4cx4dbu9nxi",
"__rl": true, "table": "m8pqj5ixgnnrzkg",
"value": "YOUR_PROJECT_ID",
"mode": "list",
"cachedResultName": "YOUR_PROJECT_NAME"
},
"tableId": {
"__rl": true,
"value": "YOUR_TABLE_ID",
"mode": "list",
"cachedResultName": "locations"
},
"fieldsUi": { "fieldsUi": {
"fieldValues": [ "fieldValues": [
{ {
@@ -117,92 +108,66 @@
] ]
} }
}, },
"id": "c519118b-0626-4ace-befc-ee9859d73504", "id": "871598c7-0d0d-420d-b570-6cc2fe68225b",
"name": "Speichere in NocoDB", "name": "Speichere in NocoDB",
"type": "n8n-nodes-base.nocoDb", "type": "n8n-nodes-base.nocoDb",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
672, 752,
0 112
], ],
"credentials": { "credentials": {
"nocoDbApiToken": { "nocoDbApiToken": {
"id": "YOUR_NOCODB_CREDENTIALS_ID", "id": "6fNBtcghMe8wFoE5",
"name": "NocoDB API Token" "name": "NocoDB Token account"
} }
} }
}, },
{ {
"parameters": { "parameters": {
"authentication": "nocoDbApiToken",
"operation": "getAll", "operation": "getAll",
"projectId": { "projectId": "pdxl4cx4dbu9nxi",
"__rl": true, "table": "m8pqj5ixgnnrzkg",
"value": "YOUR_PROJECT_ID",
"mode": "list",
"cachedResultName": "YOUR_PROJECT_NAME"
},
"tableId": {
"__rl": true,
"value": "YOUR_TABLE_ID",
"mode": "list",
"cachedResultName": "locations"
},
"returnAll": false,
"limit": 1, "limit": 1,
"options": { "options": {}
"sort": [
{
"field": "timestamp",
"direction": "desc"
}
]
}
}, },
"id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d", "id": "e80e8a1d-901e-4870-85a9-9daac4188b4a",
"name": "Hole letzten Eintrag", "name": "Hole letzten Eintrag",
"type": "n8n-nodes-base.nocoDb", "type": "n8n-nodes-base.nocoDb",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
896, 976,
0 112
], ],
"credentials": { "credentials": {
"nocoDbApiToken": { "nocoDbApiToken": {
"id": "YOUR_NOCODB_CREDENTIALS_ID", "id": "6fNBtcghMe8wFoE5",
"name": "NocoDB API Token" "name": "NocoDB Token account"
} }
} }
}, },
{ {
"parameters": { "parameters": {
"authentication": "nocoDbApiToken",
"operation": "getAll", "operation": "getAll",
"projectId": { "projectId": "pdxl4cx4dbu9nxi",
"__rl": true, "table": "m8pqj5ixgnnrzkg",
"value": "YOUR_PROJECT_ID",
"mode": "list",
"cachedResultName": "YOUR_PROJECT_NAME"
},
"tableId": {
"__rl": true,
"value": "YOUR_TABLE_ID",
"mode": "list",
"cachedResultName": "locations"
},
"returnAll": true, "returnAll": true,
"options": {} "options": {}
}, },
"id": "8b7a6c5d-4e3f-2a1b-0c9d-8e7f6a5b4c3d", "id": "c98b7cd0-bf3e-41a0-811e-04b22c5e8662",
"name": "Zähle Einträge", "name": "Zähle Einträge",
"type": "n8n-nodes-base.nocoDb", "type": "n8n-nodes-base.nocoDb",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
896, 976,
120 240
], ],
"credentials": { "credentials": {
"nocoDbApiToken": { "nocoDbApiToken": {
"id": "YOUR_NOCODB_CREDENTIALS_ID", "id": "6fNBtcghMe8wFoE5",
"name": "NocoDB API Token" "name": "NocoDB Token account"
} }
} }
}, },
@@ -210,13 +175,13 @@
"parameters": { "parameters": {
"jsCode": "// Kombiniere Daten für Telegram-Bestätigung\nconst lastEntry = $('Hole letzten Eintrag').all();\nconst allEntries = $('Zähle Einträge').all();\nconst originalData = $('Location verarbeiten').first().json;\n\nreturn [{\n json: {\n latitude: originalData.latitude,\n longitude: originalData.longitude,\n display_time: originalData.display_time,\n chat_id: originalData.chat_id,\n total: allEntries.length\n }\n}];" "jsCode": "// Kombiniere Daten für Telegram-Bestätigung\nconst lastEntry = $('Hole letzten Eintrag').all();\nconst allEntries = $('Zähle Einträge').all();\nconst originalData = $('Location verarbeiten').first().json;\n\nreturn [{\n json: {\n latitude: originalData.latitude,\n longitude: originalData.longitude,\n display_time: originalData.display_time,\n chat_id: originalData.chat_id,\n total: allEntries.length\n }\n}];"
}, },
"id": "7c6b5a4d-3e2f-1a0b-9c8d-7e6f5a4b3c2d", "id": "894ec56f-e490-4639-8c50-f5590b036cc9",
"name": "Bereite Bestätigung vor", "name": "Bereite Bestätigung vor",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
1120, 1344,
0 128
] ]
}, },
{ {
@@ -225,13 +190,13 @@
"text": "=✅ Standort gespeichert!\n\n📍 Koordinaten:\nLat: {{ $json.latitude }}\nLon: {{ $json.longitude }}\n\n🕐 Zeit: {{ $json.display_time }}\n\n🗺 Karte:\nhttps://web.unixweb.home64.de/tracker/index.html\n\n📊 Gespeicherte Punkte: {{ $json.total }}", "text": "=✅ Standort gespeichert!\n\n📍 Koordinaten:\nLat: {{ $json.latitude }}\nLon: {{ $json.longitude }}\n\n🕐 Zeit: {{ $json.display_time }}\n\n🗺 Karte:\nhttps://web.unixweb.home64.de/tracker/index.html\n\n📊 Gespeicherte Punkte: {{ $json.total }}",
"additionalFields": {} "additionalFields": {}
}, },
"id": "aa023c84-7664-4641-b3fc-cd30b9f69941", "id": "e68d8cb8-7978-44eb-875c-5dd04ae1a4f8",
"name": "Telegram Bestätigung", "name": "Telegram Bestätigung",
"type": "n8n-nodes-base.telegram", "type": "n8n-nodes-base.telegram",
"typeVersion": 1.1, "typeVersion": 1.1,
"position": [ "position": [
1344, 1520,
0 128
], ],
"webhookId": "9df3ad7d-315d-4782-b4ec-4fb154c0b46d", "webhookId": "9df3ad7d-315d-4782-b4ec-4fb154c0b46d",
"credentials": { "credentials": {
@@ -249,53 +214,37 @@
"allowedOrigins": "*" "allowedOrigins": "*"
} }
}, },
"id": "b47e8370-3276-4f49-a2c5-25ef07b83ce8", "id": "b3b98836-97c0-43b4-84ca-4a47eb4bc670",
"name": "Webhook - Location API", "name": "Webhook - Location API",
"type": "n8n-nodes-base.webhook", "type": "n8n-nodes-base.webhook",
"typeVersion": 1.1, "typeVersion": 1.1,
"position": [ "position": [
0, 80,
304 416
], ],
"webhookId": "location-api-endpoint" "webhookId": "location-api-endpoint"
}, },
{ {
"parameters": { "parameters": {
"authentication": "nocoDbApiToken",
"operation": "getAll", "operation": "getAll",
"projectId": { "projectId": "pdxl4cx4dbu9nxi",
"__rl": true, "table": "m8pqj5ixgnnrzkg",
"value": "YOUR_PROJECT_ID",
"mode": "list",
"cachedResultName": "YOUR_PROJECT_NAME"
},
"tableId": {
"__rl": true,
"value": "YOUR_TABLE_ID",
"mode": "list",
"cachedResultName": "locations"
},
"returnAll": true, "returnAll": true,
"options": { "options": {}
"sort": [
{
"field": "timestamp",
"direction": "desc"
}
]
}
}, },
"id": "200dbfff-2932-4e92-9e47-181ff706c0de", "id": "efc8af5b-b101-4a1c-b43e-f53adc22736e",
"name": "Lade Daten aus NocoDB", "name": "Lade Daten aus NocoDB",
"type": "n8n-nodes-base.nocoDb", "type": "n8n-nodes-base.nocoDb",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
224, 304,
304 416
], ],
"credentials": { "credentials": {
"nocoDbApiToken": { "nocoDbApiToken": {
"id": "YOUR_NOCODB_CREDENTIALS_ID", "id": "6fNBtcghMe8wFoE5",
"name": "NocoDB API Token" "name": "NocoDB Token account"
} }
} }
}, },
@@ -303,13 +252,13 @@
"parameters": { "parameters": {
"jsCode": "// Baue API Response aus NocoDB-Daten\nconst locations = $input.all().map(item => item.json);\n\nconst current = locations.length > 0 ? locations[0] : null;\n\nreturn [{\n json: {\n success: true,\n current: current,\n history: locations,\n total_points: locations.length,\n last_updated: current ? current.timestamp : null\n }\n}];" "jsCode": "// Baue API Response aus NocoDB-Daten\nconst locations = $input.all().map(item => item.json);\n\nconst current = locations.length > 0 ? locations[0] : null;\n\nreturn [{\n json: {\n success: true,\n current: current,\n history: locations,\n total_points: locations.length,\n last_updated: current ? current.timestamp : null\n }\n}];"
}, },
"id": "7c56b850-f1dd-4c51-ac8d-4313e199e6e7", "id": "9e270f26-f22e-4b12-a401-326786f8a3ec",
"name": "Format API Response", "name": "Format API Response",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
448, 528,
304 416
] ]
}, },
{ {
@@ -331,13 +280,13 @@
} }
} }
}, },
"id": "9b720b0b-b4f8-4599-9e2f-d6e8f67819ab", "id": "6f2b9459-9a70-4fd0-aeca-fd93e2686371",
"name": "JSON Response", "name": "JSON Response",
"type": "n8n-nodes-base.respondToWebhook", "type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
672, 752,
304 416
] ]
}, },
{ {
@@ -348,12 +297,23 @@
}, },
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"position": [ "position": [
-80, 0,
-112 0
], ],
"typeVersion": 1, "typeVersion": 1,
"id": "29506fa4-6cb3-403f-bd64-6a2f49a2eb85", "id": "5f977203-f2d1-4769-b586-61626021a492",
"name": "Sticky Note" "name": "Sticky Note"
},
{
"parameters": {},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
1168,
128
],
"id": "ddefcd86-d670-408f-86c5-bbcf4468f446",
"name": "Merge"
} }
], ],
"pinData": {}, "pinData": {},
@@ -411,7 +371,7 @@
"main": [ "main": [
[ [
{ {
"node": "Bereite Bestätigung vor", "node": "Merge",
"type": "main", "type": "main",
"index": 0 "index": 0
} }
@@ -422,9 +382,9 @@
"main": [ "main": [
[ [
{ {
"node": "Bereite Bestätigung vor", "node": "Merge",
"type": "main", "type": "main",
"index": 0 "index": 1
} }
] ]
] ]
@@ -472,19 +432,32 @@
} }
] ]
] ]
},
"Merge": {
"main": [
[
{
"node": "Bereite Bestätigung vor",
"type": "main",
"index": 0
}
]
]
} }
}, },
"active": true, "active": true,
"settings": { "settings": {
"executionOrder": "v1", "executionOrder": "v1",
"callerPolicy": "workflowsFromSameOwner", "callerPolicy": "workflowsFromSameOwner",
"executionTimeout": -1,
"availableInMCP": false, "availableInMCP": false,
"errorWorkflow": "PhwIkaqyXRasTXDH" "errorWorkflow": "PhwIkaqyXRasTXDH"
}, },
"versionId": "b87a412a-4833-4f0d-aa33-0ba9074238d9", "versionId": "01b8afe3-8aa5-4004-9384-2dc32654961a",
"meta": { "meta": {
"templateCredsSetupCompleted": true,
"instanceId": "12d864c68e4fb5dfd100dc0c683b95f43cd55af7e9efa82e25407fac5a3824a5" "instanceId": "12d864c68e4fb5dfd100dc0c683b95f43cd55af7e9efa82e25407fac5a3824a5"
}, },
"id": "5dUTiJE61r7opoul", "id": "gs6GxPzIPKTjpK2Z",
"tags": [] "tags": []
} }