diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs index 6327db0b..9532f906 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs @@ -6,8 +6,10 @@ namespace WebsitePanel.Providers public enum AppPoolState { Unknown = 0, - Start = 1, - Stop = 2, - Recycle = 3 + Starting = 1, + Started = 2, + Stopping = 3, + Stopped = 4, + Recycle = 5 } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs index 2bb975e4..21774080 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs @@ -351,9 +351,6 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects // AppPool public void ChangeAppPoolState(string siteId, AppPoolState state) { - // del - File.AppendAllText(@"c:\websitepanel\test.log", "ChangeAppPoolState " + siteId + " state " + state.ToString() + "\r\n"); - using (var srvman = GetServerManager()) { var site = srvman.Sites[siteId]; @@ -361,34 +358,44 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects if (site == null) return; - string AppPoolName = site.ApplicationDefaults.ApplicationPoolName; foreach (Application app in site.Applications) - AppPoolName = app.ApplicationPoolName; - - if (string.IsNullOrEmpty(AppPoolName)) - return; - - ApplicationPool pool = srvman.ApplicationPools[AppPoolName]; - if (pool == null) return; - - // - switch (state) { - case AppPoolState.Start: - pool.Start(); - pool.AutoStart = true; - break; - case AppPoolState.Stop: - pool.Stop(); - pool.AutoStart = false; - break; - case AppPoolState.Recycle: - pool.Recycle(); - pool.AutoStart = true; - break; + string AppPoolName = app.ApplicationPoolName; + + if (string.IsNullOrEmpty(AppPoolName)) + continue; + + ApplicationPool pool = srvman.ApplicationPools[AppPoolName]; + if (pool == null) continue; + + // + switch (state) + { + case AppPoolState.Started: + case AppPoolState.Starting: + if ((pool.State != ObjectState.Started) && (pool.State != ObjectState.Starting)) + { + pool.Start(); + pool.AutoStart = true; + } + break; + case AppPoolState.Stopped: + case AppPoolState.Stopping: + if ((pool.State != ObjectState.Stopped) && (pool.State != ObjectState.Stopping)) + { + pool.Stop(); + pool.AutoStart = false; + } + break; + case AppPoolState.Recycle: + pool.Recycle(); + pool.AutoStart = true; + break; + } + + srvman.CommitChanges(); + } - // - srvman.CommitChanges(); } } @@ -416,16 +423,16 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects switch (pool.State) { case ObjectState.Started: - state = AppPoolState.Start; + state = AppPoolState.Started; break; case ObjectState.Starting: - state = AppPoolState.Start; + state = AppPoolState.Starting; break; case ObjectState.Stopped: - state = AppPoolState.Stop; + state = AppPoolState.Stopped; break; case ObjectState.Stopping: - state = AppPoolState.Stop; + state = AppPoolState.Stopping; break; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin index d371a071..516cb229 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin @@ -31,6 +31,7 @@ Default skin template. The following skins are provided as examples only. + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/restart_24.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/restart_24.png new file mode 100644 index 00000000..6e01faab Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/restart_24.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx index 9ba2b5ba..6b8e3074 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx @@ -166,18 +166,12 @@ + - - <%-- AppPool --%> - - <%-- AppPool --%> - - - - - <%-- AppPool --%> - + + + + - <%-- AppPool --%> -
+ + - App Pool : -
@@ -188,15 +182,22 @@ - Start
- Stop
- Recycle +
+ + + + + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs index c7cf1c34..1ffd70b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs @@ -995,17 +995,17 @@ namespace WebsitePanel.Portal // AppPool private void BindAppPoolState(AppPoolState state) { - litAppPoolStatus.Text = state.ToString(); + litAppPoolStatus.Text = GetLocalizedString("SiteState." + state.ToString()); - cmdAppPoolStart.Visible = (state == AppPoolState.Stop); - cmdAppPoolStop.Visible = (state == AppPoolState.Start); - cmdAppPoolRecycle.Visible = (state == AppPoolState.Start); + cmdAppPoolStart.Visible = (state == AppPoolState.Stopped || state == AppPoolState.Stopping); + cmdAppPoolStop.Visible = (state == AppPoolState.Started || state == AppPoolState.Starting); + cmdAppPoolRecycle.Visible = (state == AppPoolState.Started || state == AppPoolState.Starting); } protected void cmdAppPoolChangeState_Click(object sender, EventArgs e) { - string stateName = ((LinkButton)sender).CommandName; + string stateName = ((ImageButton)sender).CommandName; AppPoolState state = (AppPoolState)Enum.Parse(typeof(AppPoolState), stateName, true); try diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs index d9c6a188..86809b51 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs @@ -318,6 +318,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.GridView gvPointers; + /// + /// lblWebsiteStatus элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.Label lblWebsiteStatus; + /// /// litStatus элемент управления. /// @@ -327,15 +336,6 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.Literal litStatus; - /// - /// litAppPoolStatus элемент управления. - /// - /// - /// Автоматически создаваемое поле. - /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. - /// - protected global::System.Web.UI.WebControls.Literal litAppPoolStatus; - /// /// cmdStart элемент управления. /// @@ -372,6 +372,24 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.ImageButton cmdStop; + /// + /// lblAppPoolStatus элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.Label lblAppPoolStatus; + + /// + /// litAppPoolStatus элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.Literal litAppPoolStatus; + /// /// cmdAppPoolStart элемент управления. /// @@ -379,16 +397,7 @@ namespace WebsitePanel.Portal { /// Автоматически создаваемое поле. /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. /// - protected global::System.Web.UI.WebControls.LinkButton cmdAppPoolStart; - - /// - /// cmdAppPoolStop элемент управления. - /// - /// - /// Автоматически создаваемое поле. - /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. - /// - protected global::System.Web.UI.WebControls.LinkButton cmdAppPoolStop; + protected global::System.Web.UI.WebControls.ImageButton cmdAppPoolStart; /// /// cmdAppPoolRecycle элемент управления. @@ -397,7 +406,16 @@ namespace WebsitePanel.Portal { /// Автоматически создаваемое поле. /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. /// - protected global::System.Web.UI.WebControls.LinkButton cmdAppPoolRecycle; + protected global::System.Web.UI.WebControls.ImageButton cmdAppPoolRecycle; + + /// + /// cmdAppPoolStop элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdAppPoolStop; /// /// dlTabs элемент управления.