|
|
|
@ -304,41 +304,23 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
{
|
|
|
|
|
var from = new Web.UIFormDialog() { Title = "应用设置" };
|
|
|
|
|
from.AddText("应用名称", "Caption", site.Caption);
|
|
|
|
|
from.AddText("应用主页", "Home", site.Home).NotRequired();
|
|
|
|
|
from.AddText("移动主页", "MobileHome", site.MobileHome).NotRequired();
|
|
|
|
|
from.AddText("缓存版本", "Version", site.Version).NotRequired();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var userBrowser = site.UserBrowser ?? Entities.UserBrowser.All;
|
|
|
|
|
from.AddCheckBox("支持浏览器", "UserBrowser", "All")
|
|
|
|
|
.Put("IE", "IE", (userBrowser & UserBrowser.IE) == UserBrowser.IE)
|
|
|
|
|
.Put("谷歌", "Chrome", (userBrowser & UserBrowser.Chrome) == UserBrowser.Chrome)
|
|
|
|
|
.Put("火狐", "Firefox", (userBrowser & UserBrowser.Firefox) == UserBrowser.Firefox)
|
|
|
|
|
.Put("钉钉", "Dingtalk", (userBrowser & UserBrowser.Dingtalk) == UserBrowser.Dingtalk)
|
|
|
|
|
.Put("微信", "WeiXin", (userBrowser & UserBrowser.WeiXin) == UserBrowser.WeiXin)
|
|
|
|
|
.Put("WebKit", "WebKit", (userBrowser & UserBrowser.WebKit) == UserBrowser.WebKit);
|
|
|
|
|
|
|
|
|
|
from.AddCheckBox("", "Setings", "0")
|
|
|
|
|
.Put("桌面展示", "IsDesktop", site.IsDesktop == true)
|
|
|
|
|
.Put("隐藏应用", "IsModule", site.IsModule == true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from.AddRadio("打开方式", "OpenModel")
|
|
|
|
|
.Put("新窗口", "0", (site.OpenModel ?? 0) == 0)
|
|
|
|
|
.Put("当前窗口", "1", site.OpenModel == 1)
|
|
|
|
|
.Put("最大化窗口", "2", site.OpenModel == 2)
|
|
|
|
|
.Put("快捷方式", "3", site.OpenModel == 3);
|
|
|
|
|
|
|
|
|
|
from.Submit("确认", "Site.Config");
|
|
|
|
|
return from;
|
|
|
|
|
});
|
|
|
|
|
var Home = config["Home"];
|
|
|
|
|
if (String.IsNullOrEmpty(Home) == false)
|
|
|
|
|
{
|
|
|
|
|
if (Home.StartsWith("https://") == false && Home.StartsWith("http://") == false)
|
|
|
|
|
{
|
|
|
|
|
if (Home.StartsWith("/") == false || Home.StartsWith("//"))
|
|
|
|
|
{
|
|
|
|
|
this.Prompt("主页格式不正确,请确认");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Home = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var version = config["Version"];
|
|
|
|
|
if (String.IsNullOrEmpty(version) == false)
|
|
|
|
@ -355,16 +337,27 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
var confgiSite = new Site
|
|
|
|
|
{
|
|
|
|
|
Caption = config["Caption"],
|
|
|
|
|
Home = Home,
|
|
|
|
|
OpenModel = UMC.Data.Utility.Parse(config["OpenModel"], 0),
|
|
|
|
|
Version = version,
|
|
|
|
|
IsDesktop = false,
|
|
|
|
|
IsModule = false,
|
|
|
|
|
Root = site.Root
|
|
|
|
|
};
|
|
|
|
|
var userBrowser2 = UserBrowser.All;
|
|
|
|
|
foreach (var v in config["UserBrowser"].Split(','))
|
|
|
|
|
|
|
|
|
|
var sDoHtmlType = config["Setings"].Split(',');
|
|
|
|
|
foreach (var v in sDoHtmlType)
|
|
|
|
|
{
|
|
|
|
|
userBrowser2 |= UMC.Data.Utility.Parse(v, UserBrowser.All);
|
|
|
|
|
switch (v)
|
|
|
|
|
{
|
|
|
|
|
case "IsDesktop":
|
|
|
|
|
confgiSite.IsDesktop = true;
|
|
|
|
|
break;
|
|
|
|
|
case "IsModule":
|
|
|
|
|
confgiSite.IsModule = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
confgiSite.UserBrowser = userBrowser2;
|
|
|
|
|
|
|
|
|
|
DataFactory.Instance().Put(confgiSite);
|
|
|
|
|
this.Context.Send("Site.Config", true);
|
|
|
|
|
}
|
|
|
|
@ -399,7 +392,7 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
this.Prompt("应用安全码", "AppSecret:" + site.AppSecret);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
//site.AppSecret
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Setting(Site site)
|
|
|
|
@ -407,6 +400,10 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
var config = this.AsyncDialog("Config", g =>
|
|
|
|
|
{
|
|
|
|
|
var from = new Web.UIFormDialog() { Title = "应用设置" };
|
|
|
|
|
|
|
|
|
|
from.AddText("应用主页", "Home", site.Home).NotRequired();
|
|
|
|
|
from.AddText("移动主页", "MobileHome", site.MobileHome).NotRequired();
|
|
|
|
|
|
|
|
|
|
from.AddRadio("访问许可", "AuthType")
|
|
|
|
|
.Put("所有人", "All", site.AuthType == WebAuthType.All)
|
|
|
|
|
.Put("匿名检查", "Check", site.AuthType == WebAuthType.Check)
|
|
|
|
@ -415,45 +412,82 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
.Put("用户检查", "UserCheck", site.AuthType == WebAuthType.UserCheck)
|
|
|
|
|
.Put("管理员", "Admin", site.AuthType == WebAuthType.Admin);
|
|
|
|
|
|
|
|
|
|
from.AddCheckBox("设置", "Setings", "0")
|
|
|
|
|
.Put("桌面展示", "IsDesktop", site.IsDesktop == true)
|
|
|
|
|
.Put("隐藏应用", "IsModule", site.IsModule == true)
|
|
|
|
|
from.AddCheckBox("", "Setings", "0")
|
|
|
|
|
// .Put("桌面展示", "IsDesktop", site.IsDesktop == true)
|
|
|
|
|
// .Put("隐藏应用", "IsModule", site.IsModule == true);
|
|
|
|
|
.Put("开启日志", "IsDebug", site.IsDebug == true)
|
|
|
|
|
.Put("强化验证", "IsAuth", site.IsAuth == true);
|
|
|
|
|
|
|
|
|
|
var userBrowser = site.UserBrowser ?? Entities.UserBrowser.All;
|
|
|
|
|
from.AddCheckBox("支持浏览器", "UserBrowser", "All")
|
|
|
|
|
.Put("IE", "IE", (userBrowser & UserBrowser.IE) == UserBrowser.IE)
|
|
|
|
|
.Put("谷歌", "Chrome", (userBrowser & UserBrowser.Chrome) == UserBrowser.Chrome)
|
|
|
|
|
.Put("火狐", "Firefox", (userBrowser & UserBrowser.Firefox) == UserBrowser.Firefox)
|
|
|
|
|
.Put("钉钉", "Dingtalk", (userBrowser & UserBrowser.Dingtalk) == UserBrowser.Dingtalk)
|
|
|
|
|
.Put("微信", "WeiXin", (userBrowser & UserBrowser.WeiXin) == UserBrowser.WeiXin)
|
|
|
|
|
.Put("WebKit", "WebKit", (userBrowser & UserBrowser.WebKit) == UserBrowser.WebKit);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from.AddRadio("打开方式", "OpenModel")
|
|
|
|
|
.Put("新窗口", "0", (site.OpenModel ?? 0) == 0)
|
|
|
|
|
.Put("当前窗口", "1", site.OpenModel == 1)
|
|
|
|
|
.Put("最大化窗口", "2", site.OpenModel == 2)
|
|
|
|
|
.Put("快捷方式", "3", site.OpenModel == 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from.Submit("确认", "Site.Config");
|
|
|
|
|
return from;
|
|
|
|
|
});
|
|
|
|
|
var Home = config["Home"];
|
|
|
|
|
if (String.IsNullOrEmpty(Home) == false)
|
|
|
|
|
{
|
|
|
|
|
if (Home.StartsWith("https://") == false && Home.StartsWith("http://") == false)
|
|
|
|
|
{
|
|
|
|
|
if (Home.StartsWith("/") == false || Home.StartsWith("//"))
|
|
|
|
|
{
|
|
|
|
|
this.Prompt("主页格式不正确,请确认");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Home = null;
|
|
|
|
|
}
|
|
|
|
|
var MobileHome = config["MobileHome"];
|
|
|
|
|
if (String.IsNullOrEmpty(MobileHome) == false)
|
|
|
|
|
{
|
|
|
|
|
if (MobileHome.StartsWith("https://") == false && MobileHome.StartsWith("http://") == false)
|
|
|
|
|
{
|
|
|
|
|
if (MobileHome.StartsWith("/") == false || MobileHome.StartsWith("//"))
|
|
|
|
|
{
|
|
|
|
|
this.Prompt("主页格式不正确,请确认");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MobileHome = null;
|
|
|
|
|
}
|
|
|
|
|
var confgiSite = new Site
|
|
|
|
|
{
|
|
|
|
|
Home = Home,
|
|
|
|
|
MobileHome = MobileHome,
|
|
|
|
|
OpenModel = UMC.Data.Utility.Parse(config["OpenModel"], 0),
|
|
|
|
|
IsModule = false,
|
|
|
|
|
IsDebug = false,
|
|
|
|
|
IsDesktop = false,
|
|
|
|
|
IsAuth = true,
|
|
|
|
|
IsAuth = false,
|
|
|
|
|
AuthType = UMC.Data.Utility.Parse(config["AuthType"], UMC.Web.WebAuthType.User),
|
|
|
|
|
Root = site.Root
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var userBrowser2 = UserBrowser.All;
|
|
|
|
|
foreach (var v in config["UserBrowser"].Split(','))
|
|
|
|
|
{
|
|
|
|
|
userBrowser2 |= UMC.Data.Utility.Parse(v, UserBrowser.All);
|
|
|
|
|
}
|
|
|
|
|
confgiSite.UserBrowser = userBrowser2;
|
|
|
|
|
|
|
|
|
|
var sDoHtmlType = config["Setings"].Split(',');
|
|
|
|
|
foreach (var v in sDoHtmlType)
|
|
|
|
|
{
|
|
|
|
|
switch (v)
|
|
|
|
|
{
|
|
|
|
|
case "IsDesktop":
|
|
|
|
|
confgiSite.IsDesktop = true;
|
|
|
|
|
break;
|
|
|
|
|
case "IsModule":
|
|
|
|
|
confgiSite.IsModule = true;
|
|
|
|
|
break;
|
|
|
|
|
case "IsDebug":
|
|
|
|
|
confgiSite.IsDebug = true;
|
|
|
|
|
break;
|
|
|
|
@ -952,10 +986,11 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
.AddCell("请求配置", String.IsNullOrEmpty(site.HeaderConf) ? "未设置" : "已设置", new UIClick(new WebMeta(request.Arguments).Put(g, "HeaderConf")).Send(request.Model, request.Command));
|
|
|
|
|
ui.NewSection().AddCell("动静分离", String.IsNullOrEmpty(site.StaticConf) ? "未设置" : "已设置", new UIClick(new WebMeta(request.Arguments).Put(g, "StaticConf")).Send(request.Model, request.Command))
|
|
|
|
|
.AddCell("日志参数", String.IsNullOrEmpty(site.LogConf) ? "未设置" : "已设置", new UIClick(new WebMeta(request.Arguments).Put(g, "LogConf")).Send(request.Model, request.Command));
|
|
|
|
|
|
|
|
|
|
ui.NewSection().AddCell("桌面授权", "", new UIClick(new WebMeta().Put("Key", site.Root, "Model", "Auth")).Send(this.Context.Request.Model, this.Context.Request.Command))
|
|
|
|
|
.AddCell("应用安全码", new UIClick(new WebMeta(request.Arguments).Put(g, "AppSecret")).Send(request.Model, request.Command));
|
|
|
|
|
|
|
|
|
|
if (IsShow)
|
|
|
|
|
{
|
|
|
|
|
ui.NewSection().AddCell("桌面授权", "", new UIClick(new WebMeta().Put("Key", site.Root, "Model", "Auth")).Send(this.Context.Request.Model, this.Context.Request.Command))
|
|
|
|
|
.AddCell("应用安全码", new UIClick(new WebMeta(request.Arguments).Put(g, "AppSecret")).Send(request.Model, request.Command));
|
|
|
|
|
}
|
|
|
|
|
var imageUI = ui.NewSection().AddCell("图片处理", "配置", new UIClick(new WebMeta(request.Arguments).Put(g, "ImagesConf")).Send(request.Model, request.Command));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1449,7 +1484,7 @@ namespace UMC.Proxy.Activities
|
|
|
|
|
var config = this.AsyncDialog("Config", g =>
|
|
|
|
|
{
|
|
|
|
|
var from = new Web.UIFormDialog() { Title = "动静分离" };
|
|
|
|
|
from.AddTextarea("不分离路径", "StaticConf", site.StaticConf).Put("Rows", 10).PlaceHolder("配置不分离的路径").NotRequired();
|
|
|
|
|
from.AddTextarea("分离路径", "StaticConf", site.StaticConf).Put("Rows", 10).PlaceHolder("只有路径,则表示清除默认分离的配置").NotRequired();
|
|
|
|
|
|
|
|
|
|
from.AddPrompt("默认对文件名为gif、ico、svg、bmp、png、jpg、jpeg、css、less、sass、scss、js、webp、jsx、coffee、ts、ttf、woff、woff2、wasm进行静态分离,分离参数all、user、 one、[num]");
|
|
|
|
|
from.Submit("确认", "Site.Config");
|
|
|
|
|