public ServerMonitorView(IViewContext viewContext, ServerMonitorViewModel serverMonitorViewModel)
            : base(viewContext, serverMonitorViewModel, Module.ModuleName)
        {
            InitializeComponent();

            DataContext = serverMonitorViewModel;
        }
Example #2
0
        public JsonResult GetServerMonitor()
        {
            return(ExecuteFunctionRun(() =>
            {
                ServerMonitorViewModel model = new ServerMonitorViewModel();

                model.UserCount = AppUtility.Engine.Query.Count(OThinker.Organization.User.TableName, new string[] { OThinker.Organization.User.PropertyName_State + "=" + (int)OThinker.Organization.State.Active });
                model.OnlineCount = AppUtility.OnlineUserCount;
                model.TemplateNum = AppUtility.Engine.Query.Count(WorkflowClause.TableName, new string[] { });
                model.InstanceNum = AppUtility.Engine.Query.Count(Instance.InstanceContext.TableName, new string[] { });
                model.RunningInstanceNum = AppUtility.Engine.Query.Count(Instance.InstanceContext.TableName, new string[] { "State=2" });
                model.DatabaseSize = AppUtility.Engine.EngineConfig.GetDbSize().ToString() + "MB";

                int vesselLimit = int.Parse(this.UserValidator.PortalSettings[OThinker.H3.Configs.License.PropertyName_VesselLimit] + string.Empty);
                int userLimit = int.Parse(this.UserValidator.PortalSettings[OThinker.H3.Configs.License.PropertyName_UserLimit] + string.Empty);
                int workflowLimit = int.Parse(this.UserValidator.PortalSettings[OThinker.H3.Configs.License.PropertyName_WorkflowLimit] + string.Empty);
                int languageLimit = int.Parse(this.UserValidator.PortalSettings[OThinker.H3.Configs.License.PropertyName_LanguageLimit] + string.Empty);
                model.VesselLimit = vesselLimit;
                model.UserLimit = userLimit;
                model.WorkflowLimit = workflowLimit;
                model.LanguageLimit = languageLimit;

                model.LanguageCount = 2;
                model.Expired = this.ExpriedDate.ToString("yyyy-MM-dd");


                if (LicenseType == OThinker.H3.Configs.LicenseType.Develop)
                {
                    model.Register = "ServerMonitor.Develop";
                }
                else if (LicenseType == OThinker.H3.Configs.LicenseType.Test)
                {
                    model.Register = "ServerMonitor.Test";
                }
                else if (LicenseType == OThinker.H3.Configs.LicenseType.Product)
                {
                    model.Register = "ServerMonitor.Official";
                }
                //版本号
                model.LicenseType = AppUtility.GetAppVersion();
                model.CheckedImg = "../WFRes/images/Checked.gif";;
                model.UnCheckedImg = "../WFRes/images/UnChecked.gif";
                model.imgBizBus = this.BizBusAuthorized;
                model.imgBizRule = this.BizRuleAuthorized;
                model.imgApps = this.AppsAuthorized;
                model.imgBPA = this.BPAAuthorized;
                model.imgMobile = this.MobileAuthorized;
                model.imgPortal = this.PortalAuthorized;
                model.imgSAP = this.SAPAuthorized;
                model.imgWeChat = this.WeChatAuthorized;

                return Json(model, JsonRequestBehavior.AllowGet);
            }));
        }