コード例 #1
0
        public async Task <ActionResult> NodeGraph(string nodeId, string type, string subId)
        {
            var n  = DashboardModule.GetNodeById(nodeId);
            var vd = new NodeGraphModel
            {
                Node = n,
                Type = type
            };

            if (n != null)
            {
                switch (type)
                {
                case NodeGraphModel.KnownTypes.Live:
                    await PopulateModel(vd, NodeGraphModel.KnownTypes.CPU, subId).ConfigureAwait(false);
                    await PopulateModel(vd, NodeGraphModel.KnownTypes.Memory, subId).ConfigureAwait(false);

                    //await PopulateModel(vd, NodeGraphModel.KnownTypes.Network, subId);
                    break;

                case NodeGraphModel.KnownTypes.CPU:
                case NodeGraphModel.KnownTypes.Memory:
                case NodeGraphModel.KnownTypes.Network:
                case NodeGraphModel.KnownTypes.Volume:
                case NodeGraphModel.KnownTypes.VolumePerformance:
                    await PopulateModel(vd, type, subId).ConfigureAwait(false);

                    break;
                }
            }

            return(View("Node.Graph", vd));
        }
コード例 #2
0
        public List <DashboardModule> CoordinatorDashboard(int userId)
        {
            List <DashboardModule> userlist = new List <DashboardModule>();

            try
            {
                accessManager.SqlConnectionOpen(DataBase.DataEntryTracker);
                List <SqlParameter> aParameters = new List <SqlParameter>();;
                aParameters.Add(new SqlParameter("@UserId", userId));
                SqlDataReader sqlDataReader = accessManager.GetSqlDataReader("sp_CoordinatorDashboard", aParameters);
                while (sqlDataReader.Read())
                {
                    DashboardModule common = new DashboardModule();
                    common.UserName             = sqlDataReader["UserName"].ToString();
                    common.TotalTodaysCompleted = sqlDataReader["TotalTodaysCompleted"].ToString();
                    common.CurrentWorkload      = sqlDataReader["CurrentWorkload"].ToString();
                    common.TodayAssign          = sqlDataReader["TodayAssign"].ToString();
                    common.WorkingTime          = sqlDataReader["WorkingTime"].ToString();
                    //common.WorkPercentage =(Int32.Parse(common.TotalTodaysCompleted)+ Int32.Parse(common.WorkingTime))*100/ Int32.Parse(common.CurrentWorkload);
                    userlist.Add(common);
                }
                return(userlist);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                accessManager.SqlConnectionClose();
            }
        }
コード例 #3
0
        public async Task <JsonResult> PollCPU(string id = null, string node = null)
        {
            var n = id.HasValue() ? DashboardModule.GetNodeById(id) : DashboardModule.GetNodeByName(node);

            if (n == null)
            {
                return(JsonNotFound());
            }

            var data = await n.GetCPUUtilization().ConfigureAwait(false);

            if (data?.Data == null)
            {
                return(JsonNotFound());
            }

            var total = data.Data.Find(c => c.Name == "Total");

            return(Json(new
            {
                duration = data.Duration.TotalMilliseconds,
                cores = data.Data.Where(c => c != total).Select(c => new
                {
                    name = c.Name,
                    utilization = c.Utilization
                }),
                total = total?.Utilization ?? 0
            }));
        }
コード例 #4
0
        public async Task <ActionResult> VolumeSpark(string direction, string id, string iid)
        {
            MiniProfiler.Stop(true);
            var volume = DashboardModule.GetNodeById(id)?.GetVolume(iid);

            if (volume == null)
            {
                return(ContentNotFound());
            }
            var points = await volume.GetPerformanceUtilization(SparkStart, null, SparkPoints).ConfigureAwait(false);

            if (points.Count == 0)
            {
                return(EmptySparkSVG());
            }

            Func <DoubleGraphPoint, double> getter = p => p.Value.GetValueOrDefault(0);

            if (direction == "write")
            {
                getter = p => p.BottomValue.GetValueOrDefault(0);
            }

            return(SparkSVG(points, Convert.ToInt64(points.Max(getter)), p => getter(p)));
        }
