临时提交

This commit is contained in:
Argo-MacBookPro 2018-06-07 00:45:47 +08:00
parent 10cd3440dc
commit 26e2c32180
236 changed files with 19751 additions and 19522 deletions

View File

@ -1 +0,0 @@
请不要删除此目录

View File

@ -1,29 +0,0 @@
using Bootstrap.DataAccess;
using Longbow.Caching;
using Longbow.ExceptionManagement;
using Longbow.ExceptionManagement.Configuration;
using System;
using System.Collections.Specialized;
namespace Bootstrap.Admin
{
/// <summary>
///
/// </summary>
public class DBPublisher : IExceptionPublisher
{
/// <summary>
///
/// </summary>
/// <param name="ex"></param>
/// <param name="additionalInfo"></param>
/// <param name="publisherElement"></param>
public void Publish(Exception ex, NameValueCollection additionalInfo, ExceptionPublisherElement publisherElement)
{
if (publisherElement.Mode == PublisherMode.Off) return;
ExceptionHelper.Log(ex, additionalInfo);
CacheManager.Clear(k => k == ExceptionHelper.RetrieveExceptionsDataKey);
NotificationHelper.MessagePool.Add(new MessageBody() { Category = "Notification", Message = ex.Message });
}
}
}

View File

@ -1,24 +0,0 @@
using Bootstrap.Security.Mvc;
using Longbow.Web.Mvc;
using System;
using System.Web.Mvc;
namespace Bootstrap.Admin
{
/// <summary>
///
/// </summary>
public static class FilterConfig
{
/// <summary>
///
/// </summary>
/// <param name="filters"></param>
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
if (filters == null) throw new ArgumentNullException("filters");
filters.Add(new LgbHandleErrorAttribute());
filters.Add(new BAAuthorizeAttribute());
}
}
}

View File

@ -1,19 +0,0 @@
using System.Web.Mvc;
using System.Web.Routing;
namespace Bootstrap.Admin
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}

View File

@ -1,25 +0,0 @@
using Bootstrap.Security.Mvc;
using System.Web.Http;
namespace Bootstrap.Admin
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
config.Filters.Add(new BAAPIAuthorizaAttribute());
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings;
json.DateFormatString = "yyyy'-'MM'-'dd' 'HH':'mm':'ss";
}
}
}

View File

@ -1,391 +1,167 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk.Web">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>netcoreapp2.0</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <SignAssembly>false</SignAssembly>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Bootstrap.Admin</RootNamespace>
<AssemblyName>Bootstrap.Admin</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<Use64BitIISExpress />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Bootstrap.Security.Mvc, Version=4.1.0.0, Culture=neutral, PublicKeyToken=c20f2177a7066899, processorArchitecture=MSIL" /> <PackageReference Include="Bootstrap.Security.Mvc" Version="1.0.0" />
<Reference Include="Longbow, Version=4.1.0.0, Culture=neutral, PublicKeyToken=c20f2177a7066899, processorArchitecture=MSIL" /> <PackageReference Include="Longbow.Web" Version="1.0.0" />
<Reference Include="Longbow.ComponentModel, Version=4.1.0.0, Culture=neutral, PublicKeyToken=c20f2177a7066899, processorArchitecture=MSIL" /> <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<Reference Include="Longbow.ExceptionManagement, Version=4.1.0.0, Culture=neutral, PublicKeyToken=c20f2177a7066899, processorArchitecture=MSIL" />
<Reference Include="Longbow.Web.Mvc, Version=4.1.0.0, Culture=neutral, PublicKeyToken=c20f2177a7066899, processorArchitecture=MSIL" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System.Web.Razor"> <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.Webpages">
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.dll</HintPath>
</Reference>
<Reference Include="System.Web.Webpages.Deployment">
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.Webpages.Razor">
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.Helpers">
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="App_Data\ErrorLog\Readme.txt" /> <ProjectReference Include="..\Bootstrap.DataAccess\Bootstrap.DataAccess.csproj" />
<Content Include="Content\bootstrap-theme.css" /> </ItemGroup>
<Content Include="Content\bootstrap-theme.min.css" />
<Content Include="Content\bootstrap.css" /> <ItemGroup>
<Content Include="Content\bootstrap.min.css" /> <Content Update="appsettings.Development.json">
<Content Include="Content\api.css" /> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Content Include="Content\bootstrap-datetimepicker.css" />
<Content Include="Content\bootstrap-datetimepicker.min.css" />
<Content Include="Content\fileinput.css" />
<Content Include="Content\fileinput.min.css" />
<Content Include="Content\IE8.css" />
<Content Include="Content\images\bg2.jpg" />
<Content Include="Content\images\bg4.jpg" />
<Content Include="Content\images\bg3.png" />
<Content Include="Content\login-responsive.css" />
<Content Include="Content\nprogress.css" />
<Content Include="Content\font-awesome.css" />
<Content Include="Content\font-awesome.min.css" />
<Content Include="Content\html\api.html" />
<Content Include="Content\images\error_icon.png" />
<Content Include="Content\toastr.css" />
<Content Include="Content\toastr.min.css" />
<Content Include="favicon.ico" />
<Content Include="Content\admin-responsive.css" />
<Content Include="Content\admin.css" />
<Content Include="Content\blue.css" />
<Content Include="Content\fa.css" />
<Content Include="Content\bootstrap-table.css" />
<Content Include="Content\bootstrap-table.min.css" />
<Content Include="Content\jquery.nestable.css" />
<Content Include="Content\lock.css" />
<Content Include="Content\login.css" />
<Content Include="Content\register.css" />
<Content Include="Content\tasks.css" />
<Content Include="Content\html\RegResult.html" />
<Content Include="Content\images\bg.jpg" />
<Content Include="Content\images\loading-sm.gif" />
<Content Include="Content\images\loading.gif" />
<Content Include="Content\images\lock-bg.jpg" />
<Content Include="Content\images\logo.jpg" />
<Content Include="Content\images\logo1.jpg" />
<Content Include="Content\images\logo2.jpg" />
<Content Include="Content\images\logo3.jpg" />
<Content Include="Content\images\logo4.jpg" />
<Content Include="Content\images\logo5.jpg" />
<Content Include="Content\images\logo6.jpg" />
<Content Include="Content\images\uploader\Admin.jpg" />
<Content Include="Content\images\uploader\default.jpg" />
<Content Include="Content\images\uploader\readme.txt" />
<Content Include="Content\site-responsive.css" />
<Content Include="Content\images\error.png" />
<Content Include="Content\images\nav-expand.png" />
<Content Include="Content\site.css" />
<Content Include="Content\sweetalert.css" />
<Content Include="Content\images\success.png" />
<Content Include="fonts\fontawesome-webfont.svg" />
<Content Include="fonts\glyphicons-halflings-regular.svg" />
<Content Include="Global.asax" />
<Content Include="Scripts\additional-methods.js" />
<Content Include="Scripts\additional-methods.min.js" />
<Content Include="Scripts\bootstrap-datetimepicker.js" />
<Content Include="Scripts\bootstrap-datetimepicker.min.js" />
<Content Include="Scripts\bootstrap-datetimepicker.zh-CN.js" />
<Content Include="Scripts\bootstrap-table-zh-CN.js" />
<Content Include="Scripts\bootstrap-table-zh-CN.min.js" />
<Content Include="Scripts\bootstrap-table.js" />
<Content Include="Scripts\bootstrap-table.min.js" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Scripts\bootstrap3-typeahead.js" />
<Content Include="Scripts\bootstrap3-typeahead.min.js" />
<Content Include="Scripts\common-scripts.js" />
<Content Include="Scripts\Content.js" />
<Content Include="Scripts\Dicts.js" />
<Content Include="Scripts\Exceptions.js" />
<Content Include="Scripts\fileinput.js" />
<Content Include="Scripts\fileinput.min.js" />
<Content Include="Scripts\fileinput.zh.js" />
<Content Include="Scripts\framework.js" />
<Content Include="Scripts\Groups.js" />
<Content Include="Scripts\icon.js" />
<Content Include="Scripts\Profiles.js" />
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
<Content Include="fonts\glyphicons-halflings-regular.woff" />
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
<Content Include="fonts\glyphicons-halflings-regular.eot" />
<Content Include="Content\bootstrap.min.css.map" />
<Content Include="Content\bootstrap.css.map" />
<Content Include="Content\bootstrap-theme.min.css.map" />
<Content Include="Content\bootstrap-theme.css.map" />
<Content Include="fonts\FontAwesome.otf" />
<Content Include="fonts\fontawesome-webfont.woff2" />
<Content Include="fonts\fontawesome-webfont.woff" />
<Content Include="fonts\fontawesome-webfont.ttf" />
<Content Include="fonts\fontawesome-webfont.eot" />
<Content Include="..\Keys\Longbow.Utility.snk">
<Link>Longbow.Utility.snk</Link>
</Content> </Content>
<None Include="Scripts\jquery-3.1.1.intellisense.js" /> <Content Update="appsettings.json">
<Content Include="Scripts\jquery-3.1.1.js" /> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Content Include="Scripts\jquery-3.1.1.min.js" /> </Content>
<Content Include="Scripts\jquery-3.1.1.slim.js" /> <Content Update="cache.json">
<Content Include="Scripts\jquery-3.1.1.slim.min.js" /> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<None Include="Scripts\jquery.validate-vsdoc.js" />
<Content Include="Scripts\jquery.dcjqaccordion.2.7.js" />
<Content Include="Scripts\jquery.nestable.js" />
<Content Include="Scripts\jquery.nicescroll.min.js" />
<Content Include="Scripts\jquery.scrollTo.js" />
<Content Include="Scripts\jquery.scrollTo.min.js" />
<Content Include="Scripts\jquery.validate.js" />
<Content Include="Scripts\jquery.validate.min.js" />
<Content Include="Scripts\lock.js" />
<Content Include="Scripts\log.js" />
<Content Include="Scripts\Login.js" />
<Content Include="Scripts\Logs.js" />
<Content Include="Scripts\Longbow.Common.js" />
<Content Include="Scripts\longbow.dataentity.js" />
<Content Include="Scripts\Menus.js" />
<Content Include="Scripts\message.js" />
<Content Include="Scripts\messages_zh.js" />
<Content Include="Scripts\messages_zh.min.js" />
<Content Include="Scripts\noti.js" />
<Content Include="Scripts\nprogress.js" />
<Content Include="Scripts\Settings.js" />
<Content Include="Scripts\register.js" />
<Content Include="Scripts\Roles.js" />
<Content Include="Scripts\sweetalert.js" />
<Content Include="Scripts\sweetalert.min.js" />
<Content Include="Scripts\tasks.js" />
<Content Include="Scripts\apidoc.js" />
<Content Include="Scripts\toastr.min.js" />
<Content Include="Scripts\Users.js" />
<Content Include="packages.config" />
<Content Include="Scripts\jquery-3.1.1.slim.min.map" />
<Content Include="Scripts\jquery-3.1.1.min.map" />
<Content Include="Views\Shared\Readme.txt" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content> </Content>
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\bldver.cs"> <None Include="wwwroot\css\admin-responsive.css" />
<Link>bldver.cs</Link> <None Include="wwwroot\css\admin.css" />
</Compile> <None Include="wwwroot\css\api.css" />
<Compile Include="App_Start\DBPublisher.cs" /> <None Include="wwwroot\css\blue.css" />
<Compile Include="App_Start\FilterConfig.cs" /> <None Include="wwwroot\css\bootstrap-datetimepicker.css" />
<Compile Include="App_Start\RouteConfig.cs" /> <None Include="wwwroot\css\bootstrap-datetimepicker.min.css" />
<Compile Include="App_Start\WebApiConfig.cs" /> <None Include="wwwroot\css\bootstrap-table.css" />
<Compile Include="Controllers\AdminController.cs" /> <None Include="wwwroot\css\bootstrap-table.min.css" />
<Compile Include="Controllers\DictsController.cs" /> <None Include="wwwroot\css\bootstrap-theme.css" />
<Compile Include="Controllers\ExceptionsController.cs" /> <None Include="wwwroot\css\bootstrap-theme.css.map" />
<Compile Include="Controllers\GroupsController.cs" /> <None Include="wwwroot\css\bootstrap-theme.min.css" />
<Compile Include="Controllers\HomeController.cs" /> <None Include="wwwroot\css\bootstrap-theme.min.css.map" />
<Compile Include="Controllers\ProfilesController.cs" /> <None Include="wwwroot\css\bootstrap.css" />
<Compile Include="Controllers\LoginController.cs" /> <None Include="wwwroot\css\bootstrap.css.map" />
<Compile Include="Controllers\LogsController.cs" /> <None Include="wwwroot\css\bootstrap.min.css" />
<Compile Include="Controllers\MenusController.cs" /> <None Include="wwwroot\css\bootstrap.min.css.map" />
<Compile Include="Controllers\MessagesController.cs" /> <None Include="wwwroot\css\fa.css" />
<Compile Include="Controllers\NotificationsController.cs" /> <None Include="wwwroot\css\fileinput.css" />
<Compile Include="Controllers\SettingsController.cs" /> <None Include="wwwroot\css\fileinput.min.css" />
<Compile Include="Controllers\RolesController.cs" /> <None Include="wwwroot\css\font-awesome.css" />
<Compile Include="Controllers\TasksController.cs" /> <None Include="wwwroot\css\font-awesome.min.css" />
<Compile Include="Controllers\UsersController.cs" /> <None Include="wwwroot\html\api.html" />
<Compile Include="Controllers\WSController.cs" /> <None Include="wwwroot\html\RegResult.html" />
<Compile Include="Global.asax.cs"> <None Include="wwwroot\css\IE8.css" />
<DependentUpon>Global.asax</DependentUpon> <None Include="wwwroot\favicon.ico" />
</Compile> <None Include="wwwroot\images\bg.jpg" />
<Compile Include="Models\ProfilesModel.cs" /> <None Include="wwwroot\images\bg2.jpg" />
<Compile Include="Models\LockModel.cs" /> <None Include="wwwroot\images\bg3.png" />
<Compile Include="Models\MessageCountModel.cs" /> <None Include="wwwroot\images\bg4.jpg" />
<Compile Include="Models\QueryDictOption.cs" /> <None Include="wwwroot\images\error.png" />
<Compile Include="Models\QueryExceptionOption.cs" /> <None Include="wwwroot\images\error_icon.png" />
<Compile Include="Models\QueryGroupOption.cs" /> <None Include="wwwroot\images\loading-sm.gif" />
<Compile Include="Models\QueryLogOption.cs" /> <None Include="wwwroot\images\loading.gif" />
<Compile Include="Models\QueryMenuOption.cs" /> <None Include="wwwroot\images\lock-bg.jpg" />
<Compile Include="Models\QueryRoleOption.cs" /> <None Include="wwwroot\images\logo.jpg" />
<Compile Include="Models\QueryUserOption.cs" /> <None Include="wwwroot\images\logo1.jpg" />
<Compile Include="Models\HeaderBarModel.cs" /> <None Include="wwwroot\images\logo2.jpg" />
<Compile Include="Models\LoginModel.cs" /> <None Include="wwwroot\images\logo3.jpg" />
<Compile Include="Models\ModelBase.cs" /> <None Include="wwwroot\images\logo4.jpg" />
<Compile Include="Models\NavigatorBarModel.cs" /> <None Include="wwwroot\images\logo5.jpg" />
<Compile Include="Properties\AssemblyInfo.cs" /> <None Include="wwwroot\images\logo6.jpg" />
<None Include="wwwroot\images\nav-expand.png" />
<None Include="wwwroot\images\success.png" />
<None Include="wwwroot\images\uploader\Admin.jpg" />
<None Include="wwwroot\images\uploader\default.jpg" />
<None Include="wwwroot\images\uploader\readme.txt" />
<None Include="wwwroot\css\jquery.nestable.css" />
<None Include="wwwroot\css\lock.css" />
<None Include="wwwroot\css\login-responsive.css" />
<None Include="wwwroot\css\login.css" />
<None Include="wwwroot\css\nprogress.css" />
<None Include="wwwroot\css\register.css" />
<None Include="wwwroot\css\site-responsive.css" />
<None Include="wwwroot\css\site.css" />
<None Include="wwwroot\css\sweetalert.css" />
<None Include="wwwroot\css\tasks.css" />
<None Include="wwwroot\css\toastr.css" />
<None Include="wwwroot\css\toastr.min.css" />
<None Include="wwwroot\fonts\fontawesome-webfont.eot" />
<None Include="wwwroot\fonts\fontawesome-webfont.svg" />
<None Include="wwwroot\fonts\fontawesome-webfont.ttf" />
<None Include="wwwroot\fonts\fontawesome-webfont.woff" />
<None Include="wwwroot\fonts\fontawesome-webfont.woff2" />
<None Include="wwwroot\fonts\FontAwesome.otf" />
<None Include="wwwroot\fonts\glyphicons-halflings-regular.eot" />
<None Include="wwwroot\fonts\glyphicons-halflings-regular.svg" />
<None Include="wwwroot\fonts\glyphicons-halflings-regular.ttf" />
<None Include="wwwroot\fonts\glyphicons-halflings-regular.woff" />
<None Include="wwwroot\fonts\glyphicons-halflings-regular.woff2" />
<None Include="wwwroot\js\additional-methods.js" />
<None Include="wwwroot\js\additional-methods.min.js" />
<None Include="wwwroot\js\apidoc.js" />
<None Include="wwwroot\js\bootstrap-datetimepicker.js" />
<None Include="wwwroot\js\bootstrap-datetimepicker.min.js" />
<None Include="wwwroot\js\bootstrap-datetimepicker.zh-CN.js" />
<None Include="wwwroot\js\bootstrap-table-zh-CN.js" />
<None Include="wwwroot\js\bootstrap-table-zh-CN.min.js" />
<None Include="wwwroot\js\bootstrap-table.js" />
<None Include="wwwroot\js\bootstrap-table.min.js" />
<None Include="wwwroot\js\bootstrap.js" />
<None Include="wwwroot\js\bootstrap.min.js" />
<None Include="wwwroot\js\bootstrap3-typeahead.js" />
<None Include="wwwroot\js\bootstrap3-typeahead.min.js" />
<None Include="wwwroot\js\common-scripts.js" />
<None Include="wwwroot\js\Content.js" />
<None Include="wwwroot\js\Dicts.js" />
<None Include="wwwroot\js\Exceptions.js" />
<None Include="wwwroot\js\fileinput.js" />
<None Include="wwwroot\js\fileinput.min.js" />
<None Include="wwwroot\js\fileinput.zh.js" />
<None Include="wwwroot\js\framework.js" />
<None Include="wwwroot\js\Groups.js" />
<None Include="wwwroot\js\icon.js" />
<None Include="wwwroot\js\jquery-3.1.1.intellisense.js" />
<None Include="wwwroot\js\jquery-3.1.1.js" />
<None Include="wwwroot\js\jquery-3.1.1.min.js" />
<None Include="wwwroot\js\jquery-3.1.1.min.map" />
<None Include="wwwroot\js\jquery-3.1.1.slim.js" />
<None Include="wwwroot\js\jquery-3.1.1.slim.min.js" />
<None Include="wwwroot\js\jquery-3.1.1.slim.min.map" />
<None Include="wwwroot\js\jquery.dcjqaccordion.2.7.js" />
<None Include="wwwroot\js\jquery.nestable.js" />
<None Include="wwwroot\js\jquery.nicescroll.min.js" />
<None Include="wwwroot\js\jquery.scrollTo.js" />
<None Include="wwwroot\js\jquery.scrollTo.min.js" />
<None Include="wwwroot\js\jquery.validate-vsdoc.js" />
<None Include="wwwroot\js\jquery.validate.js" />
<None Include="wwwroot\js\jquery.validate.min.js" />
<None Include="wwwroot\js\lock.js" />
<None Include="wwwroot\js\log.js" />
<None Include="wwwroot\js\Login.js" />
<None Include="wwwroot\js\Logs.js" />
<None Include="wwwroot\js\Longbow.Common.js" />
<None Include="wwwroot\js\longbow.dataentity.js" />
<None Include="wwwroot\js\Menus.js" />
<None Include="wwwroot\js\message.js" />
<None Include="wwwroot\js\messages_zh.js" />
<None Include="wwwroot\js\messages_zh.min.js" />
<None Include="wwwroot\js\noti.js" />
<None Include="wwwroot\js\nprogress.js" />
<None Include="wwwroot\js\Profiles.js" />
<None Include="wwwroot\js\register.js" />
<None Include="wwwroot\js\Roles.js" />
<None Include="wwwroot\js\Settings.js" />
<None Include="wwwroot\js\sweetalert.js" />
<None Include="wwwroot\js\sweetalert.min.js" />
<None Include="wwwroot\js\tasks.js" />
<None Include="wwwroot\js\toastr.js.map" />
<None Include="wwwroot\js\toastr.min.js" />
<None Include="wwwroot\js\Users.js" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Views\web.config" />
<Content Include="Views\Shared\_Normal.cshtml" />
<Content Include="Views\Shared\_Admin.cshtml" />
<Content Include="Views\Admin\Index.cshtml" />
<Content Include="Views\Shared\_Default.cshtml" />
<Content Include="Views\Admin\Users.cshtml" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Shared\Header.cshtml" />
<Content Include="Views\Shared\Navigator.cshtml" />
<Content Include="Views\Home\Login.cshtml" />
<Content Include="Views\Shared\UnAuthorized.cshtml" />
<Content Include="Views\Shared\AwesomeIcon.cshtml" />
<Content Include="Views\Admin\FAIcon.cshtml" />
<Content Include="Views\Admin\Groups.cshtml" />
<Content Include="Views\Admin\Roles.cshtml" />
<Content Include="Views\Admin\Menus.cshtml" />
<Content Include="Views\Admin\Dicts.cshtml" />
<Content Include="Views\Shared\RoleConfig.cshtml" />
<Content Include="Views\Shared\IconView.cshtml" />
<Content Include="Views\Shared\UserConfig.cshtml" />
<Content Include="Views\Shared\GroupConfig.cshtml" />
<Content Include="Views\Admin\Logs.cshtml" />
<Content Include="Views\Admin\Settings.cshtml" />
<Content Include="Views\Shared\Footer.cshtml" />
<Content Include="Views\Shared\NavigatorConfig.cshtml" />
<Content Include="Views\Shared\SubNavigation.cshtml" />
<Content Include="Views\Home\Lock.cshtml" />
<Content Include="Views\Home\Register.cshtml" />
<Content Include="Views\Admin\Notifications.cshtml" />
<Content Include="Views\Admin\Profiles.cshtml" />
<Content Include="Views\Admin\Exceptions.cshtml" />
<Content Include="Views\Admin\Messages.cshtml" />
<Content Include="Views\Admin\Tasks.cshtml" />
<Content Include="Views\Admin\Mobile.cshtml" />
<Content Include="Views\Shared\_Mobile.cshtml" />
<Content Include="Views\Home\Mobile.cshtml" />
<Content Include="Views\Shared\SubMenu.cshtml" />
<Content Include="Views\Admin\Api.cshtml" />
<Content Include="Views\Shared\_ButtonBarGroup.cshtml" />
<Content Include="Scripts\toastr.js.map" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\Bootstrap.DataAccess\Bootstrap.DataAccess.csproj">
<Project>{af16ca71-b8c6-4f51-b38c-0c0300fdebd7}</Project>
<Name>Bootstrap.DataAccess</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Keys\Longbow.Utility.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<DelaySign>false</DelaySign>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>53737</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:53233/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -1 +0,0 @@
请不要删除此目录

View File

@ -0,0 +1,75 @@
using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers
{
/// <summary>
/// Account controller.
/// </summary>
[AllowAnonymous]
public class AccountController : Controller
{
/// <summary>
/// Login the specified userName, password and remember.
/// </summary>
/// <returns>The login.</returns>
/// <param name="userName">User name.</param>
/// <param name="password">Password.</param>
/// <param name="remember">Remember.</param>
public async Task<IActionResult> Login(string userName, string password, string remember)
{
if (!string.IsNullOrEmpty(userName) && BootstrapUser.Authenticate(userName, password))
{
var identity = new ClaimsIdentity(CookieAuthenticationDefaults.AuthenticationScheme);
identity.AddClaim(new Claim(ClaimTypes.Name, userName));
await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity));
return Redirect("~/");
}
var mobile = true; //Request.Browser.IsMobileDevice;
var model = "IPad"; //Request.Browser.MobileDeviceModel;
return mobile && model != "IPad" ? View("Loginm", new ModelBase()) : View("Login", new ModelBase());
}
/// <summary>
/// Logout this instance.
/// </summary>
/// <returns>The logout.</returns>
public async Task<IActionResult> Logout()
{
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
return Redirect("~" + CookieAuthenticationDefaults.LoginPath);
}
/// <summary>
/// Accesses the denied.
/// </summary>
/// <returns>The denied.</returns>
public ActionResult AccessDenied()
{
return View();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public ActionResult Register(User p)
{
if (string.IsNullOrEmpty(p.UserName) || string.IsNullOrEmpty(p.Password) || string.IsNullOrEmpty(p.DisplayName) || string.IsNullOrEmpty(p.Description)) return View();
p.UserStatus = 1;
return UserHelper.SaveUser(p) ? (ActionResult)Redirect("~/html/RegResult.html") : View();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public ActionResult Mobile()
{
return View();
}
}
}

View File

