diff --git a/static/js/fetchurls.js b/static/js/fetchurls.js index 23f5768..264d9fc 100755 --- a/static/js/fetchurls.js +++ b/static/js/fetchurls.js @@ -5,7 +5,6 @@ function fetchUrls() { if (this.status === 200) { // Parse JSON response const data = JSON.parse(this.responseText); - // Get container element const container = document.getElementById("container"); var bar = document.querySelector(".progress-bar"); @@ -17,20 +16,10 @@ function fetchUrls() { bar.style.width = url.progress + "%"; speedElement.innerText = url.data; bar.innerText = url.progress.toFixed(0) + "%"; - if (url.status === 200 || url.status === 301 || url.status === 302) { + if (url.status === 200) { let urlDisplay; - if (url.status === 301) { - // For 301 status code, use redirectpath - urlDisplay = `

${url.id} ${url.path} - REDIRECTS TO: ${url.redirectpath} - http code: ${url.status} progress: ${url.progress}% ${url.data}

`; - } else if (url.status === 302) { - // For 302 status code, concatenate path and redirectpath - let targetPath = url.redirectpath ? url.path + url.redirectpath : url.path; - urlDisplay = `

${url.id} ${url.path} - REDIRECTS TO: ${targetPath} - http code: ${url.status} progress: ${url.progress}% ${url.data}

`; - } else { - // For other status codes (200), use the original path - urlDisplay = `

${url.id} ${url.path} - http code: ${url.status} progress: ${url.progress}% ${url.data}

`; - } - + // For other status codes (200), use the original path + urlDisplay = `

${url.id} ${url.path} - http code: ${url.status} progress: ${url.progress}% ${url.data}

`; container.innerHTML += urlDisplay; } });