コード例 #5
0
 public GraphController(
     SQLModule sqlModule,
     DashboardModule dashboardModule,
     IOptions <OpserverSettings> settings) : base(settings)
 {
     Sql       = sqlModule;
     Dashboard = dashboardModule;
 }
コード例 #6
0
        public async Task <ActionResult> ControlService(string node, string name, NodeService.Action serviceAction)
        {
            var n      = DashboardModule.GetNodeByName(node);
            var s      = n.GetService(name);
            var result = Json(await s.Update(serviceAction).ConfigureAwait(false));
            await n.DataProvider.PollAsync(true).ConfigureAwait(false);

            return(result);
        }
コード例 #7
0
 private void InitializeComponent()
 {
     _module1 = new SystemModule();
     _module2 = new SystemAspNetModule();
     _securityStrategyComplex1 = new SecurityStrategyComplex();
     _authenticationStandard1  = new AuthenticationStandard();
     _module4                     = new XtraDashboardTesterAspNetModule();
     _sqlConnection1              = new SqlConnection();
     _validationModule1           = new ValidationModule();
     _dashboardModule1            = new DashboardModule();
     _validationAspNetModule1     = new ValidationAspNetModule();
     _xtraDashboardWebModule1     = new XtraDashboardWebModule();
     _scriptRecorderModuleBase1   = new ScriptRecorderModuleBase();
     _scriptRecorderAspNetModule1 = new ScriptRecorderAspNetModule();
     _moduleModule1               = new ModuleModule();
     ((ISupportInitialize)this).BeginInit();
     //
     // _securityStrategyComplex1
     //
     _securityStrategyComplex1.Authentication = _authenticationStandard1;
     _securityStrategyComplex1.RoleType       = typeof(XpandPermissionPolicyRole);
     _securityStrategyComplex1.UserType       = typeof(PermissionPolicyUser);
     //
     // _authenticationStandard1
     //
     _authenticationStandard1.LogonParametersType = typeof(AuthenticationStandardLogonParameters);
     //
     // _sqlConnection1
     //
     _sqlConnection1.ConnectionString =
         "Integrated Security=SSPI;Pooling=false;Data Source=.\\SQLEXPRESS;Initial Catalog=X" +
         "traDashboardTester";
     _sqlConnection1.FireInfoMessageEventOnUserErrors = false;
     //
     // validationModule1
     //
     _validationModule1.AllowValidationDetailsAccess     = true;
     _validationModule1.IgnoreWarningAndInformationRules = false;
     //
     // XtraDashboardTesterAspNetApplication
     //
     ApplicationName = "XtraDashboardTester";
     Connection      = _sqlConnection1;
     Modules.Add(_module1);
     Modules.Add(_module2);
     Modules.Add(_validationModule1);
     Modules.Add(_dashboardModule1);
     Modules.Add(_validationAspNetModule1);
     Modules.Add(_xtraDashboardWebModule1);
     Modules.Add(_scriptRecorderModuleBase1);
     Modules.Add(_scriptRecorderAspNetModule1);
     Modules.Add(_moduleModule1);
     Modules.Add(_module4);
     Security = _securityStrategyComplex1;
     ((ISupportInitialize)this).EndInit();
 }
コード例 #8
0
        public ActionResult Node([DefaultValue(CurrentStatusTypes.Stats)] CurrentStatusTypes view, string node = null)
        {
            var vd = new NodeModel
            {
                CurrentNode       = DashboardModule.GetNodeByName(node),
                CurrentStatusType = view
            };

            return(View("Node", vd));
        }
コード例 #9
0
        public WmiDataProvider(DashboardModule module, WMISettings settings) : base(module, settings)
        {
            _config = settings;

            _wmiNodes.AddRange(InitNodeList(_config.Nodes).OrderBy(x => x.Endpoint).ToList());
            // Do this ref cast list once
            AllNodes.AddRange(_wmiNodes.Cast <Node>().ToList());
            // For fast lookups
            _wmiNodeLookup = new Dictionary <string, WmiNode>(_wmiNodes.Count);
            foreach (var n in _wmiNodes)
            {
                _wmiNodeLookup[n.Id] = n;
            }
        }
