SFA Templates

SCADA Final Aggregator uses jinja2 template engine to
serve server-side templates. You can use SFA templates for regular HTML,
javascript and JSON data files. Both ui and pvt folders can contain
template files, the difference is only that templates in ui are public while
templates in pvt are served via SFA PVT.

Template files

All files with .j2 extension are processed as templates, index.j2 has more
priority than index.html as the primary interface page.

Templates support all jinja2 functions and
features, plus have some specific built-in variables and functions.

Template variables

server contains a dict with a system and current API key info (equal to
SFA API test function result) plus an additional key
remote_ip which contains either request IP address or value of
X-Real-IP variable (if set by frontend server).