Skip to content

Commit

Permalink
removing useless .toFixed(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberRoute committed Nov 28, 2023
1 parent f7e0a14 commit c3e1c25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions static/js/fetchurls.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ function fetchUrls() {
let urlDisplay;
if (url.status === 301) {
// For 301 status code, use redirectpath
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: orange;">REDIRECTS TO:</span> <a href="${url.redirectpath}" target="_blank">${url.redirectpath}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress} ${url.data}</span></p>`;
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: orange;">REDIRECTS TO:</span> <a href="${url.redirectpath}" target="_blank">${url.redirectpath}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress}% ${url.data}</span></p>`;
} else if (url.status === 302) {
// For 302 status code, concatenate path and redirectpath
let targetPath = url.redirectpath ? url.path + url.redirectpath : url.path;
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: orange;">REDIRECTS TO:</span> <a href="${targetPath}" target="_blank">${targetPath}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress} ${url.data}</span></p>`;
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: orange;">REDIRECTS TO:</span> <a href="${targetPath}" target="_blank">${targetPath}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress}% ${url.data}</span></p>`;
} else {
// For other status codes (200), use the original path
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress.toFixed(0)}% ${url.data}</span></p>`;
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress}% ${url.data}</span></p>`;
}

container.innerHTML += urlDisplay;
Expand Down

0 comments on commit c3e1c25

Please sign in to comment.