コード例 #10
0
        public async Task <ActionResult> CPUSparkSvg(string id)
        {
            var node = DashboardModule.GetNodeById(id);

            if (node == null)
            {
                return(ContentNotFound());
            }
            var points = await node.GetCPUUtilization(SparkStart, null, SparkPoints).ConfigureAwait(false);

            return(points.Count == 0
                ? EmptySparkSVG()
                : SparkSVG(points, 100, p => p.Value.GetValueOrDefault()));
        }
コード例 #11
0
        public async Task <ActionResult> MemorySpark(string id)
        {
            var node = DashboardModule.GetNodeById(id);

            if (node?.TotalMemory == null)
            {
                return(ContentNotFound($"Could not determine total memory for '{id}'"));
            }
            var points = await node.GetMemoryUtilization(SparkStart, null, SparkPoints).ConfigureAwait(false);

            return(points.Count == 0
                ? EmptySparkSVG()
                : SparkSVG(points, Convert.ToInt64(node.TotalMemory.GetValueOrDefault()), p => p.Value.GetValueOrDefault()));
        }
コード例 #12
0
ファイル: RedisInstance.cs プロジェクト: xiaopohou/Opserver
 public string GetServerName(string hostOrIp)
 {
     if (Current.Settings.Dashboard.Enabled && IPAddress.TryParse(hostOrIp, out IPAddress addr))
     {
         var nodes = DashboardModule.GetNodesByIP(addr).ToList();
         if (nodes.Count == 1)
         {
             return(nodes[0].PrettyName);
         }
     }
     //System.Net.Dns.GetHostEntry("10.7.0.46").HostName.Split(StringSplits.Period).First()
     //TODO: Redis instance search
     return(AppCache.GetHostName(hostOrIp));
 }
コード例 #13
0
        public async Task <ActionResult> NetworkSpark(string id)
        {
            var node = DashboardModule.GetNodeById(id);

            if (node == null)
            {
                return(ContentNotFound());
            }
            var points = await node.GetNetworkUtilization(SparkStart, null, SparkPoints).ConfigureAwait(false);

            return(points.Count == 0
                ? EmptySparkSVG()
                : SparkSVG(points, Convert.ToInt64(points.Max(p => p.Value + p.BottomValue).GetValueOrDefault()), p => (p.Value + p.BottomValue).GetValueOrDefault()));
        }
コード例 #14
0
        public ActionResult InstanceSummary(string node, string type)
        {
            var n = DashboardModule.GetNodeByName(node);

            switch (type)
            {
            case "hardware":
                return(View("Node.Hardware", n));

            case "network":
                return(View("Node.Network", n));

            default:
                return(ContentNotFound("Unknown summary view requested"));
            }
        }
コード例 #15
0
ファイル: SmokeTests.cs プロジェクト: surf78/CMS-Automation
 public void SMK01_VerifyLoginAsSuperSuperAdmin()
 {
     TestGroupName = GetType().Name;
     TestName      = TestContext.TestName;
     CreateFolders(TestGroupName, TestName);
     try
     {
         LoginModule.LoginToCMS("*****@*****.**", "Nop@ss1234", TestGroupName, TestName);
         DashboardModule.VerifySuperSuperAdminDashboard(TestGroupName, TestName);
     }
     catch (Exception e)
     {
         _verificationErrors.Append(e.Message);
         Assert.Fail(e.Message);
     }
 }
コード例 #16
0
ファイル: SmokeTests.cs プロジェクト: surf78/CMS-Automation
 public void SMK05_VerifyGroupCreation()
 {
     TestGroupName = GetType().Name;
     TestName      = TestContext.TestName;
     CreateFolders(TestGroupName, TestName);
     try
     {
         var tmp = File.ReadAllText(@datapath + "\\path.txt");
         DashboardModule.NavigateToDashboard(TestGroupName, TestName);
         GroupModule.VerifyAddGroup(tmp, TestGroupName, TestName);
     }
     catch (Exception e)
     {
         _verificationErrors.Append(e.Message);
         Assert.Fail(e.Message);
     }
 }
