Include what should be working as a render display time. CSS currently does not propogate every single run

This commit is contained in:
sigonasr2, Sig, Sigo 2022-05-02 20:23:50 +00:00
parent 6cd3a226a9
commit e81f29b793
4 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,4 @@
.generateTime{
font-size:10px;
color:blue;
}

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<link rel=\"stylesheet\" href=\"sig.css\"> <link rel="stylesheet" type="text/css" href="/sig.css">
</head> </head>
<body> <body>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<link rel=\"stylesheet\" href=\"sig.css\"> <link rel="stylesheet" type="text/css" href="/sig.css">
</head> </head>
<body> <body>

View File

@ -60,12 +60,16 @@ public class sigServer {
} }
private void CreateRequest(Socket client, String statusCode, String statusMsg, String string) { private void CreateRequest(Socket client, String statusCode, String statusMsg, String string) {
long startTime = System.currentTimeMillis();
Path file = Paths.get(sigPlace.OUTDIR,string); Path file = Paths.get(sigPlace.OUTDIR,string);
try { try {
OutputStream clientOutput = client.getOutputStream(); OutputStream clientOutput = client.getOutputStream();
if (statusCode.equals("200")) { if (statusCode.equals("200")) {
if (Files.exists(file)) { if (Files.exists(file)) {
CreateRawRequest(clientOutput,statusCode,statusMsg,Files.probeContentType(file),Files.readAllBytes(file)); CreateRawRequest(clientOutput,statusCode,statusMsg,Files.probeContentType(file),Files.readAllBytes(file));
if (Files.probeContentType(file).equals("text/html")) {
clientOutput.write(("<div class=\"generateTime\">Webpage generated in "+(System.currentTimeMillis()-startTime)+"ms</div>\r\n").getBytes());
}
} else { } else {
CreateRawRequest(clientOutput,statusCode,statusMsg,"text/html","We're sorry, your webpage is in another castle!".getBytes()); CreateRawRequest(clientOutput,statusCode,statusMsg,"text/html","We're sorry, your webpage is in another castle!".getBytes());
} }