From 98db492086311d22ee2a6195f6cf8bd13e33ca0d Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Tue, 14 Aug 2018 18:12:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9A=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=A0=8F=E5=9C=B0=E5=9D=80=E4=BD=BF=E7=94=A8$.formatU?= =?UTF-8?q?rl=E6=96=B9=E6=B3=95=E7=BB=9F=E4=B8=80=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/wwwroot/js/Longbow.Common.js | 1 + Bootstrap.Admin/wwwroot/js/common-scripts.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/js/Longbow.Common.js b/Bootstrap.Admin/wwwroot/js/Longbow.Common.js index 701efa05..b1d6ac1a 100644 --- a/Bootstrap.Admin/wwwroot/js/Longbow.Common.js +++ b/Bootstrap.Admin/wwwroot/js/Longbow.Common.js @@ -216,6 +216,7 @@ return this; }, formatUrl: function (url) { + if (!url) url = ""; if (url.substr(0, 4) == "http") return url; var base = $('#pathBase').attr('href'); return base + url; diff --git a/Bootstrap.Admin/wwwroot/js/common-scripts.js b/Bootstrap.Admin/wwwroot/js/common-scripts.js index 60e58d02..a1d8540d 100644 --- a/Bootstrap.Admin/wwwroot/js/common-scripts.js +++ b/Bootstrap.Admin/wwwroot/js/common-scripts.js @@ -87,45 +87,45 @@ // new users $('#msgHeaderTask').text(result.TasksCount); $('#msgHeaderTaskBadge').text(result.TasksCount); - var htmlUserTemplate = '{0}-{2}{1}%
{1}% 完成
'; + var htmlUserTemplate = '{0}-{2}{1}%
{1}% 完成
'; var html = result.Tasks.map(function (u) { - return $.format(htmlUserTemplate, u.TaskName, u.TaskProgress, u.AssignDisplayName, u.Id); + return $.format(htmlUserTemplate, u.TaskName, u.TaskProgress, u.AssignDisplayName, u.Id, $.formatUrl()); }).join(''); $(html).insertAfter($('#msgHeaderTaskContent')); // new users $('#msgHeaderUser').text(result.NewUsersCount); $('#msgHeaderUserBadge').text(result.NewUsersCount); - htmlUserTemplate = '
  • {1}({0})
    {3}
  • '; + htmlUserTemplate = '
  • {1}({0})
    {3}
  • '; html = result.Users.map(function (u) { - return $.format(htmlUserTemplate, u.UserName, u.DisplayName, u.Description, u.Period); + return $.format(htmlUserTemplate, u.UserName, u.DisplayName, u.Description, u.Period, $.formatUrl()); }).join(''); $(html).insertAfter($('#msgHeaderUserContent')); // apps $('#msgHeaderApp').text(result.AppExceptionsCount); $('#msgHeaderAppBadge').text(result.AppExceptionsCount); - htmlUserTemplate = '
    {0}
    {2}
    '; + htmlUserTemplate = '
    {0}
    {2}
    '; html = result.Apps.map(function (u) { - return $.format(htmlUserTemplate, u.ExceptionType, u.Message, u.Period); + return $.format(htmlUserTemplate, u.ExceptionType, u.Message, u.Period, $.formatUrl()); }).join(''); $(html).insertAfter($('#msgHeaderAppContent')); // dbs $('#msgHeaderDb').text(result.DbExceptionsCount); $('#msgHeaderDbBadge').text(result.DbExceptionsCount); - htmlUserTemplate = '
    {0}
    {2}
    '; + htmlUserTemplate = '
    {0}
    {2}
    '; html = result.Dbs.map(function (u) { - return $.format(htmlUserTemplate, u.ErrorPage, u.Message, u.Period); + return $.format(htmlUserTemplate, u.ErrorPage, u.Message, u.Period, $.formatUrl()); }).join(''); $(html).insertAfter($('#msgHeaderDbContent')); // messages $('#msgHeaderMsg').text(result.MessagesCount); $('#msgHeaderMsgBadge').text(result.MessagesCount); - htmlUserTemplate = '
  • avatar{2}{4}{3}
  • '; + htmlUserTemplate = '
  • avatar{2}{4}{3}
  • '; html = result.Messages.map(function (u) { - return $.format(htmlUserTemplate, u.Id, u.FromIcon, u.FromDisplayName, u.Title, u.Period, u.Content); + return $.format(htmlUserTemplate, u.Id, u.FromIcon, u.FromDisplayName, u.Title, u.Period, u.Content, $.formatUrl()); }).join(''); $(html).insertAfter($('#msgHeaderMsgContent')); }