Skip to content

Commit

Permalink
0609 19:48
Browse files Browse the repository at this point in the history
  • Loading branch information
chourmovs committed Sep 6, 2024
1 parent f1d0126 commit 7521ae6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions webapp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@ <h1>Gestion du NAS et des analyses</h1>
// Function to display only the last two lines of output
function displayOutput(data) {
const outputElement = document.getElementById('console-output');
const currentContent = outputElement.innerText.split('\n');

// Clean and add new data
const newLine = data.trim();
const currentContent = outputElement.innerText.split('\n').filter(line => line.trim() !== '');

// Ajouter la nouvelle ligne reçue
currentContent.push(newLine);
currentContent.push(data.trim());

// Garder uniquement les deux dernières lignes
const updatedContent = currentContent.slice(-2).join('\n');

// Mettre à jour le contenu de <pre> en assurant qu'il y ait un saut de ligne à la fin
// Mettre à jour le contenu de <pre>
outputElement.innerText = updatedContent + '\n';
}

Expand Down

0 comments on commit 7521ae6

Please sign in to comment.