@ -1,5 +1,6 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Models;
using System.Web.Mvc; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers
{ {
@ -14,7 +15,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Index() public ActionResult Index()
{ {
return View(new NavigatorBarModel("~/Admin/Index")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -22,7 +23,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Users() public ActionResult Users()
{ {
return View(new NavigatorBarModel("~/Admin/Users")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -30,7 +31,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Groups() public ActionResult Groups()
{ {
return View(new NavigatorBarModel("~/Admin/Groups")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -38,7 +39,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Dicts() public ActionResult Dicts()
{ {
return View(new NavigatorBarModel("~/Admin/Dicts")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -46,7 +47,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Roles() public ActionResult Roles()
{ {
return View(new NavigatorBarModel("~/Admin/Roles")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -54,7 +55,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Menus() public ActionResult Menus()
{ {
return View(new NavigatorBarModel("~/Admin/Menus")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -62,7 +63,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Logs() public ActionResult Logs()
{ {
return View(new NavigatorBarModel("~/Admin/Logs")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -70,17 +71,15 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult FAIcon() public ActionResult FAIcon()
{ {
return View(new NavigatorBarModel("~/Admin/FAIcon")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[OutputCache(CacheProfile = "IconView")]
[AllowAnonymous] [AllowAnonymous]
public PartialViewResult IconView() public PartialViewResult IconView()
{ {
Response.Cache.SetOmitVaryStar(true);
return PartialView("IconView"); return PartialView("IconView");
} }
/// <summary> /// <summary>
@ -89,7 +88,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Settings() public ActionResult Settings()
{ {
return View(new NavigatorBarModel("~/Admin/Settings")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
@ -98,7 +97,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Notifications() public ActionResult Notifications()
{ {
return View(new NavigatorBarModel("~/Admin/Notifications")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
@ -107,7 +106,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Profiles() public ActionResult Profiles()
{ {
return View(new ProfilesModel("~/Admin/Profiles")); return View(new ProfilesModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -115,7 +114,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Exceptions() public ActionResult Exceptions()
{ {
return View(new NavigatorBarModel("~/Admin/Exceptions")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -123,7 +122,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Messages() public ActionResult Messages()
{ {
return View(new NavigatorBarModel("~/Admin/Messages")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -131,7 +130,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Tasks() public ActionResult Tasks()
{ {
return View(new NavigatorBarModel("~/Admin/Tasks")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -139,7 +138,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Mobile() public ActionResult Mobile()
{ {
return View(new NavigatorBarModel("~/Admin/Mobile")); return View(new NavigatorBarModel(this));
} }
/// <summary> /// <summary>
/// ///
@ -147,7 +146,7 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Api() public ActionResult Api()
{ {
return View(new NavigatorBarModel("~/Admin/Api")); return View(new NavigatorBarModel(this));
} }
} }
} }

View File

@ -0,0 +1,23 @@
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
{
[Route("api/[controller]")]
public class CategoryController : Controller
{
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public IEnumerable<BootstrapDict> Get()
{
return DictHelper.RetrieveCategories();
}
}
}

View File

@ -0,0 +1,47 @@
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
///
/// </summary>
[Route("api/[controller]")]
public class DictsController : Controller
{
/// <summary>
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<BootstrapDict> Get(QueryDictOption value)
{
return value.RetrieveData();
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
[HttpPost]
public bool Post([FromBody]BootstrapDict value)
{
return DictHelper.SaveDict(value);
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]
[Authorize(Roles = "Administrators")]
public object Delete(string value)
{
var result = DictHelper.DeleteDict(value);
return new { result, msg = result ? "成功!" : "失败" };
}
}
}

View File

@ -1,65 +1,77 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Collections.Generic; using Microsoft.AspNetCore.Hosting;
using System.IO; using Microsoft.AspNetCore.Mvc;
using System.Linq; using Microsoft.Extensions.DependencyInjection;
using System.Text; using System;
using System.Web; using System.Collections.Generic;
using System.Web.Http; using System.IO;
using System.Linq;
namespace Bootstrap.Admin.Controllers using System.Text;
{
public class ExceptionsController : ApiController namespace Bootstrap.Admin.Controllers.Api
{ {
/// <summary> /// <summary>
/// 显示所有异常 ///
/// </summary> /// </summary>
/// <param name="value"></param> [Route("api/[controller]")]
/// <returns></returns> public class ExceptionsController : Controller
[HttpGet] {
public QueryData<Exceptions> Get([FromUri]QueryExceptionOption value) /// <summary>
{ /// 显示所有异常
return value.RetrieveData(); /// </summary>
} /// <param name="value"></param>
/// <summary> /// <returns></returns>
/// [HttpGet]
/// </summary> public QueryData<Exceptions> Get(QueryExceptionOption value)
/// <returns></returns> {
[HttpPost] return value.RetrieveData();
public IEnumerable<string> Post() }
{ /// <summary>
var filePath = HttpContext.Current.Server.MapPath("~/App_Data/ErrorLog"); ///
return Directory.GetFiles(filePath) /// </summary>
.Where(f => Path.GetExtension(f).Equals(".log", System.StringComparison.OrdinalIgnoreCase)) /// <returns></returns>
.Select(f => Path.GetFileNameWithoutExtension(f)).OrderByDescending(s => s); [HttpPost]
} public IEnumerable<string> Post()
/// <summary> {
/// var filePath = Path.Combine(AppContext.BaseDirectory, "Error");
/// </summary> return Directory.GetFiles(filePath)
/// <returns></returns> .Where(f => Path.GetExtension(f).Equals(".log", System.StringComparison.OrdinalIgnoreCase))
[HttpPut] .Select(f => Path.GetFileNameWithoutExtension(f)).OrderByDescending(s => s);
public string Put([FromBody]string fileName) }
{ /// <summary>
var logName = HttpContext.Current.Server.MapPath(string.Format("~/App_Data/ErrorLog/{0}.log", fileName)); ///
if (!File.Exists(logName)) return "无此日志文件"; /// </summary>
StringBuilder sb = new StringBuilder(); /// <returns></returns>
using (StreamReader reader = new StreamReader(logName)) [HttpPut]
{ public JsonResult Put([FromBody]ExceptionFileQuery exceptionFile)
while (!reader.EndOfStream) {
{ var filePath = Path.Combine(AppContext.BaseDirectory, "Error");
var line = reader.ReadLine().Replace("<", "&lt;").Replace(">", "&gt;"); var logName = $"{Path.Combine(filePath, exceptionFile.FileName)}.log";
if (line == "General Information ") sb.AppendFormat("<h4><b>{0}</b></h4>", line); if (!System.IO.File.Exists(logName)) return new JsonResult("无此日志文件");
else if (line.StartsWith("TimeStamp:")) sb.AppendFormat("<div class='logTs'>{0}</div>", line); StringBuilder sb = new StringBuilder();
else if (line.EndsWith("Exception Information")) sb.AppendFormat("<div class='logExcep'>{0}</div>", line); using (StreamReader reader = new StreamReader(logName))
else if (line.StartsWith("Message:")) sb.AppendFormat("<div class='logMsg'>{0}</div>", line); {
else if (line.StartsWith("ErrorSql:")) sb.AppendFormat("<div class='logSql'>{0}</div>", line); while (!reader.EndOfStream)
else if (line.StartsWith("Exception Type: Longbow.Data.DBAccessException")) sb.AppendFormat("<div class='logDbExcep'>{0}</div>", line); {
else if (line.StartsWith("StackTrace Information")) sb.AppendFormat("<b>{0}</b><br>", line); var line = reader.ReadLine().Replace("<", "&lt;").Replace(">", "&gt;");
else sb.AppendFormat("{0}<br>", line); if (line == "General Information ") sb.AppendFormat("<h4><b>{0}</b></h4>", line);
}; else if (line.StartsWith("TimeStamp:")) sb.AppendFormat("<div class='logTs'>{0}</div>", line);
} else if (line.EndsWith("Exception Information")) sb.AppendFormat("<div class='logExcep'>{0}</div>", line);
return sb.ToString(); else if (line.StartsWith("Message:")) sb.AppendFormat("<div class='logMsg'>{0}</div>", line);
} else if (line.StartsWith("ErrorSql:")) sb.AppendFormat("<div class='logSql'>{0}</div>", line);
} else if (line.StartsWith("Exception Type: Longbow.Data.DBAccessException")) sb.AppendFormat("<div class='logDbExcep'>{0}</div>", line);
} else if (line.StartsWith("StackTrace Information")) sb.AppendFormat("<b>{0}</b><br>", line);
else sb.AppendFormat("{0}<br>", line);
};
}
return new JsonResult(sb.ToString());
}
public class ExceptionFileQuery
{
public string FileName { get; set; }
}
}
}

View File

@ -1,101 +1,105 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using Newtonsoft.Json.Linq; using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using Newtonsoft.Json.Linq;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
public class GroupsController : ApiController /// <summary>
{ ///
/// <summary> /// </summary>
/// [Route("api/[controller]")]
/// </summary> public class GroupsController : Controller
/// <param name="value"></param> {
/// <returns></returns> /// <summary>
[HttpGet] ///
public QueryData<Group> Get([FromUri]QueryGroupOption value) /// </summary>
{ /// <param name="value"></param>
return value.RetrieveData(); /// <returns></returns>
} [HttpGet]
/// <summary> public QueryData<Group> Get(QueryGroupOption value)
/// {
/// </summary> return value.RetrieveData();
/// <param name="id"></param> }
/// <returns></returns> /// <summary>
[HttpGet] ///
public Group Get(int id) /// </summary>
{ /// <param name="id"></param>
return GroupHelper.RetrieveGroups().FirstOrDefault(t => t.Id == id); /// <returns></returns>
} [HttpGet("{id}")]
/// <summary> public Group Get(int id)
/// {
/// </summary> return GroupHelper.RetrieveGroups().FirstOrDefault(t => t.Id == id);
/// <param name="value"></param> }
[HttpPost] /// <summary>
public bool Post([FromBody]Group value) ///
{ /// </summary>
return GroupHelper.SaveGroup(value); /// <param name="value"></param>
} [HttpPost]
/// <summary> public bool Post(Group value)
/// {
/// </summary> return GroupHelper.SaveGroup(value);
/// <param name="value"></param> }
[HttpDelete] /// <summary>
public bool Delete([FromBody]string value) ///
{ /// </summary>
return GroupHelper.DeleteGroup(value); /// <param name="value"></param>
} [HttpDelete]
/// <summary> public bool Delete(string value)
/// {
/// </summary> return GroupHelper.DeleteGroup(value);
/// <param name="id"></param> }
/// <param name="value"></param> /// <summary>
/// <returns></returns> ///
[HttpPost] /// </summary>
public IEnumerable<Group> Post(int id, [FromBody]JObject value) /// <param name="id"></param>
{ /// <param name="value"></param>
var ret = new List<Group>(); /// <returns></returns>
dynamic json = value; [HttpPost("{id}")]
switch ((string)json.type) public IEnumerable<Group> Post(int id, JObject value)
{ {
case "user": var ret = new List<Group>();
ret = GroupHelper.RetrieveGroupsByUserId(id).ToList(); dynamic json = value;
break; switch ((string)json.type)
case "role": {
ret = GroupHelper.RetrieveGroupsByRoleId(id).ToList(); case "user":
break; ret = GroupHelper.RetrieveGroupsByUserId(id).ToList();
default: break;
break; case "role":
} ret = GroupHelper.RetrieveGroupsByRoleId(id).ToList();
return ret; break;
} default:
/// <summary> break;
/// }
/// </summary> return ret;
/// <param name="id"></param> }
/// <param name="value"></param> /// <summary>
/// <returns></returns> ///
[HttpPut] /// </summary>
public bool Put(int id, [FromBody]JObject value) /// <param name="id"></param>
{ /// <param name="value"></param>
var ret = false; /// <returns></returns>
dynamic json = value; [HttpPut("{id}")]
string groupIds = json.groupIds; public bool Put(int id, JObject value)
switch ((string)json.type) {
{ var ret = false;
case "user": dynamic json = value;
ret = GroupHelper.SaveGroupsByUserId(id, groupIds); string groupIds = json.groupIds;
break; switch ((string)json.type)
case "role": {
ret = GroupHelper.SaveGroupsByRoleId(id, groupIds); case "user":
break; ret = GroupHelper.SaveGroupsByUserId(id, groupIds);
default: break;
break; case "role":
} ret = GroupHelper.SaveGroupsByRoleId(id, groupIds);
return ret; break;
} default:
} break;
} }
return ret;
}
}
}

View File

@ -0,0 +1,33 @@
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
[Route("api/[controller]")]
public class HomeController : Controller
{
/// <summary>
/// 获得当前样式接口
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public JsonResult Get()
{
return new JsonResult(DictHelper.RetrieveActiveCss().FirstOrDefault().Code);
}
/// <summary>
/// 获得网站所有样式表
/// </summary>
/// <returns></returns>
[HttpPost]
public IEnumerable<BootstrapDict> Post()
{
return DictHelper.RetrieveWebCss();
}
}
}

View File

@ -1,56 +1,57 @@
using Bootstrap.Security; using Bootstrap.Security;
using Bootstrap.Security.Mvc; using Longbow.Cache;
using Longbow.Caching; using Microsoft.AspNetCore.Authorization;
using Longbow.Security.Principal; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Globalization; using System.Linq;
using System.Linq;
using System.Web.Http; namespace Bootstrap.Admin.Controllers.Api
using System.Web.Security; {
/// <summary>
namespace Bootstrap.Admin.Controllers ///
{ /// </summary>
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class LoginController : ApiController [Route("api/[controller]")]
{ public class LoginController : Controller
[HttpGet] {
public LoginInfo Get() [HttpGet]
{ public object Get()
var token = Request.Headers.GetValues("Token").First(); {
return new LoginInfo() { UserName = User.Identity.Name, Token = token }; var token = Request.Headers["Token"];
} return new { UserName = User.Identity.Name, Token = token };
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="value"></param> /// </summary>
/// <returns></returns> /// <param name="value"></param>
[AllowAnonymous] /// <returns></returns>
[HttpPost] [AllowAnonymous]
public LoginInfo Post([FromBody]JObject value) [HttpPost]
{ public object Post(JObject value)
dynamic user = value; {
string userName = user.userName; dynamic user = value;
string password = user.password; string userName = user.userName;
if (LgbPrincipal.Authenticate(userName, password) || BootstrapUser.Authenticate(userName, password)) string password = user.password;
{ if (BootstrapUser.Authenticate(userName, password))
var token = CacheManager.AddOrUpdate(string.Format("WebApi-{0}", userName), k => new LoginInfo() { UserName = userName, Token = Guid.NewGuid().ToString() }, (k, info) => info, "WebApi"); {
CacheManager.AddOrUpdate(token.Token, k => token, (k, info) => info, "Token"); var token = CacheManager.AddOrUpdate(string.Format("WebApi-{0}", userName), k => new { UserName = userName, Token = Guid.NewGuid().ToString() }, (k, info) => info, "WebApi");
return token; CacheManager.AddOrUpdate(token.Token, k => token, (k, info) => info, "Token");
} return token;
return new LoginInfo() { UserName = userName }; }
} return new { UserName = userName };
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <returns></returns> /// </summary>
[AllowAnonymous] /// <returns></returns>
[HttpOptions] [AllowAnonymous]
public string Options() [HttpOptions]
{ public string Options()
return null; {
} return null;
} }
} }
}

View File

@ -1,43 +1,46 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Linq; using Microsoft.AspNetCore.Mvc;
using System.Web; using System.Linq;
using System.Web.Http;
namespace Bootstrap.Admin.Controllers.Api
namespace Bootstrap.Admin.Controllers {
{ /// <summary>
public class LogsController : ApiController ///
{ /// </summary>
/// <summary> [Route("api/[controller]")]
/// public class LogsController : Controller
/// </summary> {
/// <param name="value"></param> /// <summary>
/// <returns></returns> ///
[HttpGet] /// </summary>
public QueryData<Log> Get([FromUri]QueryLogOption value) /// <param name="value"></param>
{ /// <returns></returns>
return value.RetrieveData(); [HttpGet]
} public QueryData<Log> Get(QueryLogOption value)
/// <summary> {
/// return value.RetrieveData();
/// </summary> }
/// <param name="id"></param> /// <summary>
/// <returns></returns> ///
[HttpGet] /// </summary>
public Log Get(int id) /// <param name="id"></param>
{ /// <returns></returns>
return LogHelper.RetrieveLogs().FirstOrDefault(t => t.Id == id); [HttpGet("{id}")]
} public Log Get(int id)
{
[HttpPost] return LogHelper.RetrieveLogs().FirstOrDefault(t => t.Id == id);
public bool Post([FromBody]Log value) }
{
var request = HttpContext.Current.Request; [HttpPost]
value.ClientAgent = request.UserAgent; public bool Post(Log value)
value.ClientIp = request.UserHostAddress; {
value.UserName = HttpContext.Current.User.Identity.Name; var request = Request;
return LogHelper.SaveLog(value); //value.ClientAgent = request.UserAgent;
} //value.ClientIp = request.UserHostAddress;
} value.UserName = User.Identity.Name;
return LogHelper.SaveLog(value);
}
}
} }

View File

@ -1,89 +1,93 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using Newtonsoft.Json.Linq; using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using Newtonsoft.Json.Linq;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
public class MenusController : ApiController /// <summary>
{ ///
/// <summary> /// </summary>
/// [Route("api/[controller]")]
/// </summary> public class MenusController : Controller
/// <param name="value"></param> {
/// <returns></returns> /// <summary>
[HttpGet] ///
public QueryData<BootstrapMenu> Get([FromUri]QueryMenuOption value) /// </summary>
{ /// <param name="value"></param>
return value.RetrieveData(User.Identity.Name); /// <returns></returns>
} [HttpGet]
/// <summary> public QueryData<BootstrapMenu> Get(QueryMenuOption value)
/// {
/// </summary> return value.RetrieveData(User.Identity.Name);
/// <param name="value"></param> }
[HttpPost] /// <summary>
public bool Post([FromBody]BootstrapMenu value) ///
{ /// </summary>
return MenuHelper.SaveMenu(value); /// <param name="value"></param>
} [HttpPost]
/// <summary> public bool Post(BootstrapMenu value)
/// {
/// </summary> return MenuHelper.SaveMenu(value);
/// <param name="value"></param> }
[HttpDelete] /// <summary>
public bool Delete([FromBody]string value) ///
{ /// </summary>
return MenuHelper.DeleteMenu(value); /// <param name="value"></param>
} [HttpDelete]
/// <summary> public bool Delete(string value)
/// {
/// </summary> return MenuHelper.DeleteMenu(value);
/// <param name="id"></param> }
/// <param name="value"></param> /// <summary>
/// <returns></returns> ///
[HttpPost] /// </summary>
public IEnumerable<BootstrapMenu> Post(int id, [FromBody]JObject value) /// <param name="id"></param>
{ /// <param name="value"></param>
var ret = new List<BootstrapMenu>(); /// <returns></returns>
dynamic json = value; [HttpPost("{id}")]
switch ((string)json.type) public IEnumerable<BootstrapMenu> Post(int id, JObject value)
{ {
case "role": var ret = new List<BootstrapMenu>();
ret = MenuHelper.RetrieveMenusByRoleId(id).ToList(); dynamic json = value;
break; switch ((string)json.type)
case "user": {
ret = BootstrapMenu.RetrieveAllMenus(User.Identity.Name).ToList(); case "role":
break; ret = MenuHelper.RetrieveMenusByRoleId(id).ToList();
default: break;
break; case "user":
} ret = BootstrapMenu.RetrieveAllMenus(User.Identity.Name).ToList();
return ret; break;
} default:
/// <summary> break;
/// }
/// </summary> return ret;
/// <param name="id"></param> }
/// <param name="value"></param> /// <summary>
/// <returns></returns> ///
[HttpPut] /// </summary>
public bool Put(int id, [FromBody]JObject value) /// <param name="id"></param>
{ /// <param name="value"></param>
var ret = false; /// <returns></returns>
dynamic json = value; [HttpPut("{id}")]
string menuIds = json.menuIds.ToString(); public bool Put(int id, JObject value)
switch ((string)json.type) {
{ var ret = false;
case "role": dynamic json = value;
ret = MenuHelper.SaveMenusByRoleId(id, menuIds); string menuIds = json.menuIds.ToString();
break; switch ((string)json.type)
default: {
break; case "role":
} ret = MenuHelper.SaveMenusByRoleId(id, menuIds);
return ret; break;
} default:
} break;
}
return ret;
}
}
} }

View File

@ -1,56 +1,60 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Models;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using System.Collections.Generic; using Microsoft.AspNetCore.Mvc;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
public class MessagesController : ApiController /// <summary>
{ ///
/// <summary> /// </summary>
/// 根据Id返回不同的消息列表 [Route("api/[controller]")]
/// </summary> public class MessagesController : Controller
/// <param name="id"></param> {
/// <returns></returns> /// <summary>
[HttpGet] /// 根据Id返回不同的消息列表
public IEnumerable<Message> Get(string id) /// </summary>
{ /// <param name="id"></param>
var ret = new List<Message>(); /// <returns></returns>
switch (id) [HttpGet("{id}")]
{ public IEnumerable<Message> Get(string id)
case "inbox": {
ret = MessageHelper.Inbox(User.Identity.Name).ToList(); var ret = new List<Message>();
break; switch (id)
case "sendmail": {
ret = MessageHelper.SendMail(User.Identity.Name).ToList(); case "inbox":
break; ret = MessageHelper.Inbox(User.Identity.Name).ToList();
case "mark": break;
ret = MessageHelper.Mark(User.Identity.Name).ToList(); case "sendmail":
break; ret = MessageHelper.SendMail(User.Identity.Name).ToList();
case "trash": break;
ret = MessageHelper.Trash(User.Identity.Name).ToList(); case "mark":
break; ret = MessageHelper.Mark(User.Identity.Name).ToList();
} break;
return ret; case "trash":
} ret = MessageHelper.Trash(User.Identity.Name).ToList();
break;
/// <summary> }
/// 返回各个消息列表的文件个数 return ret;
/// </summary> }
/// <returns></returns>
[HttpGet] /// <summary>
public MessageCountModel Get() /// 返回各个消息列表的文件个数
{ /// </summary>
var mcm = new MessageCountModel /// <returns></returns>
{ [HttpGet]
InboxCount = MessageHelper.Inbox(User.Identity.Name).Count(), public MessageCountModel Get()
SendmailCount = MessageHelper.SendMail(User.Identity.Name).Count(), {
MarkCount = MessageHelper.Mark(User.Identity.Name).Count(), var mcm = new MessageCountModel
TrashCount = MessageHelper.Trash(User.Identity.Name).Count() {
}; InboxCount = MessageHelper.Inbox(User.Identity.Name).Count(),
return mcm; SendmailCount = MessageHelper.SendMail(User.Identity.Name).Count(),
} MarkCount = MessageHelper.Mark(User.Identity.Name).Count(),
} TrashCount = MessageHelper.Trash(User.Identity.Name).Count()
};
return mcm;
}
}
} }

View File

@ -1,136 +1,140 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using System.Collections.Generic; using Microsoft.AspNetCore.Mvc;
using System.Web.Http; using System;
using System.Linq; using System.Collections.Generic;
using System; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
public class NotificationsController : ApiController /// <summary>
{ ///
/// <summary> /// </summary>
/// [Route("api/[controller]")]
/// </summary> public class NotificationsController : Controller
/// <returns></returns> {
[HttpGet] /// <summary>
public Notifications Get() ///
{ /// </summary>
var ret = new Notifications(); /// <returns></returns>
// New Users [HttpGet]
var user = UserHelper.RetrieveNewUsers(); public Notifications Get()
ret.Users = user.Take(6).ToList(); {
ret.Users.AsParallel().ForAll(n => var ret = new Notifications();
{ // New Users
var ts = DateTime.Now - n.RegisterTime; var user = UserHelper.RetrieveNewUsers();
if (ts.TotalMinutes < 5) n.Period = "刚刚"; ret.Users = user.Take(6).ToList();
else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days); ret.Users.AsParallel().ForAll(n =>
else if (ts.Hours > 0) n.Period = string.Format("{0}小时", ts.Hours); {
else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes); var ts = DateTime.Now - n.RegisterTime;
}); if (ts.TotalMinutes < 5) n.Period = "刚刚";
ret.NewUsersCount = user.Count(); else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days);
else if (ts.Hours > 0) n.Period = string.Format("{0}小时", ts.Hours);
// Tasks else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes);
var task = TaskHelper.RetrieveTasks(); });
ret.Tasks = task.Take(6).ToList(); ret.NewUsersCount = user.Count();
ret.TasksCount = task.Count();
// Tasks
//Message var task = TaskHelper.RetrieveTasks();
var message = MessageHelper.RetrieveMessagesHeader(User.Identity.Name); ret.Tasks = task.Take(6).ToList();
ret.Messages = message.Take(6).ToList(); ret.TasksCount = task.Count();
ret.Messages.AsParallel().ForAll(m => m.FromIcon = Url.Content(m.FromIcon));
ret.MessagesCount = message.Count(); //Message
var message = MessageHelper.RetrieveMessagesHeader(User.Identity.Name);
//Apps ret.Messages = message.Take(6).ToList();
var apps = ExceptionHelper.RetrieveExceptions().Where(n => n.ExceptionType != "Longbow.Data.DBAccessException"); ret.Messages.AsParallel().ForAll(m => m.FromIcon = Url.Content(m.FromIcon));
ret.Apps = apps.Take(6).ToList(); ret.MessagesCount = message.Count();
ret.Apps.AsParallel().ForAll(n =>
{ //Apps
n.ExceptionType = n.ExceptionType.Split('.').Last(); var apps = ExceptionHelper.RetrieveExceptions().Where(n => n.ExceptionType != "Longbow.Data.DBAccessException");
var ts = DateTime.Now - n.LogTime; ret.Apps = apps.Take(6).ToList();
if (ts.TotalMinutes < 5) n.Period = "刚刚"; ret.Apps.AsParallel().ForAll(n =>
else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days); {
else if (ts.Hours > 0) n.Period = string.Format("{0}小时", ts.Hours); n.ExceptionType = n.ExceptionType.Split('.').Last();
else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes); var ts = DateTime.Now - n.LogTime;
}); if (ts.TotalMinutes < 5) n.Period = "刚刚";
ret.AppExceptionsCount = apps.Count(); else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days);
else if (ts.Hours > 0) n.Period = string.Format("{0}小时", ts.Hours);
//Dbs else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes);
var dbs = ExceptionHelper.RetrieveExceptions().Where(n => n.ExceptionType == "Longbow.Data.DBAccessException"); });
ret.Dbs = dbs.Take(6).ToList(); ret.AppExceptionsCount = apps.Count();
ret.Dbs.AsParallel().ForAll(n =>
{ //Dbs
var ts = DateTime.Now - n.LogTime; var dbs = ExceptionHelper.RetrieveExceptions().Where(n => n.ExceptionType == "Longbow.Data.DBAccessException");
if (ts.TotalMinutes < 5) n.Period = "刚刚"; ret.Dbs = dbs.Take(6).ToList();
else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days); ret.Dbs.AsParallel().ForAll(n =>
else if (ts.Hours > 0) n.Period = string.Format("{0}小时", ts.Hours); {
else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes); var ts = DateTime.Now - n.LogTime;
}); if (ts.TotalMinutes < 5) n.Period = "刚刚";
ret.DbExceptionsCount = dbs.Count(); else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days);
return ret; else if (ts.Hours > 0) n.Period = string.Format("{0}小时", ts.Hours);
} else if (ts.Minutes > 0) n.Period = string.Format("{0}分钟", ts.Minutes);
/// <summary> });
/// ret.DbExceptionsCount = dbs.Count();
/// </summary> return ret;
/// <param name="value"></param> }
/// <returns></returns> /// <summary>
[HttpGet] ///
public Notifications Get(string id) /// </summary>
{ /// <param name="value"></param>
var ret = new Notifications(); /// <returns></returns>
if (id == "newusers" || id == "all") ret.Users = UserHelper.RetrieveNewUsers().OrderByDescending(u => u.RegisterTime).ToList(); [HttpGet("{id}")]
return ret; public Notifications Get(string id)
} {
var ret = new Notifications();
public class Notifications if (id == "newusers" || id == "all") ret.Users = UserHelper.RetrieveNewUsers().OrderByDescending(u => u.RegisterTime).ToList();
{ return ret;
public Notifications() }
{
Users = new List<User>(); public class Notifications
Apps = new List<Exceptions>(); {
Dbs = new List<Exceptions>(); public Notifications()
Tasks = new List<Task>(); {
Messages = new List<Message>(); Users = new List<User>();
} Apps = new List<Exceptions>();
/// <summary> Dbs = new List<Exceptions>();
/// Tasks = new List<Task>();
/// </summary> Messages = new List<Message>();
public List<User> Users { get; set; } }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public List<Exceptions> Apps { get; set; } public List<User> Users { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public List<Exceptions> Dbs { get; set; } public List<Exceptions> Apps { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public List<Task> Tasks { get; set; } public List<Exceptions> Dbs { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public List<Message> Messages { get; set; } public List<Task> Tasks { get; set; }
/// <summary> /// <summary>
/// 获得/设置 消息数量 ///
/// </summary> /// </summary>
public int MessagesCount { get; set; } public List<Message> Messages { get; set; }
/// <summary> /// <summary>
/// 获得/设置 新用户数量 /// 获得/设置 消息数量
/// </summary> /// </summary>
public int NewUsersCount { get; set; } public int MessagesCount { get; set; }
/// <summary> /// <summary>
/// 获取/设置 任务数量 /// 获得/设置 新用户数量
/// </summary> /// </summary>
public int TasksCount { get; set; } public int NewUsersCount { get; set; }
/// <summary> /// <summary>
/// 获取/设置 应用程序错误数量 /// 获取/设置 任务数量
/// </summary> /// </summary>
public int AppExceptionsCount { get; set; } public int TasksCount { get; set; }
/// <summary> /// <summary>
/// 获取/设置 数据库错误数量 /// 获取/设置 应用程序错误数量
/// </summary> /// </summary>
public int DbExceptionsCount { get; set; } public int AppExceptionsCount { get; set; }
} /// <summary>
} /// 获取/设置 数据库错误数量
/// </summary>
public int DbExceptionsCount { get; set; }
}
}
} }

View File

@ -0,0 +1,47 @@
using Bootstrap.DataAccess;
using Longbow.Logging;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Specialized;
using System.IO;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
///
/// </summary>
[Route("api/[controller]")]
public class ProfilesController : Controller
{
[HttpPost]
public string Post()
{
var ret = string.Empty;
var userName = User.Identity.Name;
if (User.IsInRole("Administrators")) userName = "default";
//var files = HttpContext.Request.Files;
//if (files.Count > 0)
//{
// var webSiteUrl = DictHelper.RetrieveIconFolderPath().Code;
// var fileName = string.Format("{0}{1}", userName, Path.GetExtension(files[0].FileName));
// var fileUrl = string.Format("{0}{1}", webSiteUrl, fileName);
// var filePath = HttpContext.Current.Server.MapPath(fileUrl);
// var fileFolder = Path.GetDirectoryName(filePath);
// try
// {
// if (!Directory.Exists(fileFolder)) Directory.CreateDirectory(fileFolder);
// files[0].SaveAs(filePath);
// ret = string.Format("{0}?q={1}", Url.Content(fileUrl), DateTime.Now.Ticks);
// UserHelper.SaveUserIconByName(userName, fileName);
// }
// catch (Exception ex)
// {
// var nv = new NameValueCollection();
// nv.Add("UpLoadFileName", filePath);
// ExceptionManager.Publish(ex, nv);
// }
//}
return ret;
}
}
}

View File

@ -1,98 +1,102 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using Newtonsoft.Json.Linq; using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using Newtonsoft.Json.Linq;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
public class RolesController : ApiController /// <summary>
{ ///
/// <summary> /// </summary>
/// [Route("api/[controller]")]
/// </summary> public class RolesController : Controller
/// <param name="value"></param> {
/// <returns></returns> /// <summary>
[HttpGet] ///
public QueryData<Role> Get([FromUri]QueryRoleOption value) /// </summary>
{ /// <param name="value"></param>
return value.RetrieveData(); /// <returns></returns>
} [HttpGet]
public QueryData<Role> Get(QueryRoleOption value)
/// <summary> {
/// return value.RetrieveData();
/// </summary> }
/// <param name="id"></param>
/// <param name="value"></param> /// <summary>
/// <returns></returns> ///
[HttpPost] /// </summary>
public IEnumerable<Role> Post(int id, [FromBody]JObject value) /// <param name="id"></param>
{ /// <param name="value"></param>
var ret = new List<Role>(); /// <returns></returns>
dynamic json = value; [HttpPost("{id}")]
switch ((string)json.type) public IEnumerable<Role> Post(int id, JObject value)
{ {
case "user": var ret = new List<Role>();
ret = RoleHelper.RetrieveRolesByUserId(id).ToList(); dynamic json = value;
break; switch ((string)json.type)
case "group": {
ret = RoleHelper.RetrieveRolesByGroupId(id).ToList(); case "user":
break; ret = RoleHelper.RetrieveRolesByUserId(id).ToList();
case "menu": break;
ret = RoleHelper.RetrieveRolesByMenuId(id).ToList(); case "group":
break; ret = RoleHelper.RetrieveRolesByGroupId(id).ToList();
default: break;
break; case "menu":
} ret = RoleHelper.RetrieveRolesByMenuId(id).ToList();
return ret; break;
} default:
break;
/// <summary>根据GroupID获取 }
/// </summary> return ret;
/// <param name="value"></param> }
/// <returns></returns>
[HttpPut] /// <summary>根据GroupID获取
public bool Put(int id, [FromBody]JObject value) /// </summary>
{ /// <param name="value"></param>
var ret = false; /// <returns></returns>
dynamic json = value; [HttpPut("{id}")]
string roleIds = json.roleIds; public bool Put(int id, JObject value)
switch ((string)json.type) {
{ var ret = false;
case "user": dynamic json = value;
ret = RoleHelper.SaveRolesByUserId(id, roleIds); string roleIds = json.roleIds;
break; switch ((string)json.type)
case "group": {
ret = RoleHelper.SaveRolesByGroupId(id, roleIds); case "user":
break; ret = RoleHelper.SaveRolesByUserId(id, roleIds);
case "menu": break;
ret = RoleHelper.SavaRolesByMenuId(id, roleIds); case "group":
break; ret = RoleHelper.SaveRolesByGroupId(id, roleIds);
default: break;
break; case "menu":
} ret = RoleHelper.SavaRolesByMenuId(id, roleIds);
return ret; break;
} default:
/// <summary> break;
/// }
/// </summary> return ret;
/// <param name="value"></param> }
[HttpPost] /// <summary>
public bool Post([FromBody]Role value) ///
{ /// </summary>
return RoleHelper.SaveRole(value); /// <param name="value"></param>
} [HttpPost]
/// <summary> public bool Post(Role value)
/// {
/// </summary> return RoleHelper.SaveRole(value);
/// <param name="value"></param> }
[HttpDelete] /// <summary>
public bool Delete([FromBody]string value) ///
{ /// </summary>
return RoleHelper.DeleteRole(value); /// <param name="value"></param>
} [HttpDelete]
} public bool Delete(string value)
} {
return RoleHelper.DeleteRole(value);
}
}
}

View File

@ -1,38 +1,38 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Caching.Configuration; using Longbow.Cache;
using Newtonsoft.Json.Linq; using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using Newtonsoft.Json.Linq;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class SettingsController : ApiController [Route("api/[controller]")]
{ public class SettingsController : Controller
/// <summary> {
/// /// <summary>
/// </summary> ///
/// <param name="value"></param> /// </summary>
/// <returns></returns> /// <param name="value"></param>
[HttpPost] /// <returns></returns>
public bool Post([FromBody]JObject value) [HttpPost]
{ public bool Post(JObject value)
//保存个性化设置 {
dynamic json = value; //保存个性化设置
return DictHelper.SaveSettings((string)json.name, (string)json.code, (string)json.category); dynamic json = value;
} return DictHelper.SaveSettings((string)json.name, (string)json.code, (string)json.category);
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="value"></param> /// </summary>
[HttpGet] /// <param name="value"></param>
public IEnumerable<CacheListElement> Get([FromUri]JObject value) [HttpGet]
{ public IEnumerable<ICacheCorsItem> Get()
var section = CacheListSection.GetSection(); {
return section.Items.Where(item => item.Enabled); return CacheManager.CorsSites;
} }
} }
} }

View File

@ -1,17 +1,18 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using System.Collections.Generic;
using System.Web.Http;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class TasksController : ApiController [Route("api/[controller]")]
public class TasksController : Controller
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public IEnumerable<Task> Get() public IEnumerable<Task> Get()

View File

@ -1,158 +1,159 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Longbow.Security.Principal; using Longbow.Web.Mvc;
using Longbow.Web.Mvc; using Microsoft.AspNetCore.Authorization;
using Newtonsoft.Json.Linq; using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using Newtonsoft.Json.Linq;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class UsersController : ApiController [Route("api/[controller]")]
{ public class UsersController : Controller
/// <summary> {
/// /// <summary>
/// </summary> ///
/// <param name="value"></param> /// </summary>
/// <returns></returns> /// <param name="value"></param>
[HttpGet] /// <returns></returns>
public QueryData<User> Get([FromUri]QueryUserOption value) [HttpGet]
{ public QueryData<User> Get(QueryUserOption value)
return value.RetrieveData(); {
} return value.RetrieveData();
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <returns></returns> /// </summary>
[HttpPut] /// <returns></returns>
public bool Put([FromBody]User value) [HttpPut]
{ public bool Put(User value)
if(value.UserStatus == 3) {
{ if(value.UserStatus == 3)
return UserHelper.SaveUserCssByName(value.UserName, value.Css); {
} return UserHelper.SaveUserCssByName(value.UserName, value.Css);
if (value.UserStatus == 9) }
{ if (value.UserStatus == 9)
// vlaidate userName {
return BootstrapUser.RetrieveUserByUserName(value.UserName) == null && !UserHelper.RetrieveNewUsers().Any(u => u.UserName == value.UserName); // vlaidate userName
} return BootstrapUser.RetrieveUserByUserName(value.UserName) == null && !UserHelper.RetrieveNewUsers().Any(u => u.UserName == value.UserName);
var ret = false; }
if (value.UserName.Equals(User.Identity.Name, System.StringComparison.OrdinalIgnoreCase) || LgbPrincipal.IsAdmin(User)) var ret = false;
{ if (value.UserName.Equals(User.Identity.Name, System.StringComparison.OrdinalIgnoreCase))
if (value.UserStatus == 1) {
ret = BootstrapUser.SaveUserInfoByName(value.UserName, value.DisplayName); if (value.UserStatus == 1)
else if (value.UserStatus == 2) ret = BootstrapUser.SaveUserInfoByName(value.UserName, value.DisplayName);
ret = BootstrapUser.ChangePassword(value.UserName, value.Password, value.NewPassword); else if (value.UserStatus == 2)
} ret = BootstrapUser.ChangePassword(value.UserName, value.Password, value.NewPassword);
return ret; }
} return ret;
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="id"></param> /// </summary>
/// <param name="value"></param> /// <param name="id"></param>
/// <returns></returns> /// <param name="value"></param>
[HttpPost] /// <returns></returns>
public IEnumerable<User> Post(int id, [FromBody]JObject value) [HttpPost("{id}")]
{ public IEnumerable<User> Post(int id, JObject value)
var ret = new List<User>(); {
dynamic json = value; var ret = new List<User>();
switch ((string)json.type) dynamic json = value;
{ switch ((string)json.type)
case "role": {
ret = UserHelper.RetrieveUsersByRoleId(id).ToList(); case "role":
break; ret = UserHelper.RetrieveUsersByRoleId(id).ToList();
case "group": break;
ret = UserHelper.RetrieveUsersByGroupId(id).ToList(); case "group":
break; ret = UserHelper.RetrieveUsersByGroupId(id).ToList();
default: break;
break; default:
} break;
return ret; }
} return ret;
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="userName"></param> /// </summary>
/// <returns></returns> /// <param name="userName"></param>
[HttpGet] /// <returns></returns>
public BootstrapUser Get(string userName) [HttpGet]
{ public BootstrapUser Get(string userName)
return BootstrapUser.RetrieveUserByUserName(userName); {
} return BootstrapUser.RetrieveUserByUserName(userName);
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="value"></param> /// </summary>
[HttpPost] /// <param name="value"></param>
public bool Post([FromBody]User value) [HttpPost]
{ public bool Post(User value)
value.Description = string.Format("管理员{0}创建用户", User.Identity.Name); {
value.ApprovedBy = User.Identity.Name; value.Description = string.Format("管理员{0}创建用户", User.Identity.Name);
return UserHelper.SaveUser(value); value.ApprovedBy = User.Identity.Name;
} return UserHelper.SaveUser(value);
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="id"></param> /// </summary>
/// <param name="value"></param> /// <param name="id"></param>
/// <returns></returns> /// <param name="value"></param>
[HttpPut] /// <returns></returns>
public bool Put(int id, [FromBody]JObject value) [HttpPut("{id}")]
{ public bool Put(int id, JObject value)
var ret = false; {
dynamic json = value; var ret = false;
string userIds = json.userIds; dynamic json = value;
switch ((string)json.type) string userIds = json.userIds;
{ switch ((string)json.type)
case "role": {
ret = UserHelper.SaveUsersByRoleId(id, userIds); case "role":
break; ret = UserHelper.SaveUsersByRoleId(id, userIds);
case "group": break;
ret = UserHelper.SaveUsersByGroupId(id, userIds); case "group":
break; ret = UserHelper.SaveUsersByGroupId(id, userIds);
case "user": break;
// 此时 userIds 存储的信息是操作结果 1 标示同意 0 标示拒绝 case "user":
var user = new User() { Id = id, UserStatus = 2 }; // 此时 userIds 存储的信息是操作结果 1 标示同意 0 标示拒绝
if (userIds == "1") var user = new User() { Id = id, UserStatus = 2 };
{ if (userIds == "1")
user.ApprovedBy = User.Identity.Name; {
} user.ApprovedBy = User.Identity.Name;
else }
{ else
user.RejectedReason = "无原因"; {
user.RejectedBy = User.Identity.Name; user.RejectedReason = "无原因";
} user.RejectedBy = User.Identity.Name;
ret = UserHelper.SaveUser(user); }
break; ret = UserHelper.SaveUser(user);
default: break;
break; default:
} break;
return ret; }
} return ret;
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <param name="value"></param> /// </summary>
[HttpDelete] /// <param name="value"></param>
public bool Delete([FromBody]string value) [HttpDelete]
{ public bool Delete(string value)
return UserHelper.DeleteUser(value); {
} return UserHelper.DeleteUser(value);
/// <summary> }
/// /// <summary>
/// </summary> ///
/// <returns></returns> /// </summary>
[AllowAnonymous] /// <returns></returns>
[HttpOptions] [AllowAnonymous]
public string Options() [HttpOptions]
{ public string Options()
return null; {
} return null;
} }
}
} }

View File

@ -1,21 +1,25 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using System.Collections.Generic; using Microsoft.AspNetCore.Mvc;
using System.Linq; using System.Collections.Generic;
using System.Web.Http; using System.Linq;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers.Api
{ {
public class WSController : ApiController /// <summary>
{ ///
/// <summary> /// </summary>
/// [Route("api/[controller]")]
/// </summary> public class WSController : Controller
/// <param name="value"></param> {
/// <returns></returns> /// <summary>
[HttpGet] ///
public List<MessageBody> Get() /// </summary>
{ /// <param name="value"></param>
return NotificationHelper.MessagePool.ToList(); /// <returns></returns>
} [HttpGet]
} public List<MessageBody> Get()
{
return NotificationHelper.MessagePool.ToList();
}
}
} }

View File

@ -1,82 +0,0 @@
using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Security.Principal;
using Longbow.Web.Mvc;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace Bootstrap.Admin.Controllers
{
public class DictsController : ApiController
{
/// <summary>
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<BootstrapDict> Get([FromUri]QueryDictOption value)
{
return value.RetrieveData();
}
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
public BootstrapDict Get(int id)
{
return DictHelper.RetrieveDicts().FirstOrDefault(t => t.Id == id);
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
[HttpPost]
public bool Post([FromBody]BootstrapDict value)
{
return DictHelper.SaveDict(value);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public IEnumerable<BootstrapDict> Post(int id, [FromBody]JObject value)
{
IEnumerable<BootstrapDict> ret = new List<BootstrapDict>();
dynamic json = value;
switch ((string)json.type)
{
case "category":
ret = DictHelper.RetrieveCategories();
break;
case "css":
ret = DictHelper.RetrieveWebCss();
break;
case "activeCss":
ret = DictHelper.RetrieveActiveCss();
break;
default:
break;
}
return ret;
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]
public object Delete([FromBody]string value)
{
if (!LgbPrincipal.IsAdmin(User)) return new { result = false, msg = "当前用户权限不够" };
var result = DictHelper.DeleteDict(value);
return new { result = result, msg = result ? "成功!" : "失败" };
}
}
}

View File

@ -1,9 +1,11 @@
using Bootstrap.Admin.Models; using Bootstrap.Admin.Models;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Longbow.Security.Principal; using Microsoft.AspNetCore.Authentication;
using System.Web.Mvc; using Microsoft.AspNetCore.Authentication.Cookies;
using System.Web.Security; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers namespace Bootstrap.Admin.Controllers
{ {
@ -18,59 +20,23 @@ namespace Bootstrap.Admin.Controllers
/// <returns></returns> /// <returns></returns>
public ActionResult Index() public ActionResult Index()
{ {
var v = new HeaderBarModel { HomeUrl = DictHelper.RetrieveHomeUrl() }; var v = new HeaderBarModel(User.Identity) { HomeUrl = DictHelper.RetrieveHomeUrl() };
return v.HomeUrl.StartsWith("~/") ? (ActionResult)View(v) : Redirect(v.HomeUrl); return v.HomeUrl.StartsWith("~/") ? (ActionResult)View(v) : Redirect(v.HomeUrl);
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public ActionResult Lock() public async Task<IActionResult> Lock()
{ {
FormsAuthentication.SignOut(); await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
var user = BootstrapUser.RetrieveUserByUserName(User.Identity.Name); var user = BootstrapUser.RetrieveUserByUserName(User.Identity.Name);
return View(new LockModel return View(new LockModel
{ {
UserName = user.UserName, UserName = user.UserName,
DisplayName = user.DisplayName, DisplayName = user.DisplayName,
ReturnUrl = Url.Encode(Request.UrlReferrer == null ? FormsAuthentication.DefaultUrl : Request.UrlReferrer.AbsoluteUri) ReturnUrl = Request.Path
}); });
} }
/// <summary>
///
/// </summary>
/// <param name="login"></param>
/// <returns></returns>
[AllowAnonymous]
public ActionResult Login(LoginModel login)
{
FormsAuthentication.SignOut();
if (!string.IsNullOrEmpty(login.UserName) && (LgbPrincipal.Authenticate(login.UserName, login.Password) || BootstrapUser.Authenticate(login.UserName, login.Password)))
{
FormsAuthentication.RedirectFromLoginPage(login.UserName, login.Remember == "true");
return new EmptyResult();
}
return View(login);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public ActionResult Register(User p)
{
if (string.IsNullOrEmpty(p.UserName) || string.IsNullOrEmpty(p.Password) || string.IsNullOrEmpty(p.DisplayName) || string.IsNullOrEmpty(p.Description)) return View();
p.UserStatus = 1;
return UserHelper.SaveUser(p) ? (ActionResult)Redirect("~/Content/html/RegResult.html") : View();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public ActionResult Mobile()
{
return View();
}
} }
} }

View File

@ -1,45 +0,0 @@
using Bootstrap.DataAccess;
using Longbow.ExceptionManagement;
using Longbow.Security.Principal;
using System;
using System.Collections.Specialized;
using System.IO;
using System.Web;
using System.Web.Http;
namespace Bootstrap.Admin.Controllers
{
public class ProfilesController : ApiController
{
[HttpPost]
public string Post()
{
var ret = string.Empty;
var userName = User.Identity.Name;
if (LgbPrincipal.IsWebAdmin(userName)) userName = "default";
var files = HttpContext.Current.Request.Files;
if (files.Count > 0)
{
var webSiteUrl = DictHelper.RetrieveIconFolderPath().Code;
var fileName = string.Format("{0}{1}", userName, Path.GetExtension(files[0].FileName));
var fileUrl = string.Format("{0}{1}", webSiteUrl, fileName);
var filePath = HttpContext.Current.Server.MapPath(fileUrl);
var fileFolder = Path.GetDirectoryName(filePath);
try
{
if (!Directory.Exists(fileFolder)) Directory.CreateDirectory(fileFolder);
files[0].SaveAs(filePath);
ret = string.Format("{0}?q={1}", Url.Content(fileUrl), DateTime.Now.Ticks);
UserHelper.SaveUserIconByName(userName, fileName);
}
catch (Exception ex)
{
var nv = new NameValueCollection();
nv.Add("UpLoadFileName", filePath);
ExceptionManager.Publish(ex, nv);
}
}
return ret;
}
}
}

View File

@ -1 +0,0 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="Bootstrap.Admin.Global" Language="C#" %>

View File

@ -1,20 +0,0 @@
using System;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
namespace Bootstrap.Admin
{
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
}
}
}

View File

@ -1,5 +1,6 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using System.Security.Principal;
using System.Web; using System.Web;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Models
@ -9,9 +10,9 @@ namespace Bootstrap.Admin.Models
/// </summary> /// </summary>
public class HeaderBarModel : ModelBase public class HeaderBarModel : ModelBase
{ {
public HeaderBarModel() public HeaderBarModel(IIdentity identity)
{ {
var user = BootstrapUser.RetrieveUserByUserName(HttpContext.Current.User.Identity.Name); var user = BootstrapUser.RetrieveUserByUserName(identity.Name);
Icon = user.Icon; Icon = user.Icon;
DisplayName = user.DisplayName; DisplayName = user.DisplayName;
UserName = user.UserName; UserName = user.UserName;

View File

@ -1,14 +1,15 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using System.Collections.Generic;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Models
{ {
public class NavigatorBarModel : HeaderBarModel public class NavigatorBarModel : HeaderBarModel
{ {
public NavigatorBarModel(string url) public NavigatorBarModel(ControllerBase controller) : base(controller.User.Identity)
{ {
Navigations = BootstrapMenu.RetrieveSystemMenus(UserName, url); Navigations = BootstrapMenu.RetrieveSystemMenus(UserName, $"~/{controller.ControllerContext.ActionDescriptor.ControllerName}/{controller.ControllerContext.ActionDescriptor.ActionName}");
Applications = DictHelper.RetrieveApps(); Applications = DictHelper.RetrieveApps();
HomeUrl = "~/Admin/Index"; HomeUrl = "~/Admin/Index";
} }

View File

@ -1,8 +1,9 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Web;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Models
{ {
@ -22,10 +23,11 @@ namespace Bootstrap.Admin.Models
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="url"></param> /// <param name="controller"></param>
public ProfilesModel(string url) : base(url) public ProfilesModel(ControllerBase controller) : base(controller)
{ {
var fileName = HttpContext.Current.Server.MapPath(Icon); // TODO: 找到MapPath方法
var fileName = AppContext.BaseDirectory + Icon;
if (File.Exists(fileName)) if (File.Exists(fileName))
{ {
Size = new FileInfo(fileName).Length; Size = new FileInfo(fileName).Length;

View File

@ -0,0 +1,21 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using System;
namespace Bootstrap.Admin
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder => builder.SetBasePath(AppContext.BaseDirectory).AddJsonFile("cache.json", true, true))
.UseStartup<Startup>()
.Build();
}
}

View File

@ -1,40 +0,0 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
#if DEBUG
[assembly: AssemblyTitle("Bootstrap.Admin Debug Version")]
#else
[assembly: AssemblyTitle("Bootstrap.Admin Release Version")]
#endif
[assembly: AssemblyDescription("Bootstrap.Admin Web Component")]
//[assembly: AssemblyConfiguration("")]
//[assembly: AssemblyCompany("")]
//[assembly: AssemblyProduct("Bootstrap.DataAccess")]
//[assembly: AssemblyCopyright("Copyright © 2016")]
//[assembly: AssemblyTrademark("")]
//[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7b2b7043-3cb2-4c5a-bdf2-8c47f1a5471a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:50852/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Bootstrap.Admin": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:50853/"
}
}
}

View File

@ -1,65 +1,65 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
public class QueryDictOption : PaginationOption public class QueryDictOption : PaginationOption
{ {
/// <summary> /// <summary>
/// 字典分项 /// 字典分项
/// </summary> /// </summary>
public string Category { get; set; } public string Category { get; set; }
/// <summary> /// <summary>
/// 字典名称 /// 字典名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// 字典种类 /// 字典种类
/// </summary> /// </summary>
public string Define { get; set; } public string Define { get; set; }
/// <summary> /// <summary>
/// 字典表查询 /// 字典表查询
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public QueryData<BootstrapDict> RetrieveData() public QueryData<BootstrapDict> RetrieveData()
{ {
var data = DictHelper.RetrieveDicts(); var data = DictHelper.RetrieveDicts();
if (!string.IsNullOrEmpty(Category)) if (!string.IsNullOrEmpty(Category))
{ {
data = data.Where(t => t.Category.Contains(Category)); data = data.Where(t => t.Category.Contains(Category));
} }
if (!string.IsNullOrEmpty(Name)) if (!string.IsNullOrEmpty(Name))
{ {
data = data.Where(t => t.Name.Contains(Name)); data = data.Where(t => t.Name.Contains(Name));
} }
if (!string.IsNullOrEmpty(Define)) if (!string.IsNullOrEmpty(Define))
{ {
data = data.Where(t => t.Define.ToString() == Define); data = data.Where(t => t.Define.ToString() == Define);
} }
var ret = new QueryData<BootstrapDict>(); var ret = new QueryData<BootstrapDict>();
ret.total = data.Count(); ret.total = data.Count();
// 通过option.Sort属性判断对那列进行排序 // 通过option.Sort属性判断对那列进行排序
switch (Sort) switch (Sort)
{ {
case "Category": case "Category":
data = Order == "asc" ? data.OrderBy(t => t.Category) : data.OrderByDescending(t => t.Category); data = Order == "asc" ? data.OrderBy(t => t.Category) : data.OrderByDescending(t => t.Category);
break; break;
case "Name": case "Name":
data = Order == "asc" ? data.OrderBy(t => t.Name) : data.OrderByDescending(t => t.Name); data = Order == "asc" ? data.OrderBy(t => t.Name) : data.OrderByDescending(t => t.Name);
break; break;
case "Code": case "Code":
data = Order == "asc" ? data.OrderBy(t => t.Code) : data.OrderByDescending(t => t.Code); data = Order == "asc" ? data.OrderBy(t => t.Code) : data.OrderByDescending(t => t.Code);
break; break;
case "Define": case "Define":
data = Order == "asc" ? data.OrderBy(t => t.Define) : data.OrderByDescending(t => t.Define); data = Order == "asc" ? data.OrderBy(t => t.Define) : data.OrderByDescending(t => t.Define);
break; break;
default: default:
break; break;
} }
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -1,57 +1,57 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
public class QueryExceptionOption : PaginationOption public class QueryExceptionOption : PaginationOption
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime StartTime { get; set; } public DateTime StartTime { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime EndTime { get; set; } public DateTime EndTime { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public QueryData<Exceptions> RetrieveData() public QueryData<Exceptions> RetrieveData()
{ {
var data = ExceptionHelper.RetrieveExceptions(); var data = ExceptionHelper.RetrieveExceptions();
if (StartTime > DateTime.MinValue) if (StartTime > DateTime.MinValue)
{ {
data = data.Where(t => t.LogTime > StartTime); data = data.Where(t => t.LogTime > StartTime);
} }
if (EndTime > DateTime.MinValue) if (EndTime > DateTime.MinValue)
{ {
data = data.Where(t => t.LogTime < EndTime.AddDays(1)); data = data.Where(t => t.LogTime < EndTime.AddDays(1));
} }
var ret = new QueryData<Exceptions>(); var ret = new QueryData<Exceptions>();
ret.total = data.Count(); ret.total = data.Count();
switch (Sort) switch (Sort)
{ {
case "ErrorPage": case "ErrorPage":
data = Order == "asc" ? data.OrderBy(t => t.ErrorPage) : data.OrderByDescending(t => t.ErrorPage); data = Order == "asc" ? data.OrderBy(t => t.ErrorPage) : data.OrderByDescending(t => t.ErrorPage);
break; break;
case "UserID": case "UserID":
data = Order == "asc" ? data.OrderBy(t => t.UserId) : data.OrderByDescending(t => t.UserId); data = Order == "asc" ? data.OrderBy(t => t.UserId) : data.OrderByDescending(t => t.UserId);
break; break;
case "UserIp": case "UserIp":
data = Order == "asc" ? data.OrderBy(t => t.UserIp) : data.OrderByDescending(t => t.UserIp); data = Order == "asc" ? data.OrderBy(t => t.UserIp) : data.OrderByDescending(t => t.UserIp);
break; break;
case "LogTime": case "LogTime":
data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime); data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime);
break; break;
default: default:
break; break;
} }
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -1,40 +1,40 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
public class QueryGroupOption : PaginationOption public class QueryGroupOption : PaginationOption
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string GroupName { get; set; } public string GroupName { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string Description { get; set; } public string Description { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public QueryData<Group> RetrieveData() public QueryData<Group> RetrieveData()
{ {
// int limit, int offset, string name, string price, string sort, string order // int limit, int offset, string name, string price, string sort, string order
var data = GroupHelper.RetrieveGroups(); var data = GroupHelper.RetrieveGroups();
if (!string.IsNullOrEmpty(GroupName)) if (!string.IsNullOrEmpty(GroupName))
{ {
data = data.Where(t => t.GroupName.Contains(GroupName)); data = data.Where(t => t.GroupName.Contains(GroupName));
} }
if (!string.IsNullOrEmpty(Description)) if (!string.IsNullOrEmpty(Description))
{ {
data = data.Where(t => t.Description.Contains(Description)); data = data.Where(t => t.Description.Contains(Description));
} }
var ret = new QueryData<Group>(); var ret = new QueryData<Group>();
ret.total = data.Count(); ret.total = data.Count();
data = Order == "asc" ? data.OrderBy(t => t.GroupName) : data.OrderByDescending(t => t.GroupName); data = Order == "asc" ? data.OrderBy(t => t.GroupName) : data.OrderByDescending(t => t.GroupName);
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -1,70 +1,70 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
public class QueryLogOption : PaginationOption public class QueryLogOption : PaginationOption
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string OperateType { get; set; } public string OperateType { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime OperateTimeStart { get; set; } public DateTime OperateTimeStart { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime OperateTimeEnd { get; set; } public DateTime OperateTimeEnd { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public QueryData<Log> RetrieveData() public QueryData<Log> RetrieveData()
{ {
var data = LogHelper.RetrieveLogs(); var data = LogHelper.RetrieveLogs();
if (!string.IsNullOrEmpty(OperateType)) if (!string.IsNullOrEmpty(OperateType))
{ {
data = data.Where(t => t.CRUD.ToString().Contains(OperateType)); data = data.Where(t => t.CRUD.ToString().Contains(OperateType));
} }
if (OperateTimeStart > DateTime.MinValue) if (OperateTimeStart > DateTime.MinValue)
{ {
data = data.Where(t => t.LogTime > OperateTimeStart); data = data.Where(t => t.LogTime > OperateTimeStart);
} }
if (OperateTimeEnd > DateTime.MinValue) if (OperateTimeEnd > DateTime.MinValue)
{ {
data = data.Where(t => t.LogTime < OperateTimeEnd.AddDays(1)); data = data.Where(t => t.LogTime < OperateTimeEnd.AddDays(1));
} }
var ret = new QueryData<Log>(); var ret = new QueryData<Log>();
ret.total = data.Count(); ret.total = data.Count();
switch (Sort) switch (Sort)
{ {
case "CRUD": case "CRUD":
data = Order == "asc" ? data.OrderBy(t => t.CRUD) : data.OrderByDescending(t => t.CRUD); data = Order == "asc" ? data.OrderBy(t => t.CRUD) : data.OrderByDescending(t => t.CRUD);
break; break;
case "UserName": case "UserName":
data = Order == "asc" ? data.OrderBy(t => t.UserName) : data.OrderByDescending(t => t.UserName); data = Order == "asc" ? data.OrderBy(t => t.UserName) : data.OrderByDescending(t => t.UserName);
break; break;
case "LogTime": case "LogTime":
data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime); data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime);
break; break;
case "ClientIp": case "ClientIp":
data = Order == "asc" ? data.OrderBy(t => t.ClientIp) : data.OrderByDescending(t => t.ClientIp); data = Order == "asc" ? data.OrderBy(t => t.ClientIp) : data.OrderByDescending(t => t.ClientIp);
break; break;
case "RequestUrl": case "RequestUrl":
data = Order == "asc" ? data.OrderBy(t => t.RequestUrl) : data.OrderByDescending(t => t.RequestUrl); data = Order == "asc" ? data.OrderBy(t => t.RequestUrl) : data.OrderByDescending(t => t.RequestUrl);
break; break;
default: default:
break; break;
} }
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -1,77 +1,77 @@
using Bootstrap.Security; using Bootstrap.Security;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
public class QueryMenuOption : PaginationOption public class QueryMenuOption : PaginationOption
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string ParentName { get; set; } public string ParentName { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string Category { get; set; } public string Category { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string IsResource { get; set; } public string IsResource { get; set; }
public QueryData<BootstrapMenu> RetrieveData(string userName) public QueryData<BootstrapMenu> RetrieveData(string userName)
{ {
var data = BootstrapMenu.RetrieveMenusByUserName(userName); var data = BootstrapMenu.RetrieveMenusByUserName(userName);
if (!string.IsNullOrEmpty(ParentName)) if (!string.IsNullOrEmpty(ParentName))
{ {
data = data.Where(t => t.ParentName.Contains(ParentName)); data = data.Where(t => t.ParentName.Contains(ParentName));
} }
if (!string.IsNullOrEmpty(Name)) if (!string.IsNullOrEmpty(Name))
{ {
data = data.Where(t => t.Name.Contains(Name)); data = data.Where(t => t.Name.Contains(Name));
} }
if (!string.IsNullOrEmpty(Category)) if (!string.IsNullOrEmpty(Category))
{ {
data = data.Where(t => t.Category.Contains(Category)); data = data.Where(t => t.Category.Contains(Category));
} }
if (!string.IsNullOrEmpty(IsResource)) if (!string.IsNullOrEmpty(IsResource))
{ {
data = data.Where(t => t.IsResource.ToString() == IsResource); data = data.Where(t => t.IsResource.ToString() == IsResource);
} }
var ret = new QueryData<BootstrapMenu>(); var ret = new QueryData<BootstrapMenu>();
ret.total = data.Count(); ret.total = data.Count();
switch (Sort) switch (Sort)
{ {
case "Name": case "Name":
data = Order == "asc" ? data.OrderBy(t => t.Name) : data.OrderByDescending(t => t.Name); data = Order == "asc" ? data.OrderBy(t => t.Name) : data.OrderByDescending(t => t.Name);
break; break;
case "ParentName": case "ParentName":
data = Order == "asc" ? data.OrderBy(t => t.ParentName) : data.OrderByDescending(t => t.ParentName); data = Order == "asc" ? data.OrderBy(t => t.ParentName) : data.OrderByDescending(t => t.ParentName);
break; break;
case "Order": case "Order":
data = Order == "asc" ? data.OrderBy(t => t.Order) : data.OrderByDescending(t => t.Order); data = Order == "asc" ? data.OrderBy(t => t.Order) : data.OrderByDescending(t => t.Order);
break; break;
case "CategoryName": case "CategoryName":
data = Order == "asc" ? data.OrderBy(t => t.CategoryName) : data.OrderByDescending(t => t.CategoryName); data = Order == "asc" ? data.OrderBy(t => t.CategoryName) : data.OrderByDescending(t => t.CategoryName);
break; break;
case "Target": case "Target":
data = Order == "asc" ? data.OrderBy(t => t.Target) : data.OrderByDescending(t => t.Target); data = Order == "asc" ? data.OrderBy(t => t.Target) : data.OrderByDescending(t => t.Target);
break; break;
case "IsResource": case "IsResource":
data = Order == "asc" ? data.OrderBy(t => t.IsResource) : data.OrderByDescending(t => t.IsResource); data = Order == "asc" ? data.OrderBy(t => t.IsResource) : data.OrderByDescending(t => t.IsResource);
break; break;
case "ApplicationCode": case "ApplicationCode":
data = Order == "asc" ? data.OrderBy(t => t.ApplicationCode) : data.OrderByDescending(t => t.ApplicationCode); data = Order == "asc" ? data.OrderBy(t => t.ApplicationCode) : data.OrderByDescending(t => t.ApplicationCode);
break; break;
default: default:
break; break;
} }
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -1,40 +1,40 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
public class QueryRoleOption : PaginationOption public class QueryRoleOption : PaginationOption
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string RoleName { get; set; } public string RoleName { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string Description { get; set; } public string Description { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public QueryData<Role> RetrieveData() public QueryData<Role> RetrieveData()
{ {
// int limit, int offset, string name, string price, string sort, string order // int limit, int offset, string name, string price, string sort, string order
var data = RoleHelper.RetrieveRoles(); var data = RoleHelper.RetrieveRoles();
if (!string.IsNullOrEmpty(RoleName)) if (!string.IsNullOrEmpty(RoleName))
{ {
data = data.Where(t => t.RoleName.Contains(RoleName)); data = data.Where(t => t.RoleName.Contains(RoleName));
} }
if (!string.IsNullOrEmpty(Description)) if (!string.IsNullOrEmpty(Description))
{ {
data = data.Where(t => t.Description.Contains(Description)); data = data.Where(t => t.Description.Contains(Description));
} }
var ret = new QueryData<Role>(); var ret = new QueryData<Role>();
ret.total = data.Count(); ret.total = data.Count();
data = Order == "asc" ? data.OrderBy(t => t.RoleName) : data.OrderByDescending(t => t.RoleName); data = Order == "asc" ? data.OrderBy(t => t.RoleName) : data.OrderByDescending(t => t.RoleName);
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -1,59 +1,59 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using System.Linq; using System.Linq;
namespace Bootstrap.Admin.Models namespace Bootstrap.Admin.Query
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class QueryUserOption : PaginationOption public class QueryUserOption : PaginationOption
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string DisplayName { get; set; } public string DisplayName { get; set; }
public QueryData<User> RetrieveData() public QueryData<User> RetrieveData()
{ {
// int limit, int offset, string name, string price, string sort, string order // int limit, int offset, string name, string price, string sort, string order
var data = UserHelper.RetrieveUsers(); var data = UserHelper.RetrieveUsers();
if (!string.IsNullOrEmpty(Name)) if (!string.IsNullOrEmpty(Name))
{ {
data = data.Where(t => t.UserName.Contains(Name)); data = data.Where(t => t.UserName.Contains(Name));
} }
if (!string.IsNullOrEmpty(DisplayName)) if (!string.IsNullOrEmpty(DisplayName))
{ {
data = data.Where(t => t.DisplayName.Contains(DisplayName)); data = data.Where(t => t.DisplayName.Contains(DisplayName));
} }
var ret = new QueryData<User>(); var ret = new QueryData<User>();
ret.total = data.Count(); ret.total = data.Count();
switch (Sort) switch (Sort)
{ {
case "UserName": case "UserName":
data = Order == "asc" ? data.OrderBy(t => t.UserName) : data.OrderByDescending(t => t.UserName); data = Order == "asc" ? data.OrderBy(t => t.UserName) : data.OrderByDescending(t => t.UserName);
break; break;
case "DisplayName": case "DisplayName":
data = Order == "asc" ? data.OrderBy(t => t.DisplayName) : data.OrderByDescending(t => t.DisplayName); data = Order == "asc" ? data.OrderBy(t => t.DisplayName) : data.OrderByDescending(t => t.DisplayName);
break; break;
case "RegisterTime": case "RegisterTime":
data = Order == "asc" ? data.OrderBy(t => t.RegisterTime) : data.OrderByDescending(t => t.RegisterTime); data = Order == "asc" ? data.OrderBy(t => t.RegisterTime) : data.OrderByDescending(t => t.RegisterTime);
break; break;
case "ApprovedTime": case "ApprovedTime":
data = Order == "asc" ? data.OrderBy(t => t.ApprovedTime) : data.OrderByDescending(t => t.ApprovedTime); data = Order == "asc" ? data.OrderBy(t => t.ApprovedTime) : data.OrderByDescending(t => t.ApprovedTime);
break; break;
case "ApprovedBy": case "ApprovedBy":
data = Order == "asc" ? data.OrderBy(t => t.ApprovedBy) : data.OrderByDescending(t => t.ApprovedBy); data = Order == "asc" ? data.OrderBy(t => t.ApprovedBy) : data.OrderByDescending(t => t.ApprovedBy);
break; break;
default: default:
break; break;
} }
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
} }
} }

View File

@ -0,0 +1,76 @@
using Bootstrap.Security.Filter;
using Bootstrap.Security.Middleware;
using Longbow.Cache;
using Longbow.Cache.Middleware;
using Longbow.Configuration;
using Longbow.Data;
using Longbow.Logging;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Serialization;
using System;
using System.IO;
namespace Bootstrap.Admin
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddLogging(builder => builder.AddFileLogger());
services.AddConfigurationManager();
services.AddCacheManager();
services.AddDBAccessFactory();
services.AddDataProtection(op => op.ApplicationDiscriminator = "BootstrapAdmin")
.SetApplicationName("__bd__")
.DisableAutomaticKeyGeneration()
.PersistKeysToFileSystem(new DirectoryInfo(ConfigurationManager.AppSettings["KeyPath"]));
services.AddMvc(options =>
{
options.Filters.Add<BootstrapAdminAuthorizeFilter>();
options.Filters.Add<BootstrapAdminExceptionFilter>();
}).AddJsonOptions(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
});
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseAuthentication();
app.UseCacheManagerCorsHandler();
app.UseBootstrapRoleAuthorization();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}

View File

@ -0,0 +1,17 @@
@{
ViewBag.Title = "未授权请求";
Layout = "~/Views/Shared/_Root.cshtml";
}
@section css {
<link href="~/css/error.css" rel="stylesheet" />
}
@section Javascript {
<script src="~/js/error.js"></script>
}
<section class="error-wrapper">
<img src="~/images/error_icon.png" />
<h1>网页拒绝访问</h1>
<h3>您无权访问本页面请联系网站管理员授权后再查看</h3>
<br />
<a href="~/Home/Index" target="_top">返回首页</a>
</section>

View File

@ -0,0 +1,21 @@
@model Bootstrap.Admin.Models.ModelBase
@{
ViewBag.Title = Model.Title;
Layout = "~/Views/Shared/_Root.cshtml";
}
@section css {
<link href="~/css/bootstrap.css" rel="stylesheet">
<link href="~/css/login.css" rel="stylesheet" />
}
@section javascript {
<script src="~/js/bootstrap.js"></script>
<script src="~/js/Longbow.Common.js"></script>
<script src="~/js/jquery.validate.js"></script>
<script src="~/js/messages_zh.js"></script>
<script src="~/js/Login.js"></script>
}
<div class="container">
<form id="login" method="post">
@Html.Partial("SignIn")
</form>
</div>

View File

@ -0,0 +1,22 @@
@model Bootstrap.Admin.Models.ModelBase
@{
ViewBag.Title = Model.Title;
Layout = "~/Views/Shared/_Root.cshtml";
}
@section css {
<link href="~/css/bootstrap.css" rel="stylesheet">
<link href="~/css/loginm.css" rel="stylesheet" />
}
@section javascript {
<script src="~/js/bootstrap.js"></script>
<script src="~/js/Longbow.Common.js"></script>
<script src="~/js/jquery.validate.js"></script>
<script src="~/js/messages_zh.js"></script>
<script src="~/js/Login.js"></script>
}
<div class="container">
<form id="login" class="form-signin" method="post">
@Html.Partial("SignIn")
</form>
</div>

View File

@ -1,18 +1,18 @@
@{ @{
ViewBag.Title = "客户端测试"; ViewBag.Title = "客户端测试";
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml";
} }
@section css { @section css {
<style type="text/css"> <style type="text/css">
label { label {
word-break: break-all; word-break: break-all;
} }
section { section {
padding-top: 15px; padding-top: 15px;
} }
</style> </style>
} }
<section class="container-fluid"> <section class="container-fluid">
@Html.Partial("_Mobile") @Html.Partial("_Mobile")
</section> </section>

View File

@ -1,107 +1,107 @@
@{ @{
ViewBag.Title = "注册新用户"; ViewBag.Title = "注册新用户";
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml";
} }
@section css { @section css {
<link href="~/Content/register.css" rel="stylesheet" /> <link href="~/css/register.css" rel="stylesheet" />
} }
@section javascript { @section javascript {
<script src="~/Scripts/jquery.validate.js"></script> <script src="~/js/jquery.validate.js"></script>
<script src="~/Scripts/messages_zh.js"></script> <script src="~/js/messages_zh.js"></script>
<script src="~/Scripts/sweetalert.js"></script> <script src="~/js/sweetalert.js"></script>
<script src="~/Scripts/register.js"></script> <script src="~/js/register.js"></script>
} }
<div class="container"> <div class="container">
<div class="setup-wrapper"> <div class="setup-wrapper">
<header><h2>新用户注册</h2></header> <header><h2>新用户注册</h2></header>
<div class="setup-header"> <div class="setup-header">
<ol class="steps"> <ol class="steps">
<li class="current"> <li class="current">
<strong class="step">步骤 1:</strong><span>创建一个账号</span> <strong class="step">步骤 1:</strong><span>创建一个账号</span>
</li> </li>
<li> <li>
<strong class="step">步骤 2:</strong><span>确认信息</span> <strong class="step">步骤 2:</strong><span>确认信息</span>
</li> </li>
</ol> </ol>
</div> </div>
<form autocomplete="off" id="signup-form" method="post"> <form autocomplete="off" id="signup-form" method="post">
<div class="setup-main"> <div class="setup-main">
<div class="setup-form-container"> <div class="setup-form-container">
<h3 class="setup-form-title mb-3"> <h3 class="setup-form-title mb-3">
创建您的账号 创建您的账号
</h3> </h3>
<div class="form-group"> <div class="form-group">
<label for="userName">登陆账号:</label> <label for="userName">登陆账号:</label>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">@@</span> <span class="input-group-addon">@@</span>
<input type="text" id="userName" name="userName" class="form-control" placeholder="登陆账号" value="" autofocus maxlength="50" /> <input type="text" id="userName" name="userName" class="form-control" placeholder="登陆账号" value="" autofocus maxlength="50" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="displayName">显示名称:</label> <label for="displayName">显示名称:</label>
<div class="input-group"> <div class="input-group">
<span class="glyphicon glyphicon-user input-group-addon"></span> <span class="glyphicon glyphicon-user input-group-addon"></span>
<input type="text" id="displayName" name="displayName" class="form-control" value="" placeholder="显示名称" maxlength="50" /> <input type="text" id="displayName" name="displayName" class="form-control" value="" placeholder="显示名称" maxlength="50" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password">密码:</label> <label for="password">密码:</label>
<div class="input-group"> <div class="input-group">
<span class="glyphicon glyphicon-lock input-group-addon"></span> <span class="glyphicon glyphicon-lock input-group-addon"></span>
<input type="password" id="password" name="password" class="form-control" value="" placeholder="密码" maxlength="50" /> <input type="password" id="password" name="password" class="form-control" value="" placeholder="密码" maxlength="50" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="assurePassword">确认密码:</label> <label for="assurePassword">确认密码:</label>
<div class="input-group"> <div class="input-group">
<span class="glyphicon glyphicon-lock input-group-addon"></span> <span class="glyphicon glyphicon-lock input-group-addon"></span>
<input type="password" id="assurePassword" name="assurePassword" class="form-control" value="" placeholder="确认密码" maxlength="50" /> <input type="password" id="assurePassword" name="assurePassword" class="form-control" value="" placeholder="确认密码" maxlength="50" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="description">申请理由:</label> <label for="description">申请理由:</label>
<div class="input-group"> <div class="input-group">
<span class="glyphicon glyphicon-certificate input-group-addon"></span> <span class="glyphicon glyphicon-certificate input-group-addon"></span>
<textarea id="description" name="description" class="form-control" placeholder="申请理由500字以内" rows="6" maxlength="500"></textarea> <textarea id="description" name="description" class="form-control" placeholder="申请理由500字以内" rows="6" maxlength="500"></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<button id="btnAccount" class="btn btn-primary pull-right" type="button">继续</button> <button id="btnAccount" class="btn btn-primary pull-right" type="button">继续</button>
</div> <!-- /.setup-form-container --> </div> <!-- /.setup-form-container -->
</div> </div>
</div> </div>
<div class="setup-confirm"> <div class="setup-confirm">
<h3>您注册的信息如下:</h3> <h3>您注册的信息如下:</h3>
<div class="form-group"> <div class="form-group">
<label>登陆账号:</label><span id="loginID" class="form-control-static"></span> <label>登陆账号:</label><span id="loginID" class="form-control-static"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>显示名称:</label><span id="loginName" class="form-control-static"></span> <label>显示名称:</label><span id="loginName" class="form-control-static"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>申请理由:</label><span id="loginDesc" class="form-control-static"></span> <label>申请理由:</label><span id="loginDesc" class="form-control-static"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<button id="btnPrev" class="btn btn-default" type="button">上一步</button> <button id="btnPrev" class="btn btn-default" type="button">上一步</button>
<button id="btnSubmit" class="btn btn-primary pull-right" type="submit">确认并提交</button> <button id="btnSubmit" class="btn btn-primary pull-right" type="submit">确认并提交</button>
</div> </div>
</div> </div>
</form> </form>
<div class="setup-secondary"> <div class="setup-secondary">
<div class="setup-info-module"> <div class="setup-info-module">
<h4>欢迎加入本系统</h4> <h4>欢迎加入本系统</h4>
<ul class="features-list"> <ul class="features-list">
<li><strong>Unlimited</strong> 特性一</li> <li><strong>Unlimited</strong> 特性一</li>
<li><strong>Unlimited</strong> 特性二</li> <li><strong>Unlimited</strong> 特性二</li>
<li><strong>Unlimited</strong> 特性三</li> <li><strong>Unlimited</strong> 特性三</li>
<li><strong>Unlimited</strong> 特性四</li> <li><strong>Unlimited</strong> 特性四</li>
<li class="list-divider"></li> <li class="list-divider"></li>
<li><i class="glyphicon glyphicon-ok"></i> 优点一</li> <li><i class="glyphicon glyphicon-ok"></i> 优点一</li>
<li><i class="glyphicon glyphicon-ok"></i> 优点二</li> <li><i class="glyphicon glyphicon-ok"></i> 优点二</li>
<li><i class="glyphicon glyphicon-ok"></i> 优点三</li> <li><i class="glyphicon glyphicon-ok"></i> 优点三</li>
<li><i class="glyphicon glyphicon-ok"></i> 优点四</li> <li><i class="glyphicon glyphicon-ok"></i> 优点四</li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,24 @@
@model Bootstrap.Admin.Models.ModelBase
<h2 class="form-signin-heading">@Model.Title</h2>
<div class="login-wrap">
<div class="form-group">
<div class="input-group">
<span class="glyphicon glyphicon-user input-group-addon"></span>
<input type="text" name="userName" class="form-control" placeholder="用户名" value="" autofocus />
</div>
</div>
<div class="form-group">
<div class="input-group">
<span class="glyphicon glyphicon-lock input-group-addon"></span>
<input type="password" name="password" class="form-control" value="" placeholder="密码" />
</div>
</div>
<div class="checkbox">
<input id="remember" name="remember" type="checkbox" value="true" /><label for="remember">记住我</label>
</div>
<button class="btn btn-lg btn-login btn-block" type="submit">登 陆</button>
<div class="login-footer">
<div class="login-create"><a href="Register">申请账号</a></div>
<div class="login-reset"><a href="#">忘记密码</a></div>
</div>
</div>

View File

@ -1,13 +1,13 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "Api 文档"; ViewBag.Title = "Api 文档";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section javascript { @section javascript {
<script src="~/Scripts/apidoc.js"></script> <script src="~/js/apidoc.js"></script>
} }
@section css { @section css {
<link href="~/Content/api.css" rel="stylesheet" /> <link href="~/css/api.css" rel="stylesheet" />
} }
<section> <section>
<div><h3>接口返回值定义</h3></div> <div><h3>接口返回值定义</h3></div>

View File

@ -1,11 +1,11 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "字典表维护"; ViewBag.Title = "字典表维护";
Layout = "~/Views/Shared/_Default.cshtml"; Layout = "~/Views/Shared/_Default.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/bootstrap3-typeahead.js"></script> <script src="~/js/bootstrap3-typeahead.js"></script>
<script src="~/scripts/Dicts.js"></script> <script src="~/js/Dicts.js"></script>
} }
@section query { @section query {
<form class="form-inline" role="form"> <form class="form-inline" role="form">
@ -54,7 +54,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal" id="dataForm" name="dataForm" role="form"> <form class="form-horizontal" id="dataForm" name="dataForm" role="form">
<input type="text" class="form-control hidden" id="dictID" name="dictID" /> <input type="text" class="form-control hidden" id="dictID" name="dictID" data-default-val="0" />
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="dictCate">字典标签</label> <label class="control-label col-sm-2" for="dictCate">字典标签</label>
<div class="col-sm-10"> <div class="col-sm-10">

View File

@ -1,20 +1,20 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "程序异常"; ViewBag.Title = "程序异常";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section css { @section css {
<link href="~/Content/bootstrap-table.css" rel="stylesheet" /> <link href="~/css/bootstrap-table.css" rel="stylesheet" />
<link href="~/Content/bootstrap-datetimepicker.css" rel="stylesheet" /> <link href="~/css/bootstrap-datetimepicker.css" rel="stylesheet" />
<link href="~/Content/fa.css" rel="stylesheet" /> <link href="~/css/fa.css" rel="stylesheet" />
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/bootstrap-table.js"></script> <script src="~/js/bootstrap-table.js"></script>
<script src="~/Scripts/bootstrap-table-zh-CN.js"></script> <script src="~/js/bootstrap-table-zh-CN.js"></script>
<script src="~/Scripts/longbow.dataentity.js"></script> <script src="~/js/longbow.dataentity.js"></script>
<script src="~/Scripts/bootstrap-datetimepicker.js"></script> <script src="~/js/bootstrap-datetimepicker.js"></script>
<script src="~/Scripts/bootstrap-datetimepicker.zh-CN.js"></script> <script src="~/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="~/scripts/Exceptions.js"></script> <script src="~/js/Exceptions.js"></script>
} }
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">查询条件</div> <div class="panel-heading">查询条件</div>

View File

@ -1,12 +1,12 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "图标集"; ViewBag.Title = "图标集";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section css { @section css {
<link href="~/Content/fa.css" rel="stylesheet" /> <link href="~/css/fa.css" rel="stylesheet" />
} }
@section javascript { @section javascript {
<script src="~/Scripts/icon.js"></script> <script src="~/js/icon.js"></script>
} }
@Html.Partial("IconView") @Html.Partial("IconView")

View File

@ -1,10 +1,10 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "部门管理"; ViewBag.Title = "部门管理";
Layout = "~/Views/Shared/_Default.cshtml"; Layout = "~/Views/Shared/_Default.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/scripts/Groups.js"></script> <script src="~/js/Groups.js"></script>
} }
@section query { @section query {
<form class="form-inline" role="form"> <form class="form-inline" role="form">

View File

@ -1,19 +1,19 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "系统日志"; ViewBag.Title = "系统日志";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section css { @section css {
<link href="~/Content/bootstrap-table.css" rel="stylesheet" /> <link href="~/css/bootstrap-table.css" rel="stylesheet" />
<link href="~/Content/bootstrap-datetimepicker.css" rel="stylesheet" /> <link href="~/css/bootstrap-datetimepicker.css" rel="stylesheet" />
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/bootstrap-table.js"></script> <script src="~/js/bootstrap-table.js"></script>
<script src="~/Scripts/bootstrap-table-zh-CN.js"></script> <script src="~/js/bootstrap-table-zh-CN.js"></script>
<script src="~/Scripts/longbow.dataentity.js"></script> <script src="~/js/longbow.dataentity.js"></script>
<script src="~/Scripts/bootstrap-datetimepicker.js"></script> <script src="~/js/bootstrap-datetimepicker.js"></script>
<script src="~/Scripts/bootstrap-datetimepicker.zh-CN.js"></script> <script src="~/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="~/scripts/Logs.js"></script> <script src="~/js/Logs.js"></script>
} }
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">查询条件</div> <div class="panel-heading">查询条件</div>

View File

@ -1,15 +1,15 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "菜单管理"; ViewBag.Title = "菜单管理";
Layout = "~/Views/Shared/_Default.cshtml"; Layout = "~/Views/Shared/_Default.cshtml";
} }
@section css { @section css {
<link href="~/Content/fa.css" rel="stylesheet" /> <link href="~/css/fa.css" rel="stylesheet" />
<link href="~/Content/jquery.nestable.css" rel="stylesheet" /> <link href="~/css/jquery.nestable.css" rel="stylesheet" />
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/jquery.nestable.js"></script> <script src="~/js/jquery.nestable.js"></script>
<script src="~/scripts/Menus.js"></script> <script src="~/js/Menus.js"></script>
} }
@section query { @section query {
<form class="form-inline" role="form"> <form class="form-inline" role="form">

View File

@ -1,16 +1,16 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "站内消息"; ViewBag.Title = "站内消息";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/message.js"></script> <script src="~/js/message.js"></script>
} }
<div class="mail-box"> <div class="mail-box">
<div class="sm-side"> <div class="sm-side">
<div class="user-head"> <div class="user-head">
<a href="javascript:;" class="inbox-avatar"> <a href="javascript:;" class="inbox-avatar">
<img src="../content/images/logo6.jpg" alt=""> <img src="../images/logo6.jpg" alt="">
</a> </a>
<div class="user-name"><h5><a href="#">@Model.DisplayName</a></h5></div> <div class="user-name"><h5><a href="#">@Model.DisplayName</a></h5></div>
</div> </div>

View File

@ -1,4 +1,5 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.ModelBase
NavigatorBarModel
@{ @{
ViewBag.Title = "客户端测试"; ViewBag.Title = "客户端测试";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";

View File

@ -1,13 +1,13 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "通知管理"; ViewBag.Title = "通知管理";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/noti.js"></script> <script src="~/js/noti.js"></script>
} }
@section css { @section css {
<link href="~/Content/tasks.css" rel="stylesheet" /> <link href="~/css/tasks.css" rel="stylesheet" />
} }
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">用户注册<span class="pull-right"><a id="refreshUsers" href="javascript:;" class="fa fa-refresh" title="点击刷新" role="tooltip" data-placement="left"></a></span></div> <div class="panel-heading">用户注册<span class="pull-right"><a id="refreshUsers" href="javascript:;" class="fa fa-refresh" title="点击刷新" role="tooltip" data-placement="left"></a></span></div>

View File

@ -1,19 +1,19 @@
@model ProfilesModel @model Bootstrap.Admin.Models.ProfilesModel
@{ @{
ViewBag.Title = "个人中心"; ViewBag.Title = "个人中心";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/longbow.dataentity.js"></script> <script src="~/js/longbow.dataentity.js"></script>
<script src="~/Scripts/fileinput.js"></script> <script src="~/js/fileinput.js"></script>
<script src="~/Scripts/fileinput.zh.js"></script> <script src="~/js/fileinput.zh.js"></script>
<script src="~/Scripts/jquery.validate.js"></script> <script src="~/js/jquery.validate.js"></script>
<script src="~/Scripts/messages_zh.js"></script> <script src="~/js/messages_zh.js"></script>
<script src="~/scripts/Profiles.js"></script> <script src="~/js/Profiles.js"></script>
} }
@section css { @section css {
<link href="~/Content/tasks.css" rel="stylesheet" /> <link href="~/css/tasks.css" rel="stylesheet" />
<link href="~/Content/fileinput.css" rel="stylesheet" /> <link href="~/css/fileinput.css" rel="stylesheet" />
} }
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">基本资料</div> <div class="panel-heading">基本资料</div>
@ -31,7 +31,7 @@
</div> </div>
</form> </form>
<div class="modal-footer"> <div class="modal-footer">
<button id="btnSaveDisplayName" class="btn btn-default" type="button" disabled data-admin="@LgbPrincipal.IsWebAdmin(User.Identity.Name)"><i class="fa fa-save"></i><span>保存</span></button> <button id="btnSaveDisplayName" class="btn btn-default" type="button" disabled data-admin="@User.IsInRole("Administrators")"><i class="fa fa-save"></i><span>保存</span></button>
</div> </div>
</div> </div>
</div> </div>
@ -57,14 +57,14 @@
</div> </div>
</form> </form>
<div class="modal-footer"> <div class="modal-footer">
<button id="btnSavePassword" class="btn btn-default" type="button" disabled data-admin="@LgbPrincipal.IsWebAdmin(User.Identity.Name)"><i class="fa fa-save"></i><span>保存</span></button> <button id="btnSavePassword" class="btn btn-default" type="button" disabled data-admin="@User.IsInRole("Administrators")"><i class="fa fa-save"></i><span>保存</span></button>
</div> </div>
</div> </div>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">网站皮肤</div> <div class="panel-heading">网站皮肤</div>
<div class="panel-body"> <div class="panel-body">
<form id="infoDataForm" name="cssDataForm" class="form-inline" role="form"> <form id="cssDataForm" name="cssDataForm" class="form-inline" role="form">
<div class="row"> <div class="row">
<div class="form-group col-xs-12"> <div class="form-group col-xs-12">
<label class="control-label" for="userName">样式</label> <label class="control-label" for="userName">样式</label>
@ -86,7 +86,7 @@
</div> </div>
</form> </form>
<div class="modal-footer"> <div class="modal-footer">
<button id="btnSaveCss" class="btn btn-default" type="button" disabled data-admin="@LgbPrincipal.IsWebAdmin(User.Identity.Name)"><i class="fa fa-save"></i><span>保存</span></button> <button id="btnSaveCss" class="btn btn-default" type="button" disabled data-admin="@User.IsInRole("Administrators")"><i class="fa fa-save"></i><span>保存</span></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,15 +1,15 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "角色管理"; ViewBag.Title = "角色管理";
Layout = "~/Views/Shared/_Default.cshtml"; Layout = "~/Views/Shared/_Default.cshtml";
} }
@section css { @section css {
<link href="~/Content/fa.css" rel="stylesheet" /> <link href="~/css/fa.css" rel="stylesheet" />
<link href="~/Content/jquery.nestable.css" rel="stylesheet" /> <link href="~/css/jquery.nestable.css" rel="stylesheet" />
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/jquery.nestable.js"></script> <script src="~/js/jquery.nestable.js"></script>
<script src="~/scripts/Roles.js"></script> <script src="~/js/Roles.js"></script>
} }
@section query { @section query {

View File

@ -1,16 +1,16 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "网站设置"; ViewBag.Title = "网站设置";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/longbow.dataentity.js"></script> <script src="~/js/longbow.dataentity.js"></script>
<script src="~/Scripts/jquery.validate.js"></script> <script src="~/js/jquery.validate.js"></script>
<script src="~/Scripts/messages_zh.js"></script> <script src="~/js/messages_zh.js"></script>
<script src="~/Scripts/Settings.js"></script> <script src="~/js/Settings.js"></script>
} }
@section css { @section css {
<link href="~/Content/tasks.css" rel="stylesheet" /> <link href="~/css/tasks.css" rel="stylesheet" />
} }
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">系统名称设置</div> <div class="panel-heading">系统名称设置</div>
@ -61,7 +61,7 @@
</div> </div>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">网站缓存<a id="clearCache" href="#" class="clearcache fa fa-times-circle-o" data-admin="@LgbPrincipal.IsAdmin(User)" title="全部清除(WebAdmin可用)" role="tooltip" data-placement="left"></a><a id="refreshCache" href="#" class="pull-right fa fa-refresh" title="点击刷新" role="tooltip"></a></div> <div class="panel-heading">网站缓存<a id="clearCache" href="#" class="clearcache fa fa-times-circle-o" data-admin="@User.IsInRole("Administrators")" title="全部清除(WebAdmin可用)" role="tooltip" data-placement="left"></a><a id="refreshCache" href="#" class="pull-right fa fa-refresh" title="点击刷新" role="tooltip"></a></div>
<div class="panel-body"> <div class="panel-body">
<div class="tasks-widget"> <div class="tasks-widget">
<ul id="sortable" class="task-list ui-sortable"></ul> <ul id="sortable" class="task-list ui-sortable"></ul>

View File

@ -1,13 +1,13 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "任务管理"; ViewBag.Title = "任务管理";
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/Scripts/tasks.js"></script> <script src="~/js/tasks.js"></script>
} }
@section css { @section css {
<link href="~/Content/tasks.css" rel="stylesheet" /> <link href="~/css/tasks.css" rel="stylesheet" />
} }
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">任务消息<span class="pull-right"><a id="refreshTask" href="javascript:;" class="fa fa-refresh"></a></span></div> <div class="panel-heading">任务消息<span class="pull-right"><a id="refreshTask" href="javascript:;" class="fa fa-refresh"></a></span></div>

View File

@ -1,10 +1,10 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
@{ @{
ViewBag.Title = "用户管理"; ViewBag.Title = "用户管理";
Layout = "~/Views/Shared/_Default.cshtml"; Layout = "~/Views/Shared/_Default.cshtml";
} }
@section Javascript { @section Javascript {
<script src="~/scripts/Users.js"></script> <script src="~/js/Users.js"></script>
} }
@section query { @section query {
<form class="form-inline" role="form"> <form class="form-inline" role="form">

View File

@ -1,4 +1,4 @@
@model HeaderBarModel @model Bootstrap.Admin.Models.HeaderBarModel
@{ @{
ViewBag.Title = "首页"; ViewBag.Title = "首页";
Layout = "~/Views/Shared/_Normal.cshtml"; Layout = "~/Views/Shared/_Normal.cshtml";
@ -11,7 +11,7 @@
</style> </style>
} }
@section javascript { @section javascript {
<script src="~/Scripts/Content.js"></script> <script src="~/js/Content.js"></script>
} }
<div id="content" class="content-body welcome-bg"> <div id="content" class="content-body welcome-bg">
</div> </div>

View File

@ -1,20 +1,20 @@
@model LockModel @model Bootstrap.Admin.Models.LockModel
@{ @{
ViewBag.Title = "系统登陆"; ViewBag.Title = "系统登陆";
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml";
} }
@section css { @section css {
<link href="~/Content/lock.css" rel="stylesheet" /> <link href="~/css/lock.css" rel="stylesheet" />
} }
@section javascript { @section javascript {
<script src="~/Scripts/jquery.validate.js"></script> <script src="~/js/jquery.validate.js"></script>
<script src="~/Scripts/messages_zh.js"></script> <script src="~/js/messages_zh.js"></script>
<script src="~/Scripts/lock.js"></script> <script src="~/js/lock.js"></script>
} }
<div class="lock-wrapper"> <div class="lock-wrapper">
<div id="time"></div> <div id="time"></div>
<div class="lock-box text-center"> <div class="lock-box text-center">
<img alt="lock avatar" src="~/content/images/logo2.jpg" /> <img alt="lock avatar" src="~/images/logo2.jpg" />
<h1>@Model.DisplayName</h1> <h1>@Model.DisplayName</h1>
<span class="locked">系统已锁定</span> <span class="locked">系统已锁定</span>
<form role="form" class="form-inline" method="post" autocomplete="off" action="~/Home/Login?ReturnUrl=@Model.ReturnUrl"> <form role="form" class="form-inline" method="post" autocomplete="off" action="~/Home/Login?ReturnUrl=@Model.ReturnUrl">

View File

@ -1,41 +0,0 @@
@model LoginModel
@{
ViewBag.Title = Model.Title;
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section css {
<link href="~/Content/login.css" rel="stylesheet" />
<link href="~/Content/login-responsive.css" rel="stylesheet" />
}
@section javascript {
<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/messages_zh.js"></script>
<script src="~/Scripts/Login.js"></script>
}
<div class="container">
<form id="login" class="form-signin" method="post">
<h2 class="form-signin-heading">@Model.Title</h2>
<div class="login-wrap">
<div class="form-group">
<div class="input-group">
<span class="glyphicon glyphicon-user input-group-addon"></span>
<input type="text" name="userName" class="form-control" placeholder="用户名" value="@Model.UserName" autofocus />
</div>
</div>
<div class="form-group">
<div class="input-group">
<span class="glyphicon glyphicon-lock input-group-addon"></span>
<input type="password" name="password" class="form-control" value="@Model.Password" placeholder="密码" />
</div>
</div>
<div class="checkbox">
<input id="remember" name="remember" type="checkbox" checked value="true" /><label for="remember">记住我</label>
</div>
<button class="btn btn-lg btn-login btn-block" type="submit">登 陆</button>
<div class="login-footer">
<div class="login-create"><a href="Register">申请注册</a></div>
<div class="login-reset"><a href="#">忘记密码</a></div>
</div>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
@model HeaderBarModel @model Bootstrap.Admin.Models.HeaderBarModel
<footer class="site-footer"> <footer class="site-footer">
<div class="text-center"> <div class="text-center">
<span id="websiteFooter">@Model.Footer</span> <span id="websiteFooter">@Model.Footer</span>

View File

@ -1,4 +1,4 @@
@model HeaderBarModel @model Bootstrap.Admin.Models.HeaderBarModel
<header class="header"> <header class="header">
<div class="bg"> <div class="bg">
</div> </div>
@ -6,7 +6,7 @@
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
<span id="websiteTitle">@Model.Title</span> <span id="websiteTitle">@Model.Title</span>
</a> </a>
@if (LgbPrincipal.IsAdmin(User)) @if (User.IsInRole("Administrators"))
{ {
<ul class="notify-row"> <ul class="notify-row">
<!-- tasks start --> <!-- tasks start -->

View File

@ -1,4 +1,4 @@
@model NavigatorBarModel @model Bootstrap.Admin.Models.NavigatorBarModel
<aside> <aside>
<div id="sidebar" class="nav-collapse sidebar"> <div id="sidebar" class="nav-collapse sidebar">
<!-- sidebar menu start--> <!-- sidebar menu start-->

View File

@ -15,7 +15,7 @@
} }
.error-wrapper .icon-500 { .error-wrapper .icon-500 {
background: url(content/images/error_icon.png) no-repeat; background: url(/images/error_icon.png) no-repeat;
width: 289px; width: 289px;
height: 274px; height: 274px;
display: inline-block; display: inline-block;

View File

@ -2,27 +2,27 @@
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml";
} }
@section css { @section css {
<link href="~/Content/sweetalert.css" rel="stylesheet" /> <link href="~/css/sweetalert.css" rel="stylesheet" />
<link href="~/Content/toastr.css" rel="stylesheet" /> <link href="~/css/toastr.css" rel="stylesheet" />
<link href="~/Content/admin.css" rel="stylesheet" /> <link href="~/css/admin.css" rel="stylesheet" />
<link href="~/Content/admin-responsive.css" rel="stylesheet" /> <link href="~/css/admin-responsive.css" rel="stylesheet" />
@RenderSection("css", false) @RenderSection("css", false)
} }
@section javascript { @section javascript {
<script src="~/Scripts/sweetalert.js"></script> <script src="~/js/sweetalert.js"></script>
<script src="~/Scripts/jquery.dcjqaccordion.2.7.js"></script> <script src="~/js/jquery.dcjqaccordion.2.7.js"></script>
<script src="~/Scripts/jquery.scrollTo.js"></script> <script src="~/js/jquery.scrollTo.js"></script>
<script src="~/Scripts/jquery.nicescroll.min.js"></script> <script src="~/js/jquery.nicescroll.min.js"></script>
<script src="~/Scripts/common-scripts.js"></script> <script src="~/js/common-scripts.js"></script>
<script src="~/Scripts/log.js"></script> <script src="~/js/log.js"></script>
<script src="~/Scripts/toastr.min.js"></script> <script src="~/js/toastr.min.js"></script>
<script src="~/Scripts/framework.js"></script> <script src="~/js/framework.js"></script>
@RenderSection("Javascript", false) @RenderSection("Javascript", false)
} }
@Html.Partial("Header")
@Html.Partial("navigator") @Html.Partial("navigator")
<section id="main-content" class="main-content"> <section id="main-content" class="main-content">
@RenderBody() @RenderBody()
</section> </section>
@Html.Partial("Footer") @section modal {
@RenderSection("modal", false) @RenderSection("modal", false)
}

View File

@ -2,15 +2,15 @@
Layout = "~/Views/Shared/_Admin.cshtml"; Layout = "~/Views/Shared/_Admin.cshtml";
} }
@section css { @section css {
<link href="~/Content/bootstrap-table.css" rel="stylesheet" /> <link href="~/css/bootstrap-table.css" rel="stylesheet" />
@RenderSection("css", false) @RenderSection("css", false)
} }
@section javascript { @section javascript {
<script src="~/Scripts/longbow.dataentity.js"></script> <script src="~/js/longbow.dataentity.js"></script>
<script src="~/Scripts/bootstrap-table.js"></script> <script src="~/js/bootstrap-table.js"></script>
<script src="~/Scripts/bootstrap-table-zh-CN.js"></script> <script src="~/js/bootstrap-table-zh-CN.js"></script>
<script src="~/Scripts/jquery.validate.js"></script> <script src="~/js/jquery.validate.js"></script>
<script src="~/Scripts/messages_zh.js"></script> <script src="~/js/messages_zh.js"></script>
@RenderSection("Javascript", false) @RenderSection("Javascript", false)
} }
@section modal { @section modal {

View File

@ -1,37 +1,23 @@
<!DOCTYPE html> @{
<html lang="zh-cn"> Layout = "~/Views/Shared/_Root.cshtml";
<head> }
<meta charset="utf-8"> @section css {
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <link href="~/css/bootstrap.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1"> <link href="~/css/bootstrap-theme.css" rel="stylesheet">
<title>@ViewBag.Title</title> <link href="~/css/nprogress.css" rel="stylesheet" />
<link rel="shortcut icon" href="~/favicon.ico" /> <link href="~/css/font-awesome.css" rel="stylesheet" />
<!-- 新 Bootstrap 核心 CSS 文件 --> <link href="~/css/site.css" rel="stylesheet" />
<link href="~/Content/bootstrap.css" rel="stylesheet"> <link href="~/css/site-responsive.css" rel="stylesheet" />
<link href="~/Content/bootstrap-theme.css" rel="stylesheet">
<link href="~/Content/nprogress.css" rel="stylesheet" />
<link href="~/Content/font-awesome.css" rel="stylesheet" />
<link href="~/Content/site.css" rel="stylesheet" />
<link href="~/Content/site-responsive.css" rel="stylesheet" />
<!--[if lt IE 9 ]>
<link href="../Content/IE8.css" rel="stylesheet" />
<![endif]-->
@RenderSection("css", false) @RenderSection("css", false)
</head> }
<body> @section javascript {
<!--[if lt IE 9 ]> <script src="~/js/bootstrap.js"></script>
<div id="ieAlert" class="alert alert-danger alert-dismissible"> <script src="~/js/nprogress.js"></script>
<div>你的浏览器版本太低不能完美的支持本系统请升级到至少IE9 <a href="../IE/IE9.exe" target="_blank">速速点击下载</a> <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">微软官方下载</a> </div> <script src="~/js/Longbow.Common.js"></script>
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
</div>
<![endif]-->
@RenderBody()
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="~/Scripts/jquery-3.1.1.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="~/Scripts/bootstrap.js"></script>
<script src="~/Scripts/nprogress.js"></script>
<script src="~/Scripts/Longbow.Common.js"></script>
@RenderSection("Javascript", false) @RenderSection("Javascript", false)
</body> }
</html> <a id="pathBase" href="~/" class="hidden"></a>
@Html.Partial("Header")
@RenderBody()
@Html.Partial("Footer")
@RenderSection("modal", false)

View File

@ -2,16 +2,13 @@
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml";
} }
@section css { @section css {
<link href="~/Content/bootstrap-table.css" rel="stylesheet" /> <link href="~/css/bootstrap-table.css" rel="stylesheet" />
<link href="~/Content/sweetalert.css" rel="stylesheet" /> <link href="~/css/sweetalert.css" rel="stylesheet" />
@RenderSection("css", false) @RenderSection("css", false)
} }
@section javascript { @section javascript {
@RenderSection("Javascript", false) @RenderSection("Javascript", false)
} }
@Html.Partial("Header")
<section id="main-content"> <section id="main-content">
@RenderBody() @RenderBody()
</section> </section>
@Html.Partial("Footer")
@RenderSection("modal", false)

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@ViewBag.Title</title>
@RenderSection("css", false)
<!--[if lt IE 10 ]>
<link href="../css/IE8.css" rel="stylesheet" />
<![endif]-->
</head>
<body>
<!--[if lt IE 10 ]>
<div id="ieAlert" class="alert alert-danger alert-dismissible">
<div>你的浏览器版本太低不能完美的支持本系统请升级到至少IE10 <a href="../IE/IE10.exe" target="_blank">本地下载</a> <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">微软下载</a>或者使用Chrome浏览器 <a href="../Software/ChromeSetup.exe" target="_blank">本地下载</a></div>
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
</div>
<![endif]-->
@RenderBody()
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="~/js/jquery-3.1.1.js"></script>
@RenderSection("Javascript", false)
</body>
</html>

View File

@ -0,0 +1,2 @@
@using Bootstrap.Admin.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@ -1,3 +1,3 @@
@{ @{
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "_Layout";
} }

View File

@ -1,46 +0,0 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="Longbow.Security.Principal" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="Bootstrap.Admin" />
<add namespace="Bootstrap.DataAccess" />
<add namespace="Bootstrap.Admin.Models" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
</configuration>

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<connectionStrings>
<add name="SQL"
connectionString="Data Source=.;Initial Catalog=BootstrapAdmin;User ID=ba;Password=ba20171231"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
<add name="ba"
connectionString="Data Source=.;Initial Catalog=BootstrapAdmin;User ID=ba;Password=ba20171231"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<cacheManagerList>
<add key="bd" url="http://118.244.234.207:8082/BA/CacheList.axd?cacheKey={0}" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
<add key="cps" url="http://118.244.234.207:8082/CPS/CacheList.axd?cacheKey={0}" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</cacheManagerList>
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
-->
<connectionStrings>
<add name="SQL"
connectionString="Data Source=.;Initial Catalog=BootstrapAdmin;User ID=ba;Password=ba20171231"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
<add name="ba"
connectionString="Data Source=.;Initial Catalog=BootstrapAdmin;User ID=ba;Password=ba20171231"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<cacheManagerList>
<add key="bd" url="http://118.244.234.207:8080/BA/CacheList.axd?cacheKey={0}" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
<add key="bccs" url="http://118.244.234.207:8080/CPS/CacheList.axd?cacheKey={0}" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</cacheManagerList>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

View File

@ -34,12 +34,17 @@
<add key="BootstrapDict-RetrieveDicts" interval="600" desc="所有字典数据缓存" /> <add key="BootstrapDict-RetrieveDicts" interval="600" desc="所有字典数据缓存" />
<add key="BootstrapUser-RetrieveUsers" interval="600" desc="所有用户数据缓存" /> <add key="BootstrapUser-RetrieveUsers" interval="600" desc="所有用户数据缓存" />
<add key="BootstrapUser-RetrieveUsersByName" interval="600" desc="指定用户数据缓存" /> <add key="BootstrapUser-RetrieveUsersByName" interval="600" desc="指定用户数据缓存" />
<add key="BootstrapUser-RetrieveUsersByRoleId" interval="600" desc="指定角色用户数据缓存" />
<add key="BootstrapUser-RetrieveUsersByGroupId" interval="600" desc="指定组用户数据缓存" />
<add key="UserHelper-RetrieveNewUsers" interval="30" desc="新用户数据缓存" /> <add key="UserHelper-RetrieveNewUsers" interval="30" desc="新用户数据缓存" />
<add key="MenuHelper-RetrieveMenusByRoleId" interval="600" desc="角色菜单信息缓存" /> <add key="MenuHelper-RetrieveMenusByRoleId" interval="600" desc="角色菜单信息缓存" />
<add key="RoleHelper-RetrieveRoles" interval="600" desc="所有角色数据缓存" /> <add key="RoleHelper-RetrieveRoles" interval="600" desc="所有角色数据缓存" />
<add key="RoleHelper-RetrieveRolesByUserId" interval="600" desc="指定用户角色数据缓存" /> <add key="RoleHelper-RetrieveRolesByUserId" interval="600" desc="指定用户角色数据缓存" />
<add key="RoleHelper-RetrieveRolesByMenuId" interval="600" desc="指定菜单角色数据缓存" /> <add key="RoleHelper-RetrieveRolesByMenuId" interval="600" desc="指定菜单角色数据缓存" />
<add key="RoleHelper-RetrieveRolesByGroupId" interval="600" desc="指定组角色数据缓存" /> <add key="RoleHelper-RetrieveRolesByGroupId" interval="600" desc="指定组角色数据缓存" />
<add key="GroupHelper-RetrieveGroups" interval="600" desc="所有组数据缓存" /> <add key="GroupHelper-RetrieveGroups" interval="600" desc="所有组数据缓存" />
<add key="GroupHelper-RetrieveGroupsByUserId" interval="600" desc="指定用户组数据缓存" /> <add key="GroupHelper-RetrieveGroupsByUserId" interval="600" desc="指定用户组数据缓存" />
<add key="GroupHelper-RetrieveGroupsByRoleId" interval="600" desc="指定角色组数据缓存" /> <add key="GroupHelper-RetrieveGroupsByRoleId" interval="600" desc="指定角色组数据缓存" />
@ -49,8 +54,6 @@
<add key="ExceptionHelper-RetrieveExceptions" interval="600" desc="程序异常数据缓存" /> <add key="ExceptionHelper-RetrieveExceptions" interval="600" desc="程序异常数据缓存" />
<add key="MessageHelper-RetrieveMessages" interval="600" desc="站内消息数据缓存" /> <add key="MessageHelper-RetrieveMessages" interval="600" desc="站内消息数据缓存" />
<add key="TaskHelper-RetrieveTasks" interval="600" desc="所有任务数据缓存" /> <add key="TaskHelper-RetrieveTasks" interval="600" desc="所有任务数据缓存" />
<add key="BootstrapUser-RetrieveUsersByRoleId" interval="600" desc="指定角色用户数据缓存" />
<add key="BootstrapUser-RetrieveUsersByGroupId" interval="600" desc="指定组用户数据缓存" />
<add key="WebApi" interval="21600" desc="WebApi 数据缓存" /> <add key="WebApi" interval="21600" desc="WebApi 数据缓存" />
<add key="Token" interval="21600" desc="Token 数据缓存" /> <add key="Token" interval="21600" desc="Token 数据缓存" />
</cacheManager> </cacheManager>
@ -82,7 +85,7 @@
<compilation debug="true" targetFramework="4.5" /> <compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" /> <httpRuntime targetFramework="4.5" />
<authentication mode="Forms"> <authentication mode="Forms">
<forms defaultUrl="~/" loginUrl="~/Home/Login" name="__bd__" protection="All" timeout="360" /> <forms defaultUrl="~/" loginUrl="~/Home/Login" name="__bd__" protection="All" path="/" timeout="360" />
</authentication> </authentication>
<pages> <pages>
<namespaces> <namespaces>

View File

@ -0,0 +1,10 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}

View File

@ -0,0 +1,23 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
},
"LgbFile": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Error"
},
"FileName": "Error\\Log.log"
}
},
"ConnectionStrings": {
"ba": "Data Source=.;Initial Catalog=BootstrapAdmin;User ID=sa;Password=sa"
},
"DbProviderFactories": {
"sql": "SQLServer"
},
"": null,
"KeyPath": "C:\\keys"
}

198
Bootstrap.Admin/cache.json Normal file
View File

@ -0,0 +1,198 @@
{
"LongbowCache": {
"Enabled": true,
"CorsItems": [
{
"Enabled": true,
"Name": "ba",
"Url": "http://localhost:50852/CacheList.axd?cacheKey={0}",
"Desc": "后台管理数据缓存接口",
"Self": true
}
],
"CacheItems": [
{
"Enabled": true,
"Key": "BootstrapAdminAuthorizeFilter-RetrieveRolesByUrl",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台菜单获得所有可访问角色数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapAdminGroupMiddleware-RetrieveGroups",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理所有组数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapAdminGroupMiddleware-RetrieveGroupsByUserName",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理特定用户所属所有组数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapAdminRoleMiddleware-RetrieveRoles",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理所有角色数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapAdminRoleMiddleware-RetrieveRolesByUserName",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理特定用户所属所有角色数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapDict-RetrieveDicts",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理所有字典数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapMenu-RetrieveMenus",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理所有菜单数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapUser-RetrieveUsers",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理所有用户数据缓存"
},
{
"Enabled": true,
"Key": "BootstrapUser-RetrieveUsersByName",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "后台管理通过登录名获得当前用户数据缓存"
},
{
"Enabled": true,
"Key": "UserHelper-RetrieveNewUsers",
"Interval": 30,
"SlidingExpiration": true,
"Desc": "新用户数据缓存"
},
{
"Enabled": true,
"Key": "MenuHelper-RetrieveMenusByRoleId",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "角色菜单信息缓存"
},
{
"Enabled": true,
"Key": "RoleHelper-RetrieveRoles",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "所有角色数据缓存"
},
{
"Enabled": true,
"Key": "RoleHelper-RetrieveRolesByUserId",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "指定用户角色数据缓存"
},
{
"Enabled": true,
"Key": "RoleHelper-RetrieveRolesByMenuId",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "指定菜单角色数据缓存"
},
{
"Enabled": true,
"Key": "RoleHelper-RetrieveRolesByGroupId",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "指定组角色数据缓存"
},
{
"Enabled": true,
"Key": "GroupHelper-RetrieveGroups",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "所有组数据缓存"
},
{
"Enabled": true,
"Key": "GroupHelper-RetrieveGroupsByUserId",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "指定用户组数据缓存"
},
{
"Enabled": true,
"Key": "GroupHelper-RetrieveGroupsByRoleId",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "指定角色组数据缓存"
},
{
"Enabled": true,
"Key": "LogHelper-RetrieveLogs",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "所有日志数据缓存"
},
{
"Enabled": true,
"Key": "DictHelper-RetrieveDictsCategory",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "字典分类数据缓存"
},
{
"Enabled": true,
"Key": "NotificationHelper-RetrieveNotifications",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "通知管理数据缓存"
},
{
"Enabled": true,
"Key": "ExceptionHelper-RetrieveExceptions",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "程序异常数据缓存"
},
{
"Enabled": true,
"Key": "MessageHelper-RetrieveMessages",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "站内消息数据缓存"
},
{
"Enabled": true,
"Key": "TaskHelper-RetrieveTasks",
"Interval": 600,
"SlidingExpiration": true,
"Desc": "所有任务数据缓存"
},
{
"Enabled": true,
"Key": "WebApi",
"Interval": 21600,
"SlidingExpiration": true,
"Desc": "WebApi 数据缓存"
},
{
"Enabled": true,
"Key": "Token",
"Interval": 21600,
"SlidingExpiration": true,
"Desc": "Token 数据缓存"
}
]
}
}

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="bootstrap" version="3.3.7" targetFramework="net45" />
<package id="FontAwesome" version="4.7.0" targetFramework="net45" />
<package id="jQuery" version="3.1.1" targetFramework="net45" />
<package id="jQuery.Validation" version="1.16.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
</packages>

View File

@ -1,11 +1,11 @@
.alert { .alert {
position: absolute; position: absolute;
top: 15px; top: 15px;
left: 15px; left: 15px;
right: 15px; right: 15px;
z-index: 100; z-index: 100;
} }
.alert div { .alert div {
display: inline-block; display: inline-block;
} }

View File

@ -1,131 +1,131 @@
@media (min-width: 375px) { @media (min-width: 375px) {
.hidden-375 { .hidden-375 {
display: inline-block; display: inline-block;
} }
.toolbar .dropdown-menu a { .toolbar .dropdown-menu a {
padding: 0 20px; padding: 0 20px;
border-left: solid 1px #aeb2b7; border-left: solid 1px #aeb2b7;
} }
.toolbar .dropdown-menu a:first-child { .toolbar .dropdown-menu a:first-child {
border-left: none; border-left: none;
} }
} }
@media (min-width: 568px) { @media (min-width: 568px) {
.toolbar { .toolbar {
display: none; display: none;
} }
.bs-bars { .bs-bars {
display: inline-block; display: inline-block;
} }
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.sidebar { .sidebar {
top: 98px; top: 98px;
bottom: 40px; bottom: 40px;
position: absolute; position: absolute;
overflow: auto; overflow: auto;
} }
.form-group .form-control-url { .form-group .form-control-url {
width: 442px; width: 442px;
} }
} }
@media (min-width: 769px) { @media (min-width: 769px) {
.sidebar { .sidebar {
display: block; display: block;
width: 210px; width: 210px;
} }
.main-content { .main-content {
margin-left: 210px; margin-left: 210px;
transition: none; transition: none;
} }
.main-content.open { .main-content.open {
display: block; display: block;
} }
aside { aside {
transition: none; transition: none;
transform: none; transform: none;
top: 0; top: 0;
right: auto; right: auto;
} }
} }
@media (min-width: 940px) { @media (min-width: 940px) {
.hidden-tb { .hidden-tb {
display: inline; display: inline;
} }
.modal-dialog { .modal-dialog {
width: 900px; width: 900px;
} }
.form-group .form-control-url { .form-group .form-control-url {
width: 742px; width: 742px;
} }
} }
@media (min-height: 414px) { @media (min-height: 414px) {
.modal .modal-body { .modal .modal-body {
max-height: 200px; max-height: 200px;
} }
} }
@media (min-height: 568px) { @media (min-height: 568px) {
.modal .modal-body { .modal .modal-body {
max-height: 350px; max-height: 350px;
} }
} }
@media (min-height: 667px) { @media (min-height: 667px) {
.modal .modal-body { .modal .modal-body {
max-height: 450px; max-height: 450px;
} }
} }
@media (min-height: 736px) { @media (min-height: 736px) {
.modal .modal-body { .modal .modal-body {
max-height: 510px; max-height: 510px;
} }
} }
@media (min-height: 768px) { @media (min-height: 768px) {
.modal .modal-body { .modal .modal-body {
max-height: 540px; max-height: 540px;
} }
} }
@media (min-height: 672px) { @media (min-height: 672px) {
.sidebar { .sidebar {
top: 98px; top: 98px;
bottom: 40px; bottom: 40px;
position: absolute; position: absolute;
overflow: auto; overflow: auto;
} }
.main-content { .main-content {
position: fixed; position: fixed;
overflow: auto; overflow: auto;
transition: none; transition: none;
} }
.main-content.open { .main-content.open {
display: block; display: block;
} }
aside { aside {
top: 0; top: 0;
} }
.aside.open { .aside.open {
transform: translate(0); transform: translate(0);
} }
} }

View File

@ -1,492 +1,492 @@
.lgbDropdown { .lgbDropdown {
display: inline-block; display: inline-block;
} }
.lgbDropdown .dropdown-menu > li > a:hover { .lgbDropdown .dropdown-menu > li > a:hover {
background: #007AC0; background: #007AC0;
color: #fff; color: #fff;
} }
.logTs, .logSql, .logDbExcep { .logTs, .logSql, .logDbExcep {
color: red; color: red;
font-weight: 600; font-weight: 600;
} }
.logExcep { .logExcep {
color: #337ab7; color: #337ab7;
font-weight: 600; font-weight: 600;
} }
.logMsg { .logMsg {
color: #ce2520; color: #ce2520;
font-weight: 600; font-weight: 600;
} }
.hidden-tb, .hidden-375 { .hidden-tb, .hidden-375 {
display: none; display: none;
} }
.clearcache { .clearcache {
position: absolute; position: absolute;
right: 60px; right: 60px;
font-size: 1.7rem; font-size: 1.7rem;
color: #d9534f; color: #d9534f;
margin-top: -1px; margin-top: -1px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
} }
.clearcache:hover, .clearcache:focus { .clearcache:hover, .clearcache:focus {
color: #c12e2a; color: #c12e2a;
} }
.clearcache:active:hover { .clearcache:active:hover {
color: #ac2925; color: #ac2925;
} }
.form-inline .form-group { .form-inline .form-group {
margin-bottom: 15px; margin-bottom: 15px;
} }
.form-inline .form-group .control-label { .form-inline .form-group .control-label {
margin-right: 10px; margin-right: 10px;
width: 80px; width: 80px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
vertical-align: middle; vertical-align: middle;
} }
.modal-dialog .modal-body, .panel-body { .modal-dialog .modal-body, .panel-body {
padding-bottom: 0; padding-bottom: 0;
} }
.modal-dialog .modal-body .form-inline .form-group input[type="text"], .modal-dialog .modal-body .form-inline .form-group input[type="password"] { .modal-dialog .modal-body .form-inline .form-group input[type="text"], .modal-dialog .modal-body .form-inline .form-group input[type="password"] {
padding-right: 30px; padding-right: 30px;
} }
.btn:focus, .btn:active:focus { .btn:focus, .btn:active:focus {
outline: none; outline: none;
} }
.btn span:last-child { .btn span:last-child {
margin-left: 4px; margin-left: 4px;
} }
.modal .modal-dialog { .modal .modal-dialog {
padding: 0 15px; padding: 0 15px;
} }
.modal .modal-body { .modal .modal-body {
max-height: 164px; max-height: 164px;
overflow: auto; overflow: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
.modal.file-zoom-dialog .modal-dialog { .modal.file-zoom-dialog .modal-dialog {
max-width: none; max-width: none;
} }
.modal-header { .modal-header {
background-color: #f5f5f5; background-color: #f5f5f5;
border-top-left-radius: 6px; border-top-left-radius: 6px;
border-top-right-radius: 6px; border-top-right-radius: 6px;
padding: 10px 15px; padding: 10px 15px;
} }
.modal-header .close { .modal-header .close {
margin-top: 1px; margin-top: 1px;
} }
.modal-body .checkbox, .modal-body .radio { .modal-body .checkbox, .modal-body .radio {
min-width: 190px; min-width: 190px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.modal-footer { .modal-footer {
clear: both; clear: both;
} }
.modal-footer .btn { .modal-footer .btn {
padding-left: 22px; padding-left: 22px;
padding-right: 22px; padding-right: 22px;
} }
.has-error input { .has-error input {
background-repeat: no-repeat; background-repeat: no-repeat;
background-image: url('images/error.png'); background-image: url('../images/error.png');
background-position: right 8px center; background-position: right 8px center;
} }
.has-error .input-group-btn button, .has-error .input-group-btn button:active:focus { .has-error .input-group-btn button, .has-error .input-group-btn button:active:focus {
border-color: #a94442; border-color: #a94442;
} }
.has-success input { .has-success input {
background-repeat: no-repeat; background-repeat: no-repeat;
background-image: url('images/success.png'); background-image: url('../images/success.png');
background-position: right 8px center; background-position: right 8px center;
} }
.has-success .input-group-btn button, .has-success .input-group-btn button:active:focus { .has-success .input-group-btn button, .has-success .input-group-btn button:active:focus {
border-color: #3c763d; border-color: #3c763d;
} }
.main-content { .main-content {
transition: all .4s ease-in-out; transition: all .4s ease-in-out;
padding: 15px 15px 0 15px; padding: 15px 15px 0 15px;
margin-left: 0; margin-left: 0;
height: auto; height: auto;
left: 0; left: 0;
bottom: 40px; bottom: 40px;
right: 0; right: 0;
top: 98px; top: 98px;
} }
.main-content.open { .main-content.open {
display: none; display: none;
} }
.main-content.closed { .main-content.closed {
margin-left: 0; margin-left: 0;
} }
.main-content > .panel:last-child .panel-body { .main-content > .panel:last-child .panel-body {
padding-bottom: 0; padding-bottom: 0;
} }
.main-content > .panel > .panel-body > .modal-footer { .main-content > .panel > .panel-body > .modal-footer {
text-align: left; text-align: left;
} }
aside { aside {
transition: transform .4s ease-in-out; transition: transform .4s ease-in-out;
transform: translate(-100%); transform: translate(-100%);
height: 100%; height: 100%;
position: absolute; position: absolute;
top: 98px; top: 98px;
bottom: 40px; bottom: 40px;
left: 0; left: 0;
right: 0; right: 0;
z-index: 5; z-index: 5;
} }
aside.open { aside.open {
transform: translate(0); transform: translate(0);
} }
.sidebar { .sidebar {
display: none; display: none;
overflow: auto; overflow: auto;
width: 100%; width: 100%;
z-index: 5; z-index: 5;
background: #2a3542; background: #2a3542;
} }
.sidebar-menu { .sidebar-menu {
padding: 20px 0; padding: 20px 0;
margin-bottom: 0; margin-bottom: 0;
} }
.sidebar-menu .dcjq-icon { .sidebar-menu .dcjq-icon {
height: 17px; height: 17px;
width: 17px; width: 17px;
display: inline-block; display: inline-block;
background: url(images/nav-expand.png) no-repeat; background: url(../images/nav-expand.png) no-repeat;
float: right; float: right;
} }
.sidebar-menu .active .dcjq-icon { .sidebar-menu .active .dcjq-icon {
background-position: bottom; background-position: bottom;
} }
.sidebar-menu li { .sidebar-menu li {
margin: 5px 10px; margin: 5px 10px;
} }
.sidebar-menu li a { .sidebar-menu li a {
color: #aeb2b7; color: #aeb2b7;
display: block; display: block;
padding: 15px 10px; padding: 15px 10px;
font-size: 1.2rem; font-size: 1.2rem;
transition: all 0.3s ease; transition: all 0.3s ease;
border-radius: 4px; border-radius: 4px;
} }
.sidebar-menu li a.active, .sidebar-menu li a:hover, .sidebar-menu li a:focus { .sidebar-menu li a.active, .sidebar-menu li a:hover, .sidebar-menu li a:focus {
background: #35404d; background: #35404d;
color: #fff; color: #fff;
} }
.sidebar-menu li a.active i { .sidebar-menu li a.active i {
color: #FF6C60; color: #FF6C60;
} }
.sidebar-menu li a i { .sidebar-menu li a i {
font-size: 1.5rem; font-size: 1.5rem;
width: 22px; width: 22px;
} }
.sidebar-menu li .sub { .sidebar-menu li .sub {
padding-left: 0; padding-left: 0;
} }
.sidebar-menu li .sub li a:hover, .sidebar-menu li .sub li.active a { .sidebar-menu li .sub li a:hover, .sidebar-menu li .sub li.active a {
color: #FF6C60; color: #FF6C60;
transition: all 0.3s ease; transition: all 0.3s ease;
display: block; display: block;
} }
.sidebar-menu li .sub li { .sidebar-menu li .sub li {
background: #35404D; background: #35404D;
margin: 0; margin: 0;
padding: 0 10px 0 32px; padding: 0 10px 0 32px;
} }
.sidebar-menu li .sub li:last-child { .sidebar-menu li .sub li:last-child {
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
padding-bottom: 10px; padding-bottom: 10px;
} }
.sidebar-menu li .sub li a { .sidebar-menu li .sub li a {
padding: 12px 0; padding: 12px 0;
} }
/*Modal Dialog Checkbox*/ /*Modal Dialog Checkbox*/
.modal-body .checkbox, .modal-dialog .radio { .modal-body .checkbox, .modal-dialog .radio {
padding: 0; padding: 0;
margin-top: 0; margin-top: 0;
} }
.modal-body .checkbox label, .modal-body .radio label { .modal-body .checkbox label, .modal-body .radio label {
padding-left: 0; padding-left: 0;
} }
.modal-body .checkbox label input[type='checkbox'], .modal-body .radio label input[type='radio'] { .modal-body .checkbox label input[type='checkbox'], .modal-body .radio label input[type='radio'] {
margin: 0 4px 0 0; margin: 0 4px 0 0;
vertical-align: middle; vertical-align: middle;
position: relative; position: relative;
top: -1px; top: -1px;
} }
.modal-body .affix { .modal-body .affix {
position: fixed; position: fixed;
bottom: 95px; bottom: 95px;
right: 50px; right: 50px;
} }
.modal-body .affix a { .modal-body .affix a {
font-size: 2rem; font-size: 2rem;
margin-top: 16px; margin-top: 16px;
} }
.bs-bars { .bs-bars {
display: none; display: none;
} }
.toolbar { .toolbar {
position: relative; position: relative;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
line-height: 34px; line-height: 34px;
} }
.toolbar .dropdown-menu { .toolbar .dropdown-menu {
margin-top: 4px; margin-top: 4px;
min-width: inherit; min-width: inherit;
} }
.toolbar .dropdown-menu a { .toolbar .dropdown-menu a {
border-left: none; border-left: none;
padding: 0 14px; padding: 0 14px;
display: table-cell; display: table-cell;
color: #504d4d; color: #504d4d;
} }
.toolbar .dropdown-menu a:first-child { .toolbar .dropdown-menu a:first-child {
padding-left: 16px; padding-left: 16px;
} }
.toolbar .dropdown-menu a:last-child { .toolbar .dropdown-menu a:last-child {
padding-right: 16px; padding-right: 16px;
} }
.toolbar .dropdown-menu a:hover { .toolbar .dropdown-menu a:hover {
color: #235e90; color: #235e90;
} }
/*cache*/ /*cache*/
.panel .fa-refresh { .panel .fa-refresh {
font-size: 1.5rem; font-size: 1.5rem;
} }
.bootstrap-select .dropdown-menu { .bootstrap-select .dropdown-menu {
padding: 0; padding: 0;
} }
.bootstrap-select .dropdown-menu > li > a { .bootstrap-select .dropdown-menu > li > a {
padding-top: 7px; padding-top: 7px;
padding-bottom: 7px; padding-bottom: 7px;
} }
input[type="datetime"] { input[type="datetime"] {
min-width: 220px; min-width: 220px;
} }
/*Messages*/ /*Messages*/
.mail-box { .mail-box {
display: flex; display: flex;
} }
.mail-box .sm-side { .mail-box .sm-side {
flex: 0.4; flex: 0.4;
background: #e5e8ef; background: #e5e8ef;
border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;
} }
.mail-box .sm-side .user-head { .mail-box .sm-side .user-head {
background: #00a8b3; background: #00a8b3;
border-radius: 4px 0 0 0; border-radius: 4px 0 0 0;
padding: 10px; padding: 10px;
color: #fff; color: #fff;
min-height: 80px; min-height: 80px;
} }
.mail-box .sm-side .user-head .inbox-avatar { .mail-box .sm-side .user-head .inbox-avatar {
width: 65px; width: 65px;
float: left; float: left;
} }
.mail-box .sm-side .user-head .inbox-avatar img { .mail-box .sm-side .user-head .inbox-avatar img {
height: 65px; height: 65px;
border-radius: 4px; border-radius: 4px;
border: 0; border: 0;
vertical-align: middle; vertical-align: middle;
} }
.mail-box .sm-side .user-head .user-name { .mail-box .sm-side .user-head .user-name {
display: inline-block; display: inline-block;
margin: 0 0 0 10px; margin: 0 0 0 10px;
} }
.mail-box .sm-side .user-head .user-name h5 { .mail-box .sm-side .user-head .user-name h5 {
margin-top: 15px; margin-top: 15px;
margin-bottom: 0; margin-bottom: 0;
font-weight: 300; font-weight: 300;
} }
.mail-box .sm-side .user-head .user-name h5 a { .mail-box .sm-side .user-head .user-name h5 a {
color: #fff; color: #fff;
} }
.mail-box .sm-side .inbox-body, .mail-box .lg-side .inbox-body { .mail-box .sm-side .inbox-body, .mail-box .lg-side .inbox-body {
padding: 20px; padding: 20px;
} }
.mail-box .sm-side .inbox-body .btn-compose { .mail-box .sm-side .inbox-body .btn-compose {
background: #ff6c60; background: #ff6c60;
padding: 12px 0; padding: 12px 0;
text-align: center; text-align: center;
width: 100%; width: 100%;
color: #fff; color: #fff;
} }
.mail-box .sm-side .inbox-body .btn-compose:hover { .mail-box .sm-side .inbox-body .btn-compose:hover {
background: #f5675c; background: #f5675c;
color: #fff; color: #fff;
} }
.mail-box .sm-side ul.inbox-nav { .mail-box .sm-side ul.inbox-nav {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.mail-box .sm-side ul.inbox-nav li { .mail-box .sm-side ul.inbox-nav li {
display: inline-block; display: inline-block;
line-height: 45px; line-height: 45px;
width: 100%; width: 100%;
} }
.mail-box .sm-side ul.inbox-nav li a { .mail-box .sm-side ul.inbox-nav li a {
color: #6a6a6a; color: #6a6a6a;
line-height: 45px; line-height: 45px;
width: 100%; width: 100%;
display: inline-block; display: inline-block;
padding: 0 20px; padding: 0 20px;
} }
.mail-box .sm-side ul.inbox-nav li a:hover, .mail-box .sm-side ul.inbox-nav li.active a, .mail-box .sm-side ul.inbox-nav li a:focus { .mail-box .sm-side ul.inbox-nav li a:hover, .mail-box .sm-side ul.inbox-nav li.active a, .mail-box .sm-side ul.inbox-nav li a:focus {
color: #6a6a6a; color: #6a6a6a;
background: #d5d7de; background: #d5d7de;
} }
.mail-box .sm-side ul.inbox-nav li a .label { .mail-box .sm-side ul.inbox-nav li a .label {
margin-top: 13px; margin-top: 13px;
padding: 0.5em 0.8em; padding: 0.5em 0.8em;
} }
.mail-box .sm-side ul.inbox-nav li a i { .mail-box .sm-side ul.inbox-nav li a i {
width: 18px; width: 18px;
} }
.mail-box .lg-side { .mail-box .lg-side {
flex: 0.6; flex: 0.6;
background: #fff; background: #fff;
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
} }
.mail-box .lg-side .inbox-head { .mail-box .lg-side .inbox-head {
padding: 12px; padding: 12px;
background: #41cac0; background: #41cac0;
color: #fff; color: #fff;
border-radius: 0 4px 0 0; border-radius: 0 4px 0 0;
min-height: 80px; min-height: 80px;
} }
.mail-box .lg-side .table-inbox { .mail-box .lg-side .table-inbox {
border: 1px solid #d3d3d3; border: 1px solid #d3d3d3;
margin-bottom: 0; margin-bottom: 0;
} }
.mail-box .lg-side .table-inbox .unread td { .mail-box .lg-side .table-inbox .unread td {
font-weight: 600; font-weight: 600;
background: #f7f7f7; background: #f7f7f7;
} }
.mail-box .lg-side .table-inbox tr td { .mail-box .lg-side .table-inbox tr td {
padding: 12px; padding: 12px;
} }
.mail-box .lg-side .table-inbox tr td .fa-star.inbox-started, .mail-box .lg-side .table-inbox tr td .fa-star:hover { .mail-box .lg-side .table-inbox tr td .fa-star.inbox-started, .mail-box .lg-side .table-inbox tr td .fa-star:hover {
color: #f78a09; color: #f78a09;
} }
.mail-box .lg-side .table-inbox tr td:hover { .mail-box .lg-side .table-inbox tr td:hover {
cursor: pointer; cursor: pointer;
} }
/*Bootstrap Table BUG */ /*Bootstrap Table BUG */
.fixed-table-loading { .fixed-table-loading {
padding-top: 5px; padding-top: 5px;
} }
.bootstrap-table { .bootstrap-table {
padding-bottom: 15px; padding-bottom: 15px;
} }
.bootstrap-table .fixed-table-body .table { .bootstrap-table .fixed-table-body .table {
border-bottom: none; border-bottom: none;
} }
/*Bootstrap Table BUG END*/ /*Bootstrap Table BUG END*/
.input-group.form_date span { .input-group.form_date span {
border-left: none; border-left: none;
} }
.barTable { .barTable {
padding: 5px 15px 15px 15px; padding: 5px 15px 15px 15px;
} }

View File

@ -1,35 +1,35 @@
h3 { h3 {
margin-top: 0; margin-top: 0;
color: #000; color: #000;
} }
.btn { .btn {
text-shadow: none; text-shadow: none;
} }
.control-label { .control-label {
width: 80px; width: 80px;
} }
.main-content { .main-content {
padding: 15px; padding: 15px;
} }
.main-content > section:not(:first-child) { .main-content > section:not(:first-child) {
padding-top: 10px; padding-top: 10px;
} }
.main-content > section > div { .main-content > section > div {
line-height: 26px; line-height: 26px;
} }
.main-content > section > div > div { .main-content > section > div > div {
display: inline-block; display: inline-block;
word-break: break-all; word-break: break-all;
} }
.test { .test {
display: none; display: none;
padding: 10px 0 0 0; padding: 10px 0 0 0;
color: #5cb85c; color: #5cb85c;
} }

Some files were not shown because too many files have changed in this diff Show More