fix(10-07): add timestamp to logs refresh to prevent message not modified error
- Format Inline Logs Result now adds timestamp to message - Shows 'Updated: HH:MM:SS' at bottom of logs display - Ensures Telegram API always accepts refresh (content always different)
This commit is contained in:
+1
-1
@@ -4836,7 +4836,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"jsCode": "// Format logs result for inline keyboard display\nconst result = $json;\nconst data = $('Prepare Inline Logs Input').item.json;\n\n// Get container state (need to fetch from Docker)\n// For now, build basic keyboard\nconst containerName = result.containerName;\n\n// Build inline keyboard\nconst keyboard = [\n [\n { text: '\ud83d\udd04 Refresh Logs', callback_data: `action:logs:${containerName}` },\n { text: '\u2b06\ufe0f Update', callback_data: `action:update:${containerName}` }\n ],\n [\n { text: '\u25c0\ufe0f Back to List', callback_data: 'list:0' }\n ]\n];\n\nreturn {\n json: {\n chatId: data.chatId,\n messageId: data.messageId,\n text: result.message,\n reply_markup: { inline_keyboard: keyboard }\n }\n};"
|
"jsCode": "// Format logs result for inline keyboard display\nconst result = $json;\nconst data = $('Prepare Inline Logs Input').item.json;\n\nconst containerName = result.containerName;\n\n// Add timestamp to prevent 'message not modified' error on refresh\nconst timestamp = new Date().toLocaleTimeString('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false\n});\n\n// Build inline keyboard\nconst keyboard = [\n [\n { text: '\ud83d\udd04 Refresh Logs', callback_data: `action:logs:${containerName}` },\n { text: '\u2b06\ufe0f Update', callback_data: `action:update:${containerName}` }\n ],\n [\n { text: '\u25c0\ufe0f Back to List', callback_data: 'list:0' }\n ]\n];\n\n// Append timestamp to message\nconst messageWithTimestamp = result.message + `\\n\\n<i>Updated: ${timestamp}</i>`;\n\nreturn {\n json: {\n chatId: data.chatId,\n messageId: data.messageId,\n text: messageWithTimestamp,\n reply_markup: { inline_keyboard: keyboard }\n }\n};"
|
||||||
},
|
},
|
||||||
"id": "b1800598-1ff6-4da3-8506-4e4e8127f902",
|
"id": "b1800598-1ff6-4da3-8506-4e4e8127f902",
|
||||||
"name": "Format Inline Logs Result",
|
"name": "Format Inline Logs Result",
|
||||||
|
|||||||
Reference in New Issue
Block a user