Пример #1
0
        public ActionResult Connections(string node)
        {
            var i = SQLInstance.Get(node);

            var vd = new DashboardModel
            {
                View = SQLViews.Connections,
                CurrentInstance = i
            };
            return View(vd);
        }
Пример #2
0
        public ActionResult Instance(string node)
        {
            var i = SQLInstance.Get(node);

            var vd = new DashboardModel
            {
                View = SQLViews.Instance,
                StandaloneInstances = SQLInstance.AllStandalone,
                Refresh = node.HasValue() ? 10 : 5,
                CurrentInstance = i
            };
            return View("Instance", vd);
        }
Пример #3
0
        public ActionResult Connections(string node, bool refresh = false)
        {
            var instance = SQLInstance.Get(node);
            if (refresh && instance != null)
            {
                instance.Connections.Purge();
            }

            var vd = new DashboardModel
            {
                View = DashboardModel.Views.Connections,
                CurrentInstance = instance
            };
            return View("Dashboard", vd);
        }
Пример #4
0
        public ActionResult Instance(string node, bool ajax = false)
        {
            var instance = SQLInstance.Get(node);
            if (instance == null && ajax)
                return ContentNotFound("Instance " + node + " was not found.");

            var vd = new DashboardModel
            {
                StandaloneInstances = SQLInstance.AllStandalone,
                Refresh = node.HasValue() ? 10 : 5,
                View = DashboardModel.Views.Instance,
                CurrentInstance = instance
            };
            return View(ajax ? "Instance" : "Dashboard", vd);
        }
Пример #5
0
        public ActionResult Active(string node, SQLInstance.ActiveSearchOptions options,
                                   SQLInstance.ActiveSearchOptions.ShowSleepingSessionOptions? sleeping = null,
                                   bool? system = false,
                                   bool? details = false)
        {
            if (sleeping.HasValue) options.IncludeSleepingSessions = sleeping.Value;
            if (system.HasValue) options.IncludeSystemSessions = system.Value;
            if (details.HasValue) options.GetAdditionalInfo = details.Value;

            var vd = new DashboardModel
                {
                    View = DashboardModel.Views.Active,
                    CurrentInstance = SQLInstance.Get(node),
                    ActiveSearchOptions = options
                };
            return View("Dashboard", vd);
        }
Пример #6
0
        public ActionResult Servers(string cluster, string node, string ag, bool detailOnly = false)
        {
            var vd = new DashboardModel
                {
                    StandaloneInstances = SQLInstance.AllStandalone,
                    Clusters = SQLCluster.AllClusters,
                    Refresh = node.HasValue() ? 10 : 5
                };

            if (cluster.HasValue())
                vd.CurrentCluster = vd.Clusters.FirstOrDefault(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);
        }
Пример #7
0
        public ActionResult Databases(string node)
        {
            var i = SQLInstance.Get(node);

            var vd = new DashboardModel
            {
                View = SQLViews.Databases,
                CurrentInstance = i,
                Refresh = 10*60
            };
            return View(vd);
        }
Пример #8
0
        public ActionResult Top(string node, SQLInstance.TopSearchOptions options, bool? detailed = false)
        {
            var i = SQLInstance.Get(node);
            options.SetDefaults();

            var vd = new DashboardModel
            {
                View = SQLViews.Top,
                Detailed = detailed.GetValueOrDefault(),
                CurrentInstance = i,
                TopSearchOptions = options
            };
            return View("Operations.Top", vd);
        }
Пример #9
0
 public ActionResult Databases(string node)
 {
     var vd = new DashboardModel
     {
         View = DashboardModel.Views.Databases,
         CurrentInstance = SQLInstance.Get(node)
     };
     return View("Dashboard", vd);
 }