简体   繁体   English

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

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

I'm working on an application which contains significant server-side data manipulation and work. 我正在开发一个包含大量服务器端数据处理和工作的应用程序。 I would like to provide constant status updated and error reports related to this work, to the client. 我想向客户提供有关此工作的持续状态更新和错误报告。

The client might, for example, fire off a job or batch of jobs running server side, based on some data he uploaded. 例如,客户端可以根据他上载的某些数据来触发运行服务器端的一项或多项作业。 Then he might proceed to do other work on the site, while the jobs continue to run. 然后,在作业继续运行的同时,他可能会继续在该站点上执行其他工作。

Does MSoft provide a nice tool for showing status updates and error reports to the client? MSoft是否提供了一个很好的工具来向客户端显示状态更新和错误报告? I imagine some sort of polling javascript app, or maybe a pre-defined subform etc.., that could sit in a footer or be dynamically loaded over a corner of the screen when appropriate. 我想象一种轮询的javascript应用程序,或者是预定义的子窗体等,它们可以位于页脚中,或者在适当的时候动态地加载到屏幕的一角。

Come to think of it, I'd probably be happy with any other implementation of this kind of tool, as long as it's up to date and sees lively support. 想到这一点,我可能会对这种工具的任何其他实现感到满意,只要它是最新的并且能看到活跃的支持即可。

I had a similar requirement to refresh reports and went down the asynchronous controller route until I realized the limitations. 我有类似的要求来刷新报告,并沿异步控制器路由,直到意识到限制为止。 I decided to implement a solution that registers the report refresh from the ASP.NET MVC3 application and made a Windows Service that polls requests every 2 minutes for processing. 我决定实现一个解决方案,该解决方案注册来自ASP.NET MVC3应用程序的报表刷新,并创建了Windows服务,该服务每2分钟轮询一次请求进行处理。

View 视图

$("#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();
});

Controller Action 控制器动作

[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);
}

Repository 资料库

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.";
}

The windows service runs the same class library code as the nightly ETL process to refresh the report. Windows服务运行与夜间ETL进程相同的类库代码,以刷新报告。

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

相关问题 在mvc3中从客户端调用服务器端函数 - call server-side function from client-side in mvc3 在服务器端捕获所有JavaScript客户端错误 - Catch all JavaScript client-side errors on the server-side 导出服务器端功能以供客户端使用 - Export server-side function for client-side use 客户端还是服务器端框架? - Client-side or server-side framework? 将变量从服务器端控制器传递到客户端,以在客户端JavaScript中使用 - Pass variable from server-side controller to client-side to use in client-side JavaScript 客户端或服务器端处理? - Client-side or server-side processing? 服务器端和客户端JavaScript - Server-side and client-side JavaScript 有没有办法让 Firestore 实时监听器在客户端或服务器端持久化? - Is there a way to make firestore real time listener persistent on client-side or server-side? 输入验证是针对企业应用程序的客户端还是服务器端? - Should input validation be client-side or server-side for Enterprise applications? 执行Facebook身份验证:客户端和服务器端 - Enforcing Facebook Authentication: Client-side and server-side
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM