Dan Burkert has submitted this change and it was merged.

Change subject: Integrate Mustache templates to webserver
......................................................................


Integrate Mustache templates to webserver

This commit alters the design of webserver path handlers
to use Mustache templates instead of generating HTML
in server code. Path handlers now accept a json object
as a parameter, and fill out the fields of this object
with information to be displayed on their web page.
This json object is then passed to Mustache, along with
the name of the corresponding template, to be rendered.

Many path handlers still conform to the old design of
generating raw HTML; this commit converts two path
handlers to the new design as an example. Converting
old path handlers, and adding new ones, is a simple
process that consists of defining a callback that
accepts a json object and fills out its fields,
passing the function to RegisterPathHandler(), and
adding a new mustache template to www/.

Change-Id: I8cf8181b2b2904a57c9b24ce73316b92a4f6700f
Reviewed-on: http://gerrit.cloudera.org:8080/7448
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <[email protected]>
---
M src/kudu/master/master-path-handlers.cc
M src/kudu/server/CMakeLists.txt
M src/kudu/server/default-path-handlers.cc
M src/kudu/server/pprof-path-handlers.cc
M src/kudu/server/rpcz-path-handler.cc
M src/kudu/server/tracing-path-handlers.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/tserver/tserver-path-handlers.cc
M src/kudu/util/easy_json-test.cc
M src/kudu/util/easy_json.cc
M src/kudu/util/easy_json.h
M src/kudu/util/thread.cc
M src/kudu/util/web_callback_registry.h
A www/home.mustache
A www/logs.mustache
16 files changed, 436 insertions(+), 185 deletions(-)

Approvals:
  Dan Burkert: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/7448
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8cf8181b2b2904a57c9b24ce73316b92a4f6700f
Gerrit-PatchSet: 15
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Sam Okrent <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Sam Okrent <[email protected]>
Gerrit-Reviewer: Tidy Bot

Reply via email to