1
0
Эх сурвалжийг харах

1.友情链接回链检测改进;
2.增加手动发送系统邮件的功能

懒得勤快 4 жил өмнө
parent
commit
7f8a8898c9

+ 1 - 0
src/Masuit.MyBlogs.Core/Common/HttpContextExtension.cs

@@ -38,6 +38,7 @@ namespace Masuit.MyBlogs.Core.Common
                     "googlebot.com",
                     "googleusercontent.com",
                     "bing.com",
+                    "search.msn.com",
                     "sogou.com",
                     "soso.com",
                     "yandex.com",

+ 12 - 7
src/Masuit.MyBlogs.Core/Common/ImagebedClient.cs

@@ -191,14 +191,19 @@ namespace Masuit.MyBlogs.Core.Common
         /// <returns></returns>
         private async Task<(string url, bool success)> UploadKieng(Stream stream, CancellationToken cancellationToken)
         {
-            using var formData = new MultipartFormDataContent
+            if (bool.TryParse(_config["Imgbed:EnableExternalImgbed"], out var b) && b)
             {
-                { new StreamContent(stream), "image","1.jpg" }
-            };
-            var resp = await _httpClient.PostAsync("https://image.kieng.cn/upload.html?type=" + new[] { "tt", "jd", "c58", "sg", "sh", "wy" }.OrderByRandom().First(), formData, cancellationToken);
-            var json = await resp.Content.ReadAsStringAsync();
-            var result = JObject.Parse(json);
-            return ((string)result["data"]["url"], (int)result["code"] == 200);
+                using var formData = new MultipartFormDataContent
+                {
+                    { new StreamContent(stream), "image","1.jpg" }
+                };
+                var resp = await _httpClient.PostAsync("https://image.kieng.cn/upload.html?type=" + new[] { "tt", "jd", "c58", "sg", "sh", "wy" }.OrderByRandom().First(), formData, cancellationToken);
+                var json = await resp.Content.ReadAsStringAsync();
+                var result = JObject.Parse(json);
+                return ((string)result["data"]["url"], (int)result["code"] == 200);
+            }
+
+            return (null, false);
         }
 
         /// <summary>

+ 12 - 7
src/Masuit.MyBlogs.Core/Controllers/LinksController.cs

@@ -41,22 +41,27 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <summary>
         /// 申请友链
         /// </summary>
-        /// <param name="links"></param>
+        /// <param name="link"></param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        public async Task<ActionResult> Apply(Links links, CancellationToken cancellationToken)
+        public async Task<ActionResult> Apply(Links link, CancellationToken cancellationToken)
         {
-            if (!links.Url.MatchUrl() || links.Url.Contains(Request.Host.Host))
+            if (!link.Url.MatchUrl() || link.Url.Contains(Request.Host.Host))
             {
                 return ResultData(null, false, "添加失败!链接非法!");
             }
 
-            if (links.Url.Contains(new[] { "?", "&", "=" }))
+            if (link.Url.Contains(new[] { "?", "&", "=" }))
             {
                 return ResultData(null, false, "添加失败!请移除链接中的查询字符串后再试!如遇特殊情况,请联系站长进行处理。");
             }
 
-            var host = new Uri(links.Url).Host;
+            if (!link.Url.Contains(link.UrlBase))
+            {
+                return ResultData(null, false, "站点主页和友链地址不匹配,请检查");
+            }
+
+            var host = new Uri(link.Url).Host;
             if (LinksService.Any(l => l.Url.Contains(host)))
             {
                 return ResultData(null, false, "添加失败!检测到您的网站已经是本站的友情链接了!");
@@ -67,7 +72,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             HttpClient.DefaultRequestHeaders.Add("X-Forwarded-For", "1.1.1.1");
             HttpClient.DefaultRequestHeaders.Add("X-Forwarded-Host", "1.1.1.1");
             HttpClient.DefaultRequestHeaders.Add("X-Real-IP", "1.1.1.1");
-            return await HttpClient.GetAsync(links.Url, cancellationToken).ContinueWith(t =>
+            return await HttpClient.GetAsync(link.Url, cancellationToken).ContinueWith(t =>
             {
                 if (t.IsFaulted || t.IsCanceled)
                 {
@@ -87,7 +92,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                     return ResultData(null, false, $"添加失败!检测到您的网站上未将本站设置成友情链接,请先将本站主域名:{Request.Host}在您的网站设置为友情链接,并且能够展示后,再次尝试添加即可!");
                 }
 
-                var b = LinksService.AddEntitySaved(links) != null;
+                var b = LinksService.AddEntitySaved(link) != null;
                 return ResultData(null, b, b ? "添加成功!这可能有一定的延迟,如果没有看到您的链接,请稍等几分钟后刷新页面即可,如有疑问,请联系站长。" : "添加失败!这可能是由于网站服务器内部发生了错误,如有疑问,请联系站长。");
             });
         }

+ 16 - 1
src/Masuit.MyBlogs.Core/Controllers/SystemController.cs

@@ -1,4 +1,5 @@
-using Masuit.MyBlogs.Core.Common;
+using Hangfire;
+using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Common.Mails;
 using Masuit.MyBlogs.Core.Extensions.Firewall;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
@@ -14,6 +15,7 @@ using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using System.IO;
 using System.Linq;
 using System.Net;
@@ -168,6 +170,19 @@ namespace Masuit.MyBlogs.Core.Controllers
             }
         }
 
