繁体   English   中英

MSoft是否为用于MVC3应用程序的服务器端错误插件或工具提供持久的客户端错误报告?

[英]Does MSoft provide a persistent client-side error reporting for server-side errors plugin or tool to use with MVC3 applications?

我正在开发一个包含大量服务器端数据处理和工作的应用程序。 我想向客户提供有关此工作的持续状态更新和错误报告。

例如,客户端可以根据他上载的某些数据来触发运行服务器端的一项或多项作业。 然后,在作业继续运行的同时,他可能会继续在该站点上执行其他工作。

MSoft是否提供了一个很好的工具来向客户端显示状态更新和错误报告? 我想象一种轮询的javascript应用程序,或者是预定义的子窗体等,它们可以位于页脚中,或者在适当的时候动态地加载到屏幕的一角。

想到这一点,我可能会对这种工具的任何其他实现感到满意,只要它是最新的并且能看到活跃的支持即可。

我有类似的要求来刷新报告,并沿异步控制器路由,直到意识到限制为止。 我决定实现一个解决方案,该解决方案注册来自ASP.NET MVC3应用程序的报表刷新,并创建了Windows服务,该服务每2分钟轮询一次请求进行处理。

视图

$("#btnRefresh").live("click", function(e) {
    $.ajax({
            type: "POST",
            url: '@Url.Action("Refresh")',
            data: "reportId=@Model.Id"
        })
        .done(function(message) {
            alert(message);
        })
        .fail(function(serverResponse) {
            alert("Error occurred while processing request: " + serverResponse.responseText);
        });

    e.preventDefault();
});

控制器动作

[HttpPost, VerifyReportAccess]
public ActionResult Refresh(Guid reportId)
{
    string message;

    try
    {
        message = _publisher.RequestRefresh(reportId);
    }
    catch(Exception ex)
    {
        HttpContext.Response.StatusCode = (Int32)HttpStatusCode.BadRequest;
        message = ex.Message;
    }

    return Json(message);
}

资料库

public string RequestRefresh(Guid reportId)
{
    var scheduledReport = _repository.GetScheduleForReport(reportId);

    if (scheduledReport.CompanyId == Guid.Empty)
        throw new Exception("Requested Report Not Found");

    if(_repository.CheckPendingRefresh(scheduledReport))
        return "A request to refresh this report is already pending.";

    _repository.ScheduleReportRefresh(scheduledReport);

    return "A request to refresh the report has been submitted. The report will appear online when available.";
}

Windows服务运行与夜间ETL进程相同的类库代码,以刷新报告。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM