public JsonResult Index(LoadNodeMonitorListRequest req)
        {
            ViewBag.NodeId        = req.NodeId.ToString();
            ViewBag.MonitorStatus = req.MonitorStatus.ToString();
            ResponseBase <PageInfoResponse <List <tb_nodemonitor> > > nodelist = PostToServer <PageInfoResponse <List <tb_nodemonitor> >, LoadNodeMonitorListRequest>(ClientProxy.LoadNodeMonitorList_Url, req);

            if (nodelist.Status != ResponesStatus.Success)
            {
                return(Json(new
                {
                    sEcho = 0,
                    iTotalRecords = 0,
                    iTotalDisplayRecords = 0,
                    aaData = new List <string>()
                }));
            }

            return(Json(nodelist.Data));
        }
Exemplo n.º 2
0
        public ResponseBase <PageInfoResponse <List <tb_nodemonitor> > > LoadNodeMonitorList(LoadNodeMonitorListRequest req)
        {
            try
            {
                int pageIndex       = (req.iDisplayStart / req.iDisplayLength) + 1;
                int totalCount      = 0;
                var nodemonitorlist = nodemonitorRep.Find(out totalCount, pageIndex, req.iDisplayLength, x => x.id.ToString(), x =>
                                                          x.nodeid == (req.NodeId <= 0 ? x.nodeid : req.NodeId) &&
                                                          x.monitorstatus == (req.MonitorStatus < 0?x.monitorstatus:req.MonitorStatus) &&
                                                          x.isdel == 0
                                                          ).OrderByDescending(x => x.createtime).ToList();
                if (nodemonitorlist == null || nodemonitorlist.Count <= 0)
                {
                    return(ResponseToClient <PageInfoResponse <List <tb_nodemonitor> > >(ResponesStatus.Failed, "当前未查到任何节点"));
                }

                //data.NodeList = nodelist;
                return(ResponseToClient <PageInfoResponse <List <tb_nodemonitor> > >(ResponesStatus.Success, "", new PageInfoResponse <List <tb_nodemonitor> >()
                {
                    aaData = nodemonitorlist, iTotalDisplayRecords = totalCount, iTotalRecords = totalCount, sEcho = req.sEcho
                }));
            }
            catch (Exception ex)
            {
                return(ResponseToClient <PageInfoResponse <List <tb_nodemonitor> > >(ResponesStatus.Exception, ex.Message));
            }
        }