コード例 #17
0
ファイル: SmokeTests.cs プロジェクト: surf78/CMS-Automation
 public void SMK03_VerifyLoginAsNewCompanyAdmin()
 {
     TestGroupName = GetType().Name;
     TestName      = TestContext.TestName;
     CreateFolders(TestGroupName, TestName);
     try
     {
         var tmp = File.ReadAllText(@datapath + "\\path.txt");
         LoginModule.LoginToCMS("admin" + tmp + "@test.com", "password_" + tmp, TestGroupName, TestName);
         DashboardModule.VerifyCompanyAdminDashboard(TestGroupName, TestName);
     }
     catch (Exception e)
     {
         _verificationErrors.Append(e.Message);
         Assert.Fail(e.Message);
     }
 }
コード例 #18
0
        public async Task <ActionResult> MemoryJson(string id, long?start = null, long?end = null, bool?summary = false)
        {
            var node = DashboardModule.GetNodeById(id);

            if (node == null)
            {
                return(JsonNotFound());
            }
            var data = await MemoryData(node, start, end, summary).ConfigureAwait(false);

            if (data == null)
            {
                return(JsonNotFound());
            }

            return(Json(data));
        }
コード例 #19
0
        public static void Setup()
        {
            Console.WriteLine("E3");
            Driver = GetWebDriver(ConfigurationSettings.AppSettings["browser"]);
            string baseUrl = ConfigurationSettings.AppSettings["baseUrl"];

            Console.WriteLine("E4");
            Driver.Manage().Window.Maximize();
            Driver.Navigate().GoToUrl(baseUrl);
            LoginModule        = new LoginModule(Driver);
            CompanyModule      = new CompanyModule(Driver);
            DashboardModule    = new DashboardModule(Driver);
            ArtistModule       = new ArtistModule(Driver);
            GroupModule        = new GroupModule(Driver);
            ContentModule      = new ContentModule(Driver);
            ElementPresentTest = new ElementPresentTest(Driver);
        }
コード例 #20
0
        public async Task <ActionResult> VolumePerformanceJson(string id, string iid, long?start = null, long?end = null, bool?summary = false)
        {
            var iface = DashboardModule.GetNodeById(id)?.GetVolume(iid);

            if (iface == null)
            {
                return(JsonNotFound());
            }
            var data = await VolumePerformanceData(iface, start, end, summary).ConfigureAwait(false);

            if (data == null)
            {
                return(JsonNotFound());
            }

            return(Json(data));
        }
コード例 #21
0
ファイル: HomeController.cs プロジェクト: captncraig/Opserver
 public HomeController(
     IOptions <OpserverSettings> _settings,
     IEnumerable <StatusModule> modules,
     DashboardModule dashboard,
     SQLModule sql,
     RedisModule redis,
     ElasticModule elastic,
     ExceptionsModule exceptions,
     HAProxyModule haproxy
     ) : base(_settings)
 {
     Modules    = modules;
     Dashboard  = dashboard;
     Sql        = sql;
     Redis      = redis;
     Elastic    = elastic;
     Exceptions = exceptions;
     HAProxy    = haproxy;
 }
コード例 #22
0
        public IHttpActionResult GetDashbordList(int userid, DashboardModule module)
        {
            //var userRole = db.UserRole.FirstOrDefault(x => x.UserId == 1);

            //if(userRole.RoleId == )

            DashboardList dashboardList = new DashboardList();

            if (module == DashboardModule.PublicEvent)
            {
                dashboardList = PublicEventDashboardStatusList();
            }
            else if (module == DashboardModule.Courses)
            {
                dashboardList = ELearningDashboardStatusList();
            }
            else if (module == DashboardModule.MediaInterview)
            {
                dashboardList = MediaEventDashboardStatusList();
            }
            else if (module == DashboardModule.Exhibition)
            {
                dashboardList = ExhibitionEventDashboardStatusList();
            }
            else if (module == DashboardModule.KMC)
            {
                dashboardList = KMCList();
            }
            else if (module == DashboardModule.Publication)
            {
                dashboardList = PublicationStatusList();
            }
            else if (module == DashboardModule.Survey)
            {
                dashboardList = SurveyStatusList();
            }

            dashboardList.ModuleName = module;


            return(Ok(dashboardList));
        }
