diff --git a/Bridge/HttpBridgeActivity.cs b/Bridge/HttpBridgeActivity.cs index 658f386..8037099 100644 --- a/Bridge/HttpBridgeActivity.cs +++ b/Bridge/HttpBridgeActivity.cs @@ -141,8 +141,6 @@ namespace UMC.Host { 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}")); diff --git a/Proxy/SiteActivity.cs b/Proxy/SiteActivity.cs index 64fa010..e6edb72 100644 --- a/Proxy/SiteActivity.cs +++ b/Proxy/SiteActivity.cs @@ -250,13 +250,13 @@ namespace UMC.Proxy.Activities var config = this.AsyncDialog("Config", g => { 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.Submit("确认", "Site.Config"); return from; }); - var HostReConf = config["HeaderConf"]; + var HostReConf = config["HeaderConf"] ?? String.Empty; 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 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.Submit("确认", "Site.Config"); @@ -281,15 +281,15 @@ namespace UMC.Proxy.Activities } void LogoutPath(Site site) { - var sValue = UIDialog.AsyncDialog(this.Context, "LogoutPath", g => + var sValue = this.AsyncDialog("Settings", g => { 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.Submit("确认", "Site.Config"); return from2; - }); + })["LogoutPath"] ?? String.Empty; DataFactory.Instance().Put(new Site { @@ -850,21 +850,12 @@ namespace UMC.Proxy.Activities response.Redirect(request.IsMaster ? rdata.Put("IsMaster", true) : rdata); } break; - case "none": - this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) - .RefreshEvent($"{request.Model}.{request.Command}") - .Builder(), true); - break; default: { var title = UITitle.Create(); 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 Keyword = form["Keyword"]; @@ -911,10 +902,10 @@ namespace UMC.Proxy.Activities if (request.IsMaster) { 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())); } - response.Redirect(ui); + ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}"); } break; } @@ -947,9 +938,9 @@ namespace UMC.Proxy.Activities request.Arguments.Put("Key", site.Root); } } - this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) - .RefreshEvent("Site.Config", "System.Picture") - .Builder(), true); + // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) + // .RefreshEvent("Site.Config", "System.Picture") + // .Builder(), true); } 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())); } - response.Redirect(ui); + ui.SendTo(this.Context, true, "Site.Config", "System.Picture"); return this.DialogValue("none"); }); @@ -1405,7 +1396,7 @@ namespace UMC.Proxy.Activities from.Submit("确认", "Site.Config"); return from; }); - var Key = config["LogConf"]; + var Key = config["LogConf"] ?? String.Empty; DataFactory.Instance().Put(new Site { Root = site.Root, LogConf = Key }); @@ -1466,7 +1457,7 @@ namespace UMC.Proxy.Activities from.Submit("确认", "Site.Config"); return from; }); - var Key = config["AppendJSConf"]; + var Key = config["AppendJSConf"] ?? String.Empty; DataFactory.Instance().Put(new Site { Root = site.Root, AppendJSConf = Key }); @@ -1485,7 +1476,7 @@ namespace UMC.Proxy.Activities from.Submit("确认", "Site.Config"); return from; }); - var Key = config["ImagesConf"]; + var Key = config["ImagesConf"] ?? String.Empty; DataFactory.Instance().Put(new Site { Root = site.Root, ImagesConf = Key }); @@ -1504,7 +1495,7 @@ namespace UMC.Proxy.Activities from.Submit("确认", "Site.Config"); return from; }); - var Key = config["StaticConf"]; + var Key = config["StaticConf"] ?? String.Empty; DataFactory.Instance().Put(new Site { Root = site.Root, StaticConf = Key }); diff --git a/Proxy/SiteAppActivity.cs b/Proxy/SiteAppActivity.cs index 9f43f1d..204c26c 100644 --- a/Proxy/SiteAppActivity.cs +++ b/Proxy/SiteAppActivity.cs @@ -169,17 +169,8 @@ namespace UMC.Proxy.Activities } if (request.IsMaster) { - //this.Prompt("进入应用配置管理界面", false); 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 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")); - response.Redirect(ui); + // response.Redirect(ui); + ui.SendTo(this.Context); return this.DialogValue("none"); }); switch (Model) diff --git a/Proxy/SiteConfImageActivity.cs b/Proxy/SiteConfImageActivity.cs index a73669c..b6d1de0 100644 --- a/Proxy/SiteConfImageActivity.cs +++ b/Proxy/SiteConfImageActivity.cs @@ -64,13 +64,13 @@ namespace UMC.Proxy.Activities var confValue = UMC.Data.JSON.Deserialize(config.ConfValue) ?? new WebMeta(); var key = this.AsyncDialog("ConfValue", g => { - var ms = request.SendValues ?? request.Arguments; - if (ms.ContainsKey("limit") == false) - { - this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) - .RefreshEvent($"{request.Model}.{request.Command}") - .Builder(), true); - } + // var ms = request.SendValues ?? request.Arguments; + // if (ms.ContainsKey("limit") == false) + // { + // // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) + // // .RefreshEvent($"{request.Model}.{request.Command}") + // // .Builder(), true); + // } var title = UITitle.Create(); 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)); break; } - response.Redirect(ui); - - return this.DialogValue("none"); + ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}"); }); var ConValue = UIDialog.AsyncDialog(this.Context, "Value", r => diff --git a/Proxy/SiteLogConfActivity.cs b/Proxy/SiteLogConfActivity.cs index bdb1b8b..c134390 100644 --- a/Proxy/SiteLogConfActivity.cs +++ b/Proxy/SiteLogConfActivity.cs @@ -19,14 +19,14 @@ namespace UMC.Proxy var model = this.AsyncDialog("Id", akey => { - var form = request.SendValues ?? new WebMeta(); - if (form.ContainsKey("limit") == false) - { - this.Context.Send(new UISectionBuilder(request.Model, request.Command) - .RefreshEvent($"{request.Model}.{request.Command}") - .Builder(), true); + // var form = request.SendValues ?? new WebMeta(); + // if (form.ContainsKey("limit") == false) + // { + // this.Context.Send(new UISectionBuilder(request.Model, request.Command) + // .RefreshEvent($"{request.Model}.{request.Command}") + // .Builder(), true); - } + // } var ui = UISection.Create(new UITitle("日志组件")); @@ -126,9 +126,10 @@ namespace UMC.Proxy ui.UIFootBar = new UIFootBar() { IsFixed = true }; 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())); - 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) diff --git a/Proxy/SiteMimeActivity.cs b/Proxy/SiteMimeActivity.cs index b7670d2..c513d5b 100644 --- a/Proxy/SiteMimeActivity.cs +++ b/Proxy/SiteMimeActivity.cs @@ -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 => { - if (ms.ContainsKey("limit") == false) - { - this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) - .RefreshEvent("Mime.Config") - .Builder(), true); + // if (ms.ContainsKey("limit") == false) + // { + // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) + // .RefreshEvent("Mime.Config") + // .Builder(), true); - } + // } var title = UITitle.Create(); @@ -289,8 +289,9 @@ namespace UMC.Proxy.Activities - response.Redirect(ui); - return this.DialogValue("none"); + ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}"); + // response.Redirect(ui); + // return this.DialogValue("none"); }); switch (Model) { diff --git a/Proxy/SiteServerActivity.cs b/Proxy/SiteServerActivity.cs index 3a77777..3cf4971 100644 --- a/Proxy/SiteServerActivity.cs +++ b/Proxy/SiteServerActivity.cs @@ -23,14 +23,14 @@ namespace UMC.Proxy.Activities var hosts = UMC.Data.Reflection.Configuration("host"); var model = this.AsyncDialog("Model", akey => { - var form = request.SendValues ?? new WebMeta(); - if (form.ContainsKey("limit") == false) - { - this.Context.Send(new UISectionBuilder(request.Model, request.Command) - .RefreshEvent($"{request.Model}.{request.Command}") - .Builder(), true); + // var form = request.SendValues ?? new WebMeta(); + // if (form.ContainsKey("limit") == false) + // { + // this.Context.Send(new UISectionBuilder(request.Model, request.Command) + // .RefreshEvent() + // .Builder(), true); - } + // } 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)), new UIEventText("重新加载").Click(new UIClick("Reload").Send("Http", "Bridge")).Style(new UIStyle().BgColor())); - - response.Redirect(ui); + ui.SendTo(this.Context, true, $"{request.Model}.{request.Command}"); + // response.Redirect(ui); return this.DialogValue("none"); }); @@ -412,14 +412,14 @@ namespace UMC.Proxy.Activities var certmodel = this.AsyncDialog("CertModel", rm => { - var form = request.SendValues ?? new UMC.Web.WebMeta(); - if (form.ContainsKey("limit") == false) - { - this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) - .RefreshEvent($"{request.Model}.{request.Command}") - .Builder(), true); + // var form = request.SendValues ?? new UMC.Web.WebMeta(); + // if (form.ContainsKey("limit") == false) + // { + // this.Context.Send(new UISectionBuilder(request.Model, request.Command, request.Arguments) + // .RefreshEvent($"{request.Model}.{request.Command}") + // .Builder(), true); - } + // } 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())); break; } - response.Redirect(ui); - return this.DialogValue("none"); + ui.SendTo(this.Context, $"{request.Model}.{request.Command}"); + // response.Redirect(ui); + // return this.DialogValue("none"); }); switch (certmodel)