2023-03-17 08:07:49 +00:00
|
|
|
|
using Tesses.WebServer;
|
|
|
|
|
using Ooui;
|
|
|
|
|
UI ui=new UI();
|
|
|
|
|
ui.Verbose = false;
|
|
|
|
|
|
|
|
|
|
Button btn = new Button(){Text = "Click Me"};
|
|
|
|
|
int i =0;
|
|
|
|
|
btn.Click += (sender,e)=>{
|
|
|
|
|
btn.Text = $"Clicked {++i} time(s)";
|
|
|
|
|
};
|
|
|
|
|
ui.Publish("/",btn);
|
2024-03-26 17:45:36 +00:00
|
|
|
|
ui.Publish("/query",(ctx)=>{
|
|
|
|
|
Ooui.List list=new List();
|
|
|
|
|
foreach(var item in ctx.QueryParams)
|
|
|
|
|
{
|
|
|
|
|
foreach(var v in item.Value)
|
|
|
|
|
{
|
|
|
|
|
Ooui.ListItem listItem=new ListItem();
|
|
|
|
|
listItem.Text = $"{item.Key}: {v}";
|
|
|
|
|
list.AppendChild(listItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
});
|
2023-03-17 08:07:49 +00:00
|
|
|
|
ui.StartServer(45252);
|