UISection

pull/1/head
吴顺明 2 years ago
parent 6778b406d6
commit 165a7c84b7

@ -141,8 +141,6 @@ namespace UMC.Host
{ {
this.Prompt("支付参数不正确,请联系官方"); this.Prompt("支付参数不正确,请联系官方");
// var appId = provider["appId"];
// return this.DialogValue($"https://api.apiumc.com/UMC/Platform/Payment/Bridge?AuthKey={appId}");
}); });
response.Redirect(new Uri($"{src}&Combo={ComboValue}")); response.Redirect(new Uri($"{src}&Combo={ComboValue}"));

@ -250,13 +250,13 @@ namespace UMC.Proxy.Activities
var config = this.AsyncDialog("Config", g => var config = this.AsyncDialog("Config", g =>
{ {
var from = new Web.UIFormDialog() { Title = "请求配置" }; var from = new Web.UIFormDialog() { Title = "请求配置" };
from.AddTextarea("请求头配置", "HeaderConf", site.HeaderConf).PlaceHolder("字典配置格式").Put("Rows", 8); from.AddTextarea("请求头配置", "HeaderConf", site.HeaderConf).PlaceHolder("字典配置格式").Put("Rows", 8).NotRequired();
from.AddPrompt("将会追加请求的Header上当值为HOST、SCHEME、ADDRESS将会分别替换成当前值"); from.AddPrompt("将会追加请求的Header上当值为HOST、SCHEME、ADDRESS将会分别替换成当前值");
from.Submit("确认", "Site.Config"); from.Submit("确认", "Site.Config");
return from; return from;
}); });
var HostReConf = config["HeaderConf"]; var HostReConf = config["HeaderConf"] ?? String.Empty;
DataFactory.Instance().Put(new Site { Root = site.Root, HeaderConf = HostReConf }); DataFactory.Instance().Put(new Site { Root = site.Root, HeaderConf = HostReConf });
@ -267,7 +267,7 @@ namespace UMC.Proxy.Activities
var config = this.AsyncDialog("Config", g => var config = this.AsyncDialog("Config", g =>
{ {
var from = new Web.UIFormDialog() { Title = "内容转化配置" }; var from = new Web.UIFormDialog() { Title = "内容转化配置" };
from.AddTextarea("转化路径", "HostReConf", site.HostReConf).PlaceHolder("字典配置格式").Put("Rows", 8); from.AddTextarea("转化路径", "HostReConf", site.HostReConf).PlaceHolder("字典配置格式").Put("Rows", 8).NotRequired();
from.AddPrompt("值可为rp、rm、in、cdn、CDN其中rp表示替换域名、rm表示移除域名、in表示提交内容域名转化cdn表示静态资源加速CDN表示以资源标签加速"); from.AddPrompt("值可为rp、rm、in、cdn、CDN其中rp表示替换域名、rm表示移除域名、in表示提交内容域名转化cdn表示静态资源加速CDN表示以资源标签加速");
from.Submit("确认", "Site.Config"); from.Submit("确认", "Site.Config");
@ -281,15 +281,15 @@ namespace UMC.Proxy.Activities
} }
void LogoutPath(Site site) void LogoutPath(Site site)
{ {
var sValue = UIDialog.AsyncDialog(this.Context, "LogoutPath", g => var sValue = this.AsyncDialog("Settings", g =>
{ {
var from2 = new UIFormDialog() { Title = "触发登录页面" }; var from2 = new UIFormDialog() { Title = "触发登录页面" };
from2.AddTextarea("触发登录页面", "LogoutPath", site.LogoutPath as string).Put("Rows", 5); from2.AddTextarea("触发登录页面", "LogoutPath", site.LogoutPath as string).Put("Rows", 5).NotRequired();
from2.AddPrompt("结尾是“$”则表示从后比对,多项用换行、空格或逗号符分割"); from2.AddPrompt("结尾是“$”则表示从后比对,多项用换行、空格或逗号符分割");
from2.Submit("确认", "Site.Config"); from2.Submit("确认", "Site.Config");
return from2; return from2;
}); })["LogoutPath"] ?? String.Empty;
DataFactory.Instance().Put(new Site DataFactory.Instance().Put(new Site
{ {
@ -850,21 +850,12 @@ namespace UMC.Proxy.Activities
response.Redirect(request.IsMaster ? rdata.Put("IsMaster", true) : rdata); response.Redirect(request.IsMaster ? rdata.Put("IsMaster", true) : rdata);
} }
break; break;
case "none":
this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments)
.RefreshEvent($"{request.Model}.{request.Command}")
.Builder(), true);
break;
default: default:
{ {
var title = UITitle.Create(); var title = UITitle.Create();
title.Title = "应用网关"; title.Title = "应用网关";
if (request.IsMaster && request.IsApp)
{
title.Right(new UIEventText("新增").Click(new UIClick(new WebMeta(request.Arguments).Put(g, "Create")).Send(request.Model, request.Command)));
}
var ds = DataFactory.Instance().Site(); var ds = DataFactory.Instance().Site();
var Keyword = form["Keyword"]; var Keyword = form["Keyword"];
@ -911,10 +902,10 @@ namespace UMC.Proxy.Activities
if (request.IsMaster) if (request.IsMaster)
{ {
ui.UIFootBar = new UIFootBar() { IsFixed = true }; ui.UIFootBar = new UIFootBar() { IsFixed = true };
ui.UIFootBar.AddText(new UIEventText("网关服务").Click(new UIClick(new WebMeta(request.Arguments).Put(g, "LogSetting")).Send(request.Model, request.Command)), ui.UIFootBar.AddText(new UIEventText("网关服务").Click(new UIClick().Send(request.Model, "Server")),
new UIEventText("新增应用").Click(new UIClick(new WebMeta(request.Arguments).Put(g, "Create")).Send(request.Model, request.Command)).Style(new UIStyle().BgColor())); new UIEventText("新增应用").Click(new UIClick(new WebMeta(request.Arguments).Put(g, "Create")).Send(request.Model, request.Command)).Style(new UIStyle().BgColor()));
} }
response.Redirect(ui); ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}");
} }
break; break;
} }
@ -947,9 +938,9 @@ namespace UMC.Proxy.Activities
request.Arguments.Put("Key", site.Root); request.Arguments.Put("Key", site.Root);
} }
} }
this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments)
.RefreshEvent("Site.Config", "System.Picture") // .RefreshEvent("Site.Config", "System.Picture")
.Builder(), true); // .Builder(), true);
} }
var IsProxy = SiteConfig.Config(site.AuthConf).Contains("*"); var IsProxy = SiteConfig.Config(site.AuthConf).Contains("*");
@ -1157,7 +1148,7 @@ namespace UMC.Proxy.Activities
new UIEventText("重新加载").Click(new UIClick(new WebMeta(request.Arguments).Put(g, "Reload")).Send(request.Model, request.Command)).Style(new UIStyle().BgColor())); new UIEventText("重新加载").Click(new UIClick(new WebMeta(request.Arguments).Put(g, "Reload")).Send(request.Model, request.Command)).Style(new UIStyle().BgColor()));
} }
response.Redirect(ui); ui.SendTo(this.Context, true, "Site.Config", "System.Picture");
return this.DialogValue("none"); return this.DialogValue("none");
}); });
@ -1405,7 +1396,7 @@ namespace UMC.Proxy.Activities
from.Submit("确认", "Site.Config"); from.Submit("确认", "Site.Config");
return from; return from;
}); });
var Key = config["LogConf"]; var Key = config["LogConf"] ?? String.Empty;
DataFactory.Instance().Put(new Site { Root = site.Root, LogConf = Key }); DataFactory.Instance().Put(new Site { Root = site.Root, LogConf = Key });
@ -1466,7 +1457,7 @@ namespace UMC.Proxy.Activities
from.Submit("确认", "Site.Config"); from.Submit("确认", "Site.Config");
return from; return from;
}); });
var Key = config["AppendJSConf"]; var Key = config["AppendJSConf"] ?? String.Empty;
DataFactory.Instance().Put(new Site { Root = site.Root, AppendJSConf = Key }); DataFactory.Instance().Put(new Site { Root = site.Root, AppendJSConf = Key });
@ -1485,7 +1476,7 @@ namespace UMC.Proxy.Activities
from.Submit("确认", "Site.Config"); from.Submit("确认", "Site.Config");
return from; return from;
}); });
var Key = config["ImagesConf"]; var Key = config["ImagesConf"] ?? String.Empty;
DataFactory.Instance().Put(new Site { Root = site.Root, ImagesConf = Key }); DataFactory.Instance().Put(new Site { Root = site.Root, ImagesConf = Key });
@ -1504,7 +1495,7 @@ namespace UMC.Proxy.Activities
from.Submit("确认", "Site.Config"); from.Submit("确认", "Site.Config");
return from; return from;
}); });
var Key = config["StaticConf"]; var Key = config["StaticConf"] ?? String.Empty;
DataFactory.Instance().Put(new Site { Root = site.Root, StaticConf = Key }); DataFactory.Instance().Put(new Site { Root = site.Root, StaticConf = Key });

@ -169,17 +169,8 @@ namespace UMC.Proxy.Activities
} }
if (request.IsMaster) if (request.IsMaster)
{ {
//this.Prompt("进入应用配置管理界面", false);
response.Redirect(request.Model, "Site", site.Root); response.Redirect(request.Model, "Site", site.Root);
} }
WebMeta form = request.SendValues ?? new UMC.Web.WebMeta();
if (form.ContainsKey("limit") == false)
{
this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments)
.Builder(), true);
}
var title = new UITitle("关于应用"); var title = new UITitle("关于应用");
var ui = UMC.Web.UISection.Create(title);// new UITitle("关于应用")); var ui = UMC.Web.UISection.Create(title);// new UITitle("关于应用"));
@ -253,7 +244,8 @@ namespace UMC.Proxy.Activities
ui3.NewSection().AddCell('\uf085', "应用配置", String.Empty, new UIClick(site.Root).Send(request.Model, "Site")); ui3.NewSection().AddCell('\uf085', "应用配置", String.Empty, new UIClick(site.Root).Send(request.Model, "Site"));
response.Redirect(ui); // response.Redirect(ui);
ui.SendTo(this.Context);
return this.DialogValue("none"); return this.DialogValue("none");
}); });
switch (Model) switch (Model)

@ -64,13 +64,13 @@ namespace UMC.Proxy.Activities
var confValue = UMC.Data.JSON.Deserialize<WebMeta>(config.ConfValue) ?? new WebMeta(); var confValue = UMC.Data.JSON.Deserialize<WebMeta>(config.ConfValue) ?? new WebMeta();
var key = this.AsyncDialog("ConfValue", g => var key = this.AsyncDialog("ConfValue", g =>
{ {
var ms = request.SendValues ?? request.Arguments; // var ms = request.SendValues ?? request.Arguments;
if (ms.ContainsKey("limit") == false) // if (ms.ContainsKey("limit") == false)
{ // {
this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) // // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments)
.RefreshEvent($"{request.Model}.{request.Command}") // // .RefreshEvent($"{request.Model}.{request.Command}")
.Builder(), true); // // .Builder(), true);
} // }
var title = UITitle.Create(); var title = UITitle.Create();
title.Title = "图片模板"; title.Title = "图片模板";
@ -135,9 +135,7 @@ namespace UMC.Proxy.Activities
.AddCell("离边距离", $"{confValue["Padding"] ?? "10"}px", new UIClick(new WebMeta(request.Arguments).Put(g, "Padding")).Send(request.Model, request.Command)); .AddCell("离边距离", $"{confValue["Padding"] ?? "10"}px", new UIClick(new WebMeta(request.Arguments).Put(g, "Padding")).Send(request.Model, request.Command));
break; break;
} }
response.Redirect(ui); ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}");
return this.DialogValue("none");
}); });
var ConValue = UIDialog.AsyncDialog(this.Context, "Value", r => var ConValue = UIDialog.AsyncDialog(this.Context, "Value", r =>

@ -19,14 +19,14 @@ namespace UMC.Proxy
var model = this.AsyncDialog("Id", akey => var model = this.AsyncDialog("Id", akey =>
{ {
var form = request.SendValues ?? new WebMeta(); // var form = request.SendValues ?? new WebMeta();
if (form.ContainsKey("limit") == false) // if (form.ContainsKey("limit") == false)
{ // {
this.Context.Send(new UISectionBuilder(request.Model, request.Command) // this.Context.Send(new UISectionBuilder(request.Model, request.Command)
.RefreshEvent($"{request.Model}.{request.Command}") // .RefreshEvent($"{request.Model}.{request.Command}")
.Builder(), true); // .Builder(), true);
} // }
var ui = UISection.Create(new UITitle("日志组件")); var ui = UISection.Create(new UITitle("日志组件"));
@ -126,9 +126,10 @@ namespace UMC.Proxy
ui.UIFootBar = new UIFootBar() { IsFixed = true }; ui.UIFootBar = new UIFootBar() { IsFixed = true };
ui.UIFootBar.AddText(new UIEventText("新增字段").Click(new UIClick("ADD").Send(request.Model, request.Command)), ui.UIFootBar.AddText(new UIEventText("新增字段").Click(new UIClick("ADD").Send(request.Model, request.Command)),
new UIEventText("重新加载").Click(new UIClick("LoadConf").Send(request.Model, request.Command)).Style(new UIStyle().BgColor())); new UIEventText("重新加载").Click(new UIClick("LoadConf").Send(request.Model, request.Command)).Style(new UIStyle().BgColor()));
response.Redirect(ui); // response.Redirect(ui);
return this.DialogValue("none"); ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}");
// return this.DialogValue("none");
}); });
switch (model) switch (model)

@ -83,16 +83,16 @@ namespace UMC.Proxy.Activities
} }
var ms = request.SendValues ?? request.Arguments; // var ms = request.SendValues ?? request.Arguments;
var Model = this.AsyncDialog("Model", g => var Model = this.AsyncDialog("Model", g =>
{ {
if (ms.ContainsKey("limit") == false) // if (ms.ContainsKey("limit") == false)
{ // {
this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments)
.RefreshEvent("Mime.Config") // .RefreshEvent("Mime.Config")
.Builder(), true); // .Builder(), true);
} // }
var title = UITitle.Create(); var title = UITitle.Create();
@ -289,8 +289,9 @@ namespace UMC.Proxy.Activities
response.Redirect(ui); ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}");
return this.DialogValue("none"); // response.Redirect(ui);
// return this.DialogValue("none");
}); });
switch (Model) switch (Model)
{ {

@ -23,14 +23,14 @@ namespace UMC.Proxy.Activities
var hosts = UMC.Data.Reflection.Configuration("host"); var hosts = UMC.Data.Reflection.Configuration("host");
var model = this.AsyncDialog("Model", akey => var model = this.AsyncDialog("Model", akey =>
{ {
var form = request.SendValues ?? new WebMeta(); // var form = request.SendValues ?? new WebMeta();
if (form.ContainsKey("limit") == false) // if (form.ContainsKey("limit") == false)
{ // {
this.Context.Send(new UISectionBuilder(request.Model, request.Command) // this.Context.Send(new UISectionBuilder(request.Model, request.Command)
.RefreshEvent($"{request.Model}.{request.Command}") // .RefreshEvent()
.Builder(), true); // .Builder(), true);
} // }
var ui = UISection.Create(new UITitle("网关服务")); var ui = UISection.Create(new UITitle("网关服务"));
@ -147,8 +147,8 @@ namespace UMC.Proxy.Activities
ui.UIFootBar.AddText(new UIEventText("申请免费证书").Click(new UIClick("ApplyCert").Send(request.Model, request.Command)), ui.UIFootBar.AddText(new UIEventText("申请免费证书").Click(new UIClick("ApplyCert").Send(request.Model, request.Command)),
new UIEventText("重新加载").Click(new UIClick("Reload").Send("Http", "Bridge")).Style(new UIStyle().BgColor())); new UIEventText("重新加载").Click(new UIClick("Reload").Send("Http", "Bridge")).Style(new UIStyle().BgColor()));
ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}");
response.Redirect(ui); // response.Redirect(ui);
return this.DialogValue("none"); return this.DialogValue("none");
}); });
@ -412,14 +412,14 @@ namespace UMC.Proxy.Activities
var certmodel = this.AsyncDialog("CertModel", rm => var certmodel = this.AsyncDialog("CertModel", rm =>
{ {
var form = request.SendValues ?? new UMC.Web.WebMeta(); // var form = request.SendValues ?? new UMC.Web.WebMeta();
if (form.ContainsKey("limit") == false) // if (form.ContainsKey("limit") == false)
{ // {
this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments)
.RefreshEvent($"{request.Model}.{request.Command}") // .RefreshEvent($"{request.Model}.{request.Command}")
.Builder(), true); // .Builder(), true);
} // }
var json = webr2.Post(new WebMeta().Put("type", "info", "domain", host)).ReadAsString(); var json = webr2.Post(new WebMeta().Put("type", "info", "domain", host)).ReadAsString();
@ -542,8 +542,9 @@ namespace UMC.Proxy.Activities
new UIEventText("订阅自动续签").Click(new UIClick("Model", "Recharge", "Code", hash["root"] as string).Send(request.Model, request.Command)).Style(new UIStyle().BgColor())); new UIEventText("订阅自动续签").Click(new UIClick("Model", "Recharge", "Code", hash["root"] as string).Send(request.Model, request.Command)).Style(new UIStyle().BgColor()));
break; break;
} }
response.Redirect(ui); ui.SendTo(this.Context, $"{request.Model}.{request.Command}");
return this.DialogValue("none"); // response.Redirect(ui);
// return this.DialogValue("none");
}); });
switch (certmodel) switch (certmodel)

Loading…
Cancel
Save