This commit is contained in:
Ruslan Keba 2013-09-13 12:41:54 +03:00
commit 8d06b1c1cf
31 changed files with 8030 additions and 679 deletions

View file

@ -89,10 +89,12 @@ span.ValidationMessageBlock {
<fieldset>
<legend>
<span>Helicon Zoo engine quotas settings</span>
<span>Helicon Zoo settings</span>
</legend>
<div class="FormBody">
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable Quotas"/>
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable hosting plan controls for web engines."/>
<br />
<asp:CheckBox runat="server" ID="WebCosoleEnabled" Text="Enable web console."/>
</div>
</fieldset>

View file

@ -68,7 +68,7 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
private void BindHostingPackages()
{
// TODO: try...catch?
WPIProduct[] products = null;
try
{
@ -92,6 +92,12 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
private void BindEngines()
{
WPIProduct zooModule = ES.Services.Servers.GetWPIProductById(PanelRequest.ServerId, "HeliconZooModule");
if (!zooModule.IsInstalled || zooModule.IsUpgrade)
{
HostModule.ShowWarningMessage("Zoo Module is not installed or out-of-date. To proceed press 'Add' or 'Update' next to Helicon Zoo Module below, then press 'Install'.");
}
// get all engines from IIS
HeliconZooEngine[] engineList = ES.Services.HeliconZoo.GetEngines(PanelRequest.ServiceId);
@ -114,6 +120,8 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
// bind 'Enable quotas' checkbox
bool enabled = ES.Services.HeliconZoo.IsEnginesEnabled(PanelRequest.ServiceId);
QuotasEnabled.Checked = !enabled;
WebCosoleEnabled.Checked = ES.Services.HeliconZoo.IsWebCosoleEnabled(PanelRequest.ServiceId);
}
else
{
@ -139,6 +147,8 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
// save switcher
ES.Services.HeliconZoo.SwithEnginesEnabled(PanelRequest.ServiceId, !QuotasEnabled.Checked);
ES.Services.HeliconZoo.SetWebCosoleEnabled(PanelRequest.ServiceId, WebCosoleEnabled.Checked);
}
protected void ClearEngineForm()
@ -390,7 +400,15 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
private static WPIProduct[] RequestHostingPackages()
{
return ES.Services.Servers.GetWPIProducts(PanelRequest.ServerId, null, "ZooPackage");
List<WPIProduct> result = new List<WPIProduct>();
result.Add(ES.Services.Servers.GetWPIProductById(PanelRequest.ServerId, "HeliconZooModule"));
result.AddRange(ES.Services.Servers.GetWPIProducts(PanelRequest.ServerId, null, "ZooPackage"));
return result.ToArray();
}
protected string AddUpgradeRemoveText(WPIProduct wpiProduct)

View file

@ -1,32 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
@ -84,6 +56,15 @@ public partial class HeliconZoo_Settings {
/// </remarks>
protected global::System.Web.UI.WebControls.Label HostingPackagesLoadingError;
/// <summary>
/// EnginesPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel EnginesPanel;
/// <summary>
/// QuotasEnabled control.
/// </summary>
@ -94,13 +75,13 @@ public partial class HeliconZoo_Settings {
protected global::System.Web.UI.WebControls.CheckBox QuotasEnabled;
/// <summary>
/// EnginesPanel control.
/// WebCosoleEnabled control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel EnginesPanel;
protected global::System.Web.UI.WebControls.CheckBox WebCosoleEnabled;
/// <summary>
/// ButtonAddEngine control.