Hyper-V bugfix
This commit is contained in:
parent
1bf6c993c2
commit
9788536ab4
3 changed files with 13 additions and 18 deletions
|
@ -138,18 +138,18 @@ namespace WebsitePanel.Portal
|
|||
return r;
|
||||
}
|
||||
|
||||
public static bool IsReplicationEnabled(int packageId)
|
||||
{
|
||||
var vmsMeta = (new VirtualMachines2012Helper()).GetVirtualMachines(packageId, null, null, null, 1, 0);
|
||||
if (vmsMeta.Length == 0) return false;
|
||||
//public static bool IsReplicationEnabled(int packageId)
|
||||
//{
|
||||
// var vmsMeta = (new VirtualMachines2012Helper()).GetVirtualMachines(packageId, null, null, null, 1, 0);
|
||||
// if (vmsMeta.Length == 0) return false;
|
||||
|
||||
var packageVm = ES.Services.VPS2012.GetVirtualMachineItem(vmsMeta[0].ItemID);
|
||||
if (packageVm == null) return false;
|
||||
// var packageVm = ES.Services.VPS2012.GetVirtualMachineItem(vmsMeta[0].ItemID);
|
||||
// if (packageVm == null) return false;
|
||||
|
||||
var serviceSettings = ConvertArrayToDictionary(ES.Services.Servers.GetServiceSettings(packageVm.ServiceId));
|
||||
if (serviceSettings == null) return false;
|
||||
// var serviceSettings = ConvertArrayToDictionary(ES.Services.Servers.GetServiceSettings(packageVm.ServiceId));
|
||||
// if (serviceSettings == null) return false;
|
||||
|
||||
return serviceSettings["ReplicaMode"] == ReplicaMode.ReplicationEnabled.ToString();
|
||||
}
|
||||
// return serviceSettings["ReplicaMode"] == ReplicaMode.ReplicationEnabled.ToString();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,12 +133,9 @@ namespace WebsitePanel.Portal.VPS2012.UserControls
|
|||
if ((vm.ExternalNetworkEnabled || vm.PrivateNetworkEnabled) && !createError)
|
||||
tabsList.Add(CreateTab("vps_network", "Tab.Network"));
|
||||
|
||||
if (VirtualMachines2012Helper.IsReplicationEnabled(PanelSecurity.PackageId) && !createError)
|
||||
if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED))
|
||||
{
|
||||
if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED))
|
||||
{
|
||||
tabsList.Add(CreateTab("vps_replication", "Tab.Replication"));
|
||||
}
|
||||
tabsList.Add(CreateTab("vps_replication", "Tab.Replication"));
|
||||
}
|
||||
|
||||
//tabsList.Add(CreateTab("vps_permissions", "Tab.Permissions"));
|
||||
|
|
|
@ -52,9 +52,7 @@ namespace WebsitePanel.Portal.VPS2012
|
|||
gvServers.Columns[4].Visible = !isUserSelected;
|
||||
|
||||
// replication
|
||||
gvServers.Columns[5].Visible =
|
||||
PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED) &&
|
||||
VirtualMachines2012Helper.IsReplicationEnabled(PanelSecurity.PackageId);
|
||||
gvServers.Columns[5].Visible = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_REPLICATION_ENABLED);
|
||||
|
||||
// check package quotas
|
||||
bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue