refactor: rename DTree to DValue
This commit is contained in:
@@ -4,7 +4,7 @@ COMPONENT(Request& context)
|
||||
{
|
||||
context.call["app"]["page_title"] = "Login";
|
||||
StarterUser users(context);
|
||||
DTree result;
|
||||
DValue result;
|
||||
if(context.params["REQUEST_METHOD"] == "POST")
|
||||
{
|
||||
result = users.sign_in(context.post["email"], context.post["password"]);
|
||||
|
||||
@@ -9,9 +9,9 @@ COMPONENT(Request& context)
|
||||
return;
|
||||
}
|
||||
context.call["app"]["page_title"] = "Profile";
|
||||
DTree user = users.current();
|
||||
DValue user = users.current();
|
||||
String roles = "";
|
||||
user["roles"].each([&](DTree role, String key) {
|
||||
user["roles"].each([&](DValue role, String key) {
|
||||
if(roles != "")
|
||||
roles += ", ";
|
||||
roles += role.to_string();
|
||||
|
||||
@@ -4,7 +4,7 @@ COMPONENT(Request& context)
|
||||
{
|
||||
context.call["app"]["page_title"] = "Register";
|
||||
StarterUser users(context);
|
||||
DTree result;
|
||||
DValue result;
|
||||
if(context.params["REQUEST_METHOD"] == "POST")
|
||||
result = users.create(context.post["email"], context.post["password"]);
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
DTree asset_props;
|
||||
DValue asset_props;
|
||||
asset_props["css"]["0"] = "views/marketing.css";
|
||||
print(component("../../components/theme/assets", asset_props, context));
|
||||
context.call["app"]["page_title"] = "Auth";
|
||||
|
||||
DTree props;
|
||||
DValue props;
|
||||
props["title"] = "Sign In to Your Account";
|
||||
props["subtitle"] = "Choose your preferred authentication method to continue";
|
||||
props["google_client_id"] = "YOUR_GOOGLE_CLIENT_ID";
|
||||
|
||||
@@ -4,8 +4,8 @@ COMPONENT(Request& context)
|
||||
{
|
||||
context.call["app"]["page_type"] = "json";
|
||||
|
||||
DTree response;
|
||||
DTree body = json_decode(context.in);
|
||||
DValue response;
|
||||
DValue body = json_decode(context.in);
|
||||
if(context.params["REQUEST_METHOD"] == "POST" && body["oauth_service"].to_string() != "" && body["oauth_state"].to_string() != "")
|
||||
{
|
||||
context.session["oauth_service"] = body["oauth_service"].to_string();
|
||||
|
||||
@@ -9,8 +9,8 @@ COMPONENT(Request& context)
|
||||
{
|
||||
context.call["app"]["page_title"] = "Dashboard";
|
||||
|
||||
DTree props;
|
||||
DTree item;
|
||||
DValue props;
|
||||
DValue item;
|
||||
item["label"] = "24h Requests"; item["value"] = "18,420"; item["meta"] = "+12.8% vs yesterday"; item["tone"] = "info"; props["items"].push(item); item.clear();
|
||||
item["label"] = "Median Latency"; item["value"] = "182 ms"; item["meta"] = "stable over last 7 samples"; item["tone"] = "success"; props["items"].push(item); item.clear();
|
||||
item["label"] = "Resident Memory"; item["value"] = "2.4 GB"; item["meta"] = "combined across workers"; item["tone"] = "warning"; props["items"].push(item); item.clear();
|
||||
@@ -25,9 +25,9 @@ COMPONENT(Request& context)
|
||||
print(component("../components/data/widgets:SUMMARY_METRICS", props, context));
|
||||
|
||||
props.clear();
|
||||
DTree series;
|
||||
DTree values;
|
||||
DTree entry;
|
||||
DValue series;
|
||||
DValue values;
|
||||
DValue entry;
|
||||
entry["key"] = "requests"; entry["label"] = "Requests"; entry["color"] = "#60a5fa"; entry["axis"] = "left"; entry["format"] = "count";
|
||||
values = "240"; entry["values"].push(values); values = "268"; entry["values"].push(values); values = "294"; entry["values"].push(values); values = "322"; entry["values"].push(values); values = "301"; entry["values"].push(values); values = "356"; entry["values"].push(values); values = "388"; entry["values"].push(values);
|
||||
props["series"].push(entry); entry.clear();
|
||||
@@ -53,14 +53,14 @@ COMPONENT(Request& context)
|
||||
props["storage_key"] = "starter.dashboard.services";
|
||||
props["sort"]["column"] = "2";
|
||||
props["sort"]["direction"] = "desc";
|
||||
DTree col;
|
||||
DValue col;
|
||||
col["key"] = "service"; col["label"] = "Service"; props["columns"].push(col); col.clear();
|
||||
col["key"] = "uptime"; col["label"] = "Uptime"; props["columns"].push(col); col.clear();
|
||||
col["key"] = "requests"; col["label"] = "Requests"; col["align"] = "right"; col["format"] = "number"; props["columns"].push(col); col.clear();
|
||||
col["key"] = "memory"; col["label"] = "Memory"; col["align"] = "right"; col["format"] = "bytes"; props["columns"].push(col); col.clear();
|
||||
col["key"] = "p95_latency"; col["label"] = "P95 Latency"; col["align"] = "right"; col["format"] = "duration-ms"; props["columns"].push(col); col.clear();
|
||||
col["key"] = "healthy"; col["label"] = "Healthy"; col["align"] = "center"; col["format"] = "bool"; props["columns"].push(col);
|
||||
DTree row;
|
||||
DValue row;
|
||||
row["service"] = "router"; row["uptime"] = "12 days"; row["requests"] = "142890"; row["memory"] = "402653184"; row["p95_latency"] = "148"; row["healthy"] = "true"; props["rows"].push(row); row.clear();
|
||||
row["service"] = "queue-worker"; row["uptime"] = "8 days"; row["requests"] = "98214"; row["memory"] = "654311424"; row["p95_latency"] = "231"; row["healthy"] = "true"; props["rows"].push(row); row.clear();
|
||||
row["service"] = "vector-index"; row["uptime"] = "5 days"; row["requests"] = "44892"; row["memory"] = "1241513984"; row["p95_latency"] = "312"; row["healthy"] = "true"; props["rows"].push(row); row.clear();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
DTree asset_props;
|
||||
DValue asset_props;
|
||||
asset_props["css"]["0"] = "views/marketing.css";
|
||||
print(component("../components/theme/assets", asset_props, context));
|
||||
context.call["app"]["page_title"] = "Features";
|
||||
|
||||
@@ -5,8 +5,8 @@ COMPONENT(Request& context)
|
||||
context.call["app"]["page_title"] = "Gauges";
|
||||
f64 pi = 3.14159265358979323846;
|
||||
|
||||
DTree props;
|
||||
DTree item;
|
||||
DValue props;
|
||||
DValue item;
|
||||
|
||||
<>
|
||||
<h1>Gauge Components Demo</h1>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
DTree asset_props;
|
||||
DValue asset_props;
|
||||
asset_props["css"]["0"] = "views/marketing.css";
|
||||
print(component("../components/theme/assets", asset_props, context));
|
||||
context.call["app"]["page_title"] = "Home";
|
||||
|
||||
DTree props;
|
||||
DValue props;
|
||||
|
||||
props["title"] = "Stunning Apps";
|
||||
props["subtitle"] = "Experience the power of super bloated PHP development with our gigantic and truly unwieldy component-based framework. Seriously though, this page only serves as an example repository of different styles and blocks.";
|
||||
@@ -17,7 +17,7 @@ COMPONENT(Request& context)
|
||||
print(component("../components/example/marketing_blocks:FEATURES_GRID", context));
|
||||
|
||||
props.clear();
|
||||
DTree stat;
|
||||
DValue stat;
|
||||
stat["number"] = "10K+"; stat["label"] = "Happy Vibe Coders"; props["stats"].push(stat); stat.clear();
|
||||
stat["number"] = "<1s"; stat["label"] = "Page Load Time"; props["stats"].push(stat); stat.clear();
|
||||
stat["number"] = "99.9%"; stat["label"] = "Uptime"; props["stats"].push(stat); stat.clear();
|
||||
@@ -72,7 +72,7 @@ COMPONENT(Request& context)
|
||||
<h2>Theme Families</h2>
|
||||
<p>Compare the starter’s built-in theme families and jump to the live gallery.</p>
|
||||
<div class="theme-grid">
|
||||
<? context.cfg.get_by_path("theme/options").each([&](DTree theme, String key) {
|
||||
<? context.cfg.get_by_path("theme/options").each([&](DValue theme, String key) {
|
||||
if(key != "portal-light" && key != "portal-dark" && key != "localfirst")
|
||||
return;
|
||||
StringMap theme_params;
|
||||
@@ -99,7 +99,7 @@ COMPONENT(Request& context)
|
||||
props["secondary_text"] = "View GitHub";
|
||||
print(component("../components/example/marketing_blocks:CTA_SECTION", props, context));
|
||||
|
||||
DTree island_props;
|
||||
DValue island_props;
|
||||
island_props["name"] = "StarterGuidelines";
|
||||
island_props["id"] = "starter-guidelines-island";
|
||||
island_props["props"]["route"] = context.call["route"]["l_path"].to_string();
|
||||
@@ -120,7 +120,7 @@ COMPONENT(Request& context)
|
||||
</>
|
||||
|
||||
props.clear();
|
||||
DTree row;
|
||||
DValue row;
|
||||
row["name"] = "John Doe"; row["age"] = "25"; row["gender"] = "male"; row["department"] = "Engineering"; row["salary"] = "75000"; row["active"] = "true"; props["items"].push(row); row.clear();
|
||||
row["name"] = "Jane Smith"; row["age"] = "30"; row["gender"] = "female"; row["department"] = "Design"; row["salary"] = "82000"; row["active"] = "true"; props["items"].push(row); row.clear();
|
||||
row["name"] = "Bob Johnson"; row["age"] = "35"; row["gender"] = "male"; row["department"] = "Marketing"; row["salary"] = "68000"; row["active"] = "false"; props["items"].push(row); row.clear();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
DTree asset_props;
|
||||
DValue asset_props;
|
||||
asset_props["css"]["0"] = "views/marketing.css";
|
||||
print(component("../components/theme/assets", asset_props, context));
|
||||
context.call["app"]["page_title"] = "Components";
|
||||
@@ -51,7 +51,7 @@ COMPONENT(Request& context)
|
||||
<div class="window-dot green"></div>
|
||||
<span class="mono-text">views/index.uce</span>
|
||||
</div>
|
||||
<pre class="code-block"><code>DTree props;
|
||||
<pre class="code-block"><code>DValue props;
|
||||
props["title"] = "Stunning Apps";
|
||||
<><?: component("example/marketing_blocks:HERO_SECTION", props, context) ?></></code></pre>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
DTree asset_props;
|
||||
DValue asset_props;
|
||||
asset_props["css"]["0"] = "views/themes.css";
|
||||
print(component("../components/theme/assets", asset_props, context));
|
||||
context.call["app"]["page_title"] = "Theme Preview";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
DTree asset_props;
|
||||
DValue asset_props;
|
||||
asset_props["css"]["0"] = "views/themes.css";
|
||||
print(component("../components/theme/assets", asset_props, context));
|
||||
context.call["app"]["page_title"] = "Themes";
|
||||
@@ -16,7 +16,7 @@ COMPONENT(Request& context)
|
||||
<p>Open each theme preview directly to judge shell fit, typography, and token balance.</p>
|
||||
</section>
|
||||
<div class="theme-gallery-grid">
|
||||
<? context.cfg.get_by_path("theme/options").each([&](DTree theme_info, String theme_key) {
|
||||
<? context.cfg.get_by_path("theme/options").each([&](DValue theme_info, String theme_key) {
|
||||
StringMap params;
|
||||
params["theme"] = theme_key;
|
||||
String preview_href = app_link("theme-preview", params, context);
|
||||
|
||||
@@ -25,35 +25,35 @@ COMPONENT(Request& context)
|
||||
<div class="ws-demo-sidebar-copy"><p>This sidebar and mobile shell pattern was extracted from the AI portal app and normalized against starter theme tokens.</p></div>
|
||||
</>
|
||||
sidebar_body = ob_get_close();
|
||||
DTree sidebar_note;
|
||||
DValue sidebar_note;
|
||||
sidebar_note["icon_class"] = "fas fa-circle-info";
|
||||
sidebar_note["text"] = "Use workspace/overview, workspace/projects, or workspace/activity";
|
||||
sidebar_body += component("../../components/workspace/primitives:LIST_STATE", sidebar_note, context);
|
||||
|
||||
DTree toolbar_props;
|
||||
DValue toolbar_props;
|
||||
toolbar_props["action_html"] = "<a class=\"ws-sidebar-action-btn\" href=\"" + app_link("workspace/overview", context) + "\"><i class=\"fas fa-grid-2\"></i><span>Open shell</span></a>";
|
||||
toolbar_props["search_input_id"] = "workspace-demo-search";
|
||||
toolbar_props["search_input_name"] = "workspace_demo_search";
|
||||
toolbar_props["search_placeholder"] = "Search workspace sections";
|
||||
String sidebar_top = component("../../components/workspace/primitives:SIDEBAR_TOOLBAR", toolbar_props, context);
|
||||
|
||||
DTree sidebar_props;
|
||||
DValue sidebar_props;
|
||||
sidebar_props["id"] = "workspace-demo-sidebar";
|
||||
sidebar_props["top_html"] = sidebar_top;
|
||||
sidebar_props["body_html"] = sidebar_body;
|
||||
String sidebar = component("../../components/workspace/primitives:SIDEBAR_SHELL", sidebar_props, context);
|
||||
|
||||
DTree mobile_props;
|
||||
DValue mobile_props;
|
||||
mobile_props["button_id"] = "workspace-demo-toggle";
|
||||
mobile_props["title"] = "Starter Workspace";
|
||||
String mobile_bar = component("../../components/workspace/primitives:MOBILE_BAR", mobile_props, context);
|
||||
|
||||
DTree pill_props;
|
||||
DValue pill_props;
|
||||
pill_props["label"] = status_label;
|
||||
pill_props["variant"] = status_variant;
|
||||
String status_html = component("../../components/workspace/primitives:STATUS_PILL", pill_props, context);
|
||||
|
||||
DTree header_props;
|
||||
DValue header_props;
|
||||
header_props["title"] = title;
|
||||
header_props["subtitle"] = subtitle;
|
||||
header_props["actions_html"] = status_html;
|
||||
@@ -81,10 +81,10 @@ COMPONENT(Request& context)
|
||||
</>
|
||||
detail_html = ob_get_close();
|
||||
|
||||
DTree section_head;
|
||||
DValue section_head;
|
||||
section_head["title"] = "Why this belongs in the starter";
|
||||
String why_head = component("../../components/workspace/primitives:SECTION_HEAD", section_head, context);
|
||||
DTree section_props;
|
||||
DValue section_props;
|
||||
section_props["header_html"] = why_head;
|
||||
section_props["body_html"] = "<p class=\"ws-section-copy\">" + html_escape(description) + "</p>" + stats_html;
|
||||
String main_body = component("../../components/workspace/primitives:SECTION", section_props, context);
|
||||
@@ -99,7 +99,7 @@ COMPONENT(Request& context)
|
||||
|
||||
if(section == "activity")
|
||||
{
|
||||
DTree empty_props;
|
||||
DValue empty_props;
|
||||
empty_props["icon_class"] = "fas fa-clock-rotate-left";
|
||||
empty_props["title"] = "No live stream wired yet";
|
||||
empty_props["text"] = "The shell is generic. Add your own websocket, polling, or event-driven runtime behind it when a real product needs one.";
|
||||
@@ -107,12 +107,12 @@ COMPONENT(Request& context)
|
||||
main_body += component("../../components/workspace/primitives:EMPTY_STATE", empty_props, context);
|
||||
}
|
||||
|
||||
DTree panel_props;
|
||||
DValue panel_props;
|
||||
panel_props["header_html"] = header;
|
||||
panel_props["body_html"] = main_body;
|
||||
String main = mobile_bar + component("../../components/workspace/primitives:PANEL", panel_props, context);
|
||||
|
||||
DTree app_props;
|
||||
DValue app_props;
|
||||
app_props["id"] = "workspace-demo-shell";
|
||||
app_props["overlay_id"] = "workspace-demo-overlay";
|
||||
app_props["sidebar_html"] = sidebar;
|
||||
|
||||
Reference in New Issue
Block a user