public ActionResult Servers(string cluster, string node, string ag, bool detailOnly = false) { var vd = new ServersModel { StandaloneInstances = Module.StandaloneInstances, Clusters = Module.Clusters, Refresh = node.HasValue() ? 10 : 5 }; if (cluster.HasValue()) { vd.CurrentCluster = vd.Clusters.Find(c => string.Equals(c.Name, cluster, StringComparison.OrdinalIgnoreCase)); } if (vd.CurrentCluster != null) { vd.AvailabilityGroups = vd.CurrentCluster.GetAvailabilityGroups(node, ag).ToList(); } if (detailOnly && vd.CurrentCluster != null) { return(View("Servers.ClusterDetail", vd)); } return(View("Servers", vd)); }
public void MoveItemUp(ServersModel server) { int currentIndex = Servers.IndexOf(server); if (currentIndex <= 0) { return; } Servers.Move(currentIndex, currentIndex - 1); }
public void MoveItemDown(ServersModel server) { int currentIndex = Servers.IndexOf(server); if (currentIndex < 0 || currentIndex + 1 >= Servers.Count) { return; } Servers.Move(currentIndex, currentIndex + 1); }
public ActionResult AllJobs() { var vd = new ServersModel { View = SQLViews.Jobs, StandaloneInstances = SQLModule.StandaloneInstances, Clusters = SQLModule.Clusters, Refresh = 30 }; return(View("AllJobs", vd)); }
public ActionResult AllJobs(JobSort?sort = null, SortDir?dir = null) { var vd = new ServersModel { View = SQLViews.Jobs, StandaloneInstances = Module.StandaloneInstances, Clusters = Module.Clusters, Refresh = 30, JobSort = sort, SortDirection = dir }; return(View("AllJobs", vd)); }
public static void Server(ServersModel serverModel) { try { Process.Start(new ProcessStartInfo() { FileName = serverModel.ContentButton == "Join Server" ? GetRegistryArma3Path : $"ts3server://{serverModel.ServerIp}?channel={_tvm.TsChannelNameText}" + $"&channelpassword={_tvm.TsChannelPasswordText}", Arguments = serverModel.ContentButton == "Join Server" ? $"-connect={serverModel.ServerIp}:{Convert.ToUInt16(serverModel.ServerQueryPort)}" : string.Empty, UseShellExecute = true }); } catch (Exception e) { MessageBox.Show($"Exception raised: {e.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private bool ValidateForm() { bool output = true; ServersModel sm = new ServersModel(); //sm.serverpassword = GlobalConfig.Connections.Servers_GetPassword(); string password = sm.serverpassword; password = "******"; // TODO: sql Servers_GetPassword if (!(passwordtxtbox.Text == password)) { output = false; } return(output); }
public ActionResult StartServer(string password) { string returnstr = ArrangeChar(); if (!string.IsNullOrEmpty(returnstr)) { ViewData["error"] = returnstr; return(View("StartFailed")); } returnstr = SendStartCommandUDP(); if (!string.IsNullOrEmpty(returnstr)) { ViewData["error"] = returnstr; return(View("StartFailed", (object)returnstr)); } ServersModel serversModel = new ServersModel(); serversModel.MMSServers = cacheManage.GetCache <IList <MMSServer> >("MMSServers"); serversModel.MCSServers = cacheManage.GetCache <IList <MCSServer> >("MCSServers"); serversModel.MDSServers = cacheManage.GetCache <IList <MDSServer> >("MDSServers"); return(View("FinishStart", serversModel)); }
public ActionResult Servers(ServersModel model) { int pageIndex = model.Page ?? 1; using (EquipmentsEntities data = new EquipmentsEntities()) { model.ServersSearch = (from c in data.TB_Servers.Where(p => p.KayitDurum == "Active" && (String.IsNullOrEmpty(model.SerialNumber) || p.SerialNumber.Contains(model.SerialNumber))).OrderByDescending(p => p.ID) select new ServersListModel { Location = c.Location, Serialnumber = c.SerialNumber, ServerName = c.ServerName, UserCode = c.ServerCode }).ToPagedList(pageIndex, 15); if (Request.IsAjaxRequest()) { return(PartialView("_Servers", model)); } else { return(View(model)); } } }
public void DeleteServerItem(ServersModel server) => Servers.Remove(server);
public void JoinServer(ServersModel server) => Join.Server(server);