+        /// <summary>
+        /// 发送一封系统邮件
+        /// </summary>
+        /// <param name="tos"></param>
+        /// <param name="title"></param>
+        /// <param name="content"></param>
+        /// <returns></returns>
+        public ActionResult SendMail([Required(ErrorMessage = "收件人不能为空")] string tos, [Required(ErrorMessage = "邮件标题不能为空")] string title, [Required(ErrorMessage = "邮件内容不能为空")] string content)
+        {
+            BackgroundJob.Enqueue(() => CommonHelper.SendMail(title, content + "<p style=\"color: red\">本邮件由系统自动发出,请勿回复本邮件!</p>", tos, "127.0.0.1"));
+            return Ok();
+        }
+
         /// <summary>
         /// 路径测试
         /// </summary>

+ 1 - 2
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -220,8 +220,7 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
         /// <param name="ip"></param>
         public void UpdateLinkWeight(string referer, string ip)
         {
-            var uri = new Uri(referer);
-            var list = _linksService.GetQuery(l => l.Url.Contains(uri.Host)).ToList();
+            var list = _linksService.GetQuery(l => referer.Contains(l.UrlBase)).ToList();
             foreach (var link in list)
             {
                 link.Loopbacks.Add(new LinkLoopback()

+ 4 - 4
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -40,9 +40,9 @@
         <PackageReference Include="IP2Region" Version="1.2.0" />
         <PackageReference Include="Karambolo.AspNetCore.Bundling.NUglify" Version="3.5.0" />
         <PackageReference Include="MaxMind.GeoIP2" Version="4.0.1" />
-        <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.10" />
-        <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.10" />
-        <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.10" />
+        <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.11" />
+        <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.11" />
+        <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.11" />
         <PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.1" />
         <PackageReference Include="Microsoft.Graph" Version="4.6.0" />
         <PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.6" />
@@ -54,7 +54,7 @@
         <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.13" />
         <PackageReference Include="TimeZoneConverter" Version="3.5.0" />
         <PackageReference Include="WilderMinds.RssSyndication" Version="1.7.0" />
-        <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.2.13" />
+        <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.2.14" />
     </ItemGroup>
     <ItemGroup>
         <Content Update="appsettings.json">

+ 5 - 0
src/Masuit.MyBlogs.Core/Models/DTO/LinksDto.cs

@@ -17,6 +17,11 @@ namespace Masuit.MyBlogs.Core.Models.DTO
         /// </summary>
         public string Url { get; set; }
 
+        /// <summary>
+        /// 主页地址
+        /// </summary>
+        public string UrlBase { get; set; }
+
         /// <summary>
         /// 是否检测白名单
         /// </summary>

+ 6 - 0
src/Masuit.MyBlogs.Core/Models/Entity/Links.cs

@@ -31,6 +31,12 @@ namespace Masuit.MyBlogs.Core.Models.Entity
         [Required(ErrorMessage = "站点的URL不能为空!"), MaxLength(64, ErrorMessage = "站点的URL限制64个字符")]
         public string Url { get; set; }
 
+        /// <summary>
+        /// 主页地址
+        /// </summary>
+        [Required(ErrorMessage = "站点的主页URL不能为空!"), MaxLength(64, ErrorMessage = "站点的主页URL限制64个字符")]
+        public string UrlBase { get; set; }
+
         /// <summary>
         /// 是否检测白名单
         /// </summary>

+ 5 - 3
src/Masuit.MyBlogs.Core/Views/Links/Index.cshtml

@@ -22,7 +22,7 @@
         <div class="button-effect">
             @foreach (LinksDto link in Model)
             {
-                <a class="effect effect-5" href="@link.Url" title="@link.Name" target="_blank">@link.Name</a>
+                <a class="effect effect-5" href="@link.Url" title="@link.Name" target="_blank" referrerpolicy="unsafe-url">@link.Name</a>
             }
             <a class="effect effect-5" onclick="add()">👉点我自助申请友链👈</a>
         </div>
@@ -37,7 +37,8 @@
         swal({
             title: '申请友情链接',
             html: '<div class="input-group"><span class="input-group-addon">网站名称</span><input id="title" class="form-control" autofocus placeholder="您的网站名称"></div>' +
-                '<div class="input-group"><span class="input-group-addon">链接地址</span><input id="url" class="form-control" placeholder="链接地址" value="https://"></div>',
+                '<div class="input-group"><span class="input-group-addon">链接地址</span><input id="url" class="form-control" placeholder="https://masuit.com/links"></div>' +
+                '<div class="input-group"><span class="input-group-addon">主页地址</span><input id="urlbase" class="form-control" placeholder="https://masuit.com"></div>',
             showCloseButton: true,
             confirmButtonColor: "#DD6B55",
             confirmButtonText: "确定",
@@ -49,7 +50,8 @@
                 return new Promise(function (resolve) {
                     $.post("/links/apply", {
                         Name: $('#title').val(),
-                        Url: $('#url').val()
+                        Url: $('#url').val(),
+                        UrlBase: $('#urlbase').val()
                     }, function (res) {
                         resolve(res);
                     });

+ 5 - 3
src/Masuit.MyBlogs.Core/Views/Links/Index_Admin.cshtml

@@ -22,7 +22,7 @@
         <div class="button-effect">
             @foreach (LinksDto link in Model)
             {
-                <a class="effect effect-5" href="@link.Url" title="@link.Name" target="_blank">@link.Name</a>
+                <a class="effect effect-5" href="@link.Url" title="@link.Name" target="_blank" referrerpolicy="unsafe-url">@link.Name</a>
             }
             <a class="effect effect-5" onclick="add()">添加链接</a>
         </div>
@@ -37,7 +37,8 @@
         swal({
             title: '添加友情链接',
             html: '<div class="input-group"><span class="input-group-addon">网站名称</span><input id="title" class="form-control" autofocus placeholder="网站名称"></div>' +
-                '<div class="input-group"><span class="input-group-addon">链接地址</span><input id="url" class="form-control" placeholder="链接地址" value="http://"></div>',
+                '<div class="input-group"><span class="input-group-addon">链接地址</span><input id="url" class="form-control" placeholder="https://masuit.com/links"></div>' +
+                '<div class="input-group"><span class="input-group-addon">主页地址</span><input id="urlbase" class="form-control" placeholder="https://masuit.com"></div>',
             showCloseButton: true,
             confirmButtonColor: "#DD6B55",
             confirmButtonText: "确定",
@@ -49,7 +50,8 @@
                 return new Promise(function (resolve) {
                     $.post("/links/add", {
                         Name: $('#title').val(),
-                        Url: $('#url').val()
+                        Url: $('#url').val(),
+                        UrlBase: $('#urlbase').val()
                     }, function (res) {
                         resolve(res);
                     });

+ 6 - 0
src/Masuit.MyBlogs.Core/Views/Post/PostVisitRecordInsight.cshtml

@@ -13,6 +13,12 @@
     <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
     <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
     <link href="/Assets/layui/css/layui.min.css" media="all" rel="stylesheet">
+    <style>
+        .mp-results.mp-bottomleft {
+            top: unset !important;
+            bottom: 0;
+        }
+    </style>
 </head>
 <body style="overflow-x: hidden">
     <h3 align="center">文章《@Model.Title》洞察分析</h3>

+ 13 - 13
src/Masuit.MyBlogs.Core/Views/Shared/_Layout.cshtml

@@ -72,17 +72,17 @@
     </environment>
 </head>
 <body>
-<noscript>
-    <meta http-equiv="Refresh" content="3;url=/ServiceUnavailable"/>
-    <style>
-        .header {
-            display: none !important;
-        }
-    </style>
-    <div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
-        <p class="size48">检测到您的浏览器不支持javascript或已禁用javascript功能,当前页面无法正常显示!</p>
-    </div>
-</noscript>
+    <noscript>
+        <meta http-equiv="Refresh" content="3;url=/ServiceUnavailable" />
+        <style>
+            .header {
+                display: none !important;
+            }
+        </style>
+        <div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
+            <p class="size48">检测到您的浏览器不支持javascript或已禁用javascript功能,当前页面无法正常显示!</p>
+        </div>
+    </noscript>
     <div id="toc" style="display: none;">
         <a class="close">
             <i class="icon-cross"></i>
@@ -285,9 +285,9 @@
                                 <a href="/taskcenter" target="_blank">任务管理器</a>
                                 <span> | </span>
                             }
-                            foreach (LinksDto link in footer.Links)
+                            foreach (var link in footer.Links)
                             {
-                                <a href="@link.Url" target="_blank">@link.Name</a>
+                                <a href="@link.Url" target="_blank" referrerpolicy="unsafe-url">@link.Name</a>
                                 <span> | </span>
                             }
                         }

+ 1 - 0
src/Masuit.MyBlogs.Core/appsettings.json

@@ -36,6 +36,7 @@
     },
     "Imgbed": { // 图床相关配置
         "EnableLocalStorage": false, // 允许本地硬盘存储?
+        "EnableExternalImgbed": false, // 允许上传至第三方图床(网易图床/Sohu图床/头条图床)?
         "Gitlabs": [ // gitlab图床配置,空数组则代表不启用
             //{
             //    "ApiUrl": "https://gitlab.com/api/v4/projects/<你的项目id>/repository/files/", // /api/v4/projects/<项目id>/repository/files/,使用前请先获取private_token

+ 1 - 25
src/Masuit.MyBlogs.Core/wwwroot/Scripts/global/scripts.js

@@ -16,7 +16,6 @@
     }
 })(jQuery);
 $(function() {
-    popBrowserTips();
     $("img").lazyload({
         effect: "fadeIn", //渐现,show(直接显示),fadeIn(淡入),slideDown(下拉)
         threshold: 2700, //预加载,在图片距离屏幕180px时提前载入
@@ -91,7 +90,7 @@ $(function() {
             }, true);
         });
     }
-
+    
     window.fetch("/notice/last").then(function(response) {
         return response.json();
     }).then(function(data) {
@@ -350,29 +349,6 @@ function getFile(obj, inputName) {
     $("input[name='" + inputName + "']").val($(obj).val());
 }
 
-function popBrowserTips() {
-    if (window.sessionStorage) {
-        var deny = window.sessionStorage.getItem("deny") || false;
-        if (window.screen.width <= 320 && !deny) {
-            swal({
-                title: '访问受限制?',
-                html: "由于检测到您的设备<span style='color:red'>屏幕宽度过小</span>,网站的部分功能可能不会兼容你的设备,但是您<span style='color:red'>可以继续浏览</span>,为确保最佳用户体验,建议使用<span style='color:red'>5寸以上移动设备</span>,或分辨率大于<span style='color:red'>1360 x 768</span>的<span style='color:red'>电脑浏览器</span>访问本站,感谢您的来访和支持!",
-                type: 'error',
-                showCloseButton: true,
-                showCancelButton: true,
-                confirmButtonColor: '#3085d6',
-                cancelButtonColor: '#d33',
-                confirmButtonText: '我知道了',
-                cancelButtonText: '哦哦'
-            }).then(function(isConfirm) {
-                if (isConfirm) {
-                    window.sessionStorage.setItem("deny", true);
-                }
-            });
-        }
-    }
-}
-
 function post(url, params, callback, error) {
     var formData = new FormData();
     Object.keys(params).forEach(function(key) {

+ 4 - 1
src/Masuit.MyBlogs.Core/wwwroot/ng-views/app/route.config.js

@@ -324,7 +324,10 @@ myApp.config([
             controller: "sendbox as list",
             resolve: {
                 deps: ["$ocLazyLoad", function($ocLazyLoad) {
-                        return $ocLazyLoad.load([cpath + "/system.js"]);
+                        return $ocLazyLoad.load([{
+                            files: ["https://apps.bdimg.com/libs/ueditor/1.4.3.1/ueditor.all.min.js"],
+                            cache: true
+                        },cpath + "/system.js"]);
                     }
                 ]
             }

+ 5 - 3
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/links.js

@@ -52,7 +52,7 @@
 	self.save = function (row, rowForm) {
 		swal({
 			title: "确认修改" + row.Name+"地址为:",
-			text: row.Url,
+			text: "友链地址:"+row.Url+",主页地址:"+row.UrlBase,
 			showCancelButton: true,
 			confirmButtonColor: "#DD6B55",
 			confirmButtonText: "确定",
@@ -85,7 +85,8 @@
 		swal({
 			title: '添加联系方式',
 			html:'<div class="input-group"><span class="input-group-addon">链接名称</span><input id="title" class="form-control" autofocus placeholder="链接名称"></div>' +
-			'<div class="input-group"><span class="input-group-addon">地址</span><input id="url" class="form-control" placeholder="地址"></div>',
+			'<div class="input-group"><span class="input-group-addon">链接地址</span><input id="url" class="form-control" placeholder="链接地址"></div>' +
+			'<div class="input-group"><span class="input-group-addon">主页地址</span><input id="urlbase" class="form-control" placeholder="主页地址"></div>',
 			showCloseButton: true,
 			confirmButtonColor: "#DD6B55",
 			confirmButtonText: "确定",
@@ -97,7 +98,8 @@
 				return new Promise(function (resolve) {
 					$scope.request("/links/add", {
 						Name: $('#title').val(),
-						Url: $('#url').val()
+						Url: $('#url').val(),
+						UrlBase: $('#urlbase').val()
 					}, function (res) {
 						resolve(res);
 					});

+ 56 - 5
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/system.js

@@ -282,7 +282,6 @@ myApp.controller("email", ["$scope", "$http", function ($scope) {
 }]);
 myApp.controller("firewall", ["$scope", "$http","NgTableParams","$timeout", function ($scope, $http,NgTableParams,$timeout) {
     var self = this;
-	var data = [];
 	self.data = {};
 	$scope.request("/system/getsettings", null, function(data) {
 		var settings = {};
@@ -302,7 +301,7 @@ myApp.controller("firewall", ["$scope", "$http","NgTableParams","$timeout", func
 				filterDelay: 0,
 				dataset: res.Data.list
 			});
-			data = res.Data.list;
+			$scope.logs=res.Data.list;
 			$scope.interceptCount=res.Data.interceptCount;
 			$scope.ranking=res.Data.ranking;
 		});
@@ -482,10 +481,62 @@ myApp.controller("firewall", ["$scope", "$http","NgTableParams","$timeout", func
 		$('.layui-layer-content').jsonViewer(eval("("+text+")"), {withQuotes: true, withLinks: true});
 		$('.layui-layer-content').css("word-wrap"," break-word");
     }
+
+	$scope.distinct=false;
+	$scope.duplicate= function() {
+		$scope.distinct=!$scope.distinct;
+        if ($scope.distinct) {
+            const res = new Map();
+			self.tableParams = new NgTableParams({}, {
+				filterDelay: 0,
+				dataset: angular.copy($scope.logs).filter(item => !res.has(item["IP"]) && res.set(item["IP"], 1))
+			});
+        } else {
+			self.tableParams = new NgTableParams({}, {
+				filterDelay: 0,
+				dataset: $scope.logs
+			});
+        }
+    }
 }]);
 
 myApp.controller("sendbox", ["$scope", "$http", function ($scope, $http) {
-	$http.post("/system/sendbox").then(function (res) {
-		$scope.Mails = res.data;
-	});
+	UEDITOR_CONFIG.autoHeightEnabled=false;
+	$scope.load= function() {
+        $http.post("/system/sendbox").then(function (res) {
+		    $scope.Mails = res.data;
+	    });
+    };
+
+	$scope.newmail= function() {
+        layer.open({
+			type: 1,
+			zIndex: 8,
+			title: '发送邮件',
+			area: (window.screen.width > 800 ? 800 : window.screen.width) + 'px',
+			content: $("#modal"),
+			end: function() {
+				$("#modal").css("display", "none");
+			}
+		});
+    }
+
+	$scope.send= function(mail) {
+        $http.post("/system/sendmail",mail, {
+			'Content-Type':'application/x-www-form-urlencoded'
+		}).then(function (res) {
+            if (res.data) {
+                layer.alert(res.data.Message);
+            } else {
+                layer.msg('发送成功');
+				layer.closeAll();
+				setTimeout(function() {
+			        $("#modal").css("display", "none");
+	                $scope.load();
+		        }, 500);
+            }
+	    });
+    }
+
+	$scope.load();
 }]);

+ 10 - 0
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/links.html

@@ -27,6 +27,16 @@
                     </div>
                 </div>
             </td>
+            <td title="'主页'" ng-switch="row.isEditing" ng-class="Url.$dirty ? 'bg-warning' : ''" ng-form="UrlBase" tracked-table-cell>
+                <span ng-switch-default>
+                    <a ng-href="{{row.UrlBase}}" target="_blank">{{row.UrlBase}}</a>
+                </span>
+                <div ng-class="Url.$invalid && Url.$dirty ? 'has-error' : ''" ng-switch-when="true">
+                    <div class="fg-line">
+                        <input type="text" name="name" ng-model="row.UrlBase" class="form-control input-sm" required />
+                    </div>
+                </div>
+            </td>
             <td title="'最近来源次数'" sortable="'Loopbacks'">
                 {{row.Loopbacks}}
             </td>

+ 4 - 0
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/system/firewall.html

@@ -97,6 +97,10 @@
         <span class="icon icon-bin"></span>
     </button>
     <span class="text-right">累计拦截{{interceptCount}}次。</span>
+    <label class="el-switch">
+        <input type="checkbox" name="switch">
+        <span class="el-switch-style" ng-click="duplicate()"></span>
+    </label>按IP去重
     <table class="table table-bordered table-condensed table-hover" disable-filter="list.isAdding" ng-form="list.tableForm" ng-table="list.tableParams" tracked-table="list.tableTracker">
         <tr ng-form="rowForm" ng-repeat="row in $data" tracked-table-row="row">
             <td filter="{IP: 'text'}" sortable="'IP'" title="'IP'">

+ 43 - 2
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/system/sendbox.html

@@ -3,13 +3,21 @@
         <div class="listview lv-bordered lv-lg">
             <div class="lv-header-alt clearfix">
                 <h2 class="lvh-label hidden-xs" style="font-size: 20px">发件箱</h2>
+                <ul class="lv-actions actions">
+                    <li>
+                        <a ng-click="load();"><i class="zmdi zmdi-refresh-alt"></i></a>
+                    </li>
+                    <li>
+                        <a ng-click="newmail();"><i class="zmdi zmdi-plus"></i></a>
+                    </li>
+                </ul>
             </div>
 
             <div class="lv-body">
                 <div class="lv-item media" ng-repeat="m in Mails">
                     <div class="media-body">
-                            <h2 class="lv-title">{{m.title}}</h2>
-                            <small class="lv-small" ng-bind-html="m.content|htmlString"></small>
+                        <h2 class="lv-title">{{m.title}}</h2>
+                        <small class="lv-small" ng-bind-html="m.content|htmlString"></small>
                         <ul class="lv-attrs">
                             <li>收件人:{{m.tos}}</li>
                             <li>发送日期:{{m.time|date:'yyyy-MM-dd HH:mm:ss'}}</li>
@@ -22,4 +30,37 @@
             </div>
         </div>
     </div>
+</div>
+
+<div id="modal" class="modal">
+    <div class="container-fluid" style="margin: 15px 0;">
+        <form class="bgm-white">
+            <div class="input-group">
+                <span class="input-group-addon">
+                    收件人:
+                </span>
+                <div class="fg-line">
+                    <input type="text" class="form-control" id="tos" ng-model="mail.tos" />
+                </div>
+            </div>
+            <div class="input-group">
+                <span class="input-group-addon">
+                    标题:
+                </span>
+                <div class="fg-line">
+                    <input type="text" class="form-control" id="title" ng-model="mail.title" />
+                </div>
+            </div>
+            <div class="input-group">
+                <span class="input-group-addon">
+                    内容:
+                </span>
+                <div style="height: 300px;" class="ueditor" ng-model="mail.content" type="text/plain"></div>
+            </div>
+            <div class="btn-group">
+                <button type="button" class="btn btn-info waves-effect" ng-click="send(mail)">发送</button>
+                <button type="button" class="btn btn-danger waves-effect" onclick="layer.closeAll()">取消</button>
+            </div>
+        </form>
+    </div>
 </div>