From 601e5db76a5bc759bf6d76cd0c534b5e6726c7af Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 21 Aug 2025 09:45:41 +0200 Subject: [PATCH] , --- lib/core/herocmds/web.v | 2 +- lib/web/ui/factory.v | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/core/herocmds/web.v b/lib/core/herocmds/web.v index 5314b552..a06dd60f 100644 --- a/lib/core/herocmds/web.v +++ b/lib/core/herocmds/web.v @@ -59,7 +59,7 @@ fn cmd_web_execute(cmd Command) ! { console.print_header('Starting Hero UI...') // Prepare arguments for the UI factory - mut factory_args := ui.FactoryArgs{ + mut factory_args := ui.WebArgs{ title: 'Hero Admin Panel' host: host port: port diff --git a/lib/web/ui/factory.v b/lib/web/ui/factory.v index cb1b5481..acd4a888 100644 --- a/lib/web/ui/factory.v +++ b/lib/web/ui/factory.v @@ -2,7 +2,6 @@ module ui import veb import os -import net.http // Public Context type for veb @@ -20,7 +19,7 @@ pub: // Factory args @[params] -pub struct FactoryArgs { +pub struct WebArgs { pub mut: name string = 'default' host string = 'localhost' @@ -34,15 +33,19 @@ pub mut: pub struct App { veb.StaticHandler pub mut: - title string + title string = "default" menu []MenuItem - port int + port int = 7711 } // Start the webserver (blocking) -pub fn start(args FactoryArgs) ! { - mut app := new(args)! +pub fn start(args WebArgs) ! { + mut app := App{ + title: args.title, + menu: args.menu, + port: args.port + } veb.run[App, Context](mut app, app.port) }