コード例 #23
0
ファイル: SmokeTests.cs プロジェクト: surf78/CMS-Automation
 public void SMK08_VerifyContentCreation_Video_FixedCountdown_Artist_Preview()
 {
     TestGroupName = GetType().Name;
     TestName      = TestContext.TestName;
     CreateFolders(TestGroupName, TestName);
     try
     {
         type        = "Fixed Countdown";
         level       = "3";
         media       = "Video";
         pathcontent = datapath + "\\Video.au3";
         pathpreview = datapath + "\\Image.au3";
         owner       = "Artist";
         var tmp = File.ReadAllText(@datapath + "\\path.txt");
         DashboardModule.NavigateToDashboard(TestGroupName, TestName);
         ContentModule.VerifyAddContent(type, level, media, pathcontent, pathpreview, owner, tmp, TestGroupName, TestName);
     }
     catch (Exception e)
     {
         _verificationErrors.Append(e.Message);
         Assert.Fail(e.Message);
     }
 }
コード例 #24
0
        public async Task <ActionResult> InterfaceSpark(string direction, string id, string iid)
        {
            var iface = DashboardModule.GetNodeById(id)?.GetInterface(iid);

            if (iface == null)
            {
                return(ContentNotFound());
            }
            var points = await iface.GetUtilization(SparkStart, null, SparkPoints).ConfigureAwait(false);

            if (points.Count == 0)
            {
                return(EmptySparkSVG());
            }

            Func <DoubleGraphPoint, double> getter = p => p.Value.GetValueOrDefault(0);

            if (direction == "out")
            {
                getter = p => p.BottomValue.GetValueOrDefault(0);
            }

            return(SparkSVG(points, Convert.ToInt64(points.Max(getter)), p => getter(p)));
        }
コード例 #25
0
ファイル: SmokeTests.cs プロジェクト: surf78/CMS-Automation
 public void SMK09_VerifyContentCreation_Image_DurationCountdown_Group()
 {
     TestGroupName = GetType().Name;
     TestName      = TestContext.TestName;
     CreateFolders(TestGroupName, TestName);
     try
     {
         type        = "Duration Countdown";
         level       = "4";
         media       = "Image";
         pathcontent = datapath + "\\Image.au3";
         pathpreview = "";
         owner       = "Group";
         var tmp = File.ReadAllText(@datapath + "\\path.txt");
         DashboardModule.NavigateToDashboard(TestGroupName, TestName);
         ContentModule.VerifyAddContent(type, level, media, pathcontent, pathpreview, owner, tmp, TestGroupName, TestName);
         LoginModule.Logout(TestGroupName, TestName);
     }
     catch (Exception e)
     {
         _verificationErrors.Append(e.Message);
         Assert.Fail(e.Message);
     }
 }
コード例 #26
0
 public OrionDataProvider(DashboardModule module, OrionSettings settings) : base(module, settings)
 {
 }
コード例 #27
0
ファイル: Dashboard.cs プロジェクト: ansonhwa92/akpk_copy
 public DashboardModuleByRole()
 {
     DefaultModule   = new DashboardModule();
     AvailableModule = new List <DashboardModule>();
 }
コード例 #28
0
 public EmptyDataProvider(DashboardModule module, string uniqueKey) : base(module, uniqueKey)
 {
 }
コード例 #29
0
 public SignalFxDataProvider(DashboardModule module, SignalFxSettings settings, ILogger logger) : base(module, settings)
 {
     _logger = logger;
 }
コード例 #30
0
 public BosunDataProvider(DashboardModule module, BosunSettings settings) : base(module, settings)
 {
 }