static void Main(string[] args) { WebHost host = new WebHost(); host.IsWindowsServices = true; WebHost.Title = "Service Management"; WebHost.HeaderModel = "beetlex-process-header"; WebHost.HomeModel = "beetlex-process-home"; WebHost.TabsEnabled = false; host.RegisterComponent <Program>(); host.RegisterComponent <BeetleX.ServicesProcess.ProcessCenter>(); host.UseFontawesome(); host.UseElement(PageStyle.Element); host.Setting(o => { o.SetDebug(); o.Port = 80; o.LogLevel = LogType.Info; }); host.Initialize((http, vue, rec) => { BeetleX.ServicesProcess.WebController controller = new BeetleX.ServicesProcess.WebController(); controller.Init(new logHandler(http)); http.ActionFactory.Register(controller, new BeetleX.FastHttpApi.ControllerAttribute { BaseUrl = "process" }); rec.AddCss("website.css"); vue.Debug(); }); host.Run(); }
static void Main(string[] args) { WebHost host = new WebHost(); host.RegisterComponent <Program>(); host.UserElasticSearch("test_query_string", "http://192.168.2.19:9200"); host.UseEFCore <BlogDBContext>(); host.Setting(o => { o.Port = 80; o.LogLevel = EventArgs.LogType.Info; o.LogToConsole = true; }) .Run(); }
static void Main(string[] args) { WebHost host = new WebHost(); WebHost.GetMenus = (user, role, context) => { List <Menu> menus = new List <Menu>(); var item = new Menu(); item.ID = "home"; item.Img = "fas fa-home"; item.Name = "主页"; item.Model = "home"; menus.Add(item); item = new Menu(); item.ID = "customer"; item.Name = "客户"; item.Img = "fas fa-hospital-user"; item.Model = "customers"; menus.Add(item); return(Task.FromResult(menus)); }; host.RegisterComponent <Program>() .Setting(o => { o.SetDebug(); o.Port = 80; o.LogLevel = EventArgs.LogType.Error; o.LogToConsole = true; }) .UseEFCore <NorthwindContext>() .UseFontawesome() .UseElement(PageStyle.ElementDashboard) .UseJWT() .Initialize((http, vue, rec) => { WebHost.LoginHandler = (user, pwd, context) => { var result = context.SetJwtToken(user, "user", 60 * 60); return(Task.FromResult((object)result)); }; vue.Debug(); WebHost.Title = "Beetelx web SPA plug-in"; }).Run(); }
static void Main(string[] args) { WebHost host = new WebHost(); host.RegisterComponent <Program>() .Setting(o => { o.SetDebug(); o.Port = 80; o.LogLevel = LogType.Warring; o.LogToConsole = true; }) .Initialize((http, vue, rec) => { rec.AddCss("website.css"); vue.Debug(); }).Run(); }
static void Main(string[] args) { WebHost host = new WebHost(); WebHost.Title = "Beetlex WebFamily"; WebHost.HomeModel = "webfamily-md"; WebHost.HomeName = "Markdown"; WebHost.Login = false; host.RegisterComponent <Program>(); host.UseToastUIEditor(); host.Setting(o => { o.SetDebug(); o.Port = 80; o.LogLevel = EventArgs.LogType.Info; o.LogToConsole = true; }) .UseElement(PageStyle.Element) .Initialize((http, vue, resoure) => { resoure.AddCss("website.css"); vue.Debug(); }).Run(); }
static void Main(string[] args) { WebHost host = new WebHost(); host.RegisterComponent <Program>() .Setting(o => { o.SetDebug(); o.Port = 80; o.LogLevel = EventArgs.LogType.Error; o.LogToConsole = true; }) .UseEFCore <NorthwindContext>() .UseJWT() .UseFontawesome() .UseElement(PageStyle.ElementDashboard) .Initialize((http, vue, rec) => { rec.AddScript("echarts.js"); rec.AddCss("website.css"); vue.Debug(); WebHost.LoginHandler = (user, pwd, context) => { var result = context.SetJwtToken(user, "user", 60 * 60); return(Task.FromResult((object)result)); }; WebHost.Title = "Northwind"; WebHost.HeaderModel = "myheader"; WebHost.Login = true; WebHost.HomeModel = "home"; WebHost.GetMenus = (user, role, context) => { List <Menu> menus = new List <Menu>(); var item = new Menu(); item.ID = "home"; item.Name = "主页"; item.Img = "fas fa-home"; item.Model = "home"; menus.Add(item); item = new Menu(); item.ID = "product"; item.Name = "产品"; item.Img = "fas fa-box"; item.Model = "products"; menus.Add(item); item = new Menu(); item.ID = "order"; item.Name = "订单"; item.Img = "fas fa-shopping-cart"; item.Model = "orders"; menus.Add(item); item = new Menu(); item.ID = "customer"; item.Name = "客户"; item.Img = "fas fa-hospital-user"; item.Model = "customers"; menus.Add(item); item = new Menu(); item.ID = "employee"; item.Name = "雇员"; item.Img = "fas fa-users"; item.Model = "employees"; menus.Add(item); return(Task.FromResult(menus)); }; }).Run(); }
static void Main(string[] args) { WebHost.Title = "beetlex & bootstrap!"; WebHost.LogoImg = "/images/icons-hero.png"; WebHost.HeaderModel = "custom-header"; WebHost.Login = true; WebHost.GetMenus = (usr, role, http) => { List <Menu> result = new List <Menu>(); var item = new Menu(); item.ID = "home"; item.Img = "fas fa-home"; item.Name = "主页"; item.Model = "webfamily-home"; result.Add(item); item = new Menu(); item.ID = "line"; item.Img = "fas fa-chart-line"; item.Name = "折线图"; var sub = new Menu(); sub.ID = "line-simple"; sub.Name = "基础线图"; sub.Model = "line-simple"; item.Childs.Add(sub); sub = new Menu(); sub.ID = "line-stack"; sub.Name = "折线图堆叠"; sub.Model = "line-stack"; item.Childs.Add(sub); result.Add(item); item = new Menu(); item.ID = "pie"; item.Img = "fas fa-chart-pie"; item.Name = "饼图"; sub = new Menu(); sub.ID = "pie-simple"; sub.Name = "基础饼图"; sub.Model = "pie-simple"; item.Childs.Add(sub); sub = new Menu(); sub.ID = "pie-roseType"; sub.Name = "南丁格尔玫瑰图"; sub.Model = "pie-roseType"; item.Childs.Add(sub); result.Add(item); item = new Menu(); item.ID = "bar"; item.Img = "fas fa-chart-bar"; item.Name = "柱状图"; sub = new Menu(); sub.ID = "bar-simple"; sub.Name = "基础柱状图"; sub.Model = "bar-simple"; item.Childs.Add(sub); sub = new Menu(); sub.ID = "bar-label-rotation"; sub.Name = "柱状图标签旋转"; sub.Model = "bar-label-rotation"; item.Childs.Add(sub); result.Add(item); var code = Newtonsoft.Json.JsonConvert.SerializeObject(result); return(Task.FromResult(result)); }; WebHost host = new WebHost(); host.RegisterComponent <Program>() .Setting(o => { o.SetDebug(); o.Port = 80; o.LogLevel = EventArgs.LogType.Info; o.LogToConsole = true; }) .UseJWT() .UseFontawesome() .UseBootstrap(PageStyle.BootstrapDashboard) .Initialize((http, vue, resoure) => { resoure.AddCss("website.css"); resoure.AddScript("echarts.js"); vue.Debug(); }).Run(); }