diff --git a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj index 99bdbfa7..580b51c4 100644 --- a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/admin/Bootstrap.Admin/Controllers/Api/NotificationsController.cs b/src/admin/Bootstrap.Admin/Controllers/Api/NotificationsController.cs index 73bb5cd0..6ba18c00 100644 --- a/src/admin/Bootstrap.Admin/Controllers/Api/NotificationsController.cs +++ b/src/admin/Bootstrap.Admin/Controllers/Api/NotificationsController.cs @@ -2,18 +2,19 @@ using Microsoft.AspNetCore.Mvc; using System; using System.Linq; +using Longbow.Tasks; namespace Bootstrap.Admin.Controllers.Api { /// - /// + /// 系统通知控制器 /// [Route("api/[controller]")] [ApiController] public class NotificationsController : ControllerBase { /// - /// + /// 后台 Header 状态条调用 /// /// [HttpGet] @@ -36,7 +37,7 @@ namespace Bootstrap.Admin.Controllers.Api }); // Tasks - var task = TaskHelper.Retrieves(); + var task = TaskServicesManager.ToList().Where(s => s.NextRuntime != null).Select(s => new { s.Name, s.LastRuntime, s.LastRunResult }); var tasksCount = task.Count(); //Message @@ -90,4 +91,4 @@ namespace Bootstrap.Admin.Controllers.Api }; } } -} \ No newline at end of file +} diff --git a/src/admin/Bootstrap.Admin/wwwroot/css/site.css b/src/admin/Bootstrap.Admin/wwwroot/css/site.css index 4b9aec76..b35b2b5c 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/css/site.css +++ b/src/admin/Bootstrap.Admin/wwwroot/css/site.css @@ -455,3 +455,14 @@ pre { .refreshIcon:hover { color: #fff; } + +.header .badge.badge-task { + right: 8px; + top: 2px; +} + +.header .content-task { + position: relative; + top: 6px; + right: 26px; +} \ No newline at end of file diff --git a/src/admin/Bootstrap.Admin/wwwroot/js/common-scripts.js b/src/admin/Bootstrap.Admin/wwwroot/js/common-scripts.js index d04a97b5..20f15439 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/js/common-scripts.js +++ b/src/admin/Bootstrap.Admin/wwwroot/js/common-scripts.js @@ -72,9 +72,13 @@ // tasks $('#msgHeaderTask').text(result.TasksCount); - var htmlUserTemplate = '{0}-{2}{1}%
{1}% 完成
'; + var resultFormat = { + "Success": '成功', + "Timeout": '亚健康' + } + var htmlUserTemplate = '
{1}
{2}
{3}
'; var html = result.Tasks.map(function (u) { - return $.format(htmlUserTemplate, u.TaskName, u.TaskProgress, u.AssignDisplayName, u.Id, $.formatUrl('Admin/Tasks')); + return $.format(htmlUserTemplate, $.formatUrl('Admin/Tasks'), u.Name, u.LastRuntime, resultFormat[u.LastRunResult]); }).join(''); $(html).insertAfter($('#msgHeaderTaskContent'));