Add archive helpers and harden task runtime
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
print(starter_page_main_html(context));
|
||||
print(component("page_helpers.uce:MAIN_HTML", context.props, context));
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
context.header["Content-Type"] = "application/json";
|
||||
context.header["Cache-Control"] = "no-cache, no-store, must-revalidate";
|
||||
if(context.props["json"].get_type_name() == "array")
|
||||
print(json_encode(context.props["json"]));
|
||||
else if(context.call["info"]["json"].get_type_name() == "array")
|
||||
print(json_encode(context.call["info"]["json"]));
|
||||
else
|
||||
print(starter_page_main_html(context));
|
||||
print(component("page_helpers.uce:MAIN_HTML", context.props, context));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
COMPONENT:MAIN_HTML(Request& context)
|
||||
{
|
||||
String main_html = context.props["main_html"].to_string();
|
||||
if(main_html == "")
|
||||
main_html = context.props["main"].to_string();
|
||||
if(main_html == "")
|
||||
main_html = context.call["info"]["fragments"]["main"].to_string();
|
||||
print(main_html);
|
||||
}
|
||||
Reference in New Issue
Block a user