diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor index 2eb3556d..6c4a33f9 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor +++ b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor @@ -136,7 +136,7 @@
- +
@@ -208,6 +208,51 @@ + +
+
地址位置信息
+
+ + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + +
+
+
网站缓存 diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs b/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs index 2241829b..9c0d892a 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs @@ -81,6 +81,13 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components Text = ipSvrText, Value = ipSvrValue }; + + Model.ErrorLogPeriod = DictHelper.RetrieveExceptionsLogPeriod(); + Model.OpLog = DictHelper.RetrieveLogsPeriod(); + Model.LogLog = DictHelper.RetrieveLoginLogsPeriod(); + Model.TraceLog = DictHelper.RetrieveAccessLogPeriod(); + Model.CookiePeriod = DictHelper.RetrieveCookieExpiresPeriod(); + Model.IPCachePeriod = DictHelper.RetrieveLocaleIPSvrCachePeriod(); } /// @@ -192,6 +199,23 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components ShowMessage("保存网站页脚", ret); } + /// + /// 保存网站日志保留时长配置信息 + /// + protected void SaveLogSettings() + { + var items = new BootstrapDict[]{ + new BootstrapDict() { Category = "网站设置", Name="程序异常保留时长", Code = Model.ErrorLogPeriod.ToString(), Define = 0 }, + new BootstrapDict() { Category = "网站设置", Name="操作日志保留时长", Code = Model.OpLog.ToString(), Define = 0 }, + new BootstrapDict() { Category = "网站设置", Name="登录日志保留时长", Code = Model.LogLog.ToString(), Define = 0 }, + new BootstrapDict() { Category = "网站设置", Name="访问日志保留时长", Code = Model.TraceLog.ToString(), Define = 0 }, + new BootstrapDict() { Category = "网站设置", Name="Cookie保留时长", Code = Model.CookiePeriod.ToString(), Define = 0 }, + new BootstrapDict() { Category = "网站设置", Name="IP请求缓存时长", Code = Model.IPCachePeriod.ToString(), Define = 0 } + }; + var ret = DictHelper.SaveSettings(items); + ShowMessage("保存日志缓存设置", ret); + } + /// /// 网站设置编辑模型实体类 /// @@ -271,6 +295,36 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components /// 获得/设置 选中的地理位置配置信息 /// public SelectedItem SelectedIPLocator { get; set; } = new SelectedItem(); + + /// + /// 程序异常日志保留时长 + /// + public int ErrorLogPeriod { get; set; } + + /// + /// 操作日志保留时长 + /// + public int OpLog { get; set; } + + /// + /// 登录日志保留时长 + /// + public int LogLog { get; set; } + + /// + /// 访问日志保留时长 + /// + public int TraceLog { get; set; } + + /// + /// Cookie保留时长 + /// + public int CookiePeriod { get; set; } + + /// + /// IP请求缓存时长 + /// + public int IPCachePeriod { get; set; } } } }