public ActionResult HAProxyAdminProxy(string group, string proxy, string server, HAProxyAdmin.Action act) { var haGroup = HAProxyGroup.GetGroup(group); var proxies = (haGroup != null ? haGroup.GetProxies() : HAProxyGroup.GetAllProxies()).Where(pr => pr.Name == proxy); return(Json(HAProxyAdmin.PerformProxyAction(proxies, server, act))); }
public ActionResult HAProxyDetailed(string group, string node, string watch = null, bool norefresh = false) { var haGroup = HAProxyGroup.GetGroup(group ?? node); var vd = new HAProxyModel { SelectedGroup = haGroup, Groups = haGroup != null ? new List <HAProxyGroup> { haGroup } : HAProxyGroup.AllGroups, Proxies = (haGroup != null ? haGroup.GetProxies() : HAProxyGroup.GetAllProxies()), View = HAProxyModel.Views.Detailed, Refresh = !norefresh, WatchProxy = watch }; return(View("HAProxy.Detailed", vd)); }
public async Task <ActionResult> HAProxyAdminProxy(string group, string proxy, string server, Action act) { // Entire server if (proxy.IsNullOrEmpty() && group.IsNullOrEmpty() && server.HasValue()) { return(Json(await HAProxyAdmin.PerformServerActionAsync(server, act))); } // Entire group if (proxy.IsNullOrEmpty() && server.IsNullOrEmpty() && group.HasValue()) { return(Json(await HAProxyAdmin.PerformGroupActionAsync(group, act))); } var haGroup = HAProxyGroup.GetGroup(group); var proxies = (haGroup != null ? haGroup.GetProxies() : HAProxyGroup.GetAllProxies()).Where(pr => pr.Name == proxy); return(Json(await HAProxyAdmin.PerformProxyActionAsync(proxies, server, act))); }
public ActionResult Dashboard(string group, string node, string watch = null, bool norefresh = false) { var haGroup = HAProxyGroup.GetGroup(group ?? node); var proxies = haGroup != null?haGroup.GetProxies() : HAProxyGroup.GetAllProxies(); proxies.RemoveAll(p => !p.HasServers); var vd = new HAProxyModel { SelectedGroup = haGroup, Groups = haGroup != null ? new List <HAProxyGroup> { haGroup } : HAProxyGroup.AllGroups, Proxies = proxies, View = HAProxyModel.Views.Dashboard, Refresh = !norefresh, WatchProxy = watch }; return(View("HAProxy.Dashboard", vd)); }
public ActionResult HAProxyAdminDashboard(string group, bool norefresh = false) { var haGroup = HAProxyGroup.GetGroup(group); var proxies = haGroup != null?haGroup.GetProxies() : HAProxyGroup.GetAllProxies(); proxies.RemoveAll(p => !p.HasServers); var vd = new HAProxyModel { SelectedGroup = haGroup, Groups = haGroup != null ? new List <HAProxyGroup> { haGroup } : HAProxyGroup.AllGroups, Proxies = proxies, View = HAProxyModel.Views.Admin, Refresh = !norefresh, AdminMode = true }; return(View("HAProxy.Dashboard", vd)); }