Add Quota for Hyper-V replication

This commit is contained in:
Alexander Trofimov 2015-05-03 22:17:35 +03:00
parent bf3ec75c08
commit 054241f84e
13 changed files with 321 additions and 161 deletions

View file

@ -134,7 +134,12 @@ namespace WebsitePanel.Portal.VPS2012.UserControls
tabsList.Add(CreateTab("vps_network", "Tab.Network"));
if (VirtualMachines2012Helper.IsReplicationEnabled(PanelSecurity.PackageId) && !createError)
tabsList.Add(CreateTab("vps_replication", "Tab.Replication"));
{
if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED))
{
tabsList.Add(CreateTab("vps_replication", "Tab.Replication"));
}
}
//tabsList.Add(CreateTab("vps_permissions", "Tab.Permissions"));
//tabsList.Add(CreateTab("vps_tools", "Tab.Tools"));

View file

@ -52,7 +52,9 @@ namespace WebsitePanel.Portal.VPS2012
gvServers.Columns[4].Visible = !isUserSelected;
// replication
gvServers.Columns[5].Visible = VirtualMachines2012Helper.IsReplicationEnabled(PanelSecurity.PackageId);
gvServers.Columns[5].Visible =
PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED) &&
VirtualMachines2012Helper.IsReplicationEnabled(PanelSecurity.PackageId);
// check package quotas
bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId);

View file

@ -33,7 +33,8 @@ using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.Common;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.Virtualization;
namespace WebsitePanel.Portal.VPS2012
@ -46,6 +47,13 @@ namespace WebsitePanel.Portal.VPS2012
protected void Page_Load(object sender, EventArgs e)
{
if (!PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED))
{
ShowErrorMessage("VPS_QUOTA_REPLICATION_ENABLED");
ReplicationPanel.Visible = false;
return;
}
if (!IsPostBack)
{
Bind();