diff --git a/websiteFunctions/static/websiteFunctions/DockerContainers.js b/websiteFunctions/static/websiteFunctions/DockerContainers.js index 2b439bf1f..089a3258a 100644 --- a/websiteFunctions/static/websiteFunctions/DockerContainers.js +++ b/websiteFunctions/static/websiteFunctions/DockerContainers.js @@ -491,7 +491,8 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { summaryMessage += "
  • n8n port found (" + diagnostics.n8n_port + "):
  • "; } else { summaryMessage += "
  • n8n port (5678) not mapped:
  • "; - summaryMessage += "
  • Available ports:
    " + JSON.stringify(diagnostics.port_mappings, null, 2) + "
  • "; + var portMappingsString = JSON.stringify(diagnostics.port_mappings, null, 2); + summaryMessage += "
  • Available ports:
    " + portMappingsString + "
  • "; } if (diagnostics.container_running && diagnostics.n8n_port_found) { @@ -1156,18 +1157,23 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { $scope.cyberpanelLoading = true; $('#cyberpanelLoading').hide(); - // Simulate response + // Sample response data + var headers = { + 'content-type': 'application/json', + 'server': 'n8n' + }; + + var body = { + success: true, + executionId: '123456789' + }; + + // Simulate response with pre-stringified JSON container.webhookTools.testResult = { status: 200, statusText: 'OK', - headers: { - 'content-type': 'application/json', - 'server': 'n8n' - }, - body: { - success: true, - executionId: '123456789' - } + headers: JSON.stringify(headers, null, 2), + body: JSON.stringify(body, null, 2) }; new PNotify({ @@ -1546,4 +1552,23 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { // Add location service to the controller for the n8n URL $scope.location = window.location; + + // Function to view execution data details + $scope.viewExecutionData = function(execution) { + // Pre-stringify JSON data for template + $scope.selectedExecution = { + id: execution.id, + status: execution.status, + startedAt: execution.startedAt, + duration: execution.duration, + mode: execution.mode, + inputData: JSON.stringify(execution.inputData || {}, null, 2), + outputData: JSON.stringify(execution.outputData || {}, null, 2), + error: execution.error + }; + + if ($scope.selectedExecution.error && $scope.selectedExecution.error.stack) { + $scope.selectedExecution.error.stack = $scope.selectedExecution.error.stack.replace(/\\n/g, '\n'); + } + }; }); \ No newline at end of file diff --git a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html index 8a0814d14..8fe8f61b1 100644 --- a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html @@ -1300,11 +1300,11 @@
    -
    {{JSON.stringify(web.webhookTools.testResult.headers, null, 2)}}
    +
    {$ web.webhookTools.testResult.headers $}
    -
    {{JSON.stringify(web.webhookTools.testResult.body, null, 2)}}
    +
    {$ web.webhookTools.testResult.body $}
    @@ -1717,10 +1717,10 @@
    -
    {{JSON.stringify(selectedExecution.inputData, null, 2)}}
    +
    {$ selectedExecution.inputData $}
    -
    {{JSON.stringify(selectedExecution.outputData, null, 2)}}
    +
    {$ selectedExecution.outputData $}
    @@ -1972,7 +1972,7 @@
    Port Mappings
    -
    {{JSON.stringify(container.diagnosticResults.port_mappings, null, 2)}}
    +
    {$ JSON.stringify(container.diagnosticResults.port_mappings) $}