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)); }
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(); } }
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 })); }
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))); }
public GraphController( SQLModule sqlModule, DashboardModule dashboardModule, IOptions <OpserverSettings> settings) : base(settings) { Sql = sqlModule; Dashboard = dashboardModule; }
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); }
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(); }
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)); }
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; } }
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())); }
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())); }
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)); }
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())); }
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")); } }
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); } }
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); } }
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); } }
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)); }
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); }
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)); }
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; }
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)); }
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); } }
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))); }
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); } }
public OrionDataProvider(DashboardModule module, OrionSettings settings) : base(module, settings) { }
public DashboardModuleByRole() { DefaultModule = new DashboardModule(); AvailableModule = new List <DashboardModule>(); }
public EmptyDataProvider(DashboardModule module, string uniqueKey) : base(module, uniqueKey) { }
public SignalFxDataProvider(DashboardModule module, SignalFxSettings settings, ILogger logger) : base(module, settings) { _logger = logger; }
public BosunDataProvider(DashboardModule module, BosunSettings settings) : base(module, settings) { }