parent
ba8320708a
commit
be80b0c629
|
@ -1,4 +1,5 @@
|
||||||
using Bootstrap.Admin.Shared;
|
using Bootstrap.Admin.Shared;
|
||||||
|
using Bootstrap.DataAccess;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace Bootstrap.Admin.Components
|
namespace Bootstrap.Admin.Components
|
||||||
|
@ -18,7 +19,7 @@ namespace Bootstrap.Admin.Components
|
||||||
/// 获得 根模板页实例
|
/// 获得 根模板页实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[CascadingParameter(Name = "Default")]
|
[CascadingParameter(Name = "Default")]
|
||||||
public DefaultLayout RootLayout { get; protected set; } = new DefaultLayout();
|
protected DefaultLayout? RootLayout { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得/设置 用户图标
|
/// 获得/设置 用户图标
|
||||||
|
@ -37,5 +38,18 @@ namespace Bootstrap.Admin.Components
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<string> DisplayNameChanged { get; set; }
|
public EventCallback<string> DisplayNameChanged { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得/设置 是否显示 Blazor MVC 切换图标
|
||||||
|
/// </summary>
|
||||||
|
protected bool EnableBlazor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 参数赋值方法
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnParametersSet()
|
||||||
|
{
|
||||||
|
EnableBlazor = DictHelper.RetrieveEnableBlazor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Bootstrap.Admin.Components
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string ShowCardTitle { get; set; } = "";
|
public bool ShowCardTitle { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|
|
@ -79,5 +79,21 @@ namespace Bootstrap.Admin.Extensions
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="method"></param>
|
/// <param name="method"></param>
|
||||||
public static void Tooltip(this IJSRuntime? jSRuntime, string id, string method) => jSRuntime.InvokeVoidAsync("$.tooltip", $"#{id}", method);
|
public static void Tooltip(this IJSRuntime? jSRuntime, string id, string method) => jSRuntime.InvokeVoidAsync("$.tooltip", $"#{id}", method);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示或者隐藏 网站 Blazor 挂件图标
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jSRuntime"></param>
|
||||||
|
/// <param name="show"></param>
|
||||||
|
public static void ToggleBlazor(this IJSRuntime? jSRuntime, bool show) => jSRuntime.InvokeVoidAsync("$.toggleBlazor", show);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示或者隐藏 网站 Blazor 挂件图标
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jSRuntime"></param>
|
||||||
|
/// <param name="showSidebar"></param>
|
||||||
|
/// <param name="showCardTitle"></param>
|
||||||
|
/// <param name="fixedTableHeader"></param>
|
||||||
|
public static void SetWebSettings(this IJSRuntime? jSRuntime, bool showSidebar, bool showCardTitle, bool fixedTableHeader) => jSRuntime.InvokeVoidAsync("$.setWebSettings", showSidebar, showCardTitle, fixedTableHeader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,15 +20,15 @@ namespace Bootstrap.Admin.Models
|
||||||
Footer = DictHelper.RetrieveWebFooter(appId);
|
Footer = DictHelper.RetrieveWebFooter(appId);
|
||||||
Theme = DictHelper.RetrieveActiveTheme();
|
Theme = DictHelper.RetrieveActiveTheme();
|
||||||
IsDemo = DictHelper.RetrieveSystemModel();
|
IsDemo = DictHelper.RetrieveSystemModel();
|
||||||
ShowCardTitle = DictHelper.RetrieveCardTitleStatus() ? "" : "no-card-header";
|
ShowCardTitle = DictHelper.RetrieveCardTitleStatus();
|
||||||
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "collapsed";
|
ShowSideBar = DictHelper.RetrieveSidebarStatus();
|
||||||
AllowMobile = DictHelper.RetrieveMobileLogin();
|
AllowMobile = DictHelper.RetrieveMobileLogin();
|
||||||
AllowOAuth = DictHelper.RetrieveOAuthLogin();
|
AllowOAuth = DictHelper.RetrieveOAuthLogin();
|
||||||
ShowMobile = AllowMobile ? "" : "mobile";
|
ShowMobile = AllowMobile;
|
||||||
ShowOAuth = AllowOAuth ? "" : "oauth";
|
ShowOAuth = AllowOAuth;
|
||||||
LockScreenPeriod = DictHelper.RetrieveAutoLockScreenPeriod();
|
LockScreenPeriod = DictHelper.RetrieveAutoLockScreenPeriod();
|
||||||
EnableAutoLockScreen = DictHelper.RetrieveAutoLockScreen();
|
EnableAutoLockScreen = DictHelper.RetrieveAutoLockScreen();
|
||||||
FixedTableHeader = DictHelper.RetrieveFixedTableHeader() ? "" : "scroll";
|
FixedTableHeader = DictHelper.RetrieveFixedTableHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -54,12 +54,12 @@ namespace Bootstrap.Admin.Models
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否显示卡片标题
|
/// 是否显示卡片标题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShowCardTitle { get; protected set; }
|
public bool ShowCardTitle { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否收缩侧边栏
|
/// 是否收缩侧边栏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShowSideBar { get; protected set; }
|
public bool ShowSideBar { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 是否允许短信验证码登录
|
/// 获得 是否允许短信验证码登录
|
||||||
|
@ -74,12 +74,12 @@ namespace Bootstrap.Admin.Models
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 是否允许短信验证码登录
|
/// 获得 是否允许短信验证码登录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShowMobile { get; }
|
public bool ShowMobile { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 是否允许第三方 OAuth 认证登录
|
/// 获得 是否允许第三方 OAuth 认证登录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShowOAuth { get; }
|
public bool ShowOAuth { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 自动锁屏时长 默认 1 分钟 字典表中配置
|
/// 获得 自动锁屏时长 默认 1 分钟 字典表中配置
|
||||||
|
@ -94,6 +94,6 @@ namespace Bootstrap.Admin.Models
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 是否固定表头
|
/// 获得 是否固定表头
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FixedTableHeader { get; }
|
public bool FixedTableHeader { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace Bootstrap.Admin.Models
|
||||||
WebSiteIcon = DictHelper.RetrieveWebIcon(AppId);
|
WebSiteIcon = DictHelper.RetrieveWebIcon(AppId);
|
||||||
WebSiteLogo = DictHelper.RetrieveWebLogo(AppId);
|
WebSiteLogo = DictHelper.RetrieveWebLogo(AppId);
|
||||||
}
|
}
|
||||||
|
EnableBlazor = DictHelper.RetrieveEnableBlazor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -68,5 +69,10 @@ namespace Bootstrap.Admin.Models
|
||||||
/// 获得 当前样式
|
/// 获得 当前样式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ActiveCss { get; } = "";
|
public string ActiveCss { get; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得 是否开启 Blazor
|
||||||
|
/// </summary>
|
||||||
|
public bool EnableBlazor { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,8 @@ namespace Bootstrap.Admin.Models
|
||||||
public SettingsModel(ControllerBase controller) : base(controller)
|
public SettingsModel(ControllerBase controller) : base(controller)
|
||||||
{
|
{
|
||||||
Themes = DictHelper.RetrieveThemes();
|
Themes = DictHelper.RetrieveThemes();
|
||||||
AutoLockScreen = EnableAutoLockScreen ? "" : "lockScreen";
|
AutoLockScreen = EnableAutoLockScreen;
|
||||||
DefaultApp = DictHelper.RetrieveDefaultApp() ? "" : "defaultApp";
|
DefaultApp = DictHelper.RetrieveDefaultApp();
|
||||||
EnableBlazor = DictHelper.RetrieveEnableBlazor() ? "" : "blazor";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -28,9 +27,8 @@ namespace Bootstrap.Admin.Models
|
||||||
public SettingsModel(string? userName) : base(userName)
|
public SettingsModel(string? userName) : base(userName)
|
||||||
{
|
{
|
||||||
Themes = DictHelper.RetrieveThemes();
|
Themes = DictHelper.RetrieveThemes();
|
||||||
AutoLockScreen = EnableAutoLockScreen ? "" : "lockScreen";
|
AutoLockScreen = EnableAutoLockScreen;
|
||||||
DefaultApp = DictHelper.RetrieveDefaultApp() ? "" : "defaultApp";
|
DefaultApp = DictHelper.RetrieveDefaultApp();
|
||||||
EnableBlazor = DictHelper.RetrieveEnableBlazor() ? "" : "blazor";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -41,16 +39,11 @@ namespace Bootstrap.Admin.Models
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 是否开启自动锁屏
|
/// 获得 是否开启自动锁屏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AutoLockScreen { get; }
|
public bool AutoLockScreen { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得 是否开启自动锁屏
|
/// 获得 是否开启自动锁屏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DefaultApp { get; }
|
public bool DefaultApp { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获得 是否开启 Blazor
|
|
||||||
/// </summary>
|
|
||||||
public string EnableBlazor { get; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer text-right">
|
<div class="modal-footer text-right">
|
||||||
<button class="btn btn-secondary" type="button" @onclick="SaveSidebar"><i class="fa fa-save"></i><span>保存</span></button>
|
<button class="btn btn-secondary" type="button" @onclick="SaveWebSettings"><i class="fa fa-save"></i><span>保存</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
</div>
|
</div>
|
||||||
<ConditionComponent Inverse="true">
|
<ConditionComponent Inverse="true">
|
||||||
<div class="modal-footer text-right">
|
<div class="modal-footer text-right">
|
||||||
<button class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
|
<button class="btn btn-secondary" type="button" @onclick="SaveLogin"><i class="fa fa-save"></i><span>保存</span></button>
|
||||||
</div>
|
</div>
|
||||||
</ConditionComponent>
|
</ConditionComponent>
|
||||||
</div>
|
</div>
|
||||||
|
@ -172,7 +172,7 @@
|
||||||
<div class="card-header">网站设置</div>
|
<div class="card-header">网站设置</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="alert alert-info" role="alert">
|
<div class="alert alert-info" role="alert">
|
||||||
<span>开启此功能后后台应用使用 Blazor 多标签形式</span>
|
<span>开启此功能网站增加 Blazor 与 MVC 切换挂件</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Bootstrap.Admin.Components;
|
using Bootstrap.Admin.Components;
|
||||||
|
using Bootstrap.Admin.Extensions;
|
||||||
using Bootstrap.Admin.Shared;
|
using Bootstrap.Admin.Shared;
|
||||||
using Bootstrap.DataAccess;
|
using Bootstrap.DataAccess;
|
||||||
using Bootstrap.Security;
|
using Bootstrap.Security;
|
||||||
|
@ -62,25 +63,39 @@ namespace Bootstrap.Pages.Admin.Components
|
||||||
{
|
{
|
||||||
var ret = DictHelper.SaveSettings(new BootstrapDict[] { new BootstrapDict() { Category = "网站设置", Name = "Blazor", Code = Model.EnableBlazor ? "1" : "0" } });
|
var ret = DictHelper.SaveSettings(new BootstrapDict[] { new BootstrapDict() { Category = "网站设置", Name = "Blazor", Code = Model.EnableBlazor ? "1" : "0" } });
|
||||||
if (Model.EnableBlazor) ShowMessage("Blazor 设置保存", ret);
|
if (Model.EnableBlazor) ShowMessage("Blazor 设置保存", ret);
|
||||||
else
|
|
||||||
{
|
// 根据保存结果隐藏 Header 挂件
|
||||||
var url = RootLayout?.NavigationManager?.Uri.Replace("/Pages", "");
|
if (ret) RootLayout?.JSRuntime?.ToggleBlazor(Model.EnableBlazor);
|
||||||
RootLayout?.NavigationManager?.NavigateTo(url, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存 网站调整 方法
|
/// 保存 网站调整 方法
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void SaveSidebar()
|
protected void SaveWebSettings()
|
||||||
{
|
{
|
||||||
var ret = DictHelper.SaveSettings(new BootstrapDict[]{
|
var ret = DictHelper.SaveSettings(new BootstrapDict[]{
|
||||||
new BootstrapDict() { Category = "网站调整", Name = "侧边栏状态", Code = Model.ShowSideBar ? "1" : "0" },
|
new BootstrapDict() { Category = "网站设置", Name = "侧边栏状态", Code = Model.ShowSideBar ? "1" : "0" },
|
||||||
new BootstrapDict() { Category = "网站调整", Name = "卡片标题状态", Code = Model.ShowCardTitle ? "1" : "0" },
|
new BootstrapDict() { Category = "网站设置", Name = "卡片标题状态", Code = Model.ShowCardTitle ? "1" : "0" },
|
||||||
new BootstrapDict() { Category = "网站调整", Name = "固定表头", Code = Model.FixedTableHeader ? "1" : "0" }
|
new BootstrapDict() { Category = "网站设置", Name = "固定表头", Code = Model.FixedTableHeader ? "1" : "0" }
|
||||||
});
|
});
|
||||||
ShowMessage("网站调整 设置保存", ret);
|
ShowMessage("网站调整保存", ret);
|
||||||
|
|
||||||
|
// 根据保存结果设置网站样式
|
||||||
|
if (ret) RootLayout?.JSRuntime?.SetWebSettings(Model.ShowSideBar, Model.ShowCardTitle, Model.FixedTableHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存 登陆设置
|
||||||
|
/// </summary>
|
||||||
|
protected void SaveLogin()
|
||||||
|
{
|
||||||
|
var ret = DictHelper.SaveSettings(new BootstrapDict[]{
|
||||||
|
new BootstrapDict() { Category = "网站设置", Name = "OAuth 认证登录", Code = Model.ShowOAuth ? "1" : "0" },
|
||||||
|
new BootstrapDict() { Category = "网站设置", Name = "短信验证码登录", Code = Model.ShowMobile ? "1" : "0" }
|
||||||
|
});
|
||||||
|
ShowMessage("登录设置保存", ret);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 网站设置编辑模型实体类
|
/// 网站设置编辑模型实体类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<a id="navbar" href="@RootLayout.HomeUrl" class="sidebar-toggle-box">
|
<a id="navbar" href="@RootLayout?.HomeUrl" class="sidebar-toggle-box">
|
||||||
<i class="fa fa-bars"></i>
|
<i class="fa fa-bars"></i>
|
||||||
<span id="websiteTitle">@Title</span>
|
<span id="websiteTitle">@Title</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
@if (@RootLayout.IsAdmin)
|
@if (@RootLayout?.IsAdmin ?? false)
|
||||||
{
|
{
|
||||||
<!-- tasks start -->
|
<!-- tasks start -->
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
|
@ -91,11 +91,11 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div class="dropdown">
|
<div class="@(EnableBlazor ? "dropdown" : "dropdown d-none")">
|
||||||
<a class="shadow-success dropdown-mvc" href="/Admin/Index" data-toggle="tooltip" title="NETCore MVC 模式">
|
<a class="shadow-success dropdown-mvc" href="/Admin/Index" data-toggle="tooltip" title="NETCore MVC 模式">
|
||||||
<img src="/images/netcore2.png" />
|
<img src="/images/netcore2.png" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown userinfo">
|
<div class="dropdown userinfo">
|
||||||
<div data-toggle="dropdown" class="dropdown-toggle shadow-default">
|
<div data-toggle="dropdown" class="dropdown-toggle shadow-default">
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
<img src="@Icon.ToBlazorLink()">
|
<img src="@Icon.ToBlazorLink()">
|
||||||
<div class="flex-fill">
|
<div class="flex-fill">
|
||||||
<div class="username text-truncate">@DisplayName</div>
|
<div class="username text-truncate">@DisplayName</div>
|
||||||
<div>登录名:@RootLayout.UserName</div>
|
<div>登录名:@RootLayout?.UserName</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
@inherits SectionBase
|
@inherits SectionBase
|
||||||
|
|
||||||
<section class="main-content @ShowCardTitle @(ShowBackground ? @"welcome-bg" : @"")">
|
<section class="main-content @(ShowCardTitle ? "" : "no-card-header") @(ShowBackground ? "welcome-bg" : "")">
|
||||||
@if (LockScreenPeriod > 0)
|
@if (LockScreenPeriod > 0)
|
||||||
{
|
{
|
||||||
<input id="lockScreenPeriod" type="hidden" value="@LockScreenPeriod" />
|
<input id="lockScreenPeriod" type="hidden" value="@LockScreenPeriod" />
|
||||||
|
|
|
@ -141,7 +141,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="slidercaptcha card @Model.ShowOAuth">
|
<div class="slidercaptcha @(Model.ShowOAuth ? "card oauth" : "card")">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>请完成安全验证</span>
|
<span>请完成安全验证</span>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
|
|
@ -170,7 +170,7 @@
|
||||||
<div class="card-header">网站设置</div>
|
<div class="card-header">网站设置</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="alert alert-info" role="alert">
|
<div class="alert alert-info" role="alert">
|
||||||
<span>开启此功能后后台应用使用 Blazor 多标签形式</span>
|
<span>开启此功能网站增加 Blazor 与 MVC 切换挂件</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div class="dropdown">
|
<div class="@(Model.EnableBlazor ? "dropdown" : "dropdown d-none")">
|
||||||
<a class="shadow-success dropdown-blazor" href="/Pages" data-toggle="tooltip" title="Blazor 多 Tabs 模式">
|
<a class="shadow-success dropdown-blazor" href="/Pages" data-toggle="tooltip" title="Blazor 多 Tabs 模式">
|
||||||
<img src="~/images/blazor.svg" />
|
<img src="~/images/blazor.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
@model NavigatorBarModel
|
@model NavigatorBarModel
|
||||||
<aside class="@Model.ShowSideBar">
|
<aside class="@(Model.ShowSideBar ? "" : "collapsed")">
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
<div class="nav-brand justify-content-center">
|
<div class="nav-brand justify-content-center">
|
||||||
<a href="#">
|
<a href="#">
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<script src="~/js/log.js" asp-append-version="true"></script>
|
<script src="~/js/log.js" asp-append-version="true"></script>
|
||||||
}
|
}
|
||||||
@await Html.PartialAsync("Navigator")
|
@await Html.PartialAsync("Navigator")
|
||||||
<section id="main-content" class="main-content @Model.ShowCardTitle">
|
<section id="main-content" class="main-content @(Model.ShowCardTitle ? "" : "no-card-header")">
|
||||||
<input id="lockScreenPeriod" type="hidden" asp-condition="@Model.EnableAutoLockScreen" value="@Model.LockScreenPeriod" />
|
<input id="lockScreenPeriod" type="hidden" asp-condition="@Model.EnableAutoLockScreen" value="@Model.LockScreenPeriod" />
|
||||||
<div class="main-header">
|
<div class="main-header">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@await RenderSectionAsync("cardbody", false)
|
@await RenderSectionAsync("cardbody", false)
|
||||||
<table data-fixedHeader="@Model.FixedTableHeader"></table>
|
<table data-Header="@(Model.FixedTableHeader ? "fixed" : "scroll")"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="tableButtons" class="d-none">
|
<div id="tableButtons" class="d-none">
|
||||||
|
|
|
@ -130,6 +130,20 @@
|
||||||
},
|
},
|
||||||
submitForm: function (btn) {
|
submitForm: function (btn) {
|
||||||
$(btn).parent().prev().find('form :submit').click();
|
$(btn).parent().prev().find('form :submit').click();
|
||||||
|
},
|
||||||
|
toggleBlazor: function (show) {
|
||||||
|
var $blazor = $('header .nav .dropdown-mvc').parent();
|
||||||
|
if (show) $blazor.removeClass('d-none');
|
||||||
|
else $blazor.addClass('d-none');
|
||||||
|
},
|
||||||
|
setWebSettings: function (showSidebar, showCardTitle, fixedTableHeader) {
|
||||||
|
var $tabContent = $('section .tab-content');
|
||||||
|
if (showCardTitle) $tabContent.removeClass('no-card-header');
|
||||||
|
else $tabContent.addClass('no-card-header');
|
||||||
|
|
||||||
|
var $table = $(".bootstrap-table");
|
||||||
|
if (fixedTableHeader) $table.attr('data-header', 'fixed');
|
||||||
|
else $table.attr('data-header', 'scroll');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,10 @@ $(function () {
|
||||||
url: Settings.url, data: [{ name: 'Blazor', code: blazor, category: '网站设置' }], title: 'Blazor 设置', method: "post",
|
url: Settings.url, data: [{ name: 'Blazor', code: blazor, category: '网站设置' }], title: 'Blazor 设置', method: "post",
|
||||||
callback: function (result) {
|
callback: function (result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
// 导航到 Blazor 页面
|
// 通过值设置是否显示 Blazor 挂件
|
||||||
window.location.href = $.formatUrl("Pages/Admin/Settings");
|
var $blazor = $('header .nav .dropdown-blazor').parent();
|
||||||
|
if (blazor === "1") $blazor.removeClass('d-none');
|
||||||
|
else $blazor.addClass('d-none');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -436,7 +436,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否固定表头 小屏幕禁止固定表头功能
|
// 判断是否固定表头 小屏幕禁止固定表头功能
|
||||||
var fixHeader = this.attr('data-fixedHeader') === '' && $(window).width() >= 768;
|
var fixHeader = this.attr('data-header') === 'fixed' && $(window).width() >= 768;
|
||||||
var $tabContainer = $(settings.tableContainer);
|
var $tabContainer = $(settings.tableContainer);
|
||||||
if (fixHeader && settings.height === undefined) {
|
if (fixHeader && settings.height === undefined) {
|
||||||
var calcPrevHeight = function (element) {
|
var calcPrevHeight = function (element) {
|
||||||
|
@ -754,7 +754,7 @@
|
||||||
var oldFunc = toggle.prototype.render;
|
var oldFunc = toggle.prototype.render;
|
||||||
toggle.prototype.render = function () {
|
toggle.prototype.render = function () {
|
||||||
var defaultVal = this.$element.attr('data-default-val') || '';
|
var defaultVal = this.$element.attr('data-default-val') || '';
|
||||||
if (defaultVal === '') this.$element.prop('checked', true);
|
if (defaultVal === "True") this.$element.prop('checked', true);
|
||||||
oldFunc.call(this);
|
oldFunc.call(this);
|
||||||
this.$toggle.on('touchend', function (e) {
|
this.$toggle.on('touchend', function (e) {
|
||||||
$(this).trigger('click.bs.toggle');
|
$(this).trigger('click.bs.toggle');
|
||||||
|
|
Loading…
Reference in New Issue