mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
deprecate custom css
replaced by custom index html page
This commit is contained in:
parent
5e64844440
commit
ec237f475e
@ -238,12 +238,6 @@ kj::Promise<void> Http::request(kj::HttpMethod method, kj::StringPtr url, const
|
|||||||
return writeLogChunk(c, s);
|
return writeLogChunk(c, s);
|
||||||
}).attach(kj::mv(output)).attach(kj::mv(stream)).attach(kj::mv(lw));
|
}).attach(kj::mv(output)).attach(kj::mv(stream)).attach(kj::mv(lw));
|
||||||
}
|
}
|
||||||
} else if(url == "/custom/style.css") {
|
|
||||||
responseHeaders.set(kj::HttpHeaderId::CONTENT_TYPE, "text/css; charset=utf-8");
|
|
||||||
responseHeaders.add("Content-Transfer-Encoding", "binary");
|
|
||||||
std::string css = laminar.getCustomCss();
|
|
||||||
auto stream = response.send(200, "OK", responseHeaders, css.size());
|
|
||||||
return stream->write(css.data(), css.size()).attach(kj::mv(css)).attach(kj::mv(stream));
|
|
||||||
} else if(resources->handleRequest(url.cStr(), &start, &end, &content_type)) {
|
} else if(resources->handleRequest(url.cStr(), &start, &end, &content_type)) {
|
||||||
responseHeaders.set(kj::HttpHeaderId::CONTENT_TYPE, content_type);
|
responseHeaders.set(kj::HttpHeaderId::CONTENT_TYPE, content_type);
|
||||||
responseHeaders.add("Content-Encoding", "gzip");
|
responseHeaders.add("Content-Encoding", "gzip");
|
||||||
|
@ -826,16 +826,3 @@ R"x(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: deprecate
|
|
||||||
std::string Laminar::getCustomCss() {
|
|
||||||
KJ_IF_MAYBE(cssFile, fsHome->tryOpenFile(kj::Path{"custom","style.css"})) {
|
|
||||||
static bool warningShown = false;
|
|
||||||
if(!warningShown) {
|
|
||||||
LLOG(WARNING, "Custom CSS has been deprecated and will be removed from a future release. Use a custom HTML template instead.");
|
|
||||||
warningShown = true;
|
|
||||||
}
|
|
||||||
return (*cssFile)->readAllText().cStr();
|
|
||||||
} else {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -90,11 +90,6 @@ public:
|
|||||||
// if the job is unknown.
|
// if the job is unknown.
|
||||||
bool handleBadgeRequest(std::string job, std::string& badge);
|
bool handleBadgeRequest(std::string job, std::string& badge);
|
||||||
|
|
||||||
// Fetches the content of $LAMINAR_HOME/custom/style.css or an empty
|
|
||||||
// string. Ideally, this would instead be served by a proper web server
|
|
||||||
// which handles this url.
|
|
||||||
std::string getCustomCss();
|
|
||||||
|
|
||||||
// Aborts a single job
|
// Aborts a single job
|
||||||
bool abort(std::string job, uint buildNum);
|
bool abort(std::string job, uint buildNum);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user