diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 25255a78..c1a8d1fa 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -21,7 +21,10 @@ DELETE FROM HostingPlanQuotas WHERE QuotaID = 342 GO DELETE FROM HostingPlanQuotas WHERE QuotaID = 343 GO +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE GroupID = 33 AND [GroupName] = 'VPS2012') +BEGIN DELETE FROM HostingPlanResources WHERE GroupID = 33 +END GO @@ -8204,6 +8207,27 @@ AS INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 558 BEGIN -- RAM of VPS2012 + DECLARE @Result1 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) + DECLARE @Result2 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'DynamicMemory.Maximum' AND PT.ParentPackageID = @PackageID) + SET @Result = CASE WHEN isnull(@Result1,0) > isnull(@Result2,0) THEN @Result1 ELSE @Result2 END + END + ELSE IF @QuotaID = 559 -- HDD of VPS2012 + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 562 -- External IP addresses of VPS2012 + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID @@ -8846,16 +8870,168 @@ RETURN GO -- Hyper-V 2012 R2 Provider +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'VPS2012') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (33, N'VPS2012', 19, NULL, 1) + +INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (41, 33, N'VirtualMachine', N'WebsitePanel.Providers.Virtualization.VirtualMachine, WebsitePanel.Providers.Base', 1, 0, 0, 1, 1, 1, 0, 0) + +INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (42, 33, N'VirtualSwitch', N'WebsitePanel.Providers.Virtualization.VirtualSwitch, WebsitePanel.Providers.Base', 2, 0, 0, 1, 1, 1, 0, 0) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (553, 33, 1, N'VPS2012.ServersNumber', N'Number of VPS', 2, 0, 41, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (554, 33, 2, N'VPS2012.ManagingAllowed', N'Allow user to create VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (555, 33, 3, N'VPS2012.CpuNumber', N'Number of CPU cores', 3, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (556, 33, 7, N'VPS2012.BootCdAllowed', N'Boot from CD allowed', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (557, 33, 8, N'VPS2012.BootCdEnabled', N'Boot from CD', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (558, 33, 4, N'VPS2012.Ram', N'RAM size, MB', 2, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (559, 33, 5, N'VPS2012.Hdd', N'Hard Drive size, GB', 2, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (560, 33, 6, N'VPS2012.DvdEnabled', N'DVD drive', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (561, 33, 10, N'VPS2012.ExternalNetworkEnabled', N'External Network', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (562, 33, 11, N'VPS2012.ExternalIPAddressesNumber', N'Number of External IP addresses', 2, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (563, 33, 13, N'VPS2012.PrivateNetworkEnabled', N'Private Network', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (564, 33, 14, N'VPS2012.PrivateIPAddressesNumber', N'Number of Private IP addresses per VPS', 3, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (565, 33, 9, N'VPS2012.SnapshotsNumber', N'Number of Snaphots', 3, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (566, 33, 15, N'VPS2012.StartShutdownAllowed', N'Allow user to Start, Turn off and Shutdown VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (567, 33, 16, N'VPS2012.PauseResumeAllowed', N'Allow user to Pause, Resume VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (568, 33, 17, N'VPS2012.RebootAllowed', N'Allow user to Reboot VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (569, 33, 18, N'VPS2012.ResetAlowed', N'Allow user to Reset VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (570, 33, 19, N'VPS2012.ReinstallAllowed', N'Allow user to Re-install VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (571, 33, 12, N'VPS2012.Bandwidth', N'Monthly bandwidth, GB', 2, 0, NULL, NULL) + +END +GO + IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2') BEGIN -INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 30, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1) +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 33, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1) END ELSE BEGIN -UPDATE [dbo].[Providers] SET [EditorControl] = N'HyperV2012R2' WHERE [ProviderName] = 'HyperV2012R2' +UPDATE [dbo].[Providers] SET [EditorControl] = N'HyperV2012R2', [GroupID] = 33 WHERE [ProviderName] = 'HyperV2012R2' END GO +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetVirtualMachinesPaged2012') +DROP PROCEDURE GetVirtualMachinesPaged2012 +GO +CREATE PROCEDURE [dbo].[GetVirtualMachinesPaged2012] +( + @ActorID int, + @PackageID int, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int, + @Recursive bit +) +AS +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +SI.ItemTypeID = 41 -- VPS2012 +AND ((@Recursive = 0 AND P.PackageID = @PackageID) +OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, P.PackageID) = 1)) +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'SI.ItemName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT COUNT(SI.ItemID) FROM Packages AS P +INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID +INNER JOIN Users AS U ON P.UserID = U.UserID +LEFT OUTER JOIN ( + SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses +) AS EIP ON SI.ItemID = EIP.ItemID +LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1 +WHERE ' + @condition + ' + +DECLARE @Items AS TABLE +( + ItemID int +); + +WITH TempItems AS ( + SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row, + SI.ItemID + FROM Packages AS P + INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID + INNER JOIN Users AS U ON P.UserID = U.UserID + LEFT OUTER JOIN ( + SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses + ) AS EIP ON SI.ItemID = EIP.ItemID + LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1 + WHERE ' + @condition + ' +) + +INSERT INTO @Items +SELECT ItemID FROM TempItems +WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows + +SELECT + SI.ItemID, + SI.ItemName, + SI.PackageID, + P.PackageName, + P.UserID, + U.Username, + + EIP.ExternalIP, + PIP.IPAddress +FROM @Items AS TSI +INNER JOIN ServiceItems AS SI ON TSI.ItemID = SI.ItemID +INNER JOIN Packages AS P ON SI.PackageID = P.PackageID +INNER JOIN Users AS U ON P.UserID = U.UserID +LEFT OUTER JOIN ( + SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses +) AS EIP ON SI.ItemID = EIP.ItemID +LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1 +' + +--print @sql + +exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int, @Recursive bit', +@PackageID, @StartRow, @MaximumRows, @Recursive + +RETURN +GO + + --ES OWA Editing IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'EnterpriseFoldersOwaPermissions') CREATE TABLE EnterpriseFoldersOwaPermissions @@ -9446,10 +9622,167 @@ END GO +UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' +GO +UPDATE [dbo].[ResourceGroups] SET GroupName = 'Sharepoint Enterprise Server' WHERE GroupName = 'Sharepoint Server' +GO + +UPDATE [dbo].[ResourceGroups] SET GroupController = 'WebsitePanel.EnterpriseServer.HostedSharePointServerEntController' WHERE GroupName = 'Sharepoint Enterprise Server' +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted SharePoint Enterprise 2013') +BEGIN +DECLARE @provider_id AS INT +DECLARE @group_id AS INT +SELECT @group_id = GroupId FROM [dbo].[ResourceGroups] WHERE GroupName = 'Sharepoint Enterprise Server' +SELECT TOP 1 @provider_id = ProviderId + 1 From [dbo].[Providers] ORDER BY ProviderID DESC +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) +VALUES (@provider_id, @group_id, N'HostedSharePoint2013Ent', N'Hosted SharePoint Enterprise 2013', N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013Ent, WebsitePanel.Providers.HostedSolution.SharePoint2013Ent', N'HostedSharePoint30', NULL) +END +GO + +UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.Sites' WHERE QuotaId = 550 +GO + +UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.MaxStorage' WHERE QuotaId = 551 +GO + +UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.UseSharedSSL' WHERE QuotaId = 552 +GO + +UPDATE [dbo].[ServiceItemTypes] SET DisplayName = 'SharePointEnterpriseSiteCollection' WHERE DisplayName = 'SharePointSiteCollection' +GO +IF EXISTS (SELECT * FROM Providers WHERE ProviderName = 'HostedSharePoint2013' AND GroupID IN (Select GroupID FROM ResourceGroups WHERE GroupName = 'Sharepoint Enterprise Server')) +BEGIN + DECLARE @group_id INT + SELECT @group_id = GroupId FROM ResourceGroups WHERE GroupName = 'Sharepoint Enterprise Server' + DELETE FROM Providers WHERE ProviderName = 'HostedSharePoint2013' AND GroupID = @group_id +END + +GO + + +ALTER PROCEDURE [dbo].[AddServiceItem] +( + @ActorID int, + @PackageID int, + @ServiceID int, + @ItemName nvarchar(500), + @ItemTypeName nvarchar(200), + @ItemID int OUTPUT, + @XmlProperties ntext, + @CreatedDate datetime +) +AS +BEGIN TRAN + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- get GroupID +DECLARE @GroupID int +SELECT + @GroupID = PROV.GroupID +FROM Services AS S +INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID +WHERE S.ServiceID = @ServiceID + +DECLARE @ItemTypeID int +SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes +WHERE TypeName = @ItemTypeName +AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID)) + +-- Fix to allow plans assigned to serveradmin +IF (@ItemTypeName = 'WebsitePanel.Providers.HostedSolution.Organization, WebsitePanel.Providers.Base') +BEGIN + IF NOT EXISTS (SELECT * FROM ServiceItems WHERE PackageID = 1) + BEGIN + INSERT INTO ServiceItems (PackageID, ItemTypeID,ServiceID,ItemName,CreatedDate) + VALUES(1, @ItemTypeID, @ServiceID, 'System', @CreatedDate) + + DECLARE @TempItemID int + + SET @TempItemID = SCOPE_IDENTITY() + INSERT INTO ExchangeOrganizations (ItemID, OrganizationID) + VALUES(@TempItemID, 'System') + END +END + + + +-- add item +INSERT INTO ServiceItems +( + PackageID, + ServiceID, + ItemName, + ItemTypeID, + CreatedDate +) +VALUES +( + @PackageID, + @ServiceID, + @ItemName, + @ItemTypeID, + @CreatedDate +) + +SET @ItemID = SCOPE_IDENTITY() + +DECLARE @idoc int +--Create an internal representation of the XML document. +EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties + +-- Execute a SELECT statement that uses the OPENXML rowset provider. +DELETE FROM ServiceItemProperties +WHERE ItemID = @ItemID + +CREATE TABLE #TempTable( + ItemID int, + PropertyName nvarchar(50), + PropertyValue nvarchar(3000)) + +INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue) +SELECT + @ItemID, + PropertyName, + PropertyValue +FROM OPENXML(@idoc, '/properties/property',1) WITH +( + PropertyName nvarchar(50) '@name', + PropertyValue nvarchar(3000) '@value' +) as PV + +-- Move data from temp table to real table +INSERT INTO ServiceItemProperties +( + ItemID, + PropertyName, + PropertyValue +) +SELECT + ItemID, + PropertyName, + PropertyValue +FROM #TempTable + +DROP TABLE #TempTable + +-- remove document +exec sp_xml_removedocument @idoc + +COMMIT TRAN +RETURN +GO + +UPDATE [dbo].[ServiceItemTypes] SET TypeName ='WebsitePanel.Providers.SharePoint.SharePointEnterpriseSiteCollection, WebsitePanel.Providers.Base' WHERE DisplayName = 'SharePointEnterpriseSiteCollection' +GO -- USER PASSWORD EXPIRATION NOTIFICATION tasks @@ -9998,4 +10331,4 @@ GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF -GO \ No newline at end of file +GO diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj index 32738387..dc52b6d8 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj @@ -65,21 +65,6 @@ - - ..\..\WebsitePanel.EnterpriseServer\bin\WebsitePanel.EnterpriseServer.dll - - - ..\..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll - - - ..\..\..\Bin\WebsitePanel.EnterpriseServer.Client.dll - - - ..\..\..\Bin\WebsitePanel.EnterpriseServer.Code.dll - - - ..\..\..\Bin\WebsitePanel.Providers.Base.dll - @@ -216,6 +201,28 @@ false + + + {c09ce910-f16b-48a1-b2cc-c99b8c1cf775} + WebsitePanel.EnterpriseServer.Base + + + {4b344644-a570-477e-adcc-f2b267d6c038} + WebsitePanel.EnterpriseServer.Client + + + {60e39314-659c-4fad-ab91-d0d08e223578} + WebsitePanel.EnterpriseServer.Code + + + {59c7623a-5181-48a5-880a-c9b82b48f589} + WebsitePanel.EnterpriseServer + + + {684c932a-6c75-46ac-a327-f3689d89eb42} + WebsitePanel.Providers.Base + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 310e2626..e7102461 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -2133,7 +2133,7 @@ namespace WebsitePanel.Providers.HostedSolution uidAttr.Value = Guid.NewGuid().ToString("B"); bypassErrorsAttr.Value = (1).ToString(); - actionPropAttr.Value = "R"; + actionPropAttr.Value = "C"; thisDrivePropAttr.Value = "NOCHANGE"; allDrivesPropAttr.Value = "NOCHANGE"; userNamePropAttr.Value = string.Empty; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs index caafd49c..43c2c9a4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs @@ -31,23 +31,23 @@ using System.IO; using System.Net.Mail; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using Microsoft.Win32; -using WebsitePanel.Providers.Utils; using WebsitePanel.Server.Utils; namespace WebsitePanel.Providers.Mail { - public class IceWarp : HostingServiceProviderBase, IMailServer + public class IceWarp : HostingServiceProviderBase, IMailServer, IDisposable { protected const string API_PROGID = "IceWarpServer.APIObject"; protected const string DOMAIN_PROGID = "IceWarpServer.DomainObject"; protected const string ACCOUNT_PROGID = "IceWarpServer.AccountObject"; - + private dynamic _currentApiObject = null; - #region IceWarp Enums + #region Protected Enums protected enum IceWarpErrorCode { @@ -110,8 +110,8 @@ namespace WebsitePanel.Providers.Mail get { var apiObject = GetApiObject(); - var adresses = ((object) apiObject.GetProperty("C_System_Services_BindIPAddress")); - return adresses == null ? "" : adresses.ToString().Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); + var adresses = ((object)apiObject.GetProperty("C_System_Services_BindIPAddress")); + return adresses == null ? "" : adresses.ToString().Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); } } @@ -120,7 +120,7 @@ namespace WebsitePanel.Providers.Mail get { var apiObject = GetApiObject(); - return Convert.ToBoolean((object) apiObject.GetProperty("C_Accounts_Global_Domains_UseDiskQuota")); + return Convert.ToBoolean((object)apiObject.GetProperty("C_Accounts_Global_Domains_UseDiskQuota")); } } @@ -129,7 +129,7 @@ namespace WebsitePanel.Providers.Mail get { var apiObject = GetApiObject(); - return Convert.ToBoolean((object) apiObject.GetProperty("C_Accounts_Global_Domains_UseDomainLimits")); + return Convert.ToBoolean((object)apiObject.GetProperty("C_Accounts_Global_Domains_UseDomainLimits")); } } @@ -138,7 +138,7 @@ namespace WebsitePanel.Providers.Mail get { var apiObject = GetApiObject(); - return Convert.ToBoolean((object) apiObject.GetProperty("C_Accounts_Global_Domains_UseUserLimits")); + return Convert.ToBoolean((object)apiObject.GetProperty("C_Accounts_Global_Domains_UseUserLimits")); } } @@ -147,7 +147,7 @@ namespace WebsitePanel.Providers.Mail get { var apiObject = GetApiObject(); - return Convert.ToBoolean((object) apiObject.GetProperty("C_Accounts_Global_Domains_OverrideGlobal")); + return Convert.ToBoolean((object)apiObject.GetProperty("C_Accounts_Global_Domains_OverrideGlobal")); } } @@ -156,16 +156,16 @@ namespace WebsitePanel.Providers.Mail get { var apiObject = GetApiObject(); - return Convert.ToInt32((object) apiObject.GetProperty("C_Mail_SMTP_Delivery_MaxMsgSize"))/1024/1024; + return Convert.ToInt32((object)apiObject.GetProperty("C_Mail_SMTP_Delivery_MaxMsgSize")) / 1024 / 1024; } } - + protected int WarnMailboxUsage { get { var apiObject = GetApiObject(); - return Convert.ToInt32((object)apiObject.GetProperty("C_Accounts_Global_Domains_WarnMailboxUsage")); + return Convert.ToInt32((object)apiObject.GetProperty("C_Accounts_Global_Domains_WarnMailboxUsage")); } } @@ -177,13 +177,15 @@ namespace WebsitePanel.Providers.Mail return Convert.ToInt32((object)apiObject.GetProperty("C_Accounts_Global_Domains_WarnDomainSize")); } } - + private void SaveApiSetting(dynamic apiObject) { if (!apiObject.Save()) { - throw new Exception("Cannot save Api Object: " + GetErrorMessage(apiObject.LastErr)); + var ex = new Exception("Cannot save Api Object: " + GetErrorMessage(apiObject.LastErr)); + Log.WriteError(ex); + throw ex; } } @@ -193,7 +195,7 @@ namespace WebsitePanel.Providers.Mail protected static string GetErrorMessage(int errorCode) { - switch ((IceWarpErrorCode) errorCode) + switch ((IceWarpErrorCode)errorCode) { case IceWarpErrorCode.S_OK: return "OK"; @@ -247,6 +249,11 @@ namespace WebsitePanel.Providers.Mail } } + protected void DisposeObject(object obj) + { + Marshal.FinalReleaseComObject(obj); + } + protected dynamic GetApiObject() { if (_currentApiObject != null) return _currentApiObject; @@ -298,7 +305,7 @@ namespace WebsitePanel.Providers.Mail var obj = GetAccountObject(); if (!obj.Open(accountName)) { - throw new Exception("Cannot open account " + accountName + ": " + GetErrorMessage(obj.LastErr)); + Log.WriteWarning(string.Format("Cannot open account {0}: {1}", accountName, GetErrorMessage(obj.LastErr))); } return obj; @@ -308,7 +315,9 @@ namespace WebsitePanel.Providers.Mail { if (!domain.Save()) { - throw new ArgumentException("Could not save domain:" + GetErrorMessage(domain.LastErr)); + var ex = new Exception("Could not save domain:" + GetErrorMessage(domain.LastErr)); + Log.WriteError(ex); + throw ex; } } @@ -316,11 +325,12 @@ namespace WebsitePanel.Providers.Mail { if (!account.Save()) { - throw new ArgumentException("Could not save " + accountTypeName + ":" + GetErrorMessage(account.LastErr)); + var ex = new Exception(string.Format("Could not save {0}: {1}", accountTypeName, GetErrorMessage(account.LastErr))); + Log.WriteError(ex); + throw ex; } } - protected string GetEmailUser(string email) { if (string.IsNullOrWhiteSpace(email)) @@ -382,6 +392,8 @@ namespace WebsitePanel.Providers.Mail } } + DisposeObject(accountObject); + return mailAccounts.ToArray(); } @@ -395,7 +407,7 @@ namespace WebsitePanel.Providers.Mail apiObject.SetProperty("C_Accounts_Global_Domains_WarnMailboxUsage", ProviderSettings["WarnMailboxUsage"]); apiObject.SetProperty("C_Accounts_Global_Domains_WarnDomainSize", ProviderSettings["WarnDomainSize"]); - apiObject.SetProperty("C_Mail_SMTP_Delivery_MaxMsgSize", Convert.ToInt32(ProviderSettings["MaxMessageSize"])*1024*1024); + apiObject.SetProperty("C_Mail_SMTP_Delivery_MaxMsgSize", Convert.ToInt32(ProviderSettings["MaxMessageSize"]) * 1024 * 1024); apiObject.SetProperty("C_Mail_SMTP_Delivery_LimitMsgSize", Convert.ToInt32(ProviderSettings["MaxMessageSize"]) > 0); SaveApiSetting(apiObject); @@ -403,11 +415,11 @@ namespace WebsitePanel.Providers.Mail #endregion - #region IHostingServiceProvier methods + #region IHostingServiceProvier methods - public override SettingPair[] GetProviderDefaultSettings() - { - var settings = new [] + public override SettingPair[] GetProviderDefaultSettings() + { + var settings = new[] { new SettingPair("UseDomainDiskQuota", UseDomainDiskQuota.ToString()), new SettingPair("UseDomainLimits", UseDomainLimits.ToString()), @@ -419,8 +431,8 @@ namespace WebsitePanel.Providers.Mail new SettingPair("ServerIpAddress", BindIpAddress) }; - return settings; - } + return settings; + } public override string[] Install() { @@ -429,25 +441,25 @@ namespace WebsitePanel.Providers.Mail } public override void ChangeServiceItemsState(ServiceProviderItem[] items, bool enabled) - { - foreach (var item in items.OfType()) - { - try - { - // enable/disable mail domain - if (DomainExists(item.Name)) - { - var mailDomain = GetDomain(item.Name); - mailDomain.Enabled = enabled; - UpdateDomain(mailDomain); - } - } - catch (Exception ex) - { - Log.WriteError(String.Format("Error switching '{0}' IceWarp domain", item.Name), ex); - } - } - } + { + foreach (var item in items.OfType()) + { + try + { + // enable/disable mail domain + if (DomainExists(item.Name)) + { + var mailDomain = GetDomain(item.Name); + mailDomain.Enabled = enabled; + UpdateDomain(mailDomain); + } + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error switching '{0}' IceWarp domain", item.Name), ex); + } + } + } public override void DeleteServiceItems(ServiceProviderItem[] items) { @@ -466,64 +478,69 @@ namespace WebsitePanel.Providers.Mail } public override ServiceProviderItemDiskSpace[] GetServiceItemsDiskSpace(ServiceProviderItem[] items) - { - var itemsDiskspace = new List(); + { + var itemsDiskspace = new List(); + + var accountObject = GetAccountObject(); - // update items with diskspace - foreach (var item in items.OfType()) - { - try - { - Log.WriteStart(String.Format("Calculating mail account '{0}' size", item.Name)); - // calculate disk space - var accountObject = GetAccountObject(item.Name); - var size = Convert.ToInt64((object)accountObject.GetProperty("U_MailboxSize")) * 1024; + // update items with diskspace + foreach (var item in items.OfType()) + { + try + { + Log.WriteStart(String.Format("Calculating mail account '{0}' size", item.Name)); + // calculate disk space + accountObject.Open(item.Name); + var size = Convert.ToInt64((object)accountObject.GetProperty("U_MailboxSize")) * 1024; - var diskspace = new ServiceProviderItemDiskSpace {ItemId = item.Id, DiskSpace = size}; - itemsDiskspace.Add(diskspace); - Log.WriteEnd(String.Format("Calculating mail account '{0}' size", item.Name)); - } - catch (Exception ex) - { - Log.WriteError(ex); - } - } - return itemsDiskspace.ToArray(); - } + var diskspace = new ServiceProviderItemDiskSpace { ItemId = item.Id, DiskSpace = size }; + itemsDiskspace.Add(diskspace); - public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) - { - var itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; + Log.WriteEnd(String.Format("Calculating mail account '{0}' size", item.Name)); + } + catch (Exception ex) + { + Log.WriteError(ex); + } + } - // update items with diskspace - for (int i = 0; i < items.Length; i++) - { - ServiceProviderItem item = items[i]; + DisposeObject(accountObject); - // create new bandwidth object - itemsBandwidth[i] = new ServiceProviderItemBandwidth - { - ItemId = item.Id, + return itemsDiskspace.ToArray(); + } + + public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) + { + var itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; + + // update items with bandwidth + for (var i = 0; i < items.Length; i++) + { + var item = items[i]; + + // create new bandwidth object + itemsBandwidth[i] = new ServiceProviderItemBandwidth + { + ItemId = item.Id, Days = new DailyStatistics[0] - }; + }; - if (item is MailDomain) - { - try - { - // get daily statistics - itemsBandwidth[i].Days = GetDailyStatistics(since, item.Name); - } - catch (Exception ex) - { - Log.WriteError(ex); - System.Diagnostics.Debug.WriteLine(ex); - } - } - } + if (!(item is MailDomain)) continue; - return itemsBandwidth; - } + try + { + // get daily statistics + itemsBandwidth[i].Days = GetDailyStatistics(since, item.Name); + } + catch (Exception ex) + { + Log.WriteError(ex); + System.Diagnostics.Debug.WriteLine(ex); + } + } + + return itemsBandwidth; + } public DailyStatistics[] GetDailyStatistics(DateTime since, string maildomainName) { @@ -544,7 +561,7 @@ namespace WebsitePanel.Providers.Mail var ms = new MemoryStream(statsBuffer); var reader = new StreamReader(ms); - while (reader.Peek() != -1) + while (reader.Peek() > -1) { var line = reader.ReadLine(); var fields = line.Split(','); @@ -561,11 +578,11 @@ namespace WebsitePanel.Providers.Mail case '*': var dailyStats = new DailyStatistics { - Year = date.Year, - Month = date.Month, - Day = date.Day, - BytesSent = Convert.ToInt64(fields[mailSentField])*1024, - BytesReceived = Convert.ToInt64(fields[mailReceivedField])*1024 + Year = date.Year, + Month = date.Month, + Day = date.Day, + BytesSent = Convert.ToInt64(fields[mailSentField]) * 1024, + BytesReceived = Convert.ToInt64(fields[mailReceivedField]) * 1024 }; days.Add(dailyStats); continue; @@ -614,7 +631,7 @@ namespace WebsitePanel.Providers.Mail // Checking for version 10.4.0 (released 2012-03-21) or newer // This version introduced L_ListFile_Contents, G_ListFile_Contents and M_ListFileContents that is the latest API variable used by this provider - var split = version.Split(new[] {'.'}); + var split = version.Split(new[] { '.' }); var majorVersion = Convert.ToInt32(split[0]); var minVersion = Convert.ToInt32(split[1]); @@ -632,32 +649,34 @@ namespace WebsitePanel.Providers.Mail public string[] GetDomains() { var api = GetApiObject(); - return api.GetDomainList().Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries); + return api.GetDomainList().Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); } public MailDomain GetDomain(string domainName) { - var domain = GetDomainObject(domainName); + var domainObject = GetDomainObject(domainName); var mailDomain = new MailDomain { - Name = domain.Name, - PostmasterAccount = domain.GetProperty("D_AdminEmail"), - CatchAllAccount = domain.GetProperty("D_UnknownForwardTo"), - Enabled = Convert.ToBoolean((object) domain.GetProperty("D_DisableLogin")), - MaxDomainSizeInMB = Convert.ToInt32((object) domain.GetProperty("D_DiskQuota"))/1024, - MaxDomainUsers = Convert.ToInt32((object) domain.GetProperty("D_AccountNumber")), - MegaByteSendLimit = Convert.ToInt32((object) domain.GetProperty("D_VolumeLimit"))/1024, - NumberSendLimit = Convert.ToInt32((object) domain.GetProperty("D_NumberLimit")), - DefaultUserQuotaInMB = Convert.ToInt32((object) domain.GetProperty("D_UserMailbox"))/1024, - DefaultUserMaxMessageSizeMegaByte = Convert.ToInt32((object) domain.GetProperty("D_UserMsg"))/1024, - DefaultUserMegaByteSendLimit = Convert.ToInt32((object) domain.GetProperty("D_UserMB")), - DefaultUserNumberSendLimit = Convert.ToInt32((object) domain.GetProperty("D_UserNumber")), + Name = domainObject.Name, + PostmasterAccount = domainObject.GetProperty("D_AdminEmail"), + CatchAllAccount = domainObject.GetProperty("D_UnknownForwardTo"), + Enabled = Convert.ToBoolean((object)domainObject.GetProperty("D_DisableLogin")), + MaxDomainSizeInMB = Convert.ToInt32((object)domainObject.GetProperty("D_DiskQuota")) / 1024, + MaxDomainUsers = Convert.ToInt32((object)domainObject.GetProperty("D_AccountNumber")), + MegaByteSendLimit = Convert.ToInt32((object)domainObject.GetProperty("D_VolumeLimit")) / 1024, + NumberSendLimit = Convert.ToInt32((object)domainObject.GetProperty("D_NumberLimit")), + DefaultUserQuotaInMB = Convert.ToInt32((object)domainObject.GetProperty("D_UserMailbox")) / 1024, + DefaultUserMaxMessageSizeMegaByte = Convert.ToInt32((object)domainObject.GetProperty("D_UserMsg")) / 1024, + DefaultUserMegaByteSendLimit = Convert.ToInt32((object)domainObject.GetProperty("D_UserMB")), + DefaultUserNumberSendLimit = Convert.ToInt32((object)domainObject.GetProperty("D_UserNumber")), UseDomainDiskQuota = Convert.ToBoolean(ProviderSettings["UseDomainDiskQuota"]), UseDomainLimits = Convert.ToBoolean(ProviderSettings["UseDomainLimits"]), UseUserLimits = Convert.ToBoolean(ProviderSettings["UseUserLimits"]) }; + DisposeObject(domainObject); + return mailDomain; } @@ -665,18 +684,24 @@ namespace WebsitePanel.Providers.Mail { if (string.IsNullOrWhiteSpace(domain.Name)) { - throw new ArgumentNullException("domain.Name"); + var ex = new Exception("Cannot create domain with empty domain name", new ArgumentNullException("domain.Name")); + Log.WriteError(ex); + throw ex; } var domainObject = GetDomainObject(); if (!domainObject.New(domain.Name)) { - throw new ApplicationException("Failed to create domain: " + GetErrorMessage(domainObject.LastErr)); + var ex = new Exception("Failed to create domain: " + GetErrorMessage(domainObject.LastErr)); + Log.WriteError(ex); + throw ex; } SaveDomain(domainObject); + DisposeObject(domainObject); + UpdateDomain(domain); } @@ -698,32 +723,41 @@ namespace WebsitePanel.Providers.Mail } domainObject.SetProperty("D_DisableLogin", !domain.Enabled); - domainObject.SetProperty("D_DiskQuota", domain.MaxDomainSizeInMB*1024); + domainObject.SetProperty("D_DiskQuota", domain.MaxDomainSizeInMB * 1024); domainObject.SetProperty("D_AccountNumber", domain.MaxDomainUsers); - domainObject.SetProperty("D_VolumeLimit", domain.MegaByteSendLimit*1024); + domainObject.SetProperty("D_VolumeLimit", domain.MegaByteSendLimit * 1024); domainObject.SetProperty("D_NumberLimit", domain.NumberSendLimit); - domainObject.SetProperty("D_UserMailbox", domain.DefaultUserQuotaInMB*1024); - domainObject.SetProperty("D_UserMsg", domain.DefaultUserMaxMessageSizeMegaByte*1024); + domainObject.SetProperty("D_UserMailbox", domain.DefaultUserQuotaInMB * 1024); + domainObject.SetProperty("D_UserMsg", domain.DefaultUserMaxMessageSizeMegaByte * 1024); domainObject.SetProperty("D_UserMB", domain.DefaultUserMegaByteSendLimit); domainObject.SetProperty("D_UserNumber", domain.DefaultUserNumberSendLimit); SaveDomain(domainObject); + + DisposeObject(domainObject); } public void DeleteDomain(string domainName) { + if (!DomainExists(domainName)) + { + return; + } + var domainObject = GetDomainObject(domainName); - if (domainObject.Delete()) + if (!domainObject.Delete()) { - throw new Exception("Could not delete domain"); + Log.WriteError("Could not delete domain" + GetErrorMessage(domainObject.LastErr), null); } + + DisposeObject(domainObject); } #endregion - #region Domain alieses + #region Domain aliases public bool DomainAliasExists(string domainName, string aliasName) { @@ -734,7 +768,11 @@ namespace WebsitePanel.Providers.Mail var domainObject = GetDomainObject(aliasName); - return Convert.ToInt32((object) domainObject.GetProperty("D_Type")) == 2 && string.Compare(domainObject.GetProperty("D_DomainValue").ToString(), domainName, true) == 0; + var result = Convert.ToInt32((object)domainObject.GetProperty("D_Type")) == 2 && string.Compare(domainObject.GetProperty("D_DomainValue").ToString(), domainName, true) == 0; + + DisposeObject(domainObject); + + return result; } public string[] GetDomainAliases(string domainName) @@ -759,13 +797,15 @@ namespace WebsitePanel.Providers.Mail public void AddDomainAlias(string domainName, string aliasName) { - var mailDomain = new MailDomain {Name = aliasName}; + var mailDomain = new MailDomain { Name = aliasName }; CreateDomain(mailDomain); var domainObject = GetDomainObject(aliasName); domainObject.SetProperty("D_Type", 2); domainObject.SetProperty("D_DomainValue", domainName); SaveDomain(domainObject); + + DisposeObject(domainObject); } public void DeleteDomainAlias(string domainName, string aliasName) @@ -781,7 +821,11 @@ namespace WebsitePanel.Providers.Mail { var accountObject = GetAccountObject(); - return accountObject.Open(mailboxName) && Convert.ToInt32((object) accountObject.GetProperty("U_Type")) == (int) IceWarpAccountType.User; + var result = accountObject.Open(mailboxName) && Convert.ToInt32((object)accountObject.GetProperty("U_Type")) == (int)IceWarpAccountType.User; + + DisposeObject(accountObject); + + return result; } protected class IceWarpResponderContent @@ -827,35 +871,35 @@ namespace WebsitePanel.Providers.Mail return result; } - protected static MailAccount CreateMailAccountFromAccountObject(dynamic accountObject) + protected MailAccount CreateMailAccountFromAccountObject(dynamic accountObject) { var mailAccount = new MailAccount { Name = accountObject.EmailAddress, FullName = accountObject.GetProperty("U_Name"), - Enabled = Convert.ToInt32((object) accountObject.GetProperty("U_AccountDisabled")) == 0, - ForwardingEnabled = !string.IsNullOrWhiteSpace(accountObject.GetProperty("U_ForwardTo")) || string.IsNullOrWhiteSpace(accountObject.GetProperty("U_RemoteAddress")) && Convert.ToBoolean((object) accountObject.GetProperty("U_UseRemoteAddress")), - IsDomainAdmin = Convert.ToBoolean((object) accountObject.GetProperty("U_DomainAdmin")), - MaxMailboxSize = Convert.ToBoolean((object) accountObject.GetProperty("U_MaxBox")) ? Convert.ToInt32((object) accountObject.GetProperty("U_MaxBoxSize"))/1024 : 0, + Enabled = Convert.ToInt32((object)accountObject.GetProperty("U_AccountDisabled")) == 0, + ForwardingEnabled = !string.IsNullOrWhiteSpace(accountObject.GetProperty("U_ForwardTo")) || string.IsNullOrWhiteSpace(accountObject.GetProperty("U_RemoteAddress")) && Convert.ToBoolean((object)accountObject.GetProperty("U_UseRemoteAddress")), + IsDomainAdmin = Convert.ToBoolean((object)accountObject.GetProperty("U_DomainAdmin")), + MaxMailboxSize = Convert.ToBoolean((object)accountObject.GetProperty("U_MaxBox")) ? Convert.ToInt32((object)accountObject.GetProperty("U_MaxBoxSize")) / 1024 : 0, Password = accountObject.GetProperty("U_Password"), - ResponderEnabled = Convert.ToInt32((object) accountObject.GetProperty("U_Respond")) > 0, - QuotaUsed = Convert.ToInt64((object) accountObject.GetProperty("U_MailBoxSize")), - MaxMessageSizeMegaByte = Convert.ToInt32((object) accountObject.GetProperty("U_MaxMessageSize"))/1024, - MegaByteSendLimit = Convert.ToInt32((object) accountObject.GetProperty("U_MegabyteSendLimit")), - NumberSendLimit = Convert.ToInt32((object) accountObject.GetProperty("U_NumberSendLimit")), - DeleteOlder = Convert.ToBoolean((object) accountObject.GetProperty("U_DeleteOlder")), - DeleteOlderDays = Convert.ToInt32((object) accountObject.GetProperty("U_DeleteOlderDays")), - ForwardOlder = Convert.ToBoolean((object) accountObject.GetProperty("U_ForwardOlder")), - ForwardOlderDays = Convert.ToInt32((object) accountObject.GetProperty("U_ForwardOlderDays")), + ResponderEnabled = Convert.ToInt32((object)accountObject.GetProperty("U_Respond")) > 0, + QuotaUsed = Convert.ToInt64((object)accountObject.GetProperty("U_MailBoxSize")), + MaxMessageSizeMegaByte = Convert.ToInt32((object)accountObject.GetProperty("U_MaxMessageSize")) / 1024, + MegaByteSendLimit = Convert.ToInt32((object)accountObject.GetProperty("U_MegabyteSendLimit")), + NumberSendLimit = Convert.ToInt32((object)accountObject.GetProperty("U_NumberSendLimit")), + DeleteOlder = Convert.ToBoolean((object)accountObject.GetProperty("U_DeleteOlder")), + DeleteOlderDays = Convert.ToInt32((object)accountObject.GetProperty("U_DeleteOlderDays")), + ForwardOlder = Convert.ToBoolean((object)accountObject.GetProperty("U_ForwardOlder")), + ForwardOlderDays = Convert.ToInt32((object)accountObject.GetProperty("U_ForwardOlderDays")), ForwardOlderTo = accountObject.GetProperty("U_ForwardOlderTo"), - IceWarpAccountState = Convert.ToInt32((object) accountObject.GetProperty("U_AccountDisabled")), - IceWarpAccountType = Convert.ToInt32((object) accountObject.GetProperty("U_AccountType")), - IceWarpRespondType = Convert.ToInt32((object) accountObject.GetProperty("U_Respond")) + IceWarpAccountState = Convert.ToInt32((object)accountObject.GetProperty("U_AccountDisabled")), + IceWarpAccountType = Convert.ToInt32((object)accountObject.GetProperty("U_AccountType")), + IceWarpRespondType = Convert.ToInt32((object)accountObject.GetProperty("U_Respond")) }; if (mailAccount.ForwardingEnabled) { - mailAccount.ForwardingAddresses = new string[] {accountObject.GetProperty("U_ForwardTo") + accountObject.GetProperty("U_RemoteAddress")}; + mailAccount.ForwardingAddresses = new string[] { accountObject.GetProperty("U_ForwardTo") + accountObject.GetProperty("U_RemoteAddress") }; mailAccount.DeleteOnForward = Convert.ToInt32(accountObject.GetProperty("U_UseRemoteAddress")) == 1; mailAccount.RetainLocalCopy = !mailAccount.DeleteOnForward; } @@ -876,7 +920,7 @@ namespace WebsitePanel.Providers.Mail mailAccount.RespondTo = respondTo; } - mailAccount.RespondPeriodInDays = Convert.ToInt32((object) accountObject.GetProperty("U_RespondPeriod")); + mailAccount.RespondPeriodInDays = Convert.ToInt32((object)accountObject.GetProperty("U_RespondPeriod")); var responderContent = ParseResponderContent(accountObject.GetProperty("U_ResponderContent")); mailAccount.ResponderMessage = responderContent.Content; mailAccount.ResponderSubject = responderContent.Subject; @@ -894,7 +938,11 @@ namespace WebsitePanel.Providers.Mail public MailAccount GetAccount(string mailboxName) { var accountObject = GetAccountObject(mailboxName); - return CreateMailAccountFromAccountObject(accountObject); + var account = CreateMailAccountFromAccountObject(accountObject); + + DisposeObject(accountObject); + + return account; } public void CreateAccount(MailAccount mailbox) @@ -904,15 +952,19 @@ namespace WebsitePanel.Providers.Mail var emailParts = new MailAddress(mailbox.Name); if (!accountObject.CanCreateMailbox(emailParts.User, emailParts.User, mailbox.Password, emailParts.Host)) { - throw new Exception("Cannot create account: " + GetErrorMessage(accountObject.LastErr)); + var ex = new Exception("Cannot create account because of password policy in IceWarp server, invalid username, alias or domain. Check if the password policy is different in IceWarp and WSP. Also perhaps your IceWarp diallows username in password?"); + Log.WriteError(ex); + throw ex; } if (accountObject.New(mailbox.Name)) { + accountObject.SetProperty("U_Password", mailbox.Password); accountObject.Save(); + UpdateAccount(mailbox); } - UpdateAccount(mailbox); + DisposeObject(accountObject); } public void UpdateAccount(MailAccount mailbox) @@ -922,10 +974,15 @@ namespace WebsitePanel.Providers.Mail accountObject.SetProperty("U_Name", mailbox.FullName); accountObject.SetProperty("U_AccountDisabled", mailbox.IceWarpAccountState); accountObject.SetProperty("U_DomainAdmin", mailbox.IsDomainAdmin); - accountObject.SetProperty("U_Password", mailbox.Password); - accountObject.SetProperty("U_MaxBoxSize", mailbox.MaxMailboxSize*1024); + + if (mailbox.ChangePassword) + { + accountObject.SetProperty("U_Password", mailbox.Password); + } + + accountObject.SetProperty("U_MaxBoxSize", mailbox.MaxMailboxSize * 1024); accountObject.SetProperty("U_MaxBox", mailbox.MaxMailboxSize > 0 ? "1" : "0"); - accountObject.SetProperty("U_MaxMessageSize", mailbox.MaxMessageSizeMegaByte*1024); + accountObject.SetProperty("U_MaxMessageSize", mailbox.MaxMessageSizeMegaByte * 1024); accountObject.SetProperty("U_MegabyteSendLimit", mailbox.MegaByteSendLimit); accountObject.SetProperty("U_NumberSendLimit", mailbox.NumberSendLimit); accountObject.SetProperty("U_AccountType", mailbox.IceWarpAccountType); @@ -985,15 +1042,24 @@ namespace WebsitePanel.Providers.Mail } SaveAccount(accountObject); + + DisposeObject(accountObject); } public void DeleteAccount(string mailboxName) { + if (!AccountExists(mailboxName)) + { + return; + } + var accountObject = GetAccountObject(mailboxName); if (!accountObject.Delete()) { - throw new Exception("Cannot delete account: " + GetErrorMessage(accountObject.LastErr)); + Log.WriteError("Cannot delete account: " + GetErrorMessage(accountObject.LastErr), null); } + + DisposeObject(accountObject); } #endregion @@ -1004,7 +1070,11 @@ namespace WebsitePanel.Providers.Mail { var accountObject = GetAccountObject(); - return accountObject.Open(mailAliasName); + var result = accountObject.Open(mailAliasName); + + DisposeObject(accountObject); + + return result; } protected IEnumerable GetAliasListFromAccountObject(dynamic accountObject) @@ -1036,12 +1106,14 @@ namespace WebsitePanel.Providers.Mail { var forwardTo = GetForwardToAddressFromAccountObject(accountObject); var aliases = GetAliasListFromAccountObject(accountObject) as IEnumerable; - aliasList.AddRange(aliases.Where(a => a + "@" + domainName != forwardTo).Select(alias => new MailAlias {Name = alias + "@" + domainName, ForwardTo = forwardTo})); + aliasList.AddRange(aliases.Where(a => a + "@" + domainName != forwardTo).Select(alias => new MailAlias { Name = alias + "@" + domainName, ForwardTo = forwardTo })); } accountObject.FindDone(); } + DisposeObject(accountObject); + return aliasList.ToArray(); } @@ -1051,7 +1123,11 @@ namespace WebsitePanel.Providers.Mail var forwardTo = GetForwardToAddressFromAccountObject(accountObject); - return new MailAlias {ForwardTo = forwardTo, Name = mailAliasName}; + var result = new MailAlias { ForwardTo = forwardTo, Name = mailAliasName }; + + DisposeObject(accountObject); + + return result; } public void CreateMailAlias(MailAlias mailAlias) @@ -1061,23 +1137,25 @@ namespace WebsitePanel.Providers.Mail { mailAlias.ForwardingEnabled = true; mailAlias.DeleteOnForward = true; - mailAlias.ForwardingAddresses = new[] {mailAlias.ForwardTo}; + mailAlias.ForwardingAddresses = new[] { mailAlias.ForwardTo }; mailAlias.Password = GetRandomPassword(); CreateAccount(mailAlias); } - // else open account and add alias to list + // else open account and add alias to list else { - var accountOject = GetAccountObject(mailAlias.ForwardTo); - var aliases = GetAliasListFromAccountObject(accountOject).ToList(); + var accountObject = GetAccountObject(mailAlias.ForwardTo); + var aliases = ((IEnumerable)GetAliasListFromAccountObject(accountObject)).ToList(); aliases.Add(GetEmailUser(mailAlias.Name)); - accountOject.SetProperty("U_EmailAlias", string.Join(";", aliases)); + accountObject.SetProperty("U_EmailAlias", string.Join(";", aliases)); - SaveAccount(accountOject, "account when creating mail alias"); + SaveAccount(accountObject, "account when creating mail alias"); + + DisposeObject(accountObject); } } - private string GetRandowChars(string chars, int length) + private static string GetRandowChars(string chars, int length) { var random = new Random(); return new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); @@ -1091,8 +1169,8 @@ namespace WebsitePanel.Providers.Mail var nonAlphaNum = apiObject.GetProperty("C_Accounts_Policies_Pass_NonAlphaNum"); var alpha = apiObject.GetProperty("C_Accounts_Policies_Pass_Alpha"); - return System.Web.Security.Membership.GeneratePassword(minLength, nonAlphaNum) + - GetRandowChars("0123456789", digits)+ + return System.Web.Security.Membership.GeneratePassword(minLength, nonAlphaNum) + + GetRandowChars("0123456789", digits) + GetRandowChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", alpha); } @@ -1117,11 +1195,13 @@ namespace WebsitePanel.Providers.Mail accountObject.SetProperty("U_EmailAlias", string.Join(";", otherAliases)); SaveAccount(accountObject, "account during alias delete"); } - // If no other aliases, this should be an account with a remote address and then we should delete the account + // If no other aliases, this should be an account with a remote address and then we should delete the account else { DeleteAccount(mailAliasName); } + + DisposeObject(accountObject); } #endregion @@ -1132,7 +1212,11 @@ namespace WebsitePanel.Providers.Mail { var accountObject = GetAccountObject(); - return accountObject.Open(groupName) && Convert.ToInt32(accountObject.GetProperty("U_Type")) == 7; + var result = accountObject.Open(groupName) && (IceWarpAccountType)Enum.Parse(typeof(IceWarpAccountType), ((object)accountObject.GetProperty("U_Type")).ToString()) == IceWarpAccountType.UserGroup; + + DisposeObject(accountObject); + + return result; } public MailGroup[] GetGroups(string domainName) @@ -1145,7 +1229,7 @@ namespace WebsitePanel.Providers.Mail var mailGroup = new MailGroup { Name = accountObject.EmailAddress, - Enabled = Convert.ToInt32((object) accountObject.GetProperty("U_AccountDisabled")) == 0, + Enabled = Convert.ToInt32((object)accountObject.GetProperty("U_AccountDisabled")) == 0, GroupName = accountObject.GetProperty("G_Name"), Members = ((IEnumerable)SplitFileContents(accountObject, "G_ListFile_Contents")).ToArray() }; @@ -1156,7 +1240,11 @@ namespace WebsitePanel.Providers.Mail public MailGroup GetGroup(string groupName) { var accountObject = GetAccountObject(groupName); - return CreateMailGroupFromAccountObject(accountObject); + var result = CreateMailGroupFromAccountObject(accountObject); + + DisposeObject(accountObject); + + return result; } public void CreateGroup(MailGroup @group) @@ -1165,16 +1253,18 @@ namespace WebsitePanel.Providers.Mail if (accountObject.New(group.Name)) { - accountObject.SetProperty("U_Type", 7); + accountObject.SetProperty("U_Type", IceWarpAccountType.UserGroup); accountObject.SetProperty("G_GroupwareMailDelivery", false); SaveAccount(accountObject, "group account"); } else { - throw new ApplicationException("Failed to create group: " + GetErrorMessage(accountObject.LastErr)); + Log.WriteError("Failed to create group: " + GetErrorMessage(accountObject.LastErr), null); } UpdateGroup(group); + + DisposeObject(accountObject); } public void UpdateGroup(MailGroup @group) @@ -1186,15 +1276,24 @@ namespace WebsitePanel.Providers.Mail accountObject.SetProperty("G_ListFile_Contents", string.Join("\n", group.Members)); SaveAccount(accountObject, "group"); + + DisposeObject(accountObject); } public void DeleteGroup(string groupName) { + if (!GroupExists(groupName)) + { + return; + } + var accountObject = GetAccountObject(groupName); if (!accountObject.Delete()) { - throw new Exception("Cannot delete group: " + GetErrorMessage(accountObject.LastErr)); + Log.WriteError("Cannot delete group: " + GetErrorMessage(accountObject.LastErr), null); } + + DisposeObject(accountObject); } #endregion @@ -1205,7 +1304,11 @@ namespace WebsitePanel.Providers.Mail { var accountObject = GetAccountObject(); - return accountObject.Open(maillistName) && (IceWarpAccountType) Enum.Parse(typeof (IceWarpAccountType), ((object) accountObject.GetProperty("U_Type")).ToString()) == IceWarpAccountType.MailingList; + var result = accountObject.Open(maillistName) && (IceWarpAccountType)Enum.Parse(typeof(IceWarpAccountType), ((object)accountObject.GetProperty("U_Type")).ToString()) == IceWarpAccountType.MailingList; + + DisposeObject(accountObject); + + return result; } public MailList[] GetLists(string domainName) @@ -1215,8 +1318,8 @@ namespace WebsitePanel.Providers.Mail protected IEnumerable SplitStringProperty(dynamic accountObject, string propertyName, char separator) { - var value = (object) accountObject.GetProperty(propertyName); - return value == null ? new String[] {} : value.ToString().Split(new[] {separator}, StringSplitOptions.RemoveEmptyEntries); + var value = (object)accountObject.GetProperty(propertyName); + return value == null ? new String[] { } : value.ToString().Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries); } protected IEnumerable SplitFileContents(dynamic accountObject, string propertyName) @@ -1237,43 +1340,43 @@ namespace WebsitePanel.Providers.Mail Name = accountObject.EmailAddress, Description = accountObject.GetProperty("M_Name"), ModeratorAddress = accountObject.GetProperty("M_OwnerAddress"), - MembersSource = (IceWarpListMembersSource) Enum.Parse(typeof (IceWarpListMembersSource), ((object) accountObject.GetProperty("M_SendAllLists")).ToString()), - Members = ((IEnumerable)SplitFileContents(accountObject, "M_ListFile_Contents")).Select(m => m.TrimEnd(new[] {';', '0', '1', '2'})).ToArray(), - SetReceipientsToToHeader = Convert.ToBoolean((object) accountObject.GetProperty("M_SeparateTo")), + MembersSource = (IceWarpListMembersSource)Enum.Parse(typeof(IceWarpListMembersSource), ((object)accountObject.GetProperty("M_SendAllLists")).ToString()), + Members = ((IEnumerable)SplitFileContents(accountObject, "M_ListFile_Contents")).Select(m => m.TrimEnd(new[] { ';', '0', '1', '2' })).ToArray(), + SetReceipientsToToHeader = Convert.ToBoolean((object)accountObject.GetProperty("M_SeparateTo")), SubjectPrefix = accountObject.GetProperty("M_AddToSubject"), - Originator = (IceWarpListOriginator) Enum.Parse(typeof (IceWarpListOriginator), ((object) accountObject.GetProperty("M_ListSender")).ToString()), - PostingMode = Convert.ToBoolean((object) accountObject.GetProperty("M_MembersOnly")) ? PostingMode.MembersCanPost : PostingMode.AnyoneCanPost, - PasswordProtection = (PasswordProtection) Enum.Parse(typeof (PasswordProtection), ((object) accountObject.GetProperty("M_Moderated")).ToString()), + Originator = (IceWarpListOriginator)Enum.Parse(typeof(IceWarpListOriginator), ((object)accountObject.GetProperty("M_ListSender")).ToString()), + PostingMode = Convert.ToBoolean((object)accountObject.GetProperty("M_MembersOnly")) ? PostingMode.MembersCanPost : PostingMode.AnyoneCanPost, + PasswordProtection = (PasswordProtection)Enum.Parse(typeof(PasswordProtection), ((object)accountObject.GetProperty("M_Moderated")).ToString()), Password = accountObject.GetProperty("M_ModeratedPassword"), - DefaultRights = (IceWarpListDefaultRights) Enum.Parse(typeof (IceWarpListDefaultRights), ((object) accountObject.GetProperty("M_DefaultRights")).ToString()), - MaxMessageSizeEnabled = Convert.ToBoolean((object) accountObject.GetProperty("M_MaxList")), - MaxMessageSize = Convert.ToInt32((object) accountObject.GetProperty("M_MaxListSize")), - MaxMembers = Convert.ToInt32((object) accountObject.GetProperty("M_MaxMembers")), - SendToSender = Convert.ToBoolean((object) accountObject.GetProperty("M_SendToSender")), - DigestMode = Convert.ToBoolean((object) accountObject.GetProperty("M_DigestConfirmed")), - MaxMessagesPerMinute = Convert.ToInt32((object) accountObject.GetProperty("M_ListBatch")), - SendSubscribe = Convert.ToBoolean((object) accountObject.GetProperty("M_NotifyJoin")), - SendUnsubscribe = Convert.ToBoolean((object) accountObject.GetProperty("M_NotifyLeave")), + DefaultRights = (IceWarpListDefaultRights)Enum.Parse(typeof(IceWarpListDefaultRights), ((object)accountObject.GetProperty("M_DefaultRights")).ToString()), + MaxMessageSizeEnabled = Convert.ToBoolean((object)accountObject.GetProperty("M_MaxList")), + MaxMessageSize = Convert.ToInt32((object)accountObject.GetProperty("M_MaxListSize")), + MaxMembers = Convert.ToInt32((object)accountObject.GetProperty("M_MaxMembers")), + SendToSender = Convert.ToBoolean((object)accountObject.GetProperty("M_SendToSender")), + DigestMode = Convert.ToBoolean((object)accountObject.GetProperty("M_DigestConfirmed")), + MaxMessagesPerMinute = Convert.ToInt32((object)accountObject.GetProperty("M_ListBatch")), + SendSubscribe = Convert.ToBoolean((object)accountObject.GetProperty("M_NotifyJoin")), + SendUnsubscribe = Convert.ToBoolean((object)accountObject.GetProperty("M_NotifyLeave")), // From list server account - ConfirmSubscription = (IceWarpListConfirmSubscription) Enum.Parse(typeof (IceWarpListConfirmSubscription), ((object) listServerAccountObject.GetProperty("L_DigestConfirmed")).ToString()), - CommandsInSubject = Convert.ToBoolean((object) listServerAccountObject.GetProperty("L_ListSubject")), - DisableSubscribecommand = !Convert.ToBoolean((object) listServerAccountObject.GetProperty("M_JoinR")), - AllowUnsubscribe = Convert.ToBoolean((object) listServerAccountObject.GetProperty("M_LeaveR")), - DisableListcommand = !Convert.ToBoolean((object) listServerAccountObject.GetProperty("M_ListsR")), - DisableWhichCommand = !Convert.ToBoolean((object) listServerAccountObject.GetProperty("M_WhichR")), - DisableReviewCommand = !Convert.ToBoolean((object) listServerAccountObject.GetProperty("M_ReviewR")), - DisableVacationCommand = !Convert.ToBoolean((object) listServerAccountObject.GetProperty("M_VacationR")), - Moderated = Convert.ToBoolean((object) listServerAccountObject.GetProperty("L_Moderated")), + ConfirmSubscription = (IceWarpListConfirmSubscription)Enum.Parse(typeof(IceWarpListConfirmSubscription), ((object)listServerAccountObject.GetProperty("L_DigestConfirmed")).ToString()), + CommandsInSubject = Convert.ToBoolean((object)listServerAccountObject.GetProperty("L_ListSubject")), + DisableSubscribecommand = !Convert.ToBoolean((object)listServerAccountObject.GetProperty("M_JoinR")), + AllowUnsubscribe = Convert.ToBoolean((object)listServerAccountObject.GetProperty("M_LeaveR")), + DisableListcommand = !Convert.ToBoolean((object)listServerAccountObject.GetProperty("M_ListsR")), + DisableWhichCommand = !Convert.ToBoolean((object)listServerAccountObject.GetProperty("M_WhichR")), + DisableReviewCommand = !Convert.ToBoolean((object)listServerAccountObject.GetProperty("M_ReviewR")), + DisableVacationCommand = !Convert.ToBoolean((object)listServerAccountObject.GetProperty("M_VacationR")), + Moderated = Convert.ToBoolean((object)listServerAccountObject.GetProperty("L_Moderated")), CommandPassword = listServerAccountObject.GetProperty("L_ModeratedPassword"), - SuppressCommandResponses = Convert.ToBoolean((object) listServerAccountObject.GetProperty("L_MaxList")) + SuppressCommandResponses = Convert.ToBoolean((object)listServerAccountObject.GetProperty("L_MaxList")) }; // This is how I get values for from and replyto header values. TODO: There must be a better way, but I don't see the pattern right now... - var ss = Convert.ToInt32((object) accountObject.GetProperty("M_SetSender")); - var sv = Convert.ToInt32((object) accountObject.GetProperty("M_SetValue")); - var vm = Convert.ToBoolean((object) accountObject.GetProperty("M_ValueMode")); + var ss = Convert.ToInt32((object)accountObject.GetProperty("M_SetSender")); + var sv = Convert.ToInt32((object)accountObject.GetProperty("M_SetValue")); + var vm = Convert.ToBoolean((object)accountObject.GetProperty("M_ValueMode")); var value = accountObject.GetProperty("M_HeaderValue"); switch (ss) @@ -1338,27 +1441,37 @@ namespace WebsitePanel.Providers.Mail break; } + DisposeObject(listServerAccountObject); + return mailList; } public MailList GetList(string maillistName) { var accountObject = GetAccountObject(maillistName); - return CreateMailListFromAccountObject(accountObject); + var result = CreateMailListFromAccountObject(accountObject); + + DisposeObject(accountObject); + + return result; } public void CreateList(MailList maillist) { if (string.IsNullOrWhiteSpace(maillist.Name)) { - throw new ArgumentNullException("maillist.Name"); + var ex = new ArgumentNullException("maillist.Name", "Cannot create list with empty name"); + Log.WriteError(ex); + throw ex; } var accountObject = GetAccountObject(); if (!accountObject.New(maillist.Name)) { - throw new ApplicationException("Failed to create mailing list: " + GetErrorMessage(accountObject.LastErr)); + var ex = new Exception("Failed to create mailing list: " + GetErrorMessage(accountObject.LastErr)); + Log.WriteError(ex); + throw ex; } accountObject.SetProperty("U_Type", IceWarpAccountType.MailingList); @@ -1366,6 +1479,8 @@ namespace WebsitePanel.Providers.Mail SaveAccount(accountObject, "mailing list"); UpdateList(maillist); + + DisposeObject(accountObject); } protected dynamic FindMatchingListServerAccount(string mailingListName, bool createListServerAccountIfNeeded) @@ -1401,7 +1516,9 @@ namespace WebsitePanel.Providers.Mail // Create list server account if (!listServerAccountObject.New("srv" + mailingListName)) { - throw new Exception("Cannot create listserver account to associate with mailing list." + GetErrorMessage(listServerAccountObject.LastErr)); + var ex = new Exception("Cannot create listserver account to associate with mailing list." + GetErrorMessage(listServerAccountObject.LastErr)); + Log.WriteError(ex); + throw ex; } listServerAccountObject.SetProperty("U_Type", IceWarpAccountType.ListServer); @@ -1524,11 +1641,16 @@ namespace WebsitePanel.Providers.Mail listServerAccountObject.SetProperty("L_ListSender", maillist.Originator); listServerAccountObject.SetProperty("L_MaxList", maillist.SuppressCommandResponses); - SaveAccount(accountObject, "listserver account associated with mailing list"); + SaveAccount(listServerAccountObject, "listserver account associated with mailing list"); } public void DeleteList(string maillistName) { + if (!ListExists(maillistName)) + { + return; + } + var accountObject = GetAccountObject(maillistName); var listServerAccountObject = FindMatchingListServerAccount(maillistName, false); @@ -1546,7 +1668,9 @@ namespace WebsitePanel.Providers.Mail { if (!listServerAccountObject.Delete()) { - throw new Exception("Deleted mail list, but list server account remains: " + GetErrorMessage(listServerAccountObject.LastErr)); + var ex = new Exception("Deleted mail list, but list server account remains: " + GetErrorMessage(listServerAccountObject.LastErr)); + Log.WriteError(ex); + throw ex; } } else @@ -1554,16 +1678,26 @@ namespace WebsitePanel.Providers.Mail listServerAccountObject.SetProperty("L_ListFile_Contents", string.Join("\n", lists.Remove(maillistName))); if (!listServerAccountObject.Save()) { - throw new Exception("Deleted mail list, but associated list server account could not be updated: " + GetErrorMessage(listServerAccountObject.LastErr)); + var ex = new Exception("Deleted mail list, but associated list server account could not be updated: " + GetErrorMessage(listServerAccountObject.LastErr)); + Log.WriteError(ex); + throw ex; } } } else { - throw new Exception("Cannot delete mail list: " + GetErrorMessage(accountObject.LastErr)); + Log.WriteError("Cannot delete mail list: " + GetErrorMessage(accountObject.LastErr), null); } + + DisposeObject(accountObject); + DisposeObject(listServerAccountObject); } #endregion + + public void Dispose() + { + Marshal.FinalReleaseComObject(_currentApiObject); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb index 9439198a..c067d2d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb @@ -2034,8 +2034,9 @@ Public Class MailEnable End If If [String].IsNullOrEmpty(version) = False Then - Dim split As String() = version.Split(New [Char]() {"."c}) - Return split(0).Equals("1") Or split(0).Equals("2") Or split(0).Equals("3") Or split(0).Equals("4") Or split(0).Equals("5") Or split(0).Equals("6") Or split(0).Equals("7") + 'all versions of MailEnable will be compatible with this, so we are just checking to see if there is a version number + 'future versions aim to retain compatibility + Return True Else Return False End If diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 58bc5ab0..233fe6a2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -93,6 +93,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private const string DisableTaskManagerGpoValueName = "DisableTaskMgr"; private const string HideCDriveGpoKey = @"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; private const string HideCDriveGpoValueName = "NoDrives"; + private const string RDSSessionGpoKey = @"HKCU\Software\Policies\Microsoft\Windows NT\Terminal Services"; + private const string RDSSessionGpoValueName = "Shadow"; + private const string DisableCmdGpoKey = @"HKCU\Software\Policies\Microsoft\Windows\System"; + private const string DisableCmdGpoValueName = "DisableCMD"; + private const string DisallowRunParentKey = @"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; + private const string DisallowRunKey = @"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun"; + private const string DisallowRunValueName = "DisallowRun"; #endregion @@ -369,8 +376,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer); } - CreatePolicy(runSpace, organizationId, string.Format("{0}-administrators", collection.Name), new DirectoryEntry(GetGroupPath(organizationId, collection.Name, GetLocalAdminsGroupName(collection.Name))), collection.Name); - CreatePolicy(runSpace, organizationId, string.Format("{0}-users", collection.Name), new DirectoryEntry(GetUsersGroupPath(organizationId, collection.Name)), collection.Name); + string collectionComputersPath = GetComputerGroupPath(organizationId, collection.Name); + CreatePolicy(runSpace, organizationId, string.Format("{0}-administrators", collection.Name), + new DirectoryEntry(GetGroupPath(organizationId, collection.Name, GetLocalAdminsGroupName(collection.Name))), new DirectoryEntry(collectionComputersPath), collection.Name); + CreatePolicy(runSpace, organizationId, string.Format("{0}-users", collection.Name), new DirectoryEntry(GetUsersGroupPath(organizationId, collection.Name)) + , new DirectoryEntry(collectionComputersPath), collection.Name); + CreateHelpDeskPolicy(runSpace, new DirectoryEntry(GetHelpDeskGroupPath(RDSHelpDeskGroup)), new DirectoryEntry(collectionComputersPath), organizationId, collection.Name); } finally { @@ -516,6 +527,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices DeleteGpo(runSpace, string.Format("{0}-administrators", collectionName)); DeleteGpo(runSpace, string.Format("{0}-users", collectionName)); + DeleteHelpDeskPolicy(runSpace, collectionName); var capPolicyName = GetPolicyName(organizationId, collectionName, RdsPolicyTypes.RdCap); var rapPolicyName = GetPolicyName(organizationId, collectionName, RdsPolicyTypes.RdRap); @@ -628,6 +640,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + public void MoveSessionHostsToCollectionOU(List servers, string collectionName, string organizationId) + { + foreach(var server in servers) + { + MoveSessionHostToCollectionOU(server.Name, collectionName, organizationId); + } + } + public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) { Runspace runSpace = null; @@ -1116,7 +1136,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #region GPO - public void ApplyGPO(string collectionName, RdsServerSettings serverSettings) + public void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings) { string administratorsGpo = string.Format("{0}-administrators", collectionName); string usersGpo = string.Format("{0}-users", collectionName); @@ -1124,43 +1144,135 @@ namespace WebsitePanel.Providers.RemoteDesktopServices try { - runspace = OpenRunspace(); + runspace = OpenRunspace(); + string collectionComputersPath = GetComputerGroupPath(organizationId, collectionName); + CreatePolicy(runspace, organizationId, string.Format("{0}-administrators", collectionName), + new DirectoryEntry(GetGroupPath(organizationId, collectionName, GetLocalAdminsGroupName(collectionName))), new DirectoryEntry(collectionComputersPath), collectionName); + CreatePolicy(runspace, organizationId, string.Format("{0}-users", collectionName), + new DirectoryEntry(GetUsersGroupPath(organizationId, collectionName)), new DirectoryEntry(collectionComputersPath), collectionName); + CreateHelpDeskPolicy(runspace, new DirectoryEntry(GetHelpDeskGroupPath(RDSHelpDeskGroup)), new DirectoryEntry(collectionComputersPath), organizationId, collectionName); RemoveRegistryValue(runspace, ScreenSaverGpoKey, administratorsGpo); RemoveRegistryValue(runspace, ScreenSaverGpoKey, usersGpo); RemoveRegistryValue(runspace, RemoveRestartGpoKey, administratorsGpo); RemoveRegistryValue(runspace, RemoveRestartGpoKey, usersGpo); RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, administratorsGpo); - RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, usersGpo); + RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, usersGpo); + RemoveRegistryValue(runspace, DisableCmdGpoKey, usersGpo); + RemoveRegistryValue(runspace, DisableCmdGpoKey, administratorsGpo); + RemoveRegistryValue(runspace, DisallowRunKey, usersGpo); + RemoveRegistryValue(runspace, DisallowRunParentKey, usersGpo); + RemoveRegistryValue(runspace, DisallowRunKey, administratorsGpo); + RemoveRegistryValue(runspace, DisallowRunParentKey, administratorsGpo); - var setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.SCREEN_SAVER_DISABLED)); - SetRegistryValue(setting, runspace, ScreenSaverGpoKey, administratorsGpo, usersGpo, ScreenSaverValueName, "0", "string"); + var setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.SCREEN_SAVER_DISABLED)); + SetRegistryValue(setting, runspace, ScreenSaverGpoKey, administratorsGpo, usersGpo, ScreenSaverValueName, "0", "string"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_SHUTDOWN_RESTART)); - SetRegistryValue(setting, runspace, RemoveRestartGpoKey, administratorsGpo, usersGpo, RemoveRestartGpoValueName, "1", "DWord"); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_SHUTDOWN_RESTART)); + SetRegistryValue(setting, runspace, RemoveRestartGpoKey, administratorsGpo, usersGpo, RemoveRestartGpoValueName, "1", "DWord"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_RUN_COMMAND)); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_RUN_COMMAND)); SetRegistryValue(setting, runspace, RemoveRunGpoKey, administratorsGpo, usersGpo, RemoveRunGpoValueName, "1", "DWord"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.DISABLE_TASK_MANAGER)); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.DISABLE_TASK_MANAGER)); SetRegistryValue(setting, runspace, DisableTaskManagerGpoKey, administratorsGpo, usersGpo, DisableTaskManagerGpoValueName, "1", "DWord"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.HIDE_C_DRIVE)); - SetRegistryValue(setting, runspace, HideCDriveGpoKey, administratorsGpo, usersGpo, HideCDriveGpoValueName, "4", "DWord"); - - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.LOCK_SCREEN_TIMEOUT)); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.HIDE_C_DRIVE)); + SetRegistryValue(setting, runspace, HideCDriveGpoKey, administratorsGpo, usersGpo, HideCDriveGpoValueName, "4", "DWord"); + + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.DISABLE_CMD)); + SetRegistryValue(setting, runspace, DisableCmdGpoKey, administratorsGpo, usersGpo, DisableCmdGpoValueName, "1", "DWord"); + + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.LOCK_SCREEN_TIMEOUT)); double result; - if (!string.IsNullOrEmpty(setting.PropertyValue) && double.TryParse(setting.PropertyValue, out result)) + if (setting != null && !string.IsNullOrEmpty(setting.PropertyValue) && double.TryParse(setting.PropertyValue, out result)) { SetRegistryValue(setting, runspace, ScreenSaverTimeoutGpoKey, administratorsGpo, usersGpo, ScreenSaverTimeoutValueName, setting.PropertyValue, "string"); } + + SetRdsSessionHostPermissions(runspace, serverSettings, usersGpo, administratorsGpo); + SetPowershellPermissions(runspace, serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_POWERSHELL_COMMAND)), usersGpo, administratorsGpo); } finally { CloseRunspace(runspace); } - } + } + + private void CheckPolicySecurityFiltering(Runspace runspace, string gpoName, DirectoryEntry collectionComputersEntry) + { + var scripts = new List{ + string.Format("Get-GPPermissions -Name {0} -TargetName {1} -TargetType group", gpoName, string.Format("'{0}'", ActiveDirectoryUtils.GetADObjectProperty(collectionComputersEntry, "sAMAccountName").ToString())) + }; + + object[] errors = null; + ExecuteRemoteShellCommand(runspace, PrimaryDomainController, scripts, out errors); + + if (errors != null && errors.Any()) + { + scripts = new List{ + string.Format("Set-GPPermissions -Name {0} -PermissionLevel gpoapply -TargetName {1} -TargetType group", gpoName, string.Format("'{0}'", ActiveDirectoryUtils.GetADObjectProperty(collectionComputersEntry, "sAMAccountName").ToString())) + }; + } + + ExecuteRemoteShellCommand(runspace, PrimaryDomainController, scripts, out errors); + } + + private void SetPowershellPermissions(Runspace runspace, RdsServerSetting setting, string usersGpo, string administratorsGpo) + { + if (setting != null) + { + SetRegistryValue(setting, runspace, DisallowRunParentKey, administratorsGpo, usersGpo, DisallowRunValueName, "1", "Dword"); + + if (setting.ApplyAdministrators) + { + SetRegistryValue(runspace, DisallowRunKey, administratorsGpo, "powershell.exe", "string"); + } + + if (setting.ApplyUsers) + { + SetRegistryValue(runspace, DisallowRunKey, usersGpo, "powershell.exe", "string"); + } + } + } + + private void SetRdsSessionHostPermissions(Runspace runspace, RdsServerSettings settings, string usersGpo, string administratorsGpo) + { + var viewSetting = settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION)); + var controlSetting = settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION)); + + if (viewSetting == null || controlSetting == null) + { + return; + } + + if (controlSetting.ApplyUsers) + { + SetRegistryValue(runspace, RDSSessionGpoKey, usersGpo, "2", RDSSessionGpoValueName, "DWord"); + } + else if (viewSetting.ApplyUsers) + { + SetRegistryValue(runspace, RDSSessionGpoKey, usersGpo, "4", RDSSessionGpoValueName, "DWord"); + } + else + { + SetRegistryValue(runspace, RDSSessionGpoKey, usersGpo, "3", RDSSessionGpoValueName, "DWord"); + } + + if (controlSetting.ApplyAdministrators) + { + SetRegistryValue(runspace, RDSSessionGpoKey, administratorsGpo, "2", RDSSessionGpoValueName, "DWord"); + } + else if (viewSetting.ApplyAdministrators) + { + SetRegistryValue(runspace, RDSSessionGpoKey, administratorsGpo, "4", RDSSessionGpoValueName, "DWord"); + } + else + { + SetRegistryValue(runspace, RDSSessionGpoKey, administratorsGpo, "3", RDSSessionGpoValueName, "DWord"); + } + } private void RemoveRegistryValue(Runspace runspace, string key, string gpoName) { @@ -1173,6 +1285,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private void SetRegistryValue(RdsServerSetting setting, Runspace runspace, string key, string administratorsGpo, string usersGpo, string valueName, string value, string type) { + if (setting == null) + { + return; + } + if (setting.ApplyAdministrators) { SetRegistryValue(runspace, key, administratorsGpo, value, valueName, type); @@ -1184,6 +1301,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + private void SetRegistryValue(Runspace runspace, string key, string gpoName, string value, string type) + { + Command cmd = new Command("Set-GPRegistryValue"); + cmd.Parameters.Add("Name", gpoName); + cmd.Parameters.Add("Key", string.Format("\"{0}\"", key)); + cmd.Parameters.Add("Value", value); + cmd.Parameters.Add("Type", type); + + Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); + } + private void SetRegistryValue(Runspace runspace, string key, string gpoName, string value, string valueName, string type) { Command cmd = new Command("Set-GPRegistryValue"); @@ -1196,19 +1324,46 @@ namespace WebsitePanel.Providers.RemoteDesktopServices Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); } - private string CreatePolicy(Runspace runspace, string organizationId, string gpoName, DirectoryEntry entry, string collectionName) + private void CreateHelpDeskPolicy(Runspace runspace, DirectoryEntry entry, DirectoryEntry collectionComputersEntry, string organizationId, string collectionName) + { + string gpoName = string.Format("{0}-HelpDesk", collectionName); + string gpoId = GetPolicyId(runspace, gpoName); + + if (string.IsNullOrEmpty(gpoId)) + { + gpoId = CreateAndLinkPolicy(runspace, gpoName, organizationId, collectionName); + SetPolicyPermissions(runspace, gpoName, entry, collectionComputersEntry); + SetRegistryValue(runspace, RDSSessionGpoKey, gpoName, "2", RDSSessionGpoValueName, "DWord"); + } + else + { + CheckPolicySecurityFiltering(runspace, gpoName, collectionComputersEntry); + } + } + + private string CreatePolicy(Runspace runspace, string organizationId, string gpoName, DirectoryEntry entry, DirectoryEntry collectionComputersEntry, string collectionName) { string gpoId = GetPolicyId(runspace, gpoName); if (string.IsNullOrEmpty(gpoId)) { gpoId = CreateAndLinkPolicy(runspace, gpoName, organizationId, collectionName); - SetPolicyPermissions(runspace, gpoName, entry); + SetPolicyPermissions(runspace, gpoName, entry, collectionComputersEntry); + } + else + { + CheckPolicySecurityFiltering(runspace, gpoName, collectionComputersEntry); } return gpoId; } + private void DeleteHelpDeskPolicy(Runspace runspace, string collectionName) + { + string gpoName = string.Format("{0}-HelpDesk", collectionName); + DeleteGpo(runspace, gpoName); + } + private void DeleteGpo(Runspace runspace, string gpoName) { Command cmd = new Command("Remove-GPO"); @@ -1217,12 +1372,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); } - private void SetPolicyPermissions(Runspace runspace, string gpoName, DirectoryEntry entry) + private void SetPolicyPermissions(Runspace runspace, string gpoName, DirectoryEntry entry, DirectoryEntry collectionComputersEntry) { var scripts = new List { string.Format("Set-GPPermissions -Name {0} -Replace -PermissionLevel None -TargetName 'Authenticated Users' -TargetType group", gpoName), - string.Format("Set-GPPermissions -Name {0} -PermissionLevel gpoapply -TargetName {1} -TargetType group", gpoName, string.Format("'{0}'", ActiveDirectoryUtils.GetADObjectProperty(entry, "sAMAccountName").ToString())) + string.Format("Set-GPPermissions -Name {0} -PermissionLevel gpoapply -TargetName {1} -TargetType group", gpoName, string.Format("'{0}'", ActiveDirectoryUtils.GetADObjectProperty(entry, "sAMAccountName").ToString())), + string.Format("Set-GPPermissions -Name {0} -PermissionLevel gpoapply -TargetName {1} -TargetType group", gpoName, string.Format("'{0}'", ActiveDirectoryUtils.GetADObjectProperty(collectionComputersEntry, "sAMAccountName").ToString())) }; object[] errors = null; @@ -1235,7 +1391,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices try { - var entry = new DirectoryEntry(GetCollectionOUPath(organizationId, string.Format("{0}-OU", collectionName))); + var entry = new DirectoryEntry(GetOrganizationPath(organizationId)); var distinguishedName = string.Format("\"{0}\"", ActiveDirectoryUtils.GetADObjectProperty(entry, "DistinguishedName")); Command cmd = new Command("New-GPO"); @@ -1294,6 +1450,32 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #endregion + #region Shadow Session + + public void ShadowSession(string sessionId, bool control) + { + Runspace runspace = null; + + try + { + runspace = OpenRunspace(); + + var scripts = new List + { + string.Format("mstsc /Shadow:{0}{1}", sessionId, control ? " /Control" : "") + }; + + object[] errors = null; + ExecuteShellCommand(runspace, scripts, out errors); + } + finally + { + CloseRunspace(runspace); + } + } + + #endregion + #region RDS Help Desk private string GetHelpDeskGroupPath(string groupName) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs index b487d4cf..acdcf69c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs @@ -20,5 +20,8 @@ namespace WebsitePanel.Providers.Virtualization public const Int64 Size1G = 0x40000000; public const Int64 Size1M = 0x100000; + + public const string KVP_RAM_SUMMARY_KEY = "VM-RAM-Summary"; + public const string KVP_HDD_SUMMARY_KEY = "VM-HDD-Summary"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs index 33426fe2..ba8df901 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs @@ -36,6 +36,10 @@ namespace WebsitePanel.Providers.Virtualization { return obj.Members[name].Value == null ? "" : obj.Members[name].Value.ToString(); } + public static bool GetBool(this PSObject obj, string name) + { + return Convert.ToBoolean(obj.Members[name].Value); + } #endregion diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/MemoryHelper.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/MemoryHelper.cs new file mode 100644 index 00000000..035da473 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/MemoryHelper.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Runspaces; +using System.Text; +using System.Threading.Tasks; + +namespace WebsitePanel.Providers.Virtualization +{ + public static class MemoryHelper + { + public static DynamicMemory GetDynamicMemory(PowerShellManager powerShell, string vmName) + { + DynamicMemory info = null; + + Command cmd = new Command("Get-VMMemory"); + cmd.Parameters.Add("VMName", vmName); + Collection result = powerShell.Execute(cmd); + + if (result != null && result.Count > 0) + { + info = new DynamicMemory(); + info.Enabled = result[0].GetBool("DynamicMemoryEnabled"); + info.Minimum = Convert.ToInt32(result[0].GetLong("Minimum") / Constants.Size1M); + info.Maximum = Convert.ToInt32(result[0].GetLong("Maximum") / Constants.Size1M); + info.Buffer = Convert.ToInt32(result[0].GetInt("Buffer")); + info.Priority = Convert.ToInt32(result[0].GetInt("Priority")); + } + + return info; + } + + public static void Update(PowerShellManager powerShell, VirtualMachine vm, int ramMb, DynamicMemory dynamicMemory) + { + Command cmd = new Command("Set-VMMemory"); + + cmd.Parameters.Add("VMName", vm.Name); + cmd.Parameters.Add("StartupBytes", ramMb * Constants.Size1M); + + if (dynamicMemory != null && dynamicMemory.Enabled) + { + cmd.Parameters.Add("DynamicMemoryEnabled", true); + cmd.Parameters.Add("MinimumBytes", dynamicMemory.Minimum * Constants.Size1M); + cmd.Parameters.Add("MaximumBytes", dynamicMemory.Maximum * Constants.Size1M); + cmd.Parameters.Add("Buffer", dynamicMemory.Buffer); + cmd.Parameters.Add("Priority", dynamicMemory.Priority); + } + else + { + cmd.Parameters.Add("DynamicMemoryEnabled", false); + } + + powerShell.Execute(cmd, true); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs index 30aad925..68cd50ac 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs @@ -34,7 +34,6 @@ namespace WebsitePanel.Providers.Virtualization public static int GetVMProcessors(PowerShellManager powerShell, string name) { - int procs = 0; Command cmd = new Command("Get-VMProcessor"); @@ -50,48 +49,17 @@ namespace WebsitePanel.Providers.Virtualization return procs; } - public static MemoryInfo GetVMMemory(PowerShellManager powerShell, string name) - { - MemoryInfo info = new MemoryInfo(); - - Command cmd = new Command("Get-VMMemory"); - - cmd.Parameters.Add("VMName", name); - - Collection result = powerShell.Execute(cmd, true); - if (result != null && result.Count > 0) - { - info.DynamicMemoryEnabled = Convert.ToBoolean(result[0].GetProperty("DynamicMemoryEnabled")); - info.Startup = Convert.ToInt32(Convert.ToInt64(result[0].GetProperty("Startup")) / Constants.Size1M); - info.Minimum = Convert.ToInt32(Convert.ToInt64(result[0].GetProperty("Minimum")) / Constants.Size1M); - info.Maximum = Convert.ToInt32(Convert.ToInt64(result[0].GetProperty("Maximum")) / Constants.Size1M); - info.Buffer = Convert.ToInt32(result[0].GetProperty("Buffer")); - info.Priority = Convert.ToInt32(result[0].GetProperty("Priority")); - } - return info; - } - public static void UpdateProcessors(PowerShellManager powerShell, VirtualMachine vm, int cpuCores, int cpuLimitSettings, int cpuReserveSettings, int cpuWeightSettings) { Command cmd = new Command("Set-VMProcessor"); cmd.Parameters.Add("VMName", vm.Name); cmd.Parameters.Add("Count", cpuCores); - cmd.Parameters.Add("Maximum", Convert.ToInt64(cpuLimitSettings * 1000)); - cmd.Parameters.Add("Reserve", Convert.ToInt64(cpuReserveSettings * 1000)); + cmd.Parameters.Add("Maximum", cpuLimitSettings); + cmd.Parameters.Add("Reserve", cpuReserveSettings); cmd.Parameters.Add("RelativeWeight", cpuWeightSettings); powerShell.Execute(cmd, true); } - - public static void UpdateMemory(PowerShellManager powerShell, VirtualMachine vm, long ramMB) - { - Command cmd = new Command("Set-VMMemory"); - - cmd.Parameters.Add("VMName", vm.Name); - cmd.Parameters.Add("StartupBytes", ramMB * Constants.Size1M); - - powerShell.Execute(cmd, true); - } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs index cb14f1d2..9cfaba40 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs @@ -143,34 +143,31 @@ namespace WebsitePanel.Providers.Virtualization try { Command cmd = new Command("Get-VM"); - cmd.Parameters.Add("Id", vmId); - Collection result = PowerShell.Execute(cmd, true); + if (result != null && result.Count > 0) { - vm.Name = result[0].GetProperty("Name").ToString(); + vm.Name = result[0].GetString("Name"); vm.State = result[0].GetEnum("State"); vm.CpuUsage = ConvertNullableToInt32(result[0].GetProperty("CpuUsage")); + // This does not truly give the RAM usage, only the memory assigned to the VPS + // Lets handle detection of total memory and usage else where. SetUsagesFromKVP method have been made for it. vm.RamUsage = Convert.ToInt32(ConvertNullableToInt64(result[0].GetProperty("MemoryAssigned")) / Constants.Size1M); + vm.RamSize = Convert.ToInt32(ConvertNullableToInt64(result[0].GetProperty("MemoryStartup")) / Constants.Size1M); vm.Uptime = Convert.ToInt64(result[0].GetProperty("UpTime").TotalMilliseconds); vm.Status = result[0].GetProperty("Status").ToString(); vm.ReplicationState = result[0].GetProperty("ReplicationState").ToString(); vm.Generation = result[0].GetInt("Generation"); vm.ProcessorCount = result[0].GetInt("ProcessorCount"); vm.ParentSnapshotId = result[0].GetString("ParentSnapshotId"); - vm.Heartbeat = VirtualMachineHelper.GetVMHeartBeatStatus(PowerShell, vm.Name); - vm.CreatedDate = DateTime.Now; if (extendedInfo) { vm.CpuCores = VirtualMachineHelper.GetVMProcessors(PowerShell, vm.Name); - MemoryInfo memoryInfo = VirtualMachineHelper.GetVMMemory(PowerShell, vm.Name); - vm.RamSize = memoryInfo.Startup; - // BIOS BiosInfo biosInfo = BiosHelper.Get(PowerShell, vm.Name, vm.Generation); vm.NumLockEnabled = biosInfo.NumLockEnabled; @@ -192,6 +189,11 @@ namespace WebsitePanel.Providers.Virtualization // network adapters vm.Adapters = NetworkAdapterHelper.Get(PowerShell, vm.Name); } + + vm.DynamicMemory = MemoryHelper.GetDynamicMemory(PowerShell, vm.Name); + + // If it is possible get usage ram and usage hdd data from KVP + SetUsagesFromKVP(ref vm); } } catch (Exception ex) @@ -365,7 +367,7 @@ namespace WebsitePanel.Providers.Virtualization DvdDriveHelper.Update(PowerShell, realVm, vm.DvdDriveInstalled); // Dvd should be before bios because bios sets boot order BiosHelper.Update(PowerShell, realVm, vm.BootFromCD, vm.NumLockEnabled); VirtualMachineHelper.UpdateProcessors(PowerShell, realVm, vm.CpuCores, CpuLimitSettings, CpuReserveSettings, CpuWeightSettings); - VirtualMachineHelper.UpdateMemory(PowerShell, realVm, vm.RamSize); + MemoryHelper.Update(PowerShell, realVm, vm.RamSize, vm.DynamicMemory); NetworkAdapterHelper.Update(PowerShell, vm); } catch (Exception ex) @@ -504,19 +506,21 @@ namespace WebsitePanel.Providers.Virtualization if (vm.State != VirtualMachineState.Saved && vm.State != VirtualMachineState.Off) throw new Exception("The virtual computer system must be in the powered off or saved state prior to calling Destroy method."); - // Delete network adapters and network switchesw + // Delete network adapters and network switches foreach (var networkAdapter in vm.Adapters) { NetworkAdapterHelper.Delete(PowerShell, vm.Name, networkAdapter); - if (!string.IsNullOrEmpty(networkAdapter.SwitchName)) - DeleteSwitch(networkAdapter.SwitchName); + // If more than 1 VM are assigned to the same switch, deleting the virtual machine also deletes the switch which takes other VM instances off line + // There may be a reason for this that I am not aware of? + //if (!string.IsNullOrEmpty(networkAdapter.SwitchName)) + //DeleteSwitch(networkAdapter.SwitchName); } Command cmdSet = new Command("Remove-VM"); cmdSet.Parameters.Add("Name", vm.Name); cmdSet.Parameters.Add("Force"); - PowerShell.Execute(cmdSet, false, true); + PowerShell.Execute(cmdSet, true, true); return JobHelper.CreateSuccessResult(ReturnCode.JobStarted); } @@ -782,10 +786,11 @@ namespace WebsitePanel.Providers.Virtualization Command cmd = new Command("Get-VMSwitch"); - if (!string.IsNullOrEmpty(computerName)) cmd.Parameters.Add("ComputerName", computerName); + // Not needed as the PowerShellManager adds the computer name + //if (!string.IsNullOrEmpty(computerName)) cmd.Parameters.Add("ComputerName", computerName); if (!string.IsNullOrEmpty(type)) cmd.Parameters.Add("SwitchType", type); - Collection result = PowerShell.Execute(cmd, false, true); + Collection result = PowerShell.Execute(cmd, true, true); foreach (PSObject current in result) { @@ -1797,6 +1802,40 @@ namespace WebsitePanel.Providers.Virtualization return jobCompleted; } + private void SetUsagesFromKVP(ref VirtualMachine vm) + { + // Use the WebsitePanel VMConfig Windows service to get the RAM usage as well as the HDD usage / sizes + List vmKvps = GetKVPItems(vm.VirtualMachineId); + foreach (KvpExchangeDataItem vmKvp in vmKvps) + { + // RAM + if (vmKvp.Name == Constants.KVP_RAM_SUMMARY_KEY) + { + string[] ram = vmKvp.Data.Split(':'); + int freeRam = Int32.Parse(ram[0]); + int availRam = Int32.Parse(ram[1]); + + vm.RamUsage = availRam - freeRam; + } + + // HDD + if (vmKvp.Name == Constants.KVP_HDD_SUMMARY_KEY) + { + string[] disksArray = vmKvp.Data.Split(';'); + vm.HddLogicalDisks = new LogicalDisk[disksArray.Length]; + for (int i = 0; i < disksArray.Length; i++) + { + string[] disk = disksArray[i].Split(':'); + vm.HddLogicalDisks[i] = new LogicalDisk + { + DriveLetter = disk[0], + FreeSpace = Int32.Parse(disk[1]), + Size = Int32.Parse(disk[2]) + }; + } + } + } + } #endregion #region Remote File Methods diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/PowerShellManager.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/PowerShellManager.cs index 1f63b104..e55191f3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/PowerShellManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/PowerShellManager.cs @@ -4,8 +4,6 @@ using System.Collections.ObjectModel; using System.Linq; using System.Management.Automation; using System.Management.Automation.Runspaces; -using System.Text; -using System.Threading.Tasks; using WebsitePanel.Providers.HostedSolution; namespace WebsitePanel.Providers.Virtualization @@ -65,7 +63,6 @@ namespace WebsitePanel.Providers.Virtualization public Collection Execute(Command cmd, bool addComputerNameParameter) { - object[] errors; return Execute(cmd, addComputerNameParameter, false); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj index aa20c15c..814d9693 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj @@ -57,6 +57,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs index f43357e6..2fd82337 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs @@ -11,10 +11,6 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // - -using WebsitePanel.Providers.OS; -using WebsitePanel.Providers.Web; - namespace WebsitePanel.Providers.EnterpriseStorage { using System.Xml.Serialization; using System.Web.Services; @@ -22,6 +18,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage { using System.Web.Services.Protocols; using System; using System.Diagnostics; + using WebsitePanel.Providers.OS; + using WebsitePanel.Providers.Web; /// @@ -36,6 +34,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage { private System.Threading.SendOrPostCallback GetFoldersOperationCompleted; + private System.Threading.SendOrPostCallback GetFoldersWithoutFrsmOperationCompleted; + private System.Threading.SendOrPostCallback GetFolderOperationCompleted; private System.Threading.SendOrPostCallback CreateFolderOperationCompleted; @@ -60,6 +60,9 @@ namespace WebsitePanel.Providers.EnterpriseStorage { /// public event GetFoldersCompletedEventHandler GetFoldersCompleted; + /// + public event GetFoldersWithoutFrsmCompletedEventHandler GetFoldersWithoutFrsmCompleted; + /// public event GetFolderCompletedEventHandler GetFolderCompleted; @@ -129,6 +132,51 @@ namespace WebsitePanel.Providers.EnterpriseStorage { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFoldersWithoutFrsm", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SystemFile[] GetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings) { + object[] results = this.Invoke("GetFoldersWithoutFrsm", new object[] { + organizationId, + settings}); + return ((SystemFile[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetFoldersWithoutFrsm", new object[] { + organizationId, + settings}, callback, asyncState); + } + + /// + public SystemFile[] EndGetFoldersWithoutFrsm(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SystemFile[])(results[0])); + } + + /// + public void GetFoldersWithoutFrsmAsync(string organizationId, WebDavSetting[] settings) { + this.GetFoldersWithoutFrsmAsync(organizationId, settings, null); + } + + /// + public void GetFoldersWithoutFrsmAsync(string organizationId, WebDavSetting[] settings, object userState) { + if ((this.GetFoldersWithoutFrsmOperationCompleted == null)) { + this.GetFoldersWithoutFrsmOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFoldersWithoutFrsmOperationCompleted); + } + this.InvokeAsync("GetFoldersWithoutFrsm", new object[] { + organizationId, + settings}, this.GetFoldersWithoutFrsmOperationCompleted, userState); + } + + private void OnGetFoldersWithoutFrsmOperationCompleted(object arg) { + if ((this.GetFoldersWithoutFrsmCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFoldersWithoutFrsmCompleted(this, new GetFoldersWithoutFrsmCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolder", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -544,6 +592,32 @@ namespace WebsitePanel.Providers.EnterpriseStorage { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetFoldersWithoutFrsmCompletedEventHandler(object sender, GetFoldersWithoutFrsmCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFoldersWithoutFrsmCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetFoldersWithoutFrsmCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SystemFile[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SystemFile[])(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFolderCompletedEventHandler(object sender, GetFolderCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs new file mode 100644 index 00000000..3b465943 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs @@ -0,0 +1,926 @@ +// Copyright (c) 2015, 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. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.8657 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by wsdl, Version=2.0.50727.3038. +// +namespace WebsitePanel.Providers.HostedSolution { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + using WebsitePanel.Providers.SharePoint; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="HostedSharePointServerEntSoap", Namespace="http://smbsaas/websitepanel/server/")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] + public partial class HostedSharePointServerEnt : Microsoft.Web.Services3.WebServicesClientProtocol { + + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; + + private System.Threading.SendOrPostCallback Enterprise_GetSupportedLanguagesOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionsOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_CreateSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_UpdateQuotasOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_DeleteSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_BackupSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_RestoreSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetTempFileBinaryChunkOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_AppendTempFileBinaryChunkOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionSizeOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_SetPeoplePickerOuOperationCompleted; + + /// + public HostedSharePointServerEnt() { + this.Url = "http://localhost:9003/HostedSharePointServerEnt.asmx"; + } + + /// + public event Enterprise_GetSupportedLanguagesCompletedEventHandler Enterprise_GetSupportedLanguagesCompleted; + + /// + public event Enterprise_GetSiteCollectionsCompletedEventHandler Enterprise_GetSiteCollectionsCompleted; + + /// + public event Enterprise_GetSiteCollectionCompletedEventHandler Enterprise_GetSiteCollectionCompleted; + + /// + public event Enterprise_CreateSiteCollectionCompletedEventHandler Enterprise_CreateSiteCollectionCompleted; + + /// + public event Enterprise_UpdateQuotasCompletedEventHandler Enterprise_UpdateQuotasCompleted; + + /// + public event Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventHandler Enterprise_CalculateSiteCollectionsDiskSpaceCompleted; + + /// + public event Enterprise_DeleteSiteCollectionCompletedEventHandler Enterprise_DeleteSiteCollectionCompleted; + + /// + public event Enterprise_BackupSiteCollectionCompletedEventHandler Enterprise_BackupSiteCollectionCompleted; + + /// + public event Enterprise_RestoreSiteCollectionCompletedEventHandler Enterprise_RestoreSiteCollectionCompleted; + + /// + public event Enterprise_GetTempFileBinaryChunkCompletedEventHandler Enterprise_GetTempFileBinaryChunkCompleted; + + /// + public event Enterprise_AppendTempFileBinaryChunkCompletedEventHandler Enterprise_AppendTempFileBinaryChunkCompleted; + + /// + public event Enterprise_GetSiteCollectionSizeCompletedEventHandler Enterprise_GetSiteCollectionSizeCompleted; + + /// + public event Enterprise_SetPeoplePickerOuCompletedEventHandler Enterprise_SetPeoplePickerOuCompleted; + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSupportedLanguages", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int[] Enterprise_GetSupportedLanguages() { + object[] results = this.Invoke("Enterprise_GetSupportedLanguages", new object[0]); + return ((int[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSupportedLanguages(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSupportedLanguages", new object[0], callback, asyncState); + } + + /// + public int[] EndEnterprise_GetSupportedLanguages(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int[])(results[0])); + } + + /// + public void Enterprise_GetSupportedLanguagesAsync() { + this.Enterprise_GetSupportedLanguagesAsync(null); + } + + /// + public void Enterprise_GetSupportedLanguagesAsync(object userState) { + if ((this.Enterprise_GetSupportedLanguagesOperationCompleted == null)) { + this.Enterprise_GetSupportedLanguagesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSupportedLanguagesOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSupportedLanguages", new object[0], this.Enterprise_GetSupportedLanguagesOperationCompleted, userState); + } + + private void OnEnterprise_GetSupportedLanguagesOperationCompleted(object arg) { + if ((this.Enterprise_GetSupportedLanguagesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSupportedLanguagesCompleted(this, new Enterprise_GetSupportedLanguagesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSiteCollections", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SharePointEnterpriseSiteCollection[] Enterprise_GetSiteCollections() { + object[] results = this.Invoke("Enterprise_GetSiteCollections", new object[0]); + return ((SharePointEnterpriseSiteCollection[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollections(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollections", new object[0], callback, asyncState); + } + + /// + public SharePointEnterpriseSiteCollection[] EndEnterprise_GetSiteCollections(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointEnterpriseSiteCollection[])(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionsAsync() { + this.Enterprise_GetSiteCollectionsAsync(null); + } + + /// + public void Enterprise_GetSiteCollectionsAsync(object userState) { + if ((this.Enterprise_GetSiteCollectionsOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionsOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollections", new object[0], this.Enterprise_GetSiteCollectionsOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionsOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionsCompleted(this, new Enterprise_GetSiteCollectionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSiteCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SharePointEnterpriseSiteCollection Enterprise_GetSiteCollection(string url) { + object[] results = this.Invoke("Enterprise_GetSiteCollection", new object[] { + url}); + return ((SharePointEnterpriseSiteCollection)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollection(string url, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollection", new object[] { + url}, callback, asyncState); + } + + /// + public SharePointEnterpriseSiteCollection EndEnterprise_GetSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointEnterpriseSiteCollection)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionAsync(string url) { + this.Enterprise_GetSiteCollectionAsync(url, null); + } + + /// + public void Enterprise_GetSiteCollectionAsync(string url, object userState) { + if ((this.Enterprise_GetSiteCollectionOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollection", new object[] { + url}, this.Enterprise_GetSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionCompleted(this, new Enterprise_GetSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_CreateSiteCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void Enterprise_CreateSiteCollection(SharePointEnterpriseSiteCollection siteCollection) { + this.Invoke("Enterprise_CreateSiteCollection", new object[] { + siteCollection}); + } + + /// + public System.IAsyncResult BeginEnterprise_CreateSiteCollection(SharePointEnterpriseSiteCollection siteCollection, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_CreateSiteCollection", new object[] { + siteCollection}, callback, asyncState); + } + + /// + public void EndEnterprise_CreateSiteCollection(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_CreateSiteCollectionAsync(SharePointEnterpriseSiteCollection siteCollection) { + this.Enterprise_CreateSiteCollectionAsync(siteCollection, null); + } + + /// + public void Enterprise_CreateSiteCollectionAsync(SharePointEnterpriseSiteCollection siteCollection, object userState) { + if ((this.Enterprise_CreateSiteCollectionOperationCompleted == null)) { + this.Enterprise_CreateSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_CreateSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_CreateSiteCollection", new object[] { + siteCollection}, this.Enterprise_CreateSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_CreateSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_CreateSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_CreateSiteCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_UpdateQuotas", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void Enterprise_UpdateQuotas(string url, long maxSize, long warningSize) { + this.Invoke("Enterprise_UpdateQuotas", new object[] { + url, + maxSize, + warningSize}); + } + + /// + public System.IAsyncResult BeginEnterprise_UpdateQuotas(string url, long maxSize, long warningSize, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_UpdateQuotas", new object[] { + url, + maxSize, + warningSize}, callback, asyncState); + } + + /// + public void EndEnterprise_UpdateQuotas(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_UpdateQuotasAsync(string url, long maxSize, long warningSize) { + this.Enterprise_UpdateQuotasAsync(url, maxSize, warningSize, null); + } + + /// + public void Enterprise_UpdateQuotasAsync(string url, long maxSize, long warningSize, object userState) { + if ((this.Enterprise_UpdateQuotasOperationCompleted == null)) { + this.Enterprise_UpdateQuotasOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_UpdateQuotasOperationCompleted); + } + this.InvokeAsync("Enterprise_UpdateQuotas", new object[] { + url, + maxSize, + warningSize}, this.Enterprise_UpdateQuotasOperationCompleted, userState); + } + + private void OnEnterprise_UpdateQuotasOperationCompleted(object arg) { + if ((this.Enterprise_UpdateQuotasCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_UpdateQuotasCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_CalculateSiteCollectionsDiskSpace", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public SharePointSiteDiskSpace[] Enterprise_CalculateSiteCollectionsDiskSpace(string[] urls) { + object[] results = this.Invoke("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] { + urls}); + return ((SharePointSiteDiskSpace[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_CalculateSiteCollectionsDiskSpace(string[] urls, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] { + urls}, callback, asyncState); + } + + /// + public SharePointSiteDiskSpace[] EndEnterprise_CalculateSiteCollectionsDiskSpace(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteDiskSpace[])(results[0])); + } + + /// + public void Enterprise_CalculateSiteCollectionsDiskSpaceAsync(string[] urls) { + this.Enterprise_CalculateSiteCollectionsDiskSpaceAsync(urls, null); + } + + /// + public void Enterprise_CalculateSiteCollectionsDiskSpaceAsync(string[] urls, object userState) { + if ((this.Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted == null)) { + this.Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted); + } + this.InvokeAsync("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] { + urls}, this.Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted, userState); + } + + private void OnEnterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted(object arg) { + if ((this.Enterprise_CalculateSiteCollectionsDiskSpaceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_CalculateSiteCollectionsDiskSpaceCompleted(this, new Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_DeleteSiteCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void Enterprise_DeleteSiteCollection(SharePointEnterpriseSiteCollection siteCollection) { + this.Invoke("Enterprise_DeleteSiteCollection", new object[] { + siteCollection}); + } + + /// + public System.IAsyncResult BeginEnterprise_DeleteSiteCollection(SharePointEnterpriseSiteCollection siteCollection, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_DeleteSiteCollection", new object[] { + siteCollection}, callback, asyncState); + } + + /// + public void EndEnterprise_DeleteSiteCollection(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_DeleteSiteCollectionAsync(SharePointEnterpriseSiteCollection siteCollection) { + this.Enterprise_DeleteSiteCollectionAsync(siteCollection, null); + } + + /// + public void Enterprise_DeleteSiteCollectionAsync(SharePointEnterpriseSiteCollection siteCollection, object userState) { + if ((this.Enterprise_DeleteSiteCollectionOperationCompleted == null)) { + this.Enterprise_DeleteSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_DeleteSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_DeleteSiteCollection", new object[] { + siteCollection}, this.Enterprise_DeleteSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_DeleteSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_DeleteSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_DeleteSiteCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_BackupSiteCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Enterprise_BackupSiteCollection(string url, string filename, bool zip) { + object[] results = this.Invoke("Enterprise_BackupSiteCollection", new object[] { + url, + filename, + zip}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_BackupSiteCollection(string url, string filename, bool zip, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_BackupSiteCollection", new object[] { + url, + filename, + zip}, callback, asyncState); + } + + /// + public string EndEnterprise_BackupSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void Enterprise_BackupSiteCollectionAsync(string url, string filename, bool zip) { + this.Enterprise_BackupSiteCollectionAsync(url, filename, zip, null); + } + + /// + public void Enterprise_BackupSiteCollectionAsync(string url, string filename, bool zip, object userState) { + if ((this.Enterprise_BackupSiteCollectionOperationCompleted == null)) { + this.Enterprise_BackupSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_BackupSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_BackupSiteCollection", new object[] { + url, + filename, + zip}, this.Enterprise_BackupSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_BackupSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_BackupSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_BackupSiteCollectionCompleted(this, new Enterprise_BackupSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_RestoreSiteCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void Enterprise_RestoreSiteCollection(SharePointEnterpriseSiteCollection siteCollection, string filename) { + this.Invoke("Enterprise_RestoreSiteCollection", new object[] { + siteCollection, + filename}); + } + + /// + public System.IAsyncResult BeginEnterprise_RestoreSiteCollection(SharePointEnterpriseSiteCollection siteCollection, string filename, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_RestoreSiteCollection", new object[] { + siteCollection, + filename}, callback, asyncState); + } + + /// + public void EndEnterprise_RestoreSiteCollection(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_RestoreSiteCollectionAsync(SharePointEnterpriseSiteCollection siteCollection, string filename) { + this.Enterprise_RestoreSiteCollectionAsync(siteCollection, filename, null); + } + + /// + public void Enterprise_RestoreSiteCollectionAsync(SharePointEnterpriseSiteCollection siteCollection, string filename, object userState) { + if ((this.Enterprise_RestoreSiteCollectionOperationCompleted == null)) { + this.Enterprise_RestoreSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_RestoreSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_RestoreSiteCollection", new object[] { + siteCollection, + filename}, this.Enterprise_RestoreSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_RestoreSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_RestoreSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_RestoreSiteCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetTempFileBinaryChunk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length) { + object[] results = this.Invoke("Enterprise_GetTempFileBinaryChunk", new object[] { + path, + offset, + length}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetTempFileBinaryChunk(string path, int offset, int length, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetTempFileBinaryChunk", new object[] { + path, + offset, + length}, callback, asyncState); + } + + /// + public byte[] EndEnterprise_GetTempFileBinaryChunk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void Enterprise_GetTempFileBinaryChunkAsync(string path, int offset, int length) { + this.Enterprise_GetTempFileBinaryChunkAsync(path, offset, length, null); + } + + /// + public void Enterprise_GetTempFileBinaryChunkAsync(string path, int offset, int length, object userState) { + if ((this.Enterprise_GetTempFileBinaryChunkOperationCompleted == null)) { + this.Enterprise_GetTempFileBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetTempFileBinaryChunkOperationCompleted); + } + this.InvokeAsync("Enterprise_GetTempFileBinaryChunk", new object[] { + path, + offset, + length}, this.Enterprise_GetTempFileBinaryChunkOperationCompleted, userState); + } + + private void OnEnterprise_GetTempFileBinaryChunkOperationCompleted(object arg) { + if ((this.Enterprise_GetTempFileBinaryChunkCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetTempFileBinaryChunkCompleted(this, new Enterprise_GetTempFileBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_AppendTempFileBinaryChunk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Enterprise_AppendTempFileBinaryChunk(string fileName, string path, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] chunk) { + object[] results = this.Invoke("Enterprise_AppendTempFileBinaryChunk", new object[] { + fileName, + path, + chunk}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_AppendTempFileBinaryChunk", new object[] { + fileName, + path, + chunk}, callback, asyncState); + } + + /// + public string EndEnterprise_AppendTempFileBinaryChunk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void Enterprise_AppendTempFileBinaryChunkAsync(string fileName, string path, byte[] chunk) { + this.Enterprise_AppendTempFileBinaryChunkAsync(fileName, path, chunk, null); + } + + /// + public void Enterprise_AppendTempFileBinaryChunkAsync(string fileName, string path, byte[] chunk, object userState) { + if ((this.Enterprise_AppendTempFileBinaryChunkOperationCompleted == null)) { + this.Enterprise_AppendTempFileBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_AppendTempFileBinaryChunkOperationCompleted); + } + this.InvokeAsync("Enterprise_AppendTempFileBinaryChunk", new object[] { + fileName, + path, + chunk}, this.Enterprise_AppendTempFileBinaryChunkOperationCompleted, userState); + } + + private void OnEnterprise_AppendTempFileBinaryChunkOperationCompleted(object arg) { + if ((this.Enterprise_AppendTempFileBinaryChunkCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_AppendTempFileBinaryChunkCompleted(this, new Enterprise_AppendTempFileBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSiteCollectionSize", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public long Enterprise_GetSiteCollectionSize(string url) { + object[] results = this.Invoke("Enterprise_GetSiteCollectionSize", new object[] { + url}); + return ((long)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollectionSize(string url, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollectionSize", new object[] { + url}, callback, asyncState); + } + + /// + public long EndEnterprise_GetSiteCollectionSize(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((long)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionSizeAsync(string url) { + this.Enterprise_GetSiteCollectionSizeAsync(url, null); + } + + /// + public void Enterprise_GetSiteCollectionSizeAsync(string url, object userState) { + if ((this.Enterprise_GetSiteCollectionSizeOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionSizeOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollectionSize", new object[] { + url}, this.Enterprise_GetSiteCollectionSizeOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionSizeOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionSizeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionSizeCompleted(this, new Enterprise_GetSiteCollectionSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_SetPeoplePickerOu", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void Enterprise_SetPeoplePickerOu(string site, string ou) { + this.Invoke("Enterprise_SetPeoplePickerOu", new object[] { + site, + ou}); + } + + /// + public System.IAsyncResult BeginEnterprise_SetPeoplePickerOu(string site, string ou, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_SetPeoplePickerOu", new object[] { + site, + ou}, callback, asyncState); + } + + /// + public void EndEnterprise_SetPeoplePickerOu(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_SetPeoplePickerOuAsync(string site, string ou) { + this.Enterprise_SetPeoplePickerOuAsync(site, ou, null); + } + + /// + public void Enterprise_SetPeoplePickerOuAsync(string site, string ou, object userState) { + if ((this.Enterprise_SetPeoplePickerOuOperationCompleted == null)) { + this.Enterprise_SetPeoplePickerOuOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_SetPeoplePickerOuOperationCompleted); + } + this.InvokeAsync("Enterprise_SetPeoplePickerOu", new object[] { + site, + ou}, this.Enterprise_SetPeoplePickerOuOperationCompleted, userState); + } + + private void OnEnterprise_SetPeoplePickerOuOperationCompleted(object arg) { + if ((this.Enterprise_SetPeoplePickerOuCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_SetPeoplePickerOuCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSupportedLanguagesCompletedEventHandler(object sender, Enterprise_GetSupportedLanguagesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSupportedLanguagesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSupportedLanguagesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionsCompletedEventHandler(object sender, Enterprise_GetSiteCollectionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointEnterpriseSiteCollection[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointEnterpriseSiteCollection[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionCompletedEventHandler(object sender, Enterprise_GetSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointEnterpriseSiteCollection Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointEnterpriseSiteCollection)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_CreateSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_UpdateQuotasCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventHandler(object sender, Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteDiskSpace[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteDiskSpace[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_DeleteSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_BackupSiteCollectionCompletedEventHandler(object sender, Enterprise_BackupSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_BackupSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_BackupSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_RestoreSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetTempFileBinaryChunkCompletedEventHandler(object sender, Enterprise_GetTempFileBinaryChunkCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetTempFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetTempFileBinaryChunkCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public byte[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((byte[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_AppendTempFileBinaryChunkCompletedEventHandler(object sender, Enterprise_AppendTempFileBinaryChunkCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_AppendTempFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_AppendTempFileBinaryChunkCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionSizeCompletedEventHandler(object sender, Enterprise_GetSiteCollectionSizeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public long Result { + get { + this.RaiseExceptionIfNecessary(); + return ((long)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_SetPeoplePickerOuCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index fbb586a2..bbd90595 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -104,6 +104,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { private System.Threading.SendOrPostCallback ApplyGPOOperationCompleted; + private System.Threading.SendOrPostCallback ShadowSessionOperationCompleted; + + private System.Threading.SendOrPostCallback MoveSessionHostsToCollectionOUOperationCompleted; + /// public RemoteDesktopServices() { this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; @@ -220,6 +224,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event ApplyGPOCompletedEventHandler ApplyGPOCompleted; + /// + public event ShadowSessionCompletedEventHandler ShadowSessionCompleted; + + /// + public event MoveSessionHostsToCollectionOUCompletedEventHandler MoveSessionHostsToCollectionOUCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1791,15 +1801,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ApplyGPO", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void ApplyGPO(string collectionName, RdsServerSettings serverSettings) { + public void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings) { this.Invoke("ApplyGPO", new object[] { + organizationId, collectionName, serverSettings}); } /// - public System.IAsyncResult BeginApplyGPO(string collectionName, RdsServerSettings serverSettings, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ApplyGPO", new object[] { + organizationId, collectionName, serverSettings}, callback, asyncState); } @@ -1810,16 +1822,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } /// - public void ApplyGPOAsync(string collectionName, RdsServerSettings serverSettings) { - this.ApplyGPOAsync(collectionName, serverSettings, null); + public void ApplyGPOAsync(string organizationId, string collectionName, RdsServerSettings serverSettings) { + this.ApplyGPOAsync(organizationId, collectionName, serverSettings, null); } /// - public void ApplyGPOAsync(string collectionName, RdsServerSettings serverSettings, object userState) { + public void ApplyGPOAsync(string organizationId, string collectionName, RdsServerSettings serverSettings, object userState) { if ((this.ApplyGPOOperationCompleted == null)) { this.ApplyGPOOperationCompleted = new System.Threading.SendOrPostCallback(this.OnApplyGPOOperationCompleted); } this.InvokeAsync("ApplyGPO", new object[] { + organizationId, collectionName, serverSettings}, this.ApplyGPOOperationCompleted, userState); } @@ -1831,6 +1844,95 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ShadowSession", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ShadowSession(string sessionId, bool control) { + this.Invoke("ShadowSession", new object[] { + sessionId, + control}); + } + + /// + public System.IAsyncResult BeginShadowSession(string sessionId, bool control, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ShadowSession", new object[] { + sessionId, + control}, callback, asyncState); + } + + /// + public void EndShadowSession(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void ShadowSessionAsync(string sessionId, bool control) { + this.ShadowSessionAsync(sessionId, control, null); + } + + /// + public void ShadowSessionAsync(string sessionId, bool control, object userState) { + if ((this.ShadowSessionOperationCompleted == null)) { + this.ShadowSessionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShadowSessionOperationCompleted); + } + this.InvokeAsync("ShadowSession", new object[] { + sessionId, + control}, this.ShadowSessionOperationCompleted, userState); + } + + private void OnShadowSessionOperationCompleted(object arg) { + if ((this.ShadowSessionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ShadowSessionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveSessionHostsToCollectionOU", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void MoveSessionHostsToCollectionOU(RdsServer[] servers, string collectionName, string organizationId) { + this.Invoke("MoveSessionHostsToCollectionOU", new object[] { + servers, + collectionName, + organizationId}); + } + + /// + public System.IAsyncResult BeginMoveSessionHostsToCollectionOU(RdsServer[] servers, string collectionName, string organizationId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("MoveSessionHostsToCollectionOU", new object[] { + servers, + collectionName, + organizationId}, callback, asyncState); + } + + /// + public void EndMoveSessionHostsToCollectionOU(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void MoveSessionHostsToCollectionOUAsync(RdsServer[] servers, string collectionName, string organizationId) { + this.MoveSessionHostsToCollectionOUAsync(servers, collectionName, organizationId, null); + } + + /// + public void MoveSessionHostsToCollectionOUAsync(RdsServer[] servers, string collectionName, string organizationId, object userState) { + if ((this.MoveSessionHostsToCollectionOUOperationCompleted == null)) { + this.MoveSessionHostsToCollectionOUOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveSessionHostsToCollectionOUOperationCompleted); + } + this.InvokeAsync("MoveSessionHostsToCollectionOU", new object[] { + servers, + collectionName, + organizationId}, this.MoveSessionHostsToCollectionOUOperationCompleted, userState); + } + + private void OnMoveSessionHostsToCollectionOUOperationCompleted(object arg) { + if ((this.MoveSessionHostsToCollectionOUCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.MoveSessionHostsToCollectionOUCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -2468,4 +2570,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ApplyGPOCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void ShadowSessionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void MoveSessionHostsToCollectionOUCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj index 751a8fe5..c68a63eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -82,6 +82,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs b/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs index b0d975f2..e3c1a823 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs @@ -29,6 +29,7 @@ using System; using System.Diagnostics; + namespace WebsitePanel.Server.Utils { /// @@ -151,5 +152,7 @@ namespace WebsitePanel.Server.Utils // return String.Concat(String.Format("[{0:G}] {1}: ", DateTime.Now, tag), message); } + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.sln b/WebsitePanel/Sources/WebsitePanel.Server.sln index c5af78c6..b06fa4e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.sln +++ b/WebsitePanel/Sources/WebsitePanel.Server.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 +VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching Application Block", "Caching Application Block", "{C8E6F2E4-A5B8-486A-A56E-92D864524682}" ProjectSection(SolutionItems) = preProject @@ -152,6 +152,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Mail EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Virtualization.HyperV2012R2", "WebsitePanel.Providers.Virtualization.HyperV-2012R2\WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj", "{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.SharePoint2013Ent", "WebsitePanel.Providers.HostedSolution.SharePoint2013Ent\WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.csproj", "{0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -762,6 +764,16 @@ Global {EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU {EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|x86.ActiveCfg = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|x86.ActiveCfg = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Any CPU.Build.0 = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs index ecd4878c..6a27c78a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs @@ -75,6 +75,23 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public SystemFile[] GetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings) + { + try + { + Log.WriteStart("'{0}' GetFolders", ProviderSettings.ProviderName); + SystemFile[] result = EnterpriseStorageProvider.GetFoldersWithoutFrsm(organizationId, settings); + Log.WriteEnd("'{0}' GetFolders", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetFolders", ProviderSettings.ProviderName), ex); + throw; + } + } + [WebMethod, SoapHeader("settings")] public SystemFile GetFolder(string organizationId, string folder, WebDavSetting setting) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx new file mode 100644 index 00000000..6eb0df72 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="HostedSharePointServerEnt.asmx.cs" Class="WebsitePanel.Server.HostedSharePointServerEnt" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs new file mode 100644 index 00000000..732ddf55 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs @@ -0,0 +1,274 @@ +// Copyright (c) 2015, 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. + +using System; +using System.ComponentModel; +using System.Web.Services; +using System.Web.Services.Protocols; +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.SharePoint; +using WebsitePanel.Server.Utils; +using Microsoft.Web.Services3; + +namespace WebsitePanel.Server +{ + /// + /// Summary description for HostedSharePointServerEnt + /// + [WebService(Namespace = "http://smbsaas/websitepanel/server/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class HostedSharePointServerEnt : HostingServiceProviderWebService + { + private delegate TReturn Action(); + + /// + /// Gets hosted SharePoint provider instance. + /// + private IHostedSharePointServerEnt HostedSharePointServerEntProvider + { + get { return (IHostedSharePointServerEnt)Provider; } + } + + /// + /// Gets list of supported languages by this installation of SharePoint. + /// + /// List of supported languages + [WebMethod, SoapHeader("settings")] + public int[] Enterprise_GetSupportedLanguages() + { + return ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_GetSupportedLanguages(); + }, "GetSupportedLanguages"); + } + + + /// + /// Gets list of SharePoint collections within root web application. + /// + /// List of SharePoint collections within root web application. + [WebMethod, SoapHeader("settings")] + public SharePointEnterpriseSiteCollection[] Enterprise_GetSiteCollections() + { + return ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_GetSiteCollections(); + }, "GetSiteCollections"); + } + + /// + /// Gets SharePoint collection within root web application with given name. + /// + /// Url that uniquely identifies site collection to be loaded. + /// SharePoint collection within root web application with given name. + [WebMethod, SoapHeader("settings")] + public SharePointEnterpriseSiteCollection Enterprise_GetSiteCollection(string url) + { + return ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_GetSiteCollection(url); + }, "GetSiteCollection"); + } + + /// + /// Creates site collection within predefined root web application. + /// + /// Information about site coolection to be created. + [WebMethod, SoapHeader("settings")] + public void Enterprise_CreateSiteCollection(SharePointEnterpriseSiteCollection siteCollection) + { + siteCollection.OwnerLogin = AttachNetbiosDomainName(siteCollection.OwnerLogin); + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_CreateSiteCollection(siteCollection); + return new object(); + }, "CreateSiteCollection"); + } + + + [WebMethod, SoapHeader("settings")] + public void Enterprise_UpdateQuotas(string url, long maxSize, long warningSize) + { + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_UpdateQuotas(url, maxSize, warningSize); + return new object(); + }, "UpdateQuotas"); + + + + } + + [WebMethod, SoapHeader("settings")] + public SharePointSiteDiskSpace[] Enterprise_CalculateSiteCollectionsDiskSpace(string[] urls) + { + SharePointSiteDiskSpace[] ret = null; + ret = ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_CalculateSiteCollectionsDiskSpace(urls); + }, "CalculateSiteCollectionDiskSpace"); + return ret; + + } + /// + /// Deletes site collection under given url. + /// + /// Url that uniquely identifies site collection to be deleted. + [WebMethod, SoapHeader("settings")] + public void Enterprise_DeleteSiteCollection(SharePointEnterpriseSiteCollection siteCollection) + { + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_DeleteSiteCollection(siteCollection); + return new object(); + }, "DeleteSiteCollection"); + } + /// + /// Backups site collection under give url. + /// + /// Url that uniquely identifies site collection to be deleted. + /// Resulting backup file name. + /// A value which shows whether created backup must be archived. + /// Created backup full path. + [WebMethod, SoapHeader("settings")] + public string Enterprise_BackupSiteCollection(string url, string filename, bool zip) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_BackupSiteCollection(url, filename, zip); + }, "BackupSiteCollection"); + } + + /// + /// Restores site collection under given url from backup. + /// + /// Site collection to be restored. + /// Backup file name to restore from. + [WebMethod, SoapHeader("settings")] + public void Enterprise_RestoreSiteCollection(SharePointEnterpriseSiteCollection siteCollection, string filename) + { + siteCollection.OwnerLogin = AttachNetbiosDomainName(siteCollection.OwnerLogin); + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_RestoreSiteCollection(siteCollection, filename); + return new object(); + }, "RestoreSiteCollection"); + } + + /// + /// Gets binary data chunk of specified size from specified offset. + /// + /// Path to file to get bunary data chunk from. + /// Offset from which to start data reading. + /// Binary data chunk length. + /// Binary data chunk read from file. + [WebMethod, SoapHeader("settings")] + public byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_GetTempFileBinaryChunk(path, offset, length); + }, "GetTempFileBinaryChunk"); + } + + /// + /// Appends supplied binary data chunk to file. + /// + /// Non existent file name to append to. + /// Full path to existent file to append to. + /// Binary data chunk to append to. + /// Path to file that was appended with chunk. + [WebMethod, SoapHeader("settings")] + public virtual string Enterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_AppendTempFileBinaryChunk(fileName, path, chunk); + }, "AppendTempFileBinaryChunk"); + } + + + [WebMethod, SoapHeader("settings")] + public long Enterprise_GetSiteCollectionSize(string url) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_GetSiteCollectionSize(url); + }, "GetSiteCollectionSize"); + } + + + [WebMethod, SoapHeader("settings")] + public void Enterprise_SetPeoplePickerOu(string site, string ou) + { + HostedSharePointServerEntProvider.Enterprise_SetPeoplePickerOu(site, ou); + } + + + /// + /// Executes supplied action and performs logging. + /// + /// Type of action's return value. + /// Action to be executed. + /// Action name for logging purposes. + /// Action execution result. + private TReturn ExecuteAction(Action action, string actionName) + { + try + { + Log.WriteStart("'{0}' {1}", ProviderSettings.ProviderName, actionName); + TReturn result = action(); + Log.WriteEnd("'{0}' {1}", ProviderSettings.ProviderName, actionName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Can't {1} '{0}' provider", ProviderSettings.ProviderName, actionName), ex); + throw; + } + } + + /// + /// Returns fully qualified netbios account name. + /// + /// Account name. + /// Fully qualified netbios account name. + private string AttachNetbiosDomainName(string accountName) + { + string domainNetbiosName = String.Format("{0}\\", ActiveDirectoryUtils.GetNETBIOSDomainName(ServerSettings.ADRootDomain)); + return String.Format("{0}{1}", domainNetbiosName, accountName.Replace(domainNetbiosName, String.Empty)); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index ff949699..e28846eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -665,12 +665,12 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public void ApplyGPO(string collectionName, RdsServerSettings serverSettings) + public void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings) { try { Log.WriteStart("'{0}' ApplyGPO", ProviderSettings.ProviderName); - RDSProvider.ApplyGPO(collectionName, serverSettings); + RDSProvider.ApplyGPO(organizationId, collectionName, serverSettings); Log.WriteEnd("'{0}' ApplyGPO", ProviderSettings.ProviderName); } catch (Exception ex) @@ -679,5 +679,37 @@ namespace WebsitePanel.Server throw; } } + + [WebMethod, SoapHeader("settings")] + public void ShadowSession(string sessionId, bool control) + { + try + { + Log.WriteStart("'{0}' ShadowSession", ProviderSettings.ProviderName); + RDSProvider.ShadowSession(sessionId, control); + Log.WriteEnd("'{0}' ShadowSession", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ShadowSession", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void MoveSessionHostsToCollectionOU(List servers, string collectionName, string organizationId) + { + try + { + Log.WriteStart("'{0}' MoveSessionHostsToCollectionOU", ProviderSettings.ProviderName); + RDSProvider.MoveSessionHostsToCollectionOU(servers, collectionName, organizationId); + Log.WriteEnd("'{0}' MoveSessionHostsToCollectionOU", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' MoveSessionHostsToCollectionOU", ProviderSettings.ProviderName), ex); + throw; + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 8b1d2bb6..029e25a2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -35,6 +35,7 @@ 4 AllRules.ruleset 618 + OnlyFilesToRunTheApp none @@ -91,9 +92,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -115,9 +294,11 @@ - + + + Designer - + @@ -141,6 +322,10 @@ EnterpriseStorage.asmx Component + + HostedSharePointServerEnt.asmx + Component + RemoteDesktopServices.asmx Component @@ -243,6 +428,10 @@ {684C932A-6C75-46AC-A327-F3689D89EB42} WebsitePanel.Providers.Base + + {990c4a2a-34a5-4be0-9546-e10abdfffd0e} + WebsitePanel.Server.Client + {E91E52F3-9555-4D00-B577-2B1DBDD87CA7} WebsitePanel.Server.Utils @@ -253,7 +442,7 @@ - + 10.0 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Containers/Default/VPS2012.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Containers/Default/VPS2012.ascx new file mode 100644 index 00000000..89c6426c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Containers/Default/VPS2012.ascx @@ -0,0 +1,10 @@ +<%@ Control Language="C#" AutoEventWireup="false" %> +
+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config index f79eefba..7933d0cc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config @@ -99,11 +99,22 @@ - + + + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config index 54627906..6a632d9b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config @@ -69,6 +69,7 @@ + @@ -123,6 +124,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Backup + + + Cancel + + + ZIP Backup + + + <p>The backup file that you create includes list or library content, security settings, user information, navigation, customizations, and personalizations (such as views, site templates, and content types). The backup file does not include workflows, alerts, and properties stored at the site collection level.</p> + + + Backup Destination: + + + Backup File Name: + + + Backup Options: + + + Backup SharePoint Site Collection + + + Copy to Folder + + + Download via HTTP + + + Backup SharePoint Site Collection + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseEditSiteCollection.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseEditSiteCollection.ascx.resx new file mode 100644 index 00000000..856828c3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseEditSiteCollection.ascx.resx @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Backup Site Collection + + + Cancel + + + ShowProgressDialog('Deleting SharePoint site collection...'); + + + Delete + + + Restore Site Collection + + + ShowProgressDialog('Updating SharePoint site collection...'); + + + Update + + + <p>Here you can create new SharePoint site collection. Choose URL from the list of domains you already own. Site URL like team.yourcompany.com should be added as domain in “Domain names” organization’s menu before SharePoint site collection creation.</p> + +<p><b>Site owner</b> is member of your organization who will be responsible for this SharePoint site collection administration: choosing site templates, adding other users, creating sub-sites.</p> + +<p><b>Locale ID</b> defines your site language and can not be changed after site creation. However child sub sites can use another Locale IDs.</p> + +<p>Title will be visible in site header.</p> + +<p><b>Description</b> will be visible when you open site on the top of the main site page.</p> + +<p>After you create this site open it using owner login, and do at least 2 main steps: +1. Choose site template +2. Define who will be able to access this site. To add user from your hosted organization to SharePoint site, please copy/paste his or her e-mail from user's properties in WebsitePanel to SharePoint site collection’s Users/Groups field.</p> + + + Email + + + User Name + + + Description: + + + Locale ID: + + + Owner: + + + Url: + + + Title: + + + Send warning E-mail when site storage reaches (MB): + + + Full list of locales + + + SharePoint Site Collection + + + SharePoint Site Collection Tools + + + Add Site Collection + + + Edit SharePoint Site Collection + + + Update + + + Maximum site storage size (MB): + + + Do not send + + + ShowProgressDialog('Creating SharePoint site collection...'); + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointRestoreSiteCollection.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseRestoreSiteCollection.ascx.resx similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointRestoreSiteCollection.ascx.resx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseRestoreSiteCollection.ascx.resx diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseSiteCollections.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseSiteCollections.ascx.resx new file mode 100644 index 00000000..224fd542 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseSiteCollections.ascx.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add SharePoint Enterprise Site Collection + + + Create New Site Collection + + + Delete + + + Url + + + <p><b>SharePoint site collection</b> is a group of sites built on Microsoft Windows SharePoint Services that all exist under a top-level site. To make managing the sites and their content more convenient, you can assign users to be site collection administrators or site collection owners. These are permission levels to give to users who you want to have full administrative rights to all sites and content within a site collection.</p> + + + Owner + + + No SharePoint site collections have been created. To create a SharePoint site collection click "Create New Site Collection" button. + + + Site Collection Url + + + Total Site Collections Created: + + + SharePoint Enterprise Site Collections + + + SharePoint Enterprise Site Collections + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointStorageSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseStorageSettings.ascx.resx similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointStorageSettings.ascx.resx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseStorageSettings.ascx.resx diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointStorageUsage.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseStorageUsage.ascx.resx similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointStorageUsage.ascx.resx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointEnterpriseStorageUsage.ascx.resx diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointRestoreSiteCollection.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointRestoreSiteCollection.ascx.resx new file mode 100644 index 00000000..06164c47 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointRestoreSiteCollection.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + ShowProgressDialog('Restoring SharePoint site collection...'); + + + Restore + + + <p>After site collection is restored it will have primary administrator assigned to it as it was before restoration (primary administrator record from backup is ignored).</p> + + + .ZIP, .BAK files are allowed + + + Restore From: + + + Restore SharePoint Site Collection + + + Hosting Space File + + + Uploaded File + + + Restore SharePoint Site Collection + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointSiteCollections.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointSiteCollections.ascx.resx similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointSiteCollections.ascx.resx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointSiteCollections.ascx.resx diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointStorageSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointStorageSettings.ascx.resx new file mode 100644 index 00000000..062e04df --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointStorageSettings.ascx.resx @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Save + + + Save and Apply to All Site Collections + + + <p>Storage settings are used to limit the amount of storage available on a SharePoint site collection, and they are used to send e-mail alerts to the site administrator when a specified value of space is used.</p> + +<p>These settings will be applied to the new site collections only. By clicking "Save and Apply to All Site Collections" button you can override these settings for all existing site collections.</p> + +<p>Please note, that you cannot specify storage settings higher than defined in the space hosting plan.</p> + + + Maximum site storage size (MB): + + + Send warning E-mail when site storage reaches (MB): + + + Storage Settings + + + Storage Settings + + + Storage Settings + + + Don't use + + + Do not send + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointStorageUsage.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointStorageUsage.ascx.resx new file mode 100644 index 00000000..b945ab03 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/App_LocalResources/HostedSharePointStorageUsage.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Recalculate Disk Space + + + <p>SharePoint disk space usage is calculated on timely basis (usually once a day). You can recalculate it right now by clicking "Recalculate Disk Space" button.</p> + + + Site Collection + + + Total Size, MB + + + There are no site collections + + + Storage Usage + + + Site Collections + + + Storage Usage + + + Total Size (MB): + + + Total Items: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx similarity index 87% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx index 932d7aa8..743a1ec4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx @@ -1,10 +1,11 @@ <%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointBackupSiteCollection.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointBackupSiteCollection" %> -<%@ Register Src="UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> -<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" +<%@ Register Src="../UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> - -<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" + +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx.cs similarity index 90% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx.cs index 4171ea68..5e1afb37 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx.cs @@ -61,11 +61,6 @@ namespace WebsitePanel.Portal } } - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -165,10 +160,10 @@ namespace WebsitePanel.Portal RedirectBack(); } - private void RedirectBack() - { - HttpContext.Current.Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); - } + private void RedirectBack() + { + HttpContext.Current.Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); + } protected void chkZipBackup_CheckedChanged(object sender, EventArgs e) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx.designer.cs similarity index 75% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx.designer.cs index fd9c426c..6bd4aa9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointBackupSiteCollection.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx similarity index 87% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx index d80139d7..ad030d8c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx @@ -1,13 +1,14 @@ <%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointEditSiteCollection.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointEditSiteCollection" %> -<%@ Register Src="ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> -<%@ Register Src="UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> -<%@ Register Src="UserControls/AllocatePackageIPAddresses.ascx" TagName="SiteUrlBuilder" TagPrefix="wsp" %> -<%@ Register Src="ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> -<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> -<%@ Register src="UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> -<%@ Register Src="DomainsSelectDomainControl.ascx" TagName="DomainsSelectDomainControl" TagPrefix="uc1" %> +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AllocatePackageIPAddresses.ascx" TagName="SiteUrlBuilder" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register src="../UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> +<%@ Register Src="../DomainsSelectDomainControl.ascx" TagName="DomainsSelectDomainControl" TagPrefix="uc1" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx.cs similarity index 92% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx.cs index 0a35bcfc..1c150ca9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx.cs @@ -44,11 +44,6 @@ namespace WebsitePanel.Portal { SharePointSiteCollection item = null; - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - private int OrganizationId { get @@ -230,7 +225,7 @@ namespace WebsitePanel.Portal /// Reserved disk space vallue. private int GetReservedDiskStorageSpace() { - var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false, GroupName); + var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false); return (int)existingCollections.Sum(siteCollection => siteCollection.MaxSiteStorage); } @@ -257,20 +252,9 @@ namespace WebsitePanel.Portal { item = new SharePointSiteCollection(); - string groupName = GroupName; - - if (ResourceGroups.SharepointFoundationServer.Replace(" ", "").Equals(groupName)) - { - groupName = ResourceGroups.SharepointFoundationServer; - } - else if (ResourceGroups.SharepointServer.Replace(" ", "").Equals(groupName)) - { - groupName = ResourceGroups.SharepointServer; - } - - if (!UseSharedSLL(PanelSecurity.PackageId)) + if (!UseSharedSLL(PanelSecurity.PackageId)) { - SharePointSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue, groupName); + SharePointSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue); foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) { Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name); @@ -303,7 +287,7 @@ namespace WebsitePanel.Portal item.MaxSiteStorage = maxStorage.QuotaValue; item.WarningStorage = warningStorage.QuotaValue; - int result = ES.Services.HostedSharePointServers.AddSiteCollection(item, groupName); + int result = ES.Services.HostedSharePointServers.AddSiteCollection(item); if (result < 0) { localMessageBox.ShowResultMessage(result); @@ -390,19 +374,19 @@ namespace WebsitePanel.Portal protected void btnBackup_Click(object sender, EventArgs e) { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); } protected void btnRestore_Click(object sender, EventArgs e) { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); } private void RedirectToSiteCollectionsList() { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString())); } private bool UseSharedSLL(int packageID) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx.designer.cs similarity index 88% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx.designer.cs index b82a5dd1..6801e4b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEditSiteCollection.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx new file mode 100644 index 00000000..f680ba4a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx @@ -0,0 +1,80 @@ +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointEnterpriseBackupSiteCollection.ascx.cs" + Inherits="WebsitePanel.Portal.HostedSharePointEnterpriseBackupSiteCollection" %> +<%@ Register Src="../UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" + TagPrefix="wsp" %> + +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" + TagPrefix="wsp" %> + + + + +
+
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+  
+ +
+ + +
+
+
+ + +
+ +
+      +
+
+ + +
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx.cs new file mode 100644 index 00000000..6a74ea65 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx.cs @@ -0,0 +1,189 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.IO; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using WebsitePanel.Providers.SharePoint; + +namespace WebsitePanel.Portal +{ + public partial class HostedSharePointEnterpriseBackupSiteCollection : WebsitePanelModuleBase + { + private const string BACKUP_EXTENSION = ".bsh"; + + private int OrganizationId + { + get + { + return PanelRequest.GetInt("ItemID"); + } + } + + private int SiteCollectionId + { + get + { + return PanelRequest.GetInt("SiteCollectionID"); + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSite(); + } + } + + private void BindSite() + { + try + { + SharePointEnterpriseSiteCollection siteCollection = ES.Services.HostedSharePointServersEnt.Enterprise_GetSiteCollection(this.SiteCollectionId); + litSiteCollectionName.Text = siteCollection.PhysicalAddress; + txtBackupName.Text = siteCollection.Url + BACKUP_EXTENSION; + fileLookup.SelectedFile = "\\"; + fileLookup.PackageId = siteCollection.PackageId; + + BindBackupName(); + ToggleControls(); + } + catch (Exception ex) + { + ShowErrorMessage("SHAREPOINT_GET_SITE", ex); + return; + } + } + + private void BindBackupName() + { + string backupName = Path.GetFileNameWithoutExtension(txtBackupName.Text); + txtBackupName.Text = backupName + (chkZipBackup.Checked ? ".zip" : BACKUP_EXTENSION); + } + + private void ToggleControls() + { + fileLookup.Visible = rbCopy.Checked; + } + + private void BackupSiteCollection() + { + try + { + string bakFile = ES.Services.HostedSharePointServersEnt.Enterprise_BackupSiteCollection(this.SiteCollectionId, + txtBackupName.Text, chkZipBackup.Checked, rbDownload.Checked, fileLookup.SelectedFile); + + if (rbDownload.Checked && !String.IsNullOrEmpty(bakFile)) + { + + string fileName = bakFile; + + //Response.Clear(); + Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(fileName)); + Response.ContentType = "application/octet-stream"; + + int FILE_BUFFER_LENGTH = 5000000; + byte[] buffer = null; + int offset = 0; + do + { + // Read remote content. + buffer = ES.Services.HostedSharePointServersEnt.Enterprise_GetBackupBinaryChunk(this.SiteCollectionId, fileName, offset, FILE_BUFFER_LENGTH); + + // Write to stream. + //Response.BinaryWrite(buffer); + Response.OutputStream.Write(buffer, 0, buffer.Length); + offset += FILE_BUFFER_LENGTH; + } + while (buffer.Length == FILE_BUFFER_LENGTH); + + Response.Flush(); + Response.End(); + //Response.Close(); + //HttpContext.Current.ApplicationInstance.CompleteRequest(); + //Response.End(); + + } + } + catch (Exception ex) + { + ShowErrorMessage("SHAREPOINT_BACKUP_SITE", ex); + return; + } + //Response.ClearContent(); + Context.Response.Clear(); + if (!rbDownload.Checked) + RedirectBack(); + + } + + protected void btnBackup_Click(object sender, EventArgs e) + { + BackupSiteCollection(); + } + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack(); + } + + private void RedirectBack() + { + HttpContext.Current.Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_enterprise_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); + } + + protected void chkZipBackup_CheckedChanged(object sender, EventArgs e) + { + BindBackupName(); + } + + protected void rbDownload_CheckedChanged(object sender, EventArgs e) + { + ToggleControls(); + } + + protected override void OnPreRender(EventArgs e) + { + string str = string.Format("var rb = document.getElementById('{0}'); if (!rb.checked) ShowProgressDialog('Backing up site collection...');", rbDownload.ClientID); + + + + btnBackup.Attributes.Add("onclick", str); + base.OnPreRender(e); + } + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx.designer.cs new file mode 100644 index 00000000..b74025b4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseBackupSiteCollection.ascx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class HostedSharePointEnterpriseBackupSiteCollection { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// litSiteCollectionName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSiteCollectionName; + + /// + /// lblBackupFileName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBackupFileName; + + /// + /// txtBackupName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBackupName; + + /// + /// validatorUserName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator validatorUserName; + + /// + /// lblBackupOptions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBackupOptions; + + /// + /// chkZipBackup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkZipBackup; + + /// + /// lblBackupDestination control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBackupDestination; + + /// + /// rbDownload control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbDownload; + + /// + /// rbCopy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbCopy; + + /// + /// fileLookup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.FileLookup fileLookup; + + /// + /// btnBackup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnBackup; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx new file mode 100644 index 00000000..5a4b5917 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx @@ -0,0 +1,209 @@ +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointEnterpriseEditSiteCollection.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointEnterpriseEditSiteCollection" %> +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AllocatePackageIPAddresses.ascx" TagName="SiteUrlBuilder" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register src="../UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> +<%@ Register Src="../DomainsSelectDomainControl.ascx" TagName="DomainsSelectDomainControl" TagPrefix="uc1" %> + + + +
+
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + . + + +
+ + + +
+ + + +
+ + + + +
+ + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ + + +
+ + + + +
+ + + +
+ + + +
+ + + +
+ + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx.cs new file mode 100644 index 00000000..80585245 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx.cs @@ -0,0 +1,450 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Web; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.SharePoint; + + +namespace WebsitePanel.Portal +{ + public partial class HostedSharePointEnterpriseEditSiteCollection : WebsitePanelModuleBase + { + SharePointEnterpriseSiteCollection item = null; + + private int OrganizationId + { + get + { + return PanelRequest.GetInt("ItemID"); + } + } + + private int SiteCollectionId + { + get + { + return PanelRequest.GetInt("SiteCollectionID"); + } + } + + protected void Page_Load(object sender, EventArgs e) + { + domain.PackageId = PanelSecurity.PackageId; + + warningStorage.UnlimitedText = GetLocalizedString("WarningUnlimitedValue"); + editWarningStorage.UnlimitedText = GetLocalizedString("WarningUnlimitedValue"); + + bool newItem = (this.SiteCollectionId == 0); + + tblEditItem.Visible = newItem; + tblViewItem.Visible = !newItem; + + //btnUpdate.Visible = newItem; + btnDelete.Visible = !newItem; + btnUpdate.Text = newItem ? GetLocalizedString("Text.Add") : GetLocalizedString("Text.Update"); + btnUpdate.OnClientClick = newItem ? GetLocalizedString("btnCreate.OnClientClick") : GetLocalizedString("btnUpdate.OnClientClick"); + + btnBackup.Enabled = btnRestore.Enabled = !newItem; + + // bind item + BindItem(); + + } + + private void BindItem() + { + try + { + if (!IsPostBack) + { + if (!this.IsDnsServiceAvailable()) + { + localMessageBox.ShowWarningMessage("HOSTEDSHAREPOINT_NO_DNS"); + } + + // load item if required + if (this.SiteCollectionId > 0) + { + // existing item + item = ES.Services.HostedSharePointServersEnt.Enterprise_GetSiteCollection(this.SiteCollectionId); + if (item != null) + { + // save package info + ViewState["PackageId"] = item.PackageId; + } + else + RedirectToBrowsePage(); + } + else + { + // new item + ViewState["PackageId"] = PanelSecurity.PackageId; + if (UseSharedSLL(PanelSecurity.PackageId)) + { + + rowUrl.Visible = false; + valRequireHostName.Enabled = false; + valRequireCorrectHostName.Enabled = false; + } + } + + //this.gvUsers.DataBind(); + + List cultures = new List(); + foreach (int localeId in ES.Services.HostedSharePointServersEnt.Enterprise_GetSupportedLanguages(PanelSecurity.PackageId)) + { + cultures.Add(new CultureInfo(localeId, false)); + } + + this.ddlLocaleID.DataSource = cultures; + this.ddlLocaleID.DataBind(); + } + + if (!IsPostBack) + { + // bind item to controls + if (item != null) + { + // bind item to controls + lnkUrl.Text = item.PhysicalAddress; + lnkUrl.NavigateUrl = item.PhysicalAddress; + litSiteCollectionOwner.Text = String.Format("{0} ({1})", item.OwnerName, item.OwnerEmail); + litLocaleID.Text = new CultureInfo(item.LocaleId, false).DisplayName; + litTitle.Text = item.Title; + litDescription.Text = item.Description; + editWarningStorage.QuotaValue = (int)item.WarningStorage; + editMaxStorage.QuotaValue = (int)item.MaxSiteStorage; + } + + Organization org = ES.Services.Organizations.GetOrganization(OrganizationId); + + if (org != null) + { + SetStorageQuotas(org, item); + } + } + //OrganizationDomainName[] domains = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); + + //DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId); + + EnterpriseServer.DomainInfo[] domains = ES.Services.Servers.GetDomains(PanelSecurity.PackageId); + + if (domains.Length == 0) + { + localMessageBox.ShowWarningMessage("HOSTEDSHAREPOINT_NO_DOMAINS"); + DisableFormControls(this, btnCancel); + return; + } + //if (this.gvUsers.Rows.Count == 0) + //{ + // localMessageBox.ShowWarningMessage("HOSTEDSHAREPOINT_NO_USERS"); + // DisableFormControls(this, btnCancel); + // return; + //} + } + catch + { + + localMessageBox.ShowWarningMessage("INIT_SERVICE_ITEM_FORM"); + + DisableFormControls(this, btnCancel); + return; + } + } + + /// Checks and sets disk quotas values. + /// The organization. + /// The site collection. + private void SetStorageQuotas(Organization organization, SharePointEnterpriseSiteCollection collection) + { + var quotaValue = organization.MaxSharePointEnterpriseStorage; + + if (quotaValue != -1) + { + var spaceResrved = GetReservedDiskStorageSpace(); + + if (spaceResrved > quotaValue) + { + quotaValue = 0; + } + else + { + quotaValue -= spaceResrved; + } + + if (collection != null) + { + quotaValue += (int)collection.MaxSiteStorage; + } + } + + maxStorage.ParentQuotaValue = quotaValue; + maxStorage.QuotaValue = quotaValue; + editMaxStorage.ParentQuotaValue = quotaValue; + warningStorage.ParentQuotaValue = quotaValue; + warningStorage.QuotaValue = quotaValue; + editWarningStorage.ParentQuotaValue = quotaValue; + + btnUpdate.Enabled = quotaValue != 0; + } + + /// Gets disk space reserved by existing site collections. + /// Reserved disk space vallue. + private int GetReservedDiskStorageSpace() + { + var existingCollections = ES.Services.HostedSharePointServersEnt.Enterprise_GetSiteCollections(PanelSecurity.PackageId, false); + + return (int)existingCollections.Sum(siteCollection => siteCollection.MaxSiteStorage); + } + + private void SaveItem() + { + if (!Page.IsValid) + { + return; + } + + + if (this.SiteCollectionId == 0) + { + if (this.userSelector.GetAccount() == null) + { + localMessageBox.ShowWarningMessage("HOSTEDSHAREPOINT_NO_USERS"); + return; + } + + + // new item + try + { + item = new SharePointEnterpriseSiteCollection(); + + if (!UseSharedSLL(PanelSecurity.PackageId)) + { + SharePointEnterpriseSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServersEnt.Enterprise_GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue); + foreach (SharePointEnterpriseSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) + { + Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name); + if (existentSiteCollection.Name == String.Format("{0}://{1}", existentSiteCollectionUri.Scheme, this.txtHostName.Text.ToLower() + "." + this.domain.DomainName)) + { + localMessageBox.ShowWarningMessage("HOSTEDSHAREPOINT_DOMAIN_IN_USE"); + return; + } + } + + item.Name = this.txtHostName.Text.ToLower() + "." + this.domain.DomainName; + } + else + item.Name = string.Empty; + + // get form data + + item.OrganizationId = this.OrganizationId; + item.Id = this.SiteCollectionId; + item.PackageId = PanelSecurity.PackageId; + + item.LocaleId = Int32.Parse(this.ddlLocaleID.SelectedValue); + item.OwnerLogin = this.userSelector.GetSAMAccountName(); + item.OwnerEmail = this.userSelector.GetPrimaryEmailAddress(); + item.OwnerName = this.userSelector.GetDisplayName(); + item.Title = txtTitle.Text; + item.Description = txtDescription.Text; + + + item.MaxSiteStorage = maxStorage.QuotaValue; + item.WarningStorage = warningStorage.QuotaValue; + + int result = ES.Services.HostedSharePointServersEnt.Enterprise_AddSiteCollection(item); + if (result < 0) + { + localMessageBox.ShowResultMessage(result); + return; + } + } + catch (Exception ex) + { + localMessageBox.ShowErrorMessage("HOSTEDSHAREPOINT_ADD_SITECOLLECTION", ex); + return; + } + } + else + { + ES.Services.HostedSharePointServersEnt.Enterprise_UpdateQuota(PanelRequest.ItemID, SiteCollectionId, editMaxStorage.QuotaValue, editWarningStorage.QuotaValue); + } + + // return + RedirectToSiteCollectionsList(); + } + + private void AddDnsRecord(int domainId, string recordName, string recordData) + { + int result = ES.Services.Servers.AddDnsZoneRecord(domainId, recordName, DnsRecordType.A, recordData, 0, 0, 0, 0); + if (result < 0) + { + ShowResultMessage(result); + } + } + + private bool IsDnsServiceAvailable() + { + ProviderInfo dnsProvider = ES.Services.Servers.GetPackageServiceProvider(PanelSecurity.PackageId, ResourceGroups.Dns); + return dnsProvider != null; + } + + private void DeleteItem() + { + // delete + try + { + int result = ES.Services.HostedSharePointServersEnt.Enterprise_DeleteSiteCollection(this.SiteCollectionId); + if (result < 0) + { + ShowResultMessage(result); + return; + } + } + catch (Exception ex) + { + localMessageBox.ShowErrorMessage("HOSTEDSHAREPOINT_DELETE_SITECOLLECTION", ex); + return; + } + + // return + RedirectToSiteCollectionsList(); + } + + protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + localMessageBox.ShowErrorMessage("ORGANIZATION_GET_USERS", e.Exception); + e.ExceptionHandled = true; + } + } + + + protected void btnCancel_Click(object sender, EventArgs e) + { + // return + RedirectToSiteCollectionsList(); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + DeleteItem(); + } + + protected void btnUpdate_Click(object sender, EventArgs e) + { + SaveItem(); + } + + protected void btnBackup_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_enterprise_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); + } + + protected void btnRestore_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_enterprise_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); + } + + + + private void RedirectToSiteCollectionsList() + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_enterprise_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString())); + } + + private bool UseSharedSLL(int packageID) + { + PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId); + if (cntx != null) + { + foreach (QuotaValueInfo quota in cntx.QuotasArray) + { + switch (quota.QuotaId) + { + case 552: + if (Convert.ToBoolean(quota.QuotaAllocatedValue)) + { + return true; + } + + break; + } + } + } + + return false; + } + + + //private void RegisterOwnerSelector() + //{ + // // Define the name and type of the client scripts on the page. + // String csname = "OwnerSelectorScript"; + // Type cstype = this.GetType(); + + // // Get a ClientScriptManager reference from the Page class. + // ClientScriptManager cs = Page.ClientScript; + + // // Check to see if the client script is already registered. + // if (!cs.IsClientScriptBlockRegistered(cstype, csname)) + // { + // StringBuilder ownerSelector = new StringBuilder(); + // ownerSelector.Append(""); + // cs.RegisterClientScriptBlock(cstype, csname, ownerSelector.ToString(), false); + // } + + //} + + //private StringDictionary ConvertArrayToDictionary(string[] settings) + //{ + // StringDictionary r = new StringDictionary(); + // foreach (string setting in settings) + // { + // int idx = setting.IndexOf('='); + // r.Add(setting.Substring(0, idx), setting.Substring(idx + 1)); + // } + // return r; + //} + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx.designer.cs new file mode 100644 index 00000000..37f5fdf5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseEditSiteCollection.ascx.designer.cs @@ -0,0 +1,447 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class HostedSharePointEnterpriseEditSiteCollection { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// localMessageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox localMessageBox; + + /// + /// tblEditItem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblEditItem; + + /// + /// rowUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow rowUrl; + + /// + /// lblSiteCollectionUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSiteCollectionUrl; + + /// + /// txtHostName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHostName; + + /// + /// domain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.DomainsSelectDomainControl domain; + + /// + /// valRequireHostName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireHostName; + + /// + /// valRequireCorrectHostName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valRequireCorrectHostName; + + /// + /// lblSiteCollectionOwner control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSiteCollectionOwner; + + /// + /// userSelector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector userSelector; + + /// + /// lblSiteCollectionLocaleID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSiteCollectionLocaleID; + + /// + /// ddlLocaleID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlLocaleID; + + /// + /// lblMaxStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMaxStorage; + + /// + /// maxStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaEditor maxStorage; + + /// + /// lblWarningStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWarningStorage; + + /// + /// warningStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaEditor warningStorage; + + /// + /// lblTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTitle; + + /// + /// txtTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTitle; + + /// + /// valRequireTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireTitle; + + /// + /// lblDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescription; + + /// + /// txtDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDescription; + + /// + /// RequiredFieldValidator1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; + + /// + /// tblViewItem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblViewItem; + + /// + /// lblSiteCollectionUrl2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSiteCollectionUrl2; + + /// + /// lnkUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkUrl; + + /// + /// lblSiteCollectionOwner2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSiteCollectionOwner2; + + /// + /// litSiteCollectionOwner control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSiteCollectionOwner; + + /// + /// lblSiteCollectionLocaleID2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSiteCollectionLocaleID2; + + /// + /// litLocaleID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litLocaleID; + + /// + /// lblMaxStorageView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMaxStorageView; + + /// + /// editMaxStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaEditor editMaxStorage; + + /// + /// lblWarningStorageView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWarningStorageView; + + /// + /// editWarningStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaEditor editWarningStorage; + + /// + /// lblTitle2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTitle2; + + /// + /// litTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litTitle; + + /// + /// lblDescription2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescription2; + + /// + /// litDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDescription; + + /// + /// secMainTools control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secMainTools; + + /// + /// ToolsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ToolsPanel; + + /// + /// tblMaintenance control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblMaintenance; + + /// + /// btnBackup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnBackup; + + /// + /// btnRestore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRestore; + + /// + /// btnUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdate; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx new file mode 100644 index 00000000..b2a36898 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx @@ -0,0 +1,101 @@ +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointEnterpriseRestoreSiteCollection.ascx.cs" + Inherits="WebsitePanel.Portal.HostedSharePointEnterpriseRestoreSiteCollection" %> +<%@ Register Src="../UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" + TagPrefix="wsp" %> +6 +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> + + +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" + TagPrefix="wsp" %> + + + + + +
+
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + +
+
+  
+ + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + +
+
+
+
+ + + + + + + +
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx.cs new file mode 100644 index 00000000..191c7546 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx.cs @@ -0,0 +1,176 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.IO; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using WebsitePanel.Providers.SharePoint; + +namespace WebsitePanel.Portal +{ + public partial class HostedSharePointEnterpriseRestoreSiteCollection : WebsitePanelModuleBase + { + private int OrganizationId + { + get + { + return PanelRequest.GetInt("ItemID"); + } + } + + private int SiteCollectionId + { + get + { + return PanelRequest.GetInt("SiteCollectionID"); + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSite(); + } + } + + private void BindSite() + { + try + { + SharePointEnterpriseSiteCollection siteCollection = ES.Services.HostedSharePointServersEnt.Enterprise_GetSiteCollection(this.SiteCollectionId); + litSiteCollectionName.Text = siteCollection.PhysicalAddress; + fileLookup.SelectedFile = String.Empty; + fileLookup.PackageId = siteCollection.PackageId; + + ToggleControls(); + } + catch (Exception ex) + { + ShowErrorMessage("SHAREPOINT_GET_SITE", ex); + return; + } + } + + private void ToggleControls() + { + cellFile.Visible = radioFile.Checked; + cellUploadFile.Visible = radioUpload.Checked; + } + + private void RestoreSiteCollection() + { + try + { + string uploadedFile = null; + string packageFile = null; + + if (radioUpload.Checked) + { + if (uploadFile.PostedFile.FileName != "") + { + Stream stream = uploadFile.PostedFile.InputStream; + + // save uploaded file + int FILE_BUFFER_LENGTH = 5000000; + string path = null; + int readBytes = 0; + string fileName = Path.GetFileName(uploadFile.PostedFile.FileName); + + int offset = 0; + do + { + // read input stream + byte[] buffer = new byte[FILE_BUFFER_LENGTH]; + readBytes = stream.Read(buffer, 0, FILE_BUFFER_LENGTH); + + if (readBytes < FILE_BUFFER_LENGTH) + Array.Resize(ref buffer, readBytes); + + // write remote backup file + string tempPath = ES.Services.HostedSharePointServersEnt.Enterprise_AppendBackupBinaryChunk(this.SiteCollectionId, fileName, path, buffer); + if (path == null) + path = tempPath; + + offset += FILE_BUFFER_LENGTH; + } + while (readBytes == FILE_BUFFER_LENGTH); + + uploadedFile = path; + } + } + else + { + // package files + packageFile = fileLookup.SelectedFile; + } + + int result = ES.Services.HostedSharePointServersEnt.Enterprise_RestoreSiteCollection(this.SiteCollectionId, uploadedFile, packageFile); + if (result < 0) + { + ShowResultMessage(result); + return; + } + } + catch (Exception ex) + { + ShowErrorMessage("SHAREPOINT_RESTORE_SITE", ex); + return; + } + + RedirectBack(); + } + + protected void btnRestore_Click(object sender, EventArgs e) + { + RestoreSiteCollection(); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack(); + } + + private void RedirectBack() + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_enterprise_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); + } + protected void radioUpload_CheckedChanged(object sender, EventArgs e) + { + ToggleControls(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx.designer.cs new file mode 100644 index 00000000..444b7e6c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseRestoreSiteCollection.ascx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class HostedSharePointEnterpriseRestoreSiteCollection { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// litSiteCollectionName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSiteCollectionName; + + /// + /// lblRestoreFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRestoreFrom; + + /// + /// radioUpload control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioUpload; + + /// + /// radioFile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioFile; + + /// + /// cellUploadFile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableCell cellUploadFile; + + /// + /// uploadFile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload uploadFile; + + /// + /// lblAllowedFiles1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAllowedFiles1; + + /// + /// cellFile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableCell cellFile; + + /// + /// fileLookup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.FileLookup fileLookup; + + /// + /// lblAllowedFiles2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAllowedFiles2; + + /// + /// btnRestore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRestore; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx new file mode 100644 index 00000000..02e376d4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx @@ -0,0 +1,92 @@ +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointEnterpriseSiteCollections.ascx.cs" + Inherits="WebsitePanel.Portal.HostedSharePointEnterpriseSiteCollections" %> +<%@ Register Src="../UserControls/SpaceServiceItems.ascx" TagName="SpaceServiceItems" + TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" + TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> + +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" + TagPrefix="wsp" %> + + + + + +
+
+
+
+
+
+
+ + +
+
+ +
+
+ +
+
+ + + + Url + + +
+
+ + + + + + + <%# Eval("PhysicalAddress") %> + + + + + + + + + + + + + + + + + + + +
+ +     + <%----%> + +
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx.cs new file mode 100644 index 00000000..43fafca9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx.cs @@ -0,0 +1,110 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using System.Collections.Generic; +using WebsitePanel.Providers.SharePoint; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal +{ + public partial class HostedSharePointEnterpriseSiteCollections : WebsitePanelModuleBase + { + + protected void Page_Load(object sender, EventArgs e) + { + this.BindStats(); + } + + private void BindStats() + { + // quota values + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); + OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + + siteCollectionsQuota.QuotaUsedValue = stats.CreatedSharePointEnterpriseSiteCollections; + siteCollectionsQuota.QuotaValue = stats.AllocatedSharePointEnterpriseSiteCollections; + if (stats.AllocatedSharePointEnterpriseSiteCollections != -1) siteCollectionsQuota.QuotaAvailable = tenantStats.AllocatedSharePointEnterpriseSiteCollections - tenantStats.CreatedSharePointEnterpriseSiteCollections; + } + + protected void btnCreateSiteCollection_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_enterprise_edit_sitecollection", "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + public string GetSiteCollectionEditUrl(string siteCollectionId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_enterprise_edit_sitecollection", + "SiteCollectionID=" + siteCollectionId, + "ItemID=" + PanelRequest.ItemID.ToString()); + } + + protected void odsSharePointEnterpriseSiteCollectionPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("HOSTEDSHAREPOINT_GET_SITECOLLECTIONS", e.Exception); + e.ExceptionHandled = true; + } + } + + protected void gvSiteCollections_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + int siteCollectionId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + try + { + int result = ES.Services.HostedSharePointServersEnt.Enterprise_DeleteSiteCollection(siteCollectionId); + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + gvSiteCollections.DataBind(); + this.BindStats(); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("HOSTEDSHAREPOINT_DELETE_SITECOLLECTION", ex); + } + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx.designer.cs new file mode 100644 index 00000000..7c4bf6b7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseSiteCollections.ascx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class HostedSharePointEnterpriseSiteCollections { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnCreateSiteCollection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreateSiteCollection; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// locSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSearch; + + /// + /// ddlSearchColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvSiteCollections control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvSiteCollections; + + /// + /// odsSiteCollectionsPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsSiteCollectionsPaged; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// siteCollectionsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer siteCollectionsQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx new file mode 100644 index 00000000..ab641896 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx @@ -0,0 +1,62 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HostedSharePointEnterpriseStorageSettings.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointEnterpriseStorageSettings" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" + TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" + TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" + TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register src="../UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> + + + +
+
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + +
+ +
+ + +
+
+
+ +
+ + + +
+ +
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx.cs new file mode 100644 index 00000000..d2b2547b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx.cs @@ -0,0 +1,93 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal +{ + public partial class HostedSharePointEnterpriseStorageSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + warningValue.UnlimitedText = GetLocalizedString("WarningUnlimitedValue"); + + + if (!IsPostBack) + { + Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + + PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId); + foreach(QuotaValueInfo quota in cntx.QuotasArray) + { + if (quota.QuotaId == 551 /*Max storage quota*/) + { + maxStorageSettingsValue.ParentQuotaValue = quota.QuotaAllocatedValue; + warningValue.ParentQuotaValue = quota.QuotaAllocatedValue; + } + } + + maxStorageSettingsValue.QuotaValue = org.MaxSharePointEnterpriseStorage; + warningValue.QuotaValue = org.WarningSharePointEnterpriseStorage; + + } + } + + private void Save(bool apply) + { + try + { + int res = ES.Services.HostedSharePointServersEnt.Enterprise_SetStorageSettings(PanelRequest.ItemID, maxStorageSettingsValue.QuotaValue, + warningValue.QuotaValue, + apply); + if (res < 0) + { + messageBox.ShowResultMessage(res); + return; + } + messageBox.ShowSuccessMessage("HOSTED_SHAREPOINT_UPDATE_QUOTAS"); + } + catch (Exception) + { + messageBox.ShowErrorMessage("HOSTED_SHAREPOINT_UPDATE_QUOTAS"); + } + + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save(false); + } + + protected void btnSaveApply_Click(object sender, EventArgs e) + { + Save(true); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx.designer.cs new file mode 100644 index 00000000..26170885 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageSettings.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class HostedSharePointEnterpriseStorageSettings { + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secStorageLimits control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secStorageLimits; + + /// + /// StorageLimits control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel StorageLimits; + + /// + /// locMaxStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaxStorage; + + /// + /// maxStorageSettingsValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaEditor maxStorageSettingsValue; + + /// + /// locWarningStorage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locWarningStorage; + + /// + /// warningValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaEditor warningValue; + + /// + /// btnSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// btnSaveApply control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveApply; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx new file mode 100644 index 00000000..5e30898b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx @@ -0,0 +1,57 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HostedSharePointEnterpriseStorageUsage.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointEnterpriseStorageUsage" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" + TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" + TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" + TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> + +
+
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + +
177
100
+
+
+ + +
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx.cs new file mode 100644 index 00000000..da030e66 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx.cs @@ -0,0 +1,94 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.SharePoint; + +namespace WebsitePanel.Portal +{ + public partial class HostedSharePointEnterpriseStorageUsage : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + BindGrid(); + } + + protected void btnRecalculateDiscSpace_Click(object sender, EventArgs e) + { + BindGrid(); + } + + private void BindGrid() + { + int errorCode; + try + { + SharePointEnterpriseSiteDiskSpace[] sharePointEnterpriseSiteDiskSpace = + ES.Services.HostedSharePointServersEnt.Enterprise_CalculateSharePointSitesDiskSpace(PanelRequest.ItemID, + out errorCode); + + + if (errorCode < 0) + { + messageBox.ShowResultMessage(errorCode); + return; + } + + if (sharePointEnterpriseSiteDiskSpace != null && sharePointEnterpriseSiteDiskSpace.Length == 1 && string.IsNullOrEmpty(sharePointEnterpriseSiteDiskSpace[0].Url)) + { + gvStorageUsage.DataSource = null; + gvStorageUsage.DataBind(); + lblTotalItems.Text = "0"; + lblTotalSize.Text = "0"; + return; + } + + gvStorageUsage.DataSource = sharePointEnterpriseSiteDiskSpace; + gvStorageUsage.DataBind(); + + if (sharePointEnterpriseSiteDiskSpace != null) + { + lblTotalItems.Text = sharePointEnterpriseSiteDiskSpace.Length.ToString(); + + long total = 0; + foreach (SharePointEnterpriseSiteDiskSpace current in sharePointEnterpriseSiteDiskSpace) + { + total += current.DiskSpace; + } + + lblTotalSize.Text = total.ToString(); + } + } + catch(Exception ex) + { + messageBox.ShowErrorMessage("HOSTED_SHAREPOINT_RECALCULATE_SIZE", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx.designer.cs new file mode 100644 index 00000000..a91f43f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointEnterpriseStorageUsage.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class HostedSharePointEnterpriseStorageUsage { + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secSiteCollectionsReport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSiteCollectionsReport; + + /// + /// siteCollectionsReport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel siteCollectionsReport; + + /// + /// gvStorageUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvStorageUsage; + + /// + /// locTotalboxItems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalboxItems; + + /// + /// lblTotalItems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalItems; + + /// + /// locTotalMailboxesSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalMailboxesSize; + + /// + /// lblTotalSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalSize; + + /// + /// btnRecalculateDiscSpace control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRecalculateDiscSpace; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx similarity index 88% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx index 4b256403..abd8ad0c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx @@ -1,10 +1,13 @@ <%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointRestoreSiteCollection.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointRestoreSiteCollection" %> -<%@ Register Src="UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> -<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" +<%@ Register Src="../UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +6 +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> + -<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx.cs similarity index 93% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx.cs index 74c9be70..de33f161 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx.cs @@ -59,11 +59,6 @@ namespace WebsitePanel.Portal } } - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -171,7 +166,7 @@ namespace WebsitePanel.Portal private void RedirectBack() { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); } protected void radioUpload_CheckedChanged(object sender, EventArgs e) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx.designer.cs similarity index 75% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx.designer.cs index 061c85f8..c59bec70 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointRestoreSiteCollection.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx similarity index 85% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx index a1734e43..7a5430e3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx @@ -1,13 +1,13 @@ <%@ Control Language="C#" AutoEventWireup="true" Codebehind="HostedSharePointSiteCollections.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointSiteCollections" %> -<%@ Register Src="UserControls/SpaceServiceItems.ascx" TagName="SpaceServiceItems" +<%@ Register Src="../UserControls/SpaceServiceItems.ascx" TagName="SpaceServiceItems" TagPrefix="wsp" %> -<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> -<%@ Register Src="UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> -<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> @@ -76,8 +76,7 @@ function confirmation() - - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx.cs similarity index 91% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx.cs index 0bd9b7b0..b03fd0f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx.cs @@ -44,11 +44,7 @@ namespace WebsitePanel.Portal { public partial class HostedSharePointSiteCollections : WebsitePanelModuleBase { - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - + protected void Page_Load(object sender, EventArgs e) { this.BindStats(); @@ -67,14 +63,14 @@ namespace WebsitePanel.Portal protected void btnCreateSiteCollection_Click(object sender, EventArgs e) { - Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_edit_sitecollection", "SpaceID=" + PanelSecurity.PackageId.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_edit_sitecollection", "SpaceID=" + PanelSecurity.PackageId.ToString())); } public string GetSiteCollectionEditUrl(string siteCollectionId) { return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + siteCollectionId, - "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName); + "ItemID=" + PanelRequest.ItemID.ToString()); } protected void odsSharePointSiteCollectionPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx.designer.cs similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointSiteCollections.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx similarity index 79% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx index 6329dc5b..a4557072 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx @@ -1,13 +1,13 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HostedSharePointStorageSettings.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointStorageSettings" %> -<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> -<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> -<%@ Register Src="ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> - -<%@ Register src="UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register src="../UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx.cs similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx.designer.cs similarity index 69% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx.designer.cs index 8cc0e3cc..04b5be91 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageSettings.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx similarity index 83% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx index 54db370b..b551a4a7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx @@ -1,11 +1,12 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HostedSharePointStorageUsage.ascx.cs" Inherits="WebsitePanel.Portal.HostedSharePointStorageUsage" %> -<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> -<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> -<%@ Register Src="ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx.cs similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx.designer.cs similarity index 69% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx.designer.cs index 43f100c7..4c003393 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePoint/HostedSharePointStorageUsage.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs index dfaf5172..866f8426 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs @@ -233,6 +233,26 @@ namespace WebsitePanel.Portal } } + + if (cntx.Groups.ContainsKey(ResourceGroups.VPS2012)) + { + // VPS resource found + // check created VPS + VirtualMachineMetaItemsPaged vms = ES.Services.VPS2012.GetVirtualMachines(packageId, "", "", "", 0, Int32.MaxValue, false); + if (vms.Items.Length == 1) + { + // one VPS - redirect to its properties screen + Response.Redirect(PortalUtils.NavigatePageURL("SpaceVPS2012", "SpaceID", packageId.ToString(), + "ItemID=" + vms.Items[0].ItemID.ToString(), "ctl=vps_general", "moduleDefId=VPS2012")); + } + else + { + // several VPS - redirect to VPS list page + Response.Redirect(PortalUtils.NavigatePageURL("SpaceVPS2012", "SpaceID", packageId.ToString(), + "ctl=", "moduleDefId=VPS2012")); + } + } + if (cntx.Groups.ContainsKey(ResourceGroups.VPSForPC)) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailAccountsEditAccount.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailAccountsEditAccount.ascx.cs index bc1bdca0..019e0b95 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailAccountsEditAccount.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailAccountsEditAccount.ascx.cs @@ -153,6 +153,7 @@ namespace WebsitePanel.Portal if (maxMailboxSizeLimit == -1 || maxMailboxSizeLimit == 0) { MaxMailboxSizeLimitValidator.Enabled = false; + CompareValidator1.Enabled = false; } else { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs index 858cb7d4..d6915278 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IceWarp_EditAccount.ascx.cs @@ -43,6 +43,7 @@ namespace WebsitePanel.Portal.ProviderControls secForwarding.Visible = (PanelRequest.ItemID > 0); OlderMailsPanel.Visible = (PanelRequest.ItemID > 0); secOlderMails.Visible = (PanelRequest.ItemID > 0); + Utils.SelectListItem(ddlAccountType, "1"); // Set default account type to POP3 & IMAP } public void BindItem(MailAccount item) @@ -108,7 +109,6 @@ namespace WebsitePanel.Portal.ProviderControls item.ForwardingAddresses = Utils.ParseDelimitedString(txtForward.Text, ';', ' ', ','); item.DeleteOnForward = cbDeleteOnForward.Checked; item.ChangePassword = cbChangePassword.Checked; - item.ChangePassword = cbChangePassword.Checked; item.IsDomainAdmin = cbDomainAdmin.Checked; item.DeleteOlder = cbDeleteOlder.Checked; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx index 91b50033..1ba5fff1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx @@ -123,6 +123,15 @@ Users + + Changing Desktop Disabled + + + Control RDS Session without Users's Permission + + + Disable Command Prompt + Drive Space Threshold @@ -147,7 +156,7 @@ Lock Screen Timeout - - Changing Desktop Disabled + + View RDS Session without Users's Permission \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx index 61c375b4..a5c69ade 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx @@ -138,4 +138,7 @@ * Enter E-Mail + + Back to Users List + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx index e8f7f85d..54e311d7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx @@ -150,4 +150,16 @@ Refresh + + Control + + + Control Session + + + View + + + View Session + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx index cb177a39..c7cf7553 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx @@ -29,7 +29,7 @@ @@ -145,13 +145,65 @@
- +
-
- + + + + + + + + + + + +

+ + + + + + + +
+ + + +
+
+
+ + + + + + + +
+ + + +
+
+
+ + + + + + + +
+ + + +
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs index 4d5ee15a..19e11012 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs @@ -15,6 +15,12 @@ namespace WebsitePanel.Portal.RDS { if (!IsPostBack) { + var timeouts = RdsServerSettings.ScreenSaverTimeOuts; + ddTimeout.DataSource = timeouts; + ddTimeout.DataTextField = "Value"; + ddTimeout.DataValueField = "Key"; + ddTimeout.DataBind(); + var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); litCollectionName.Text = collection.DisplayName; BindSettings(); @@ -27,8 +33,8 @@ namespace WebsitePanel.Portal.RDS if (serverSettings == null || !serverSettings.Settings.Any()) { - var defaultSettings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.RDS_POLICY); - BindDefaultSettings(defaultSettings); + ddTimeout.SelectedValue = ""; + ddTreshold.SelectedValue = ""; } else { @@ -39,45 +45,47 @@ namespace WebsitePanel.Portal.RDS private void BindSettings(RdsServerSettings settings) { var setting = GetServerSetting(settings, RdsServerSettings.LOCK_SCREEN_TIMEOUT); - txtTimeout.Text = setting.PropertyValue; - cbTimeoutAdministrators.Checked = setting.ApplyAdministrators; - cbTimeoutUsers.Checked = setting.ApplyUsers; - setting = GetServerSetting(settings, RdsServerSettings.REMOVE_RUN_COMMAND); - cbRunCommandAdministrators.Checked = setting.ApplyAdministrators; - cbRunCommandUsers.Checked = setting.ApplyUsers; + if (setting != null) + { + ddTimeout.SelectedValue = setting.PropertyValue; + cbTimeoutAdministrators.Checked = setting.ApplyAdministrators; + cbTimeoutUsers.Checked = setting.ApplyUsers; + } - setting = GetServerSetting(settings, RdsServerSettings.REMOVE_POWERSHELL_COMMAND); - cbPowershellAdministrators.Checked = setting.ApplyAdministrators; - cbPowershellUsers.Checked = setting.ApplyUsers; - - setting = GetServerSetting(settings, RdsServerSettings.HIDE_C_DRIVE); - cbHideCDriveAdministrators.Checked = setting.ApplyAdministrators; - cbHideCDriveUsers.Checked = setting.ApplyUsers; - - setting = GetServerSetting(settings, RdsServerSettings.REMOVE_SHUTDOWN_RESTART); - cbShutdownAdministrators.Checked = setting.ApplyAdministrators; - cbShutdownUsers.Checked = setting.ApplyUsers; - - setting = GetServerSetting(settings, RdsServerSettings.DISABLE_TASK_MANAGER); - cbTaskManagerAdministrators.Checked = setting.ApplyAdministrators; - cbTaskManagerUsers.Checked = setting.ApplyUsers; - - setting = GetServerSetting(settings, RdsServerSettings.CHANGE_DESKTOP_DISABLED); - cbDesktopAdministrators.Checked = setting.ApplyAdministrators; - cbDesktopUsers.Checked = setting.ApplyUsers; - - setting = GetServerSetting(settings, RdsServerSettings.SCREEN_SAVER_DISABLED); - cbScreenSaverAdministrators.Checked = setting.ApplyAdministrators; - cbScreenSaverUsers.Checked = setting.ApplyUsers; + SetCheckboxes(settings, RdsServerSettings.REMOVE_RUN_COMMAND, cbRunCommandAdministrators, cbRunCommandUsers); + SetCheckboxes(settings, RdsServerSettings.REMOVE_POWERSHELL_COMMAND, cbPowershellAdministrators, cbPowershellUsers); + SetCheckboxes(settings, RdsServerSettings.HIDE_C_DRIVE, cbHideCDriveAdministrators, cbHideCDriveUsers); + SetCheckboxes(settings, RdsServerSettings.REMOVE_SHUTDOWN_RESTART, cbShutdownAdministrators, cbShutdownUsers); + SetCheckboxes(settings, RdsServerSettings.DISABLE_TASK_MANAGER, cbTaskManagerAdministrators, cbTaskManagerUsers); + SetCheckboxes(settings, RdsServerSettings.CHANGE_DESKTOP_DISABLED, cbDesktopAdministrators, cbDesktopUsers); + SetCheckboxes(settings, RdsServerSettings.SCREEN_SAVER_DISABLED, cbScreenSaverAdministrators, cbScreenSaverUsers); + SetCheckboxes(settings, RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION, cbViewSessionAdministrators, cbViewSessionUsers); + SetCheckboxes(settings, RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION, cbControlSessionAdministrators, cbControlSessionUsers); + SetCheckboxes(settings, RdsServerSettings.DISABLE_CMD, cbDisableCmdAdministrators, cbDisableCmdUsers); setting = GetServerSetting(settings, RdsServerSettings.DRIVE_SPACE_THRESHOLD); - txtThreshold.Text = setting.PropertyValue; + + if (setting != null) + { + ddTreshold.SelectedValue = setting.PropertyValue; + } + } + + private void SetCheckboxes(RdsServerSettings settings, string settingName, CheckBox cbAdministrators, CheckBox cbUsers) + { + var setting = GetServerSetting(settings, settingName); + + if (setting != null) + { + cbAdministrators.Checked = setting.ApplyAdministrators; + cbUsers.Checked = setting.ApplyUsers; + } } private RdsServerSetting GetServerSetting(RdsServerSettings settings, string propertyName) { - return settings.Settings.First(s => s.PropertyName.Equals(propertyName)); + return settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(propertyName)); } private RdsServerSettings GetSettings() @@ -87,7 +95,7 @@ namespace WebsitePanel.Portal.RDS settings.Settings.Add(new RdsServerSetting { PropertyName = RdsServerSettings.LOCK_SCREEN_TIMEOUT, - PropertyValue = txtTimeout.Text, + PropertyValue = ddTimeout.SelectedValue, ApplyAdministrators = cbTimeoutAdministrators.Checked, ApplyUsers = cbTimeoutUsers.Checked }); @@ -151,43 +159,37 @@ namespace WebsitePanel.Portal.RDS settings.Settings.Add(new RdsServerSetting { PropertyName = RdsServerSettings.DRIVE_SPACE_THRESHOLD, - PropertyValue = txtThreshold.Text, + PropertyValue = ddTreshold.SelectedValue, ApplyAdministrators = true, ApplyUsers = true }); + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION, + PropertyValue = "", + ApplyAdministrators = cbViewSessionAdministrators.Checked, + ApplyUsers = cbViewSessionUsers.Checked + }); + + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION, + PropertyValue = "", + ApplyAdministrators = cbControlSessionAdministrators.Checked, + ApplyUsers = cbControlSessionUsers.Checked + }); + + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.DISABLE_CMD, + PropertyValue = "", + ApplyAdministrators = cbDisableCmdAdministrators.Checked, + ApplyUsers = cbDisableCmdUsers.Checked + }); + return settings; - } - - private void BindDefaultSettings(UserSettings settings) - { - txtTimeout.Text = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; - cbTimeoutAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]); - cbTimeoutUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS]); - - cbRunCommandAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_RUN_COMMAND_ADMINISTRATORS]); - cbRunCommandUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_RUN_COMMAND_USERS]); - - cbPowershellAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_ADMINISTRATORS]); - cbPowershellUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_USERS]); - - cbHideCDriveAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.HIDE_C_DRIVE_ADMINISTRATORS]); - cbHideCDriveUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.HIDE_C_DRIVE_USERS]); - - cbShutdownAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_ADMINISTRATORS]); - cbShutdownUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_USERS]); - - cbTaskManagerAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_TASK_MANAGER_ADMINISTRATORS]); - cbTaskManagerUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_TASK_MANAGER_USERS]); - - cbDesktopAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_ADMINISTRATORS]); - cbDesktopUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_USERS]); - - cbScreenSaverAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]); - cbScreenSaverUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS]); - - txtThreshold.Text = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; - } + } private bool SaveServerSettings() { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs index a743b041..b12d745a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs @@ -85,13 +85,13 @@ namespace WebsitePanel.Portal.RDS { protected global::System.Web.UI.WebControls.Panel timeoutPanel; /// - /// txtTimeout control. + /// ddTimeout control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtTimeout; + protected global::System.Web.UI.WebControls.DropDownList ddTimeout; /// /// cbTimeoutUsers control. @@ -382,13 +382,121 @@ namespace WebsitePanel.Portal.RDS { protected global::System.Web.UI.WebControls.Panel driveSpacePanel; /// - /// txtThreshold control. + /// ddTreshold control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtThreshold; + protected global::System.Web.UI.WebControls.DropDownList ddTreshold; + + /// + /// secViewSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secViewSession; + + /// + /// viewSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel viewSessionPanel; + + /// + /// cbViewSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionUsers; + + /// + /// cbViewSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionAdministrators; + + /// + /// secControlSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secControlSession; + + /// + /// controlSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel controlSessionPanel; + + /// + /// cbControlSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionUsers; + + /// + /// cbControlSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionAdministrators; + + /// + /// secDisableCmd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDisableCmd; + + /// + /// disableCmdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel disableCmdPanel; + + /// + /// cbDisableCmdUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdUsers; + + /// + /// cbDisableCmdAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdAdministrators; /// /// buttonPanel control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx index 42fbacb1..23f91360 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx @@ -18,7 +18,7 @@
- + @@ -41,13 +41,13 @@ - - - - - - + +
+ + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs index 41e33a4a..c50344f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs @@ -59,5 +59,10 @@ namespace WebsitePanel.Portal.RDS return; } } + + protected void btnExit_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_collection_edit_users", "CollectionId=" + PanelRequest.CollectionID, "ItemID=" + PanelRequest.ItemID)); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs index 7a8f53e8..32a49f96 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs @@ -129,6 +129,15 @@ namespace WebsitePanel.Portal.RDS { /// protected global::System.Web.UI.WebControls.TextBox txtCC; + /// + /// btnExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnExit; + /// /// btnSend control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx index 9afc8a5b..15d0ef9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx @@ -40,7 +40,7 @@ OnRowCommand="gvRDSCollections_RowCommand" AllowPaging="True" AllowSorting="True"> - + @@ -48,17 +48,29 @@ - + - + + + + + + + + + + + - + <%# Eval("Name") %> - + <%# Eval("Name") %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs index 57e12294..9165638c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs @@ -22,12 +22,11 @@ namespace WebsitePanel.Portal.RDS.UserControls List tabsList = new List(); tabsList.Add(CreateTab("rds_edit_collection", "Tab.RdsServers")); tabsList.Add(CreateTab("rds_edit_collection_settings", "Tab.Settings")); + tabsList.Add(CreateTab("rds_collection_user_experience", "Tab.UserExperience")); tabsList.Add(CreateTab("rds_collection_edit_apps", "Tab.RdsApplications")); tabsList.Add(CreateTab("rds_collection_edit_users", "Tab.RdsUsers")); tabsList.Add(CreateTab("rds_collection_user_sessions", "Tab.UserSessions")); - tabsList.Add(CreateTab("rds_collection_local_admins", "Tab.LocalAdmins")); - tabsList.Add(CreateTab("rds_collection_user_experience", "Tab.UserExperience")); - tabsList.Add(CreateTab("rds_setup_letter", "Tab.RdsSetupLetter")); + tabsList.Add(CreateTab("rds_collection_local_admins", "Tab.LocalAdmins")); int idx = 0; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx index cb516139..af9ad456 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx @@ -63,10 +63,10 @@ - - + + - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs index 3ed913ac..6142e465 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs @@ -161,7 +161,7 @@ namespace WebsitePanel.Portal (resourceGroup.GroupName == ResourceGroups.Os)| (resourceGroup.GroupName == ResourceGroups.HostedOrganizations) | (resourceGroup.GroupName == ResourceGroups.SharepointFoundationServer) | - (resourceGroup.GroupName == ResourceGroups.SharepointServer) | + (resourceGroup.GroupName == ResourceGroups.SharepointEnterpriseServer) | (resourceGroup.GroupName == ResourceGroups.Mail)| (resourceGroup.GroupName == ResourceGroups.Lync)| (resourceGroup.GroupName == ResourceGroups.Exchange)| @@ -177,6 +177,7 @@ namespace WebsitePanel.Portal (resourceGroup.GroupName == ResourceGroups.MySql5)| (resourceGroup.GroupName == ResourceGroups.Statistics)| (resourceGroup.GroupName == ResourceGroups.VPS)| + (resourceGroup.GroupName == ResourceGroups.VPS2012)| (resourceGroup.GroupName == ResourceGroups.VPSForPC)); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx index 5b860eef..1f3300e5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx @@ -6,7 +6,7 @@ @@ -122,10 +122,62 @@
- +
-
- + + + + + + + + + + + +

+ + + + + + + + +
+ + + +
+
+
+ + + + + + + +
+ + + +
+
+
+ + + + + + + +
+ + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs index c7cc46ff..3e28ef23 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs @@ -13,7 +13,13 @@ namespace WebsitePanel.Portal { public void BindSettings(UserSettings settings) { - txtTimeout.Text = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; + var timeouts = RdsServerSettings.ScreenSaverTimeOuts; + ddTimeout.DataSource = timeouts; + ddTimeout.DataTextField = "Value"; + ddTimeout.DataValueField = "Key"; + ddTimeout.DataBind(); + + ddTimeout.SelectedValue = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; cbTimeoutAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]); cbTimeoutUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS]); @@ -38,12 +44,20 @@ namespace WebsitePanel.Portal cbScreenSaverAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]); cbScreenSaverUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS]); - txtThreshold.Text = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; + cbViewSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]); + cbViewSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users]); + cbControlSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]); + cbControlSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]); + + cbDisableCmdAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]); + cbDisableCmdUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_USERS]); + + ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; } public void SaveSettings(UserSettings settings) { - settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE] = txtTimeout.Text; + settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE] = ddTimeout.SelectedValue; settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS] = cbTimeoutAdministrators.Checked.ToString(); settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS] = cbTimeoutUsers.Checked.ToString(); settings[RdsServerSettings.REMOVE_RUN_COMMAND_ADMINISTRATORS] = cbRunCommandAdministrators.Checked.ToString(); @@ -60,7 +74,13 @@ namespace WebsitePanel.Portal settings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_USERS] = cbDesktopUsers.Checked.ToString(); settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS] = cbScreenSaverAdministrators.Checked.ToString(); settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS] = cbScreenSaverUsers.Checked.ToString(); - settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE] = txtThreshold.Text; + settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE] = ddTreshold.SelectedValue; + settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS] = cbViewSessionAdministrators.Checked.ToString(); + settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users] = cbViewSessionUsers.Checked.ToString(); + settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS] = cbControlSessionAdministrators.Checked.ToString(); + settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users] = cbControlSessionUsers.Checked.ToString(); + settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS] = cbDisableCmdAdministrators.Checked.ToString(); + settings[RdsServerSettings.DISABLE_CMD_USERS] = cbDisableCmdUsers.Checked.ToString(); } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs index ab5d3f15..9ecc5ff4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs @@ -31,13 +31,13 @@ namespace WebsitePanel.Portal { protected global::System.Web.UI.WebControls.Panel timeoutPanel; /// - /// txtTimeout control. + /// ddTimeout control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtTimeout; + protected global::System.Web.UI.WebControls.DropDownList ddTimeout; /// /// cbTimeoutUsers control. @@ -328,12 +328,120 @@ namespace WebsitePanel.Portal { protected global::System.Web.UI.WebControls.Panel driveSpacePanel; /// - /// txtThreshold control. + /// ddTreshold control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtThreshold; + protected global::System.Web.UI.WebControls.DropDownList ddTreshold; + + /// + /// secViewSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secViewSession; + + /// + /// viewSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel viewSessionPanel; + + /// + /// cbViewSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionUsers; + + /// + /// cbViewSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionAdministrators; + + /// + /// secControlSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secControlSession; + + /// + /// controlSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel controlSessionPanel; + + /// + /// cbControlSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionUsers; + + /// + /// cbControlSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionAdministrators; + + /// + /// secDisableCmd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDisableCmd; + + /// + /// disableCmdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel disableCmdPanel; + + /// + /// cbDisableCmdUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdUsers; + + /// + /// cbDisableCmdAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdAdministrators; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx index b52a64b4..d5260819 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx @@ -71,9 +71,14 @@ - + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs index 0f4cd791..1bba95c0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs @@ -66,14 +66,15 @@ namespace WebsitePanel.Portal { "quotaOCSUsers", "pnlOCSUsers" }, { "quotaLyncUsers", "pnlLyncUsers" }, { "quotaBlackBerryUsers", "pnlBlackBerryUsers" }, - { "quotaSharepointSites", "pnlSharepointSites" }, + { "quotaSharepointSites", "pnlSharepointSites" }, { "quotaWebSites", "pnlWebSites" }, { "quotaDatabases", "pnlDatabases" }, { "quotaNumberOfVm", "pnlHyperVForPC" }, { "quotaFtpAccounts", "pnlFtpAccounts" }, { "quotaExchangeStorage", "pnlExchangeStorage" }, { "quotaNumberOfFolders", "pnlFolders" }, - { "quotaEnterpriseStorage", "pnlEnterpriseStorage" } + { "quotaEnterpriseStorage", "pnlEnterpriseStorage" }, + { "quotaEnterpriseSharepointSites", "pnlEnterpriseSharepointSites"} }; protected void Page_Load(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs index fbb13a74..309c02cb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -454,6 +426,33 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.Quota quotaSharepointSites; + /// + /// pnlEnterpriseSharepointSites control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlEnterpriseSharepointSites; + + /// + /// lblEnterpriseSharepointSites control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnterpriseSharepointSites; + + /// + /// quotaEnterpriseSharepointSites control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaEnterpriseSharepointSites; + /// /// pnlWebSites control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx index a93f67c0..91d4c4a6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx @@ -27,6 +27,9 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.cs index 0d27729f..03e3f186 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.cs @@ -61,6 +61,8 @@ namespace WebsitePanel.Portal "edit_settings", "SettingsName=ExchangeServer", "SpaceID=" + PanelSecurity.PackageId.ToString()); lnkVps.NavigateUrl = EditUrl("SettingsControl", "SpaceSettingsVPS", "edit_settings", "SettingsName=VirtualPrivateServers", "SpaceID=" + PanelSecurity.PackageId.ToString()); + lnkVps2012.NavigateUrl = EditUrl("SettingsControl", "SpaceSettingsVPS2012", + "edit_settings", "SettingsName=VirtualPrivateServers2012", "SpaceID=" + PanelSecurity.PackageId.ToString()); lnkVpsForPC.NavigateUrl = EditUrl("SettingsControl", "SpaceSettingsVPSForPC", "edit_settings", "SettingsName=VirtualPrivateServersForPrivateCloud", "SpaceID=" + PanelSecurity.PackageId.ToString()); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.designer.cs index 71f55ee5..7680bfbd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettings.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -121,6 +93,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.HyperLink lnkVps; + /// + /// lnkVps2012 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkVps2012; + /// /// lnkVpsForPC control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackageIPAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackageIPAddresses.ascx.cs index 8c5ea109..d73c8be3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackageIPAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackageIPAddresses.ascx.cs @@ -90,7 +90,13 @@ namespace WebsitePanel.Portal.UserControls } int quotaAllowed = -1; - string quotaName = (String.Compare(ResourceGroup, ResourceGroups.VPS, true) == 0) ? Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER : Quotas.WEB_IP_ADDRESSES; + string quotaName = Quotas.WEB_IP_ADDRESSES; + + if (String.Compare(ResourceGroup, ResourceGroups.VPS, StringComparison.OrdinalIgnoreCase) == 0) + quotaName = Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER; + else if (String.Compare(ResourceGroup, ResourceGroups.VPS2012, StringComparison.OrdinalIgnoreCase) == 0) + quotaName = Quotas.VPS2012_EXTERNAL_IP_ADDRESSES_NUMBER; + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(quotaName)) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs index 95925257..d493bed7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs @@ -96,10 +96,10 @@ namespace WebsitePanel.Portal.UserControls //SharePoint menu group; if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer)) - PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointFoundationServerGroup"), ResourceGroups.SharepointFoundationServer.Replace(" ", "")); + PrepareSharePointMenuRoot(items); - if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointServer)) - PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointServerGroup"), ResourceGroups.SharepointServer.Replace(" ", "")); + if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + PrepareSharePointEnterpriseMenuRoot(items); //CRM Menu if (Cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013)) @@ -362,19 +362,19 @@ namespace WebsitePanel.Portal.UserControls bbItems.Add(CreateMenuItem("BlackBerryUsers", "blackberry_users", @"Icons/blackberry_users_48.png")); } - private void PrepareSharePointMenuRoot(MenuItemCollection items, string menuItemText, string group) + private void PrepareSharePointMenuRoot(MenuItemCollection items) { if (ShortMenu) { - PrepareSharePointMenu(items, group); + PrepareSharePointMenu(items); } else { - MenuItem item = new MenuItem(menuItemText, "", "", null); + MenuItem item = new MenuItem(GetLocalizedString("Text.SharePointFoundationServerGroup"), "", "", null); item.Selectable = false; - PrepareSharePointMenu(item.ChildItems, group); + PrepareSharePointMenu(item.ChildItems); if (item.ChildItems.Count > 0) { @@ -383,30 +383,44 @@ namespace WebsitePanel.Portal.UserControls } } - private void PrepareSharePointMenu(MenuItemCollection spItems, string group) + private void PrepareSharePointMenu(MenuItemCollection spItems) { - spItems.Add(CreateSharepointMenuItem("Text.SiteCollections", "sharepoint_sitecollections", @"Icons/sharepoint_sitecollections_48.png", group)); - spItems.Add(CreateSharepointMenuItem("Text.StorageUsage", "sharepoint_storage_usage", @"Icons/sharepoint_storage_usage_48.png", group)); - spItems.Add(CreateSharepointMenuItem("Text.StorageLimits", "sharepoint_storage_settings", @"Icons/sharepoint_storage_settings_48.png", group)); + spItems.Add(CreateMenuItem("SiteCollections", "sharepoint_sitecollections", @"Icons/sharepoint_sitecollections_48.png")); + spItems.Add(CreateMenuItem("StorageUsage", "sharepoint_storage_usage", @"Icons/sharepoint_storage_usage_48.png")); + spItems.Add(CreateMenuItem("StorageLimits", "sharepoint_storage_settings", @"Icons/sharepoint_storage_settings_48.png")); } - private MenuItem CreateSharepointMenuItem(string text, string key, string img, string group) + + private void PrepareSharePointEnterpriseMenuRoot(MenuItemCollection items) { - MenuItem item = new MenuItem(); - string PID_SPACE_EXCHANGE_SERVER = "SpaceExchangeServer"; - item.Text = GetLocalizedString(text); - item.NavigateUrl = PortalUtils.NavigatePageURL(PID_SPACE_EXCHANGE_SERVER, "ItemID", ItemID.ToString(), - PortalUtils.SPACE_ID_PARAM + "=" + PackageId, DefaultPage.CONTROL_ID_PARAM + "=" + key, "GroupName=" + group, - "moduleDefId=exchangeserver"); - - if (ShowImg) + if (ShortMenu) { - item.ImageUrl = PortalUtils.GetThemedIcon(img); + PrepareSharePointEnterpriseMenu(items); } + else + { + MenuItem item = new MenuItem(GetLocalizedString("Text.SharePointEnterpriseServerGroup"), "", "", null); - return item; + item.Selectable = false; + + PrepareSharePointEnterpriseMenu(item.ChildItems); + + if (item.ChildItems.Count > 0) + { + items.Add(item); + } + } } + + private void PrepareSharePointEnterpriseMenu(MenuItemCollection spItems) + { + spItems.Add(CreateMenuItem("SiteCollections", "sharepoint_enterprise_sitecollections", @"Icons/sharepoint_sitecollections_48.png")); + spItems.Add(CreateMenuItem("StorageUsage", "sharepoint_enterprise_storage_usage", @"Icons/sharepoint_storage_usage_48.png")); + spItems.Add(CreateMenuItem("StorageLimits", "sharepoint_enterprise_storage_settings", @"Icons/sharepoint_storage_settings_48.png")); + } + + private void PrepareOCSMenuRoot(MenuItemCollection items) { if (ShortMenu) @@ -542,8 +556,7 @@ namespace WebsitePanel.Portal.UserControls MenuItem item = new MenuItem(); item.Text = GetLocalizedString("Text." + text); - item.NavigateUrl = PortalUtils.EditUrl("ItemID", ItemID.ToString(), key, - "SpaceID=" + PackageId); + item.NavigateUrl = PortalUtils.EditUrl("ItemID", ItemID.ToString(), key, "SpaceID=" + PackageId); if (ShowImg) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/App_LocalResources/VdcCreateServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/App_LocalResources/VdcCreateServer.ascx.resx index aad17c43..dab48649 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/App_LocalResources/VdcCreateServer.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/App_LocalResources/VdcCreateServer.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Create @@ -369,4 +369,7 @@ Enter correct domain name, for example "mydomain.com" + + Generation: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Create.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Create.ascx.resx index 5b5b2e6f..29dcb1b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Create.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Create.ascx.resx @@ -117,16 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - First - - - Second - - - Generation: - - - Generation - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Edit.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Edit.ascx.resx new file mode 100644 index 00000000..29dcb1b3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/App_LocalResources/HyperV2012R2_Edit.ascx.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx index 04e7bb37..c3d1bc9d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx @@ -1,20 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HyperV2012R2_Create.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.HyperV2012R2_Create" %> -<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> +<%@ Register TagPrefix="wsp" TagName="Generation" Src="../UserControls/Generation.ascx" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemory" Src="../UserControls/DynamicMemory.ascx" %> - - - - - - - - -
- - - 1 - 2 - -
-
+ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.cs index 18553f3d..884535d6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.cs @@ -27,25 +27,51 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.UI; using WebsitePanel.Providers.Virtualization; namespace WebsitePanel.Portal.ProviderControls { - public partial class HyperV2012R2_Create : WebsitePanelControlBase, IVirtualMachineCreateControl + public partial class HyperV2012R2_Create : WebsitePanelControlBase, IVirtualMachineSettingsControl { + private bool _isEditMode; + protected void Page_Load(object sender, EventArgs e) { } + public bool IsEditMode + { + get { return _isEditMode; } + set + { + _isEditMode = value; + SettingContols.ForEach(s=>s.IsEditMode = _isEditMode); + } + } + public void BindItem(VirtualMachine item) { - var generation = item.Generation > 1 ? item.Generation : 1; - ddlGeneration.SelectedValue = generation.ToString(); + SettingContols.ForEach(s => s.BindItem(item)); } public void SaveItem(VirtualMachine item) { - item.Generation = Convert.ToInt32(ddlGeneration.SelectedValue); + SettingContols.ForEach(s => s.SaveItem(item)); + } + + private List SettingContols + { + get + { + return Controls + .Cast() + .Where(c => c is IVirtualMachineSettingsControl) + .Cast() + .ToList(); + } } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.designer.cs index ffb228ce..a48cb3d9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Create.ascx.designer.cs @@ -13,39 +13,21 @@ namespace WebsitePanel.Portal.ProviderControls { public partial class HyperV2012R2_Create { /// - /// secGeneration control. + /// GenerationSetting control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secGeneration; + protected global::WebsitePanel.Portal.VPS.UserControls.Generation GenerationSetting; /// - /// GenerationPanel control. + /// DynamicMemorySetting control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel GenerationPanel; - - /// - /// locGeneration control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locGeneration; - - /// - /// ddlGeneration control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlGeneration; + protected global::WebsitePanel.Portal.VPS.UserControls.DynamicMemory DynamicMemorySetting; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx new file mode 100644 index 00000000..6be1b29e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx @@ -0,0 +1,4 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HyperV2012R2_Edit.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.HyperV2012R2_Edit" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemory" Src="../UserControls/DynamicMemory.ascx" %> + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx.cs new file mode 100644 index 00000000..1fd43a45 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.ProviderControls +{ + public partial class HyperV2012R2_Edit : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public bool IsEditMode { get; set; } + + public void BindItem(VirtualMachine item) + { + DynamicMemorySetting.BindItem(item); + } + + public void SaveItem(VirtualMachine item) + { + DynamicMemorySetting.SaveItem(item); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx.designer.cs new file mode 100644 index 00000000..8d77b902 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/ProviderControls/HyperV2012R2_Edit.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ProviderControls { + + + public partial class HyperV2012R2_Edit { + + /// + /// DynamicMemorySetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS.UserControls.DynamicMemory DynamicMemorySetting; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/App_LocalResources/DynamicMemory.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/App_LocalResources/DynamicMemory.ascx.resx new file mode 100644 index 00000000..de7f7771 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/App_LocalResources/DynamicMemory.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dymanic memory: + + + Dymanic memory + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/App_LocalResources/Generation.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/App_LocalResources/Generation.ascx.resx new file mode 100644 index 00000000..5b5b2e6f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/App_LocalResources/Generation.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + First + + + Second + + + Generation: + + + Generation + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx new file mode 100644 index 00000000..65e54d68 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx @@ -0,0 +1,17 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DynamicMemory.ascx.cs" Inherits="WebsitePanel.Portal.VPS.UserControls.DynamicMemory" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> + + + + + + + + + +
+ + +
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx.cs new file mode 100644 index 00000000..99314d09 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx.cs @@ -0,0 +1,50 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS.UserControls +{ + public partial class DynamicMemory : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public bool IsEditMode { get; set; } + + public void BindItem(VirtualMachine item) + { + } + + public void SaveItem(VirtualMachine item) + { + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx.designer.cs new file mode 100644 index 00000000..55c21c10 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/DynamicMemory.ascx.designer.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS.UserControls { + + + public partial class DynamicMemory { + + /// + /// secDymanicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDymanicMemory; + + /// + /// DymanicMemoryPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DymanicMemoryPanel; + + /// + /// locDymanicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDymanicMemory; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx new file mode 100644 index 00000000..bab1e23d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx @@ -0,0 +1,24 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Generation.ascx.cs" Inherits="WebsitePanel.Portal.VPS.UserControls.Generation" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> + + + + + + + + +
+ + + <% if (IsEditMode) + { %> + + 1 + 2 + + <% } else { %> + + <% } %> +
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx.cs new file mode 100644 index 00000000..8b135de2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx.cs @@ -0,0 +1,54 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS.UserControls +{ + public partial class Generation : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public bool IsEditMode { get; set; } + + public void BindItem(VirtualMachine item) + { + var generation = item.Generation > 1 ? item.Generation : 1; + ddlGeneration.SelectedValue = generation.ToString(); + lblGeneration.Text = generation.ToString(); + } + + public void SaveItem(VirtualMachine item) + { + item.Generation = Convert.ToInt32(ddlGeneration.SelectedValue); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx.designer.cs new file mode 100644 index 00000000..14a00d87 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/Generation.ascx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS.UserControls { + + + public partial class Generation { + + /// + /// secGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secGeneration; + + /// + /// GenerationPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel GenerationPanel; + + /// + /// locGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGeneration; + + /// + /// ddlGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlGeneration; + + /// + /// lblGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGeneration; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs index c1c05f80..bbcd3638 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs @@ -215,9 +215,14 @@ namespace WebsitePanel.Portal.VPS.UserControls gauge.Visible = false; if (e.Item.ItemIndex == task.GetLogs().Count - 1) { - gauge.Visible = true; - gauge.Total = task.IndicatorMaximum; - gauge.Progress = task.IndicatorCurrent; + if (task.IndicatorCurrent == -1) + litRecord.Text += "..."; + else + { + gauge.Visible = true; + gauge.Total = task.IndicatorMaximum; + gauge.Progress = task.IndicatorCurrent; + } } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx index c864299e..4836faf1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx @@ -188,8 +188,6 @@ - - diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs index 4fb5436e..f8f4a212 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Outercurve Foundation. +// Copyright (c) 2015, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -26,7 +26,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; + using System; using System.Collections.Generic; using System.Web; using System.Web.UI; @@ -42,8 +42,6 @@ namespace WebsitePanel.Portal.VPS { protected void Page_Load(object sender, EventArgs e) { - LoadCustomProviderControl(); - if (!IsPostBack) { BindFormControls(); @@ -55,27 +53,7 @@ namespace WebsitePanel.Portal.VPS // toggle ToggleControls(); } - - private void LoadCustomProviderControl() - { - try - { - LoadProviderControl(PanelSecurity.PackageId, "VPS", providerControl, "Create.ascx"); - } - catch { /* skip */ } - } - - private IVirtualMachineCreateControl CustomProviderControl - { - get - { - if (providerControl.Controls.Count == 0) - return null; - - return (IVirtualMachineCreateControl)providerControl.Controls[0]; - } - } - + private void ToggleWizardSteps() { // external network @@ -135,13 +113,6 @@ namespace WebsitePanel.Portal.VPS ddlCpu.SelectedIndex = ddlCpu.Items.Count - 1; // select last (maximum) item - // the custom provider control - if (CustomProviderControl != null) - { - IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)providerControl.Controls[0]; - ctrl.BindItem(new VirtualMachine()); - } - // external network details if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS_EXTERNAL_NETWORK_ENABLED)) { @@ -316,15 +287,6 @@ namespace WebsitePanel.Portal.VPS try { - VirtualMachine virtualMachine = new VirtualMachine(); - - // the custom provider control - if (CustomProviderControl != null) - { - IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)providerControl.Controls[0]; - ctrl.SaveItem(virtualMachine); - } - // collect and prepare data string hostname = String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim()); @@ -343,7 +305,7 @@ namespace WebsitePanel.Portal.VPS // create virtual machine IntResult res = ES.Services.VPS.CreateVirtualMachine(PanelSecurity.PackageId, hostname, listOperatingSystems.SelectedValue, adminPassword, summaryEmail, - virtualMachine.Generation, Utils.ParseInt(ddlCpu.SelectedValue), Utils.ParseInt(txtRam.Text.Trim()), + 1, Utils.ParseInt(ddlCpu.SelectedValue), Utils.ParseInt(txtRam.Text.Trim()), Utils.ParseInt(txtHdd.Text.Trim()), Utils.ParseInt(txtSnapshots.Text.Trim()), chkDvdInstalled.Checked, chkBootFromCd.Checked, chkNumLock.Checked, chkStartShutdown.Checked, chkPauseResume.Checked, chkReboot.Checked, chkReset.Checked, chkReinstall.Checked, diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.designer.cs index c179bdcf..f5ea6588 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.designer.cs @@ -372,15 +372,6 @@ namespace WebsitePanel.Portal.VPS { /// protected global::System.Web.UI.WebControls.Localize locGB; - /// - /// providerControl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder providerControl; - /// /// secSnapshots control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.cs index b4252e5c..2bd4d455 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.cs @@ -96,9 +96,6 @@ namespace WebsitePanel.Portal.VPS chkExternalNetworkEnabled.Checked = vm.ExternalNetworkEnabled; chkPrivateNetworkEnabled.Checked = vm.PrivateNetworkEnabled; - // toggle controls - - // other quotas BindCheckboxOption(chkDvdInstalled, Quotas.VPS_DVD_ENABLED); chkBootFromCd.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS_BOOT_CD_ALLOWED); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.designer.cs index 3a79a132..d7975256 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VpsDetailsEditConfiguration.ascx.designer.cs @@ -1,38 +1,9 @@ -// Copyright (c) 2015, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1434 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -463,14 +434,5 @@ namespace WebsitePanel.Portal.VPS { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnCancel; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAddExternalAddress.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAddExternalAddress.ascx.resx new file mode 100644 index 00000000..9b619b66 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAddExternalAddress.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>The form allows allocating of additional External IP addresses to this hosting space. These IP addresses are used to configure VPS network adapter connected to External network.</p><p>VPS module is looking for free external IP addresses in "VPS External Network" pool, so WebsitePanel administrator must make sure there are sufficient number of unallotted IP addresses in that pool.</p> + + + Allocate IP Addresses + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAuditLog.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAuditLog.ascx.resx new file mode 100644 index 00000000..0ec75155 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAuditLog.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>Audit log displays the chronology of events for all VPS located in the hosting space.</p><p>By default audit log displays all today's events. You may filter the log by date (day, week, month), severity, task and item name (VPS host name).</p><p>To see task details click the link with task name in "Task" column.</p><p>To export log in CSV format click "Export Log" button.</p> + + + Audit Log + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcCreateServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcCreateServer.ascx.resx new file mode 100644 index 00000000..b095172a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcCreateServer.ascx.resx @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Create + + + Next > + + + < Back + + + <p><b>Welcome to VPS Creation Wizard!</b></p><p>The wizard allows specifying parameters of new VPS such as host name, operating system template, administrator password, External and Private (if allowed in the hosting plan) network parameters.</p><p>If e-mail address is specified in "Send summary letter to" then VPS summary information will be sent on that e-mail upon provisioning process completion.</p><p>After clicking "Create" button on the last step of the wizard the process of provisioning a new VPS will be started. The process is asynchronous, so it's not necessary to wait until it's finished.</p> + + + Configuration + + + External Network + + + Name & OS + + + Private Network + + + Summary + + + Enter domain name + + + Enter the number of external IP addresses + + + Enter host name + + + Enter the number of private IP addresses + + + Enter the size of hard disk drive + + + Enter amount of RAM allocated to new VPS + + + Enter the maximum number of snapshots + + + Enter e-mail address to send summary letter + + + Boot from CD + + + DVD drive installed + + + External network enabled + + + "Num Lock" enabled + + + Pause, Resume + + + Private network enabled + + + Reboot + + + Re-install + + + Reset + + + Send summary e-mail to: + + + Start, Turn off and Shutdown + + + CPU: + + + HDD: + + + RAM: + + + Administrator password: + + + Boot from CD: + + + Configuration + + + cores + + + CPU cores: + + + DVD Drive installed: + + + Number of IP addresses: + + + IP addresses list: + + + Number of IP addresses: + + + External Network + + + External network enabled: + + + GB + + + Hard disk size, GB: + + + * Hold CTRL key to select multiple addresses + + + Host name: + + + MB + + + Name and Operating System + + + "Num Lock" enabled: + + + * Type one IP address per line + + + Operating system: + + + Pause, resume allowed: + + + Number of IP addresses: + + + IP addresses list: + + + Number of IP addresses: + + + Private Network + + + Private network enabled: + + + Network addresses format: + + + Subnet mask: + + + RAM, MB: + + + Reboot allowed: + + + Re-install allowed: + + + Reset allowed: + + + Number of snapshots: + + + Start, turn off and shutdown allowed: + + + Summary + + + Create New VPS + + + Randomly select IP addresses from the pool + + + Select IP addresses from the list + + + Randomly select next available IP addresses to the addresses format + + + Assign specified IP addresses + + + Allowed actions + + + BIOS + + + DVD + + + Resources + + + Snapshots + + + Select operating system template + + + <Select OS template> + + + ShowProgressDialog('Creating Virtual Server...'); + + + ({0} max) + + + ({0} max) + + + The pool of available external IP addresses is empty. All IP addresses allocated to the current hosting space are assigned to existing virtual servers. More external IP addresses could be allocated by the host. + + + Enter correct host name, for example "vps01" + + + Enter correct domain name, for example "mydomain.com" + + + Generation: + + + Dynamic Memory + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcExternalNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcExternalNetwork.ascx.resx new file mode 100644 index 00000000..a0d73a20 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcExternalNetwork.ascx.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>The form displays the list of IP addresses from "VPS External Network" pool allocated to the hosting space. Alternatively, this form could be considered as a "map" of external IP addresses and their assignments to virtual machines.</p><p>If any IP has already assigned to some VPS then there will be VPS host name in the "Item name" column.</p><p>If there are lot of VPS in the hosting space you can easily search them by their external IP.</p><p>"Number of IP addresses" quota shows the maximum number of external IP addresses that could be allocated to this space.</p> + + + Bandwidth, GB: + + + Number of IP Addresses: + + + External Network + + + Quotas + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcHome.ascx.resx new file mode 100644 index 00000000..8b86f534 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcHome.ascx.resx @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Create VM + + + <p>The form displays the list of Virtual Private Servers created in the hosting space.</p><p>In terms of WebsitePanel VPS module hosting space could be compared to the Virtual Dedicated Center (VDC). You can see VPS bindings to external and private IP addresses as well as search VPS by these fields.</p><p>Quotas in the bottom of the forms show the total amount of computer resources available for VPS.</p> + + + No VPS have been created. To create a new VPS click "Create VPS" button. + + + External IP + + + Host name + + + Private IP + + + Space + + + User + + + External IP + + + Private IP + + + VPS Name + + + User Name + + + Delete + + + HDD, GB: + + + RAM, MB: + + + Virtual Private Servers + + + Number of VPS: + + + Quotas + + + Import VPS + + + return confirm('Remove this VM from meta-base?'); + + + Detach + + + Move + + + Fast Create VM + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcImportServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcImportServer.ascx.resx new file mode 100644 index 00000000..d8cecd56 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcImportServer.ascx.resx @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Pause, Resume + + + Reboot + + + Reset + + + Start, Turn off and Shutdown + + + Cancel + + + Import + + + Enable Remote Desktop Web Connection + + + <p>This wizard allows you to import existing Virtual Machine to control panel meta-base to provide its owner self-service functions.</p><p>Importing is absolutely safe for VM as nor VM configuration, nor its state are changing during the process.</p><p>To import VM, first, select registered in control panel Hyper-V service where VM is located. Then select VM, specify its allowed actions and select network adapter bindings.</p><p>External and management networks are determined on appropriate Hyper-V service properties page.</p><p>To enable Remote Desktop Web connections you have to provide real guest OS administrator password (for automatic sign-on).</p> + + + Administrator password: + + + Boot from CD + + + CPU, cores: + + + DVD drive is installed + + + Connected NIC: + + + Assign IP addresses: + + + HDD, Gb: + + + Hyper-V Service: + + + Connected NIC: + + + Assign IP addresses: + + + Num Lock + + + RAM, Mb: + + + Import Existing VPS + + + VHD location: + + + Virtual Machine: + + + Allowed Actions + + + BIOS + + + Configuration + + + DVD + + + External Network + + + Management Network + + + OS Template: + + + <Select Hyper-V service> + + + <Select virtual machine> + + + Please select OS template + + + Please select virtual machine to import + + + Please select Hyper-V service to import VPS from + + + <Select Operating System template> + + + ShowProgressDialog('Importing Virtual Server...'); + + + Please enter guest OS administrator password + + + Select at least one External IP address + + + Select at least one Management IP address + + + <Not connected> + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcManagementNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcManagementNetwork.ascx.resx new file mode 100644 index 00000000..ead4bdcd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcManagementNetwork.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p><b>This form is visible to administrators only.</b></p><p> Management network is not available to resellers and users and it's being managed by WebsitePanel on their behalf.</p><p>Management network is a back-end company network used by system administrators to manage customers' VPS. This network is also used by VPS to access various utility resources and services such as DNS, KMS, backups, etc.</p><p>If Management network is enabled on Hyper-V service properties then every created VPS will be assigned one IP address from "VPS Management Network" pool, so WebsitePanel administrator must make sure there are sufficient number of IP addresses in that pool.</p> + + + Management Network + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPermissions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPermissions.ascx.resx new file mode 100644 index 00000000..101f29ae --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPermissions.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Updating permissions...'); + + + ShowProgressDialog('Updating permissions...'); + + + User permissions allow... + + + No peers exist under your user account. + + + No peers exist under your user account. + + + User Permissions + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPrivateNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPrivateNetwork.ascx.resx new file mode 100644 index 00000000..c3aa3949 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPrivateNetwork.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>If this form is available in the hosting space then it means that all VPS in this hosting space are connected to dedicated private network available only to this hosting space.</p> <p>Private network is a very powerful mechanizm that allows additional increase of network security. For example, you might have only one front-end server (e.g. server with Exchange CAS and HUB roles installed) connected to External network and all the rest of servers connected to private (internal) network only (e.g. one server with Exchange MB role and second one with DC).</p><p>Quota in the bottom of the form displays the maximum number of private IP addresses that could be assigned to every VPS.</p> + + + No private IP addresses have been used in this hosting space. + + + IP Address + + + VPS Name + + + IP + + + VPS + + + Primary + + + Private Network + + + IP addresses per VPS: + + + Quotas + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddExternalAddress.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddExternalAddress.ascx.resx new file mode 100644 index 00000000..17810cf9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddExternalAddress.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add + + + Cancel + + + Enter the number of IP addresses + + + <p>This form allows assigning of new IP addresses to VPS "External" network adapter.</p><p>Additional IP addresses could be assigned to the VPS if only there is enough number of free (unassigned) external IP addresses allocated to this hosting space.</p><p>After clicking "Add" button special configuration instructions will be sent to VPS, so it may take some time (up to few minutes) until network adapter parameters are changed.</p> + + + Number of IP addresses: + + + * Hold CTRL key to select multiple addresses + + + Add External IP Addresses + + + Network + + + Randomly select IP addresses from the pool + + + Select IP addresses from the list + + + ({0} max) + + + The pool of available external IP addresses is empty. All IP addresses allocated to the current hosting space are assigned to existing virtual servers. More external IP addresses could be allocated by the host. + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddPrivateAddress.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddPrivateAddress.ascx.resx new file mode 100644 index 00000000..63bd6af6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddPrivateAddress.ascx.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add + + + Cancel + + + <p>This form allows assigning of new IP addresses to VPS "Private" network adapter.</p><p>In the private network you could assign any IP addresses to VPS, however if you decide to leave this job for WebsitePanel then it will generate private IP addresses for you by the algorithm set on the service level and make sure IPs are not duplicated.</p><p>After clicking "Add" button special configuration instructions will be sent to VPS, so it may take some time (up to few minutes) until network adapter parameters are changed.</p> + + + * Type one IP address per line + + + Number of IP addresses: + + + Add Private IP Addresses + + + Network + + + Enter the number of private IP addresses + + + Randomly select next available IP addresses to the addresses format + + + Assign specified IP addresses + + + ({0} max) + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAuditLog.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAuditLog.ascx.resx new file mode 100644 index 00000000..b3ea1412 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAuditLog.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>Audit log displays the chronology of events for this VPS.</p><p>By default audit log displays all today's events. You may filter the log by date (day, week, month), severity, task and item name (VPS host name).</p><p>To see task details click the link with task name in "Task" column.</p><p>To export log in CSV format click "Export Log" button.</p> + + + Audit Log + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsConfiguration.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsConfiguration.ascx.resx new file mode 100644 index 00000000..c2391630 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsConfiguration.ascx.resx @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Changing password...', 'PasswordModal'); + + + {0} cores + + + {0} GB + + + {0} MB + + + Network + + + Cancel + + + Change password + + + Change + + + Edit configuration + + + <p>This form shows VPS configuration.</p><p>To change VPS Administrator account password click "Change" link in "Software" section.<br/>To change password special configuration instructions will be sent to VPS, so it may take some time (up to few minutes) until it is changed.</p><p>To change VPS configuration (if allowed in the hosting plan) click "Edit configuration" button.</p> + + + CPU: + + + HDD: + + + RAM: + + + Administrator password: + + + Change Administrator Password + + + Enter new password: + + + Operating system: + + + Number of snapshots: + + + Configuration + + + Boot from CD + + + DVD drive installed + + + External network enabled + + + Num Lock enabled + + + Pause, Resume + + + Private network enabled + + + Reboot + + + Re-Install + + + Reset + + + Start, Turn off and Shutdown + + + Server Actions + + + BIOS + + + DVD + + + Resources + + + Snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsDvd.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsDvd.ascx.resx new file mode 100644 index 00000000..7357567a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsDvd.ascx.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Ejecting disk...'); + + + <empty> + + + Eject + + + Insert Disk... + + + <p>The form shows the status of DVD drive. If there is <b>&lt;empty&gt;</b> then there is no disk in the drive.</p><p>Click <b>"Insert Disk..."</b> button to browse Media Library.</p><p>Click <b>"Eject"</b> button to remove disk from DVD drive.</p> + + + DVD Drive: + + + DVD + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsEditConfiguration.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsEditConfiguration.ascx.resx new file mode 100644 index 00000000..f01b77a7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsEditConfiguration.ascx.resx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + if(!confirm('Before applying new configuration VPS will be stopped.\n\nAfter the configuration is changed it will be started again automatically.\n\nDo you want to proceed?')) return false; ShowProgressDialog('Updating configuration...'); + + + Update + + + Boot from CD + + + DVD drive installed + + + External network enabled + + + Num Lock enabled + + + Pause, Resume + + + Private network enabled + + + Reboot + + + Re-Install + + + Reset + + + Start, Turn off and Shutdown + + + <p>Change VPS configuration and click "Update" button.</p><p><b>Before applying new configuration settings VPS will be stopped. After new configuration is applied it will be started again.</b></p> + + + CPU: + + + HDD: + + + RAM: + + + cores + + + GB + + + MB + + + Number of snapshots: + + + Edit Configuration + + + Edit Configuration + + + Please specify HDD size + + + Please specify RAM size + + + Server Actions + + + BIOS + + + DVD + + + Network + + + Resources + + + Snapshots + + + Please enter the number of snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsGeneral.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsGeneral.ascx.resx new file mode 100644 index 00000000..5d662ca5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsGeneral.ascx.resx @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Changing host name...', 'ChangeHostnameModal'); + + + Delete + + + Pause + + + Reboot + + + Reset + + + Resume + + + Shut&nbsp;Down + + + Snapshot + + + Start + + + Turn&nbsp;Off + + + {0}% + + + {0}% + + + Used: {0} MB, Total: {1} MB + + + if(!confirm('Pause VPS?')) return false; ShowProgressDialog('Pausing...'); + + + if(!confirm('Reboot VPS?')) return false; ShowProgressDialog('Rebooting...'); + + + if(!confirm('Reset VPS?')) return false; ShowProgressDialog('Resetting...'); + + + ShowProgressDialog('Resuming...'); + + + if(!confirm('Shut down VPS?')) return false; ShowProgressDialog('Shutting down...'); + + + ShowProgressDialog('Taking snapshot...'); + + + ShowProgressDialog('Starting...'); + + + if(!confirm('Turn off VPS?')) return false; ShowProgressDialog('Turning off...'); + + + Host&nbsp;name: + + + Cancel + + + Change + + + Edit + + + Update computer network name + + + <p><b>Status</b> shows the current state of VPS. The list of available VPS action buttons on the right depends on the current status.</p><p><b>Uptime</b> is the time since the last VPS start.</p><b>Heartbeat</b> is a very useful indicator as it shows whether VPS operating system is active and respond. If there is "No contact" then it means the system is not started yet, but if there is an "Error" then it means OS does not respond to the host machine.</p><p><b>CPU</b> meter displays VPS processor utilization.</p><p><b>RAM</b> and <b>HDD</b> meters show real-time data provided by VPS operating system.</p> + + + Error + + + Lost communication + + + No contact + + + None + + + OK + + + Paused + + + Change VPS Host Name + + + CPU: + + + Created: + + + Domain: + + + Heartbeat: + + + Host name: + + + RAM: + + + Status: + + + General + + + Uptime: + + + Deleted + + + Migrating + + + Off + + + Paused + + + Pausing + + + Saved + + + Saving + + + Taking Snapshot + + + Running + + + Starting + + + Running + + + Stopping + + + Enter correct host name, for example "vps01" + + + Enter correct domain name, for example "mydomain.com" + + + {0}% + + + Free: {0} GB, Total: {1} GB on {2} drive(s) + + + HDD: + + + Domain: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsHelp.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsHelp.ascx.resx new file mode 100644 index 00000000..59a45d4c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsHelp.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Sending e-mail...'); + + + Send + + + <p>This form displays VPS summary information prepared by the host.</p><p>This information could be re-send to any e-mail address specified in "Send instructions by e-mail" section. This section is collapsed by default.</p> + + + BCC: + + + To: + + + Help + + + Send instructions by e-mail + + + Please enter e-mail address + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsInsertDvd.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsInsertDvd.ascx.resx new file mode 100644 index 00000000..5f5792c4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsInsertDvd.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + ShowProgressDialog('Inserting disk...'); + + + Insert + + + <p>Browse Media Library and click <b>"Insert"</b> button in the row with DVD you want to insert into drive.</p><p>Click <b>"Cancel"</b> button to return to DVD drive properties screen.</p> + + + No disks found in the media library. + + + Title + + + Browse Media Library + + + DVD + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsNetwork.ascx.resx new file mode 100644 index 00000000..98dfebbe --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsNetwork.ascx.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add IP... + + + Add IP... + + + Delete + + + Delete + + + Set As Primary + + + Set As Primary + + + <p>This form shows VPS network configuration.</p><p>To assign additional IP addresses to "External" or "Private" adapter click "Add" button in the appropriate section.</p><p>When you delete external or private IP or change network adapter primary IP address the system sends special configuration instructions to VPS operating system, so it may take some time (up to few minutes) until network adapter parameters are changed.</p> + + + No IP addresses are assigned to external network adapter. + + + IP Address + + + Primary + + + No IP addresses are assigned to private network adapter. + + + Server address: + + + Default gateway: + + + Subnet mask: + + + Server address: + + + Network format: + + + Subnet mask: + + + Network + + + IP addresses: + + + IP addresses: + + + External Network + + + Private Network + + + &lt;auto&gt; + + + Gateway + + + Subnet Mask + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsPermissions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsPermissions.ascx.resx new file mode 100644 index 00000000..867a4a7f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsPermissions.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Updating permissions...'); + + + User permissions allow... + + + No peers exist under your user account. + + + Permissions + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsSnapshots.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsSnapshots.ascx.resx new file mode 100644 index 00000000..3b106beb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsSnapshots.ascx.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + if(this.disabled) return false;if(!confirm('Do you want to apply selected snapshot to VPS?')) return false;ShowProgressDialog('Applying snapshot...'); + + + if(this.disabled) return false;if(!confirm('Do you want to completely delete selected snapshot?')) return false;ShowProgressDialog('Deleting snapshot...'); + + + if(!confirm('Do you want to completely delete selected snapshot and all its sub-tree?')) return false;ShowProgressDialog('Deleting snapshot sub-tree...'); + + + ShowProgressDialog('Renaming snapshot...', 'RenameSnapshotModal'); + + + ShowProgressDialog('Taking snapshot...'); + + + Now + + + This virtual server has no snapshots. + + + Apply + + + Cancel + + + Delete + + + Delete Subtree + + + Rename + + + Rename + + + <p>To take a <b>snapshot</b> is much like to take a picture of current VPS state: its configuration, memory and hard disk.</p><p>Snapshots maybe used as backup/restore points when installing new software or using VPS for development or testing purposes. If something has gone wrong there is an ability to roll-back and <b>"Apply"</b> a snapshot with good configuration.</p><p><b>"Rename"</b> button allows renaming snapshot and giving it some informative name, for example "Before applying service pack".</p> + + + Created: + + + Number of Snapshots: + + + Rename Snapshot + + + Snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsTools.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsTools.ascx.resx new file mode 100644 index 00000000..0f143aa1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsTools.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete VPS + + + Re-install VPS + + + + + + Completely removes VPS and all its data. + + + Re-creates VPS with the same configuration settings and operating system template. The wizard allows to preserve existing virtual disk data. + + + Tools + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsMoveServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsMoveServer.ascx.resx new file mode 100644 index 00000000..166a5167 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsMoveServer.ascx.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + <p>This wizard allows you to change Hyper-V service binding for existing Virtual Machine meta-item.</p><p>The wizard <b>DOES NOT PERFORM</b> physical virtual machine migration, but it could be used to point control panel to the right Hyper-V service AFTER virtual machine was moved with some external management tool like Hyper-V manager or SCVMM.</p> + + + Move VPS + + + ShowProgressDialog('Moving Virtual Server...'); + + + Move + + + Destination Hyper-V Service: + + + Please select Hyper-V where VPS has been moved + + + Source Hyper-V service: + + + <Select Hyper-V service> + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsDeleteServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsDeleteServer.ascx.resx new file mode 100644 index 00000000..93428664 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsDeleteServer.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + ShowProgressDialog('Deleting Virtual Server...'); + + + Delete + + + Delete this Virtual Server + + + Export VPS before deletion to the following folder: + + + Do not delete VPS files (virtual hard disk, snapshots) + + + Please enter export path + + + <p>This form confirms deletion of VPS.</p><p>In order to confirm "Delete this virtual server" checkbox must be checked.</p> + + + Administrator options + + + This wizard will delete VPS and all its contents from the virtualization server. + + + Delete VPS Server + + + Delete Server + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsReinstallServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsReinstallServer.ascx.resx new file mode 100644 index 00000000..ae295246 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsReinstallServer.ascx.resx @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Re-install + + + Yes, I confirm re-installation of this VPS + + + Export VPS before re-installation to the following folder: + + + Save existing VPS hard drive files + + + Do not delete VPS virtual hard drive file + + + Enter export path + + + + + + This wizard will re-create VPS with the same configuration settings from scratch and then apply current OS template. + + + New administrator password: + + + All files from existing hard drive will be copied to &quot;old&quot; disk folder on hard drive of new VPS. + + + Re-install VPS Server + + + Re-install Server + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/App_LocalResources/Connect.aspx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/App_LocalResources/Connect.aspx.resx new file mode 100644 index 00000000..2c7a42b1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/App_LocalResources/Connect.aspx.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Remote Desktop Connection + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx new file mode 100644 index 00000000..4222b165 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx @@ -0,0 +1,231 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Connect.aspx.cs" Inherits="WebsitePanel.Portal.VPS2012.RemoteDesktop.Connect" %> + + + + + + <asp:Literal ID="litServerName" runat="server"></asp:Literal> + <asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Remote Desktop Web Connection"></asp:Localize> + + + + + + + + + +
+
+ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.cs new file mode 100644 index 00000000..ea83ecab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.RemoteDesktop +{ + public partial class Connect : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + resolution.Text = Request["Resolution"]; + + // load server info + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + litServerName.Text = vm.Name + " - "; + username.Text = "Administrator"; + password.Text = vm.AdministratorPassword; + + // load external network parameters + NetworkAdapterDetails nic = ES.Services.VPS2012.GetExternalNetworkAdapterDetails(PanelRequest.ItemID); + if (nic.IPAddresses.Length > 0) + { + NetworkAdapterIPAddress ip = nic.IPAddresses[0]; + serverName.Text = !String.IsNullOrEmpty(ip.NATAddress) ? ip.NATAddress : ip.IPAddress; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.designer.cs new file mode 100644 index 00000000..b9b9ff55 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.RemoteDesktop { + + + public partial class Connect { + + /// + /// litServerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litServerName; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// resolution control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal resolution; + + /// + /// serverName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal serverName; + + /// + /// username control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal username; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal password; + + /// + /// AspForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm AspForm; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/msrdp.cab b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/msrdp.cab new file mode 100644 index 00000000..695c0137 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/msrdp.cab differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx new file mode 100644 index 00000000..31661d8d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx @@ -0,0 +1,46 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestVirtualMachineTemplate.aspx.cs" Inherits="WebsitePanel.Portal.VPS2012.TestVirtualMachineTemplate" %> + +<%@ Register src="../UserControls/MessageBox.ascx" tagname="MessageBox" tagprefix="wsp" %> + +<%@ Register src="../UserControls/SimpleMessageBox.ascx" tagname="SimpleMessageBox" tagprefix="uc1" %> + + + + + Test VPS2012 Summary Template + + + +
+
+

Test VPS2012 Summary Template +

+ + + +

+ Item ID:
+ +

+

+ Template:
+ +
+ +

+

+ Results: +
+

+

+
+
+ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.cs new file mode 100644 index 00000000..479d409d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Web; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class TestVirtualMachineTemplate : System.Web.UI.Page + { + public const string EVALUATE_VIRTUAL_MACHINE_TEMPLATE = "EVALUATE_VIRTUAL_MACHINE_TEMPLATE"; + + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnEvaluate_Click(object sender, EventArgs e) + { + try + { + litResults.Text = HttpUtility.HtmlEncode(ES.Services.VPS2012.EvaluateVirtualMachineTemplate(Utils.ParseInt(txtItemId.Text.Trim(), 0), txtTemplate.Text)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage(EVALUATE_VIRTUAL_MACHINE_TEMPLATE, ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.designer.cs new file mode 100644 index 00000000..2cd00d39 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.designer.cs @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class TestVirtualMachineTemplate { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// txtItemId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtItemId; + + /// + /// txtTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTemplate; + + /// + /// btnEvaluate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEvaluate; + + /// + /// litResults control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litResults; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Breadcrumb.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Breadcrumb.ascx.resx new file mode 100644 index 00000000..5ea0895e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Breadcrumb.ascx.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/DynamicMemoryControl.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/DynamicMemoryControl.ascx.resx new file mode 100644 index 00000000..8ddc22e8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/DynamicMemoryControl.ascx.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Minimum RAM, Mb: + + + Minimum memory must be a whole number + + + Enter the minimum memory + + + Dymanic memory enabled + + + Dymanic memory + + + Dymanic memory enabled: + + + Dynamic memory enabled + + + Buffer must be a whole number between 0 and 100 + + + Enter the buffer + + + Buffer, %: + + + Maximum RAM, Mb: + + + Weight (Priority): + + + Maximum memory must be a whole number + + + Enter the maximum memory + + + Weight (priority) must be a whole number between 0 and 100 + + + Enter the weight (priority) + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Generation.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Generation.ascx.resx new file mode 100644 index 00000000..5b5b2e6f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Generation.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + First + + + Second + + + Generation: + + + Generation + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Menu.ascx.resx new file mode 100644 index 00000000..a4af7bf0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Menu.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Audit Log + + + External Network + + + Management Network + + + Private Network + + + User Permissions + + + Virtual Private Servers + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx new file mode 100644 index 00000000..eaf0db7c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + return CancelOperation('Cancel current operation?', 'Cancelling operation...'); + + + Audit Log + + + Configuration + + + DVD + + + General + + + Help + + + Network + + + Permissions + + + Snapshots + + + Tools + + + Elapsed: + + + Started: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx new file mode 100644 index 00000000..2dd3eb5c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx @@ -0,0 +1,4 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Breadcrumb.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.cs new file mode 100644 index 00000000..1bf7495d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.cs @@ -0,0 +1,50 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class Breadcrumb : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind package name + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); + litSpaceName.Text = package.PackageName; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.designer.cs new file mode 100644 index 00000000..4231a1d5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class Breadcrumb { + + /// + /// litSpaceName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSpaceName; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx new file mode 100644 index 00000000..a8c9888a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx @@ -0,0 +1,126 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DynamicMemoryControl.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.DynamicMemoryControl" %> +<%@ Import Namespace="WebsitePanel.Portal" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> +<%@ Register TagPrefix="wsp" TagName="CheckBoxOption" Src="../../UserControls/CheckBoxOption.ascx" %> + +<% if (Mode != VirtualMachineSettingsMode.Summary){ %> + + + + + <% if (Mode == VirtualMachineSettingsMode.Edit) { %> + + + + <% } else { %> + + + + + + + + + + + + + + + + + + + + <% } %> +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + * + * +
+ + + + + * + * +
+ + + + + * + * +
+ + + + + * + * +
+
+ +
+
+<% } else { %> + + + + + + + + + + + + + + + + + + + + +<% } %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx.cs new file mode 100644 index 00000000..1ee4fc95 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx.cs @@ -0,0 +1,88 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class DynamicMemoryControl : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + ToggleControls(); + } + + private void ToggleControls() + { + tableDynamicMemory.Visible = chkDynamicMemoryEnabled.Checked; + } + + public VirtualMachineSettingsMode Mode { get; set; } + + public void BindItem(VirtualMachine item) + { + if (item.DynamicMemory == null) + item.DynamicMemory = new DynamicMemory(); + + // set values + chkDynamicMemoryEnabled.Checked = optionDymanicMemoryDisplay.Value = optionDymanicMemorySummary.Value = item.DynamicMemory.Enabled; + txtMinimum.Text = litMinimumDisplay.Text = litMinimumSummary.Text = item.DynamicMemory.Minimum.ToString(); + txtMaximum.Text = litMaximumDisplay.Text = litMaximumSummary.Text = item.DynamicMemory.Maximum.ToString(); + txtBuffer.Text = litBufferDisplay.Text = litBufferSummary.Text = item.DynamicMemory.Buffer.ToString(); + txtPriority.Text = litPriorityDisplay.Text = litPrioritySummary.Text = item.DynamicMemory.Priority.ToString(); + + // set visibilities + trMinimumDisplay.Visible = trMaximumDisplay.Visible = trBufferDisplay.Visible = trPriorityDisplay.Visible = item.DynamicMemory.Enabled; + trMinimumSummary.Visible = trMaximumSummary.Visible = trBufferSummary.Visible = trPrioritySummary.Visible = item.DynamicMemory.Enabled; + } + + public void SaveItem(ref VirtualMachine item) + { + if (Mode != VirtualMachineSettingsMode.Edit) + return; + + item.DynamicMemory = new DynamicMemory + { + Enabled = chkDynamicMemoryEnabled.Checked, + Minimum = ParseInt(txtMinimum.Text), + Maximum = ParseInt(txtMaximum.Text), + Buffer = ParseInt(txtBuffer.Text), + Priority = ParseInt(txtPriority.Text), + }; + } + + private int ParseInt(string text) + { + if (string.IsNullOrEmpty(text)) + return 0; + + return Int32.Parse(text); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx.designer.cs new file mode 100644 index 00000000..328179bb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemoryControl.ascx.designer.cs @@ -0,0 +1,366 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class DynamicMemoryControl { + + /// + /// secDymanicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDymanicMemory; + + /// + /// DymanicMemoryPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DymanicMemoryPanel; + + /// + /// chkDynamicMemoryEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDynamicMemoryEnabled; + + /// + /// tableDynamicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tableDynamicMemory; + + /// + /// locMinimum control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMinimum; + + /// + /// txtMinimum control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMinimum; + + /// + /// locMaximum control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaximum; + + /// + /// txtMaximum control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaximum; + + /// + /// locBuffer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBuffer; + + /// + /// txtBuffer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBuffer; + + /// + /// locPriority control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPriority; + + /// + /// txtPriority control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPriority; + + /// + /// optionDymanicMemoryDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionDymanicMemoryDisplay; + + /// + /// trMinimumDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trMinimumDisplay; + + /// + /// locMinimumDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMinimumDisplay; + + /// + /// litMinimumDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMinimumDisplay; + + /// + /// trMaximumDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trMaximumDisplay; + + /// + /// locMaximumDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaximumDisplay; + + /// + /// litMaximumDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaximumDisplay; + + /// + /// trBufferDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trBufferDisplay; + + /// + /// locBufferDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBufferDisplay; + + /// + /// litBufferDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litBufferDisplay; + + /// + /// trPriorityDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trPriorityDisplay; + + /// + /// locPriorityDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPriorityDisplay; + + /// + /// litPriorityDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPriorityDisplay; + + /// + /// locDymanicMemorySummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDymanicMemorySummary; + + /// + /// optionDymanicMemorySummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionDymanicMemorySummary; + + /// + /// trMinimumSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trMinimumSummary; + + /// + /// locMinimumSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMinimumSummary; + + /// + /// litMinimumSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMinimumSummary; + + /// + /// trMaximumSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trMaximumSummary; + + /// + /// locMaximumSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaximumSummary; + + /// + /// litMaximumSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaximumSummary; + + /// + /// trBufferSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trBufferSummary; + + /// + /// locBufferSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBufferSummary; + + /// + /// litBufferSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litBufferSummary; + + /// + /// trPrioritySummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow trPrioritySummary; + + /// + /// locPrioritySummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrioritySummary; + + /// + /// litPrioritySummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrioritySummary; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx new file mode 100644 index 00000000..4a361f2b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx @@ -0,0 +1,4 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FormTitle.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.FormTitle" %> + +- + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.cs new file mode 100644 index 00000000..bc88fcea --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class FormTitle : WebsitePanelControlBase + { + public string Text + { + get { return litTitle.Text; } + set { litTitle.Text = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + if (vm != null) + litServerName.Text = vm.Name; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.designer.cs new file mode 100644 index 00000000..e56c4e0e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class FormTitle { + + /// + /// litTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litTitle; + + /// + /// litServerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litServerName; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx new file mode 100644 index 00000000..ad9dc272 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx @@ -0,0 +1,36 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Generation.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.Generation" %> +<%@ Import Namespace="WebsitePanel.Portal" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> + +<% if (Mode != VirtualMachineSettingsMode.Summary){ %> + + + + <% if (Mode == VirtualMachineSettingsMode.Edit) { %> + + + + + <% } else { %> + + + + <% } %> +
+ + + + 1 + 2 + +
+ + +
+
+<% } else { %> + + + + +<% } %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.cs new file mode 100644 index 00000000..e092af49 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class Generation : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public VirtualMachineSettingsMode Mode { get; set; } + + public void BindItem(VirtualMachine item) + { + var generation = item.Generation > 1 ? item.Generation.ToString () : "1"; + + ddlGeneration.SelectedValue = generation; + lblGeneration.Text = litGeneration.Text = GetLocalizedString("ddlGenerationItem." + generation); + } + + public void SaveItem(ref VirtualMachine item) + { + if (Mode == VirtualMachineSettingsMode.Edit) + item.Generation = Convert.ToInt32(ddlGeneration.SelectedValue); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.designer.cs new file mode 100644 index 00000000..690bec4e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class Generation { + + /// + /// secGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secGeneration; + + /// + /// GenerationPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel GenerationPanel; + + /// + /// locGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGeneration; + + /// + /// ddlGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlGeneration; + + /// + /// locGenerationDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGenerationDisplay; + + /// + /// lblGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGeneration; + + /// + /// locGeneration2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGeneration2; + + /// + /// litGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litGeneration; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx new file mode 100644 index 00000000..10902dd6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx @@ -0,0 +1,18 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.Menu" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.cs new file mode 100644 index 00000000..fe628e86 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.cs @@ -0,0 +1,129 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class Menu : WebsitePanelControlBase + { + public class MenuItem + { + private string url; + private string text; + private string key; + + public string Url + { + get { return url; } + set { url = value; } + } + + public string Text + { + get { return text; } + set { text = value; } + } + + public string Key + { + get { return key; } + set { key = value; } + } + } + + private string selectedItem; + public string SelectedItem + { + get { return selectedItem; } + set { selectedItem = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + BindMenu(); + } + + private void BindMenu() + { + bool isAdmin = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + + // build the list of menu items + List items = new List(); + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // add items + items.Add(CreateMenuItem("Vps", "")); + + if(cntx.Quotas.ContainsKey(Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED) + && !cntx.Quotas[Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED].QuotaExhausted + || (PanelSecurity.PackageId == 1 && isAdmin)) + items.Add(CreateMenuItem("ExternalNetwork", "vdc_external_network")); + + if (isAdmin) + items.Add(CreateMenuItem("ManagementNetwork", "vdc_management_network")); + + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_PRIVATE_NETWORK_ENABLED) + && !cntx.Quotas[Quotas.VPS2012_PRIVATE_NETWORK_ENABLED].QuotaExhausted) + items.Add(CreateMenuItem("PrivateNetwork", "vdc_private_network")); + + //items.Add(CreateMenuItem("UserPermissions", "vdc_permissions")); + items.Add(CreateMenuItem("AuditLog", "vdc_audit_log")); + + // selected menu item + for (int i = 0; i < items.Count; i++) + { + if (String.Compare(items[i].Key, SelectedItem, true) == 0) + { + MenuItems.SelectedIndex = i; + break; + } + } + + // bind items + MenuItems.DataSource = items; + MenuItems.DataBind(); + } + + private MenuItem CreateMenuItem(string text, string key) + { + MenuItem item = new MenuItem(); + item.Key = key; + item.Text = GetLocalizedString("Text." + text); + item.Url = HostModule.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key); + return item; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.designer.cs new file mode 100644 index 00000000..625e22b8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class Menu { + + /// + /// MenuItems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList MenuItems; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx new file mode 100644 index 00000000..d5a9c3ea --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx @@ -0,0 +1,75 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ServerTabs.ascx.cs" + Inherits="WebsitePanel.Portal.VPS2012.UserControls.ServerTabs" %> +<%@ Register Src="../../UserControls/Gauge.ascx" TagName="Gauge" TagPrefix="wsp" %> +<%@ Register Src="../../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> + + + + + + + + + + + + + + + + + + + + + + + +
+ +
 
+ + +
+ + +
 
+ + +
+ + +
+
+
+
+ + + + + +
+    + + + + + <%# Eval("Name") %> + + + + + + <%# Eval("Name") %> + + + +
+
+ + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs new file mode 100644 index 00000000..f5b51d3a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs @@ -0,0 +1,230 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class ServerTabs : WebsitePanelControlBase + { + class Tab + { + string id; + string name; + string url; + + public Tab(string id, string name, string url) + { + this.id = id; + this.name = name; + this.url = url; + } + + public string Id + { + get { return this.id; } + set { this.id = value; } + } + + public string Name + { + get { return this.name; } + set { this.name = value; } + } + + public string Url + { + get { return this.url; } + set { this.url = value; } + } + } + + private string selectedTab; + public string SelectedTab + { + get { return selectedTab; } + set { selectedTab = value; } + } + + private BackgroundTask task = null; + + protected void Page_Load(object sender, EventArgs e) + { + BindTabs(); + } + + private void BindTabs() + { + // load item + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + + if (!String.IsNullOrEmpty(vm.CurrentTaskId)) + { + // show panel + TaskTable.Visible = true; + + // bind task details + BindTask(vm); + + return; + } + + if (TaskTable.Visible) + Response.Redirect(Request.Url.ToString()); // refresh screen + + // show tabs + TabsTable.Visible = true; + + // disable timer + refreshTimer.Enabled = false; + + // check if VPS2012 created with error + bool createError = (vm.ProvisioningStatus == VirtualMachineProvisioningStatus.Error); + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // build tabs list + List tabsList = new List(); + + tabsList.Add(CreateTab("vps_general", "Tab.General")); + + if (!createError) + tabsList.Add(CreateTab("vps_config", "Tab.Configuration")); + + if (vm.DvdDriveInstalled && !createError) + tabsList.Add(CreateTab("vps_dvd", "Tab.DVD")); + + if (vm.SnapshotsNumber > 0 && !createError) + tabsList.Add(CreateTab("vps_snapshots", "Tab.Snapshots")); + + if ((vm.ExternalNetworkEnabled || vm.PrivateNetworkEnabled) && !createError) + tabsList.Add(CreateTab("vps_network", "Tab.Network")); + + //tabsList.Add(CreateTab("vps_permissions", "Tab.Permissions")); + //tabsList.Add(CreateTab("vps_tools", "Tab.Tools")); + tabsList.Add(CreateTab("vps_audit_log", "Tab.AuditLog")); + + if (!createError) + tabsList.Add(CreateTab("vps_help", "Tab.Help")); + + + // find selected menu item + int idx = 0; + foreach (Tab tab in tabsList) + { + if (String.Compare(tab.Id, SelectedTab, true) == 0) + break; + idx++; + } + dlTabs.SelectedIndex = idx; + + dlTabs.DataSource = tabsList; + dlTabs.DataBind(); + + // show provision error message + if(createError && idx == 0) + messageBox.ShowErrorMessage("VPS_PROVISION_ERROR"); + } + + private void BindTask(VirtualMachine vm) + { + task = ES.Services.Tasks.GetTaskWithLogRecords(vm.CurrentTaskId, DateTime.MinValue); + if (task == null) + return; + + // bind task details + litTaskName.Text = String.Format("{0} "{1}"", + GetAuditLogTaskName(task.Source, task.TaskName), + task.ItemName); + + // time + litStarted.Text = task.StartDate.ToString("T"); + TimeSpan d = (TimeSpan)(DateTime.Now - task.StartDate); + litElapsed.Text = new TimeSpan(d.Hours, d.Minutes, d.Seconds).ToString(); + + // bind records + repRecords.DataSource = task.GetLogs(); + repRecords.DataBind(); + } + + private Tab CreateTab(string id, string text) + { + return new Tab(id, GetLocalizedString(text), + HostModule.EditUrl("ItemID", PanelRequest.ItemID.ToString(), id, + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void repRecords_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + BackgroundTaskLogRecord record = (BackgroundTaskLogRecord)e.Item.DataItem; + + Literal litRecord = (Literal)e.Item.FindControl("litRecord"); + Gauge gauge = (Gauge)e.Item.FindControl("gauge"); + + if (litRecord != null) + { + string text = record.Text; + + // localize text + string locText = GetSharedLocalizedString("TaskActivity." + text); + if (locText != null) + text = locText; + + // format parameters + if (record.TextParameters != null + && record.TextParameters.Length > 0 + && record.Severity == 0) + text = String.Format(text, record.TextParameters); + + litRecord.Text = text; + + // gauge + gauge.Visible = false; + if (e.Item.ItemIndex == task.GetLogs().Count - 1) + { + if (task.IndicatorCurrent == -1) + litRecord.Text += "..."; + else + { + gauge.Visible = true; + gauge.Total = task.IndicatorMaximum; + gauge.Progress = task.IndicatorCurrent; + } + } + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.designer.cs new file mode 100644 index 00000000..fd9d70f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class ServerTabs { + + /// + /// refreshTimer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.Timer refreshTimer; + + /// + /// TabsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel TabsPanel; + + /// + /// TaskTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable TaskTable; + + /// + /// litTaskName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litTaskName; + + /// + /// locStarted control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locStarted; + + /// + /// litStarted control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litStarted; + + /// + /// locElapsed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locElapsed; + + /// + /// litElapsed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litElapsed; + + /// + /// repRecords control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater repRecords; + + /// + /// TabsTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable TabsTable; + + /// + /// dlTabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList dlTabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx new file mode 100644 index 00000000..b589e4ec --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx @@ -0,0 +1,39 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcAddExternalAddress.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcAddExternalAddress" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AllocatePackageIPAddresses.ascx" TagName="AllocatePackageIPAddresses" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+
+ +
+
+ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.cs new file mode 100644 index 00000000..38ee774d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcAddExternalAddress : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.designer.cs new file mode 100644 index 00000000..37393f5f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.designer.cs @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcAddExternalAddress { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// allocateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.AllocatePackageIPAddresses allocateAddresses; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx new file mode 100644 index 00000000..3df88dc9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx @@ -0,0 +1,34 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcAuditLog.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcAuditLog" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AuditLogControl.ascx" TagName="AuditLogControl" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.cs new file mode 100644 index 00000000..f2fea5eb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcAuditLog : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.designer.cs new file mode 100644 index 00000000..8b560f54 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcAuditLog { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// auditLog control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.AuditLogControl auditLog; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx new file mode 100644 index 00000000..058854d5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx @@ -0,0 +1,580 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcCreateServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcCreate" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="Generation" Src="UserControls/Generation.ascx" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemoryControl" Src="UserControls/DynamicMemoryControl.ascx" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + * + + + + . + + + * + + +
 
+ + + * +
 
+ + + +
 
+ + + + * +
+
+ +
+ + +

+
+ + + + + + + + + + + + +
+ + +
+ + + + + + +
+ + * +
+ + + + + + +
+ + * +
+
+ + + + + + + + + + + +
+ + + * +
+
+ + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+ +
+ + + + +

+
+ +

+ +

+ +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+
+
+ + + + +

+
+ +

+ +

+ + + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+
+ + + + + + + + + + +
+ +
+ +
+ + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
 
+ +
 
+ +
 
+ +
 
+ +
+
+
+
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.cs new file mode 100644 index 00000000..ad7cdbb3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.cs @@ -0,0 +1,392 @@ +// Copyright (c) 2015, 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. + + using System; +using System.Collections.Generic; + using System.Linq; + using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + using WebsitePanel.Portal.Code.Helpers; + using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcCreate : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindFormControls(); + } + + // remove non-required steps + ToggleWizardSteps(); + + // toggle + ToggleControls(); + } + + private void ToggleWizardSteps() + { + // external network + if (!PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED)) + { + wizard.WizardSteps.Remove(stepExternalNetwork); + chkExternalNetworkEnabled.Checked = false; + } + + // private network + if (!PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED)) + { + wizard.WizardSteps.Remove(stepPrivateNetwork); + chkPrivateNetworkEnabled.Checked = false; + } + } + + + private void BindFormControls() + { + var virtualMachine = new VirtualMachine + { + DynamicMemory = new DynamicMemory + { + Buffer = 20, + Priority = 50 + } + }; + + // bind password policy + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.VPS_POLICY, "AdministratorPasswordPolicy"); + + // OS templates + listOperatingSystems.DataSource = ES.Services.VPS2012.GetOperatingSystemTemplates(PanelSecurity.PackageId); + listOperatingSystems.DataBind(); + listOperatingSystems.Items.Insert(0, new ListItem(GetLocalizedString("SelectOsTemplate.Text"), "")); + + // summary letter e-mail + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); + if (package != null) + { + UserInfo user = ES.Services.Users.GetUserById(package.UserId); + if (user != null) + { + chkSendSummary.Checked = true; + txtSummaryEmail.Text = user.Email; + } + } + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // bind CPU cores + int maxCores = ES.Services.VPS2012.GetMaximumCpuCoresNumber(PanelSecurity.PackageId); + + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_CPU_NUMBER)) + { + QuotaValueInfo cpuQuota = cntx.Quotas[Quotas.VPS2012_CPU_NUMBER]; + + if (cpuQuota.QuotaAllocatedValue != -1 + && maxCores > cpuQuota.QuotaAllocatedValue) + maxCores = cpuQuota.QuotaAllocatedValue; + } + + for (int i = 1; i < maxCores + 1; i++) + ddlCpu.Items.Add(i.ToString()); + + ddlCpu.SelectedIndex = ddlCpu.Items.Count - 1; // select last (maximum) item + + // external network details + if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED)) + { + // bind list + PackageIPAddress[] ips = ES.Services.Servers.GetPackageUnassignedIPAddresses(PanelSecurity.PackageId, 0, IPAddressPool.VpsExternalNetwork); + foreach (PackageIPAddress ip in ips) + { + string txt = ip.ExternalIP; + if (!String.IsNullOrEmpty(ip.DefaultGateway)) + txt += "/" + ip.DefaultGateway; + listExternalAddresses.Items.Add(new ListItem(txt, ip.PackageAddressID.ToString())); + } + + // toggle controls + int maxAddresses = listExternalAddresses.Items.Count; + litMaxExternalAddresses.Text = String.Format(GetLocalizedString("litMaxExternalAddresses.Text"), maxAddresses); + if (maxAddresses > 0) + txtExternalAddressesNumber.Text = "1"; + } + + // private network + if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED)) + { + NetworkAdapterDetails nic = ES.Services.VPS2012.GetPrivateNetworkDetails(PanelSecurity.PackageId); + litPrivateNetworkFormat.Text = nic.NetworkFormat; + litPrivateSubnetMask.Text = nic.SubnetMask; + + // set max number + QuotaValueInfo privQuota = cntx.Quotas[Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER]; + int maxPrivate = privQuota.QuotaAllocatedValue; + if (maxPrivate == -1) + maxPrivate = 10; + + // handle DHCP mode + if (nic.IsDHCP) + { + maxPrivate = 0; + ViewState["DHCP"] = true; + } + + txtPrivateAddressesNumber.Text = "1"; + litMaxPrivateAddresses.Text = String.Format(GetLocalizedString("litMaxPrivateAddresses.Text"), maxPrivate); + } + + // RAM size + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_RAM)) + { + QuotaValueInfo ramQuota = cntx.Quotas[Quotas.VPS2012_RAM]; + if (ramQuota.QuotaAllocatedValue == -1) + { + // unlimited RAM + txtRam.Text = ""; + } + else + { + int availSize = ramQuota.QuotaAllocatedValue - ramQuota.QuotaUsedValue; + txtRam.Text = availSize < 0 ? "" : availSize.ToString(); + + if (availSize > 0) + { + virtualMachine.DynamicMemory.Minimum = availSize/2; + virtualMachine.DynamicMemory.Maximum = availSize; + } + } + } + + // HDD size + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_HDD)) + { + QuotaValueInfo hddQuota = cntx.Quotas[Quotas.VPS2012_HDD]; + if (hddQuota.QuotaAllocatedValue == -1) + { + // unlimited HDD + txtHdd.Text = ""; + } + else + { + int availSize = hddQuota.QuotaAllocatedValue - hddQuota.QuotaUsedValue; + txtHdd.Text = availSize < 0 ? "" : availSize.ToString(); + } + } + + // snapshots number + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_SNAPSHOTS_NUMBER)) + { + int snapsNumber = cntx.Quotas[Quotas.VPS2012_SNAPSHOTS_NUMBER].QuotaAllocatedValue; + txtSnapshots.Text = (snapsNumber != -1) ? snapsNumber.ToString() : ""; + txtSnapshots.Enabled = (snapsNumber != 0); + } + + // toggle controls + BindCheckboxOption(chkDvdInstalled, Quotas.VPS2012_DVD_ENABLED); + chkBootFromCd.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_BOOT_CD_ALLOWED); + + BindCheckboxOption(chkStartShutdown, Quotas.VPS2012_START_SHUTDOWN_ALLOWED); + BindCheckboxOption(chkPauseResume, Quotas.VPS2012_PAUSE_RESUME_ALLOWED); + BindCheckboxOption(chkReset, Quotas.VPS2012_RESET_ALOWED); + BindCheckboxOption(chkReboot, Quotas.VPS2012_REBOOT_ALLOWED); + BindCheckboxOption(chkReinstall, Quotas.VPS2012_REINSTALL_ALLOWED); + + // the settings user controls + this.BindSettingsControls(virtualMachine); + } + + private void BindCheckboxOption(CheckBox chk, string quotaName) + { + chk.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, quotaName); + chk.Checked = chk.Enabled; + } + + private void ToggleControls() + { + // send letter + txtSummaryEmail.Enabled = chkSendSummary.Checked; + SummaryEmailValidator.Enabled = chkSendSummary.Checked; + + // external network + bool emptyIps = listExternalAddresses.Items.Count == 0; + EmptyExternalAddressesMessage.Visible = emptyIps; + tableExternalNetwork.Visible = chkExternalNetworkEnabled.Checked && !emptyIps; + chkExternalNetworkEnabled.Enabled = !emptyIps; + chkExternalNetworkEnabled.Checked = chkExternalNetworkEnabled.Checked && !emptyIps; + ExternalAddressesNumberRow.Visible = radioExternalRandom.Checked; + ExternalAddressesListRow.Visible = radioExternalSelected.Checked; + + // private network + tablePrivateNetwork.Visible = chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); + PrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked; + PrivateAddressesListRow.Visible = radioPrivateSelected.Checked; + } + + private void BindSummary() + { + var resultVm = new VirtualMachine(); + + // the user controls + this.SaveSettingsControls(ref resultVm); + this.BindSettingsControls(resultVm); + + // general + litHostname.Text = PortalAntiXSS.Encode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim())); + litOperatingSystem.Text = listOperatingSystems.SelectedItem.Text; + + litSummaryEmail.Text = PortalAntiXSS.Encode(txtSummaryEmail.Text.Trim()); + SummSummaryEmailRow.Visible = chkSendSummary.Checked; + + // config + litCpu.Text = PortalAntiXSS.Encode(ddlCpu.SelectedValue); + litRam.Text = PortalAntiXSS.Encode(txtRam.Text.Trim()); + litHdd.Text = PortalAntiXSS.Encode(txtHdd.Text.Trim()); + litSnapshots.Text = PortalAntiXSS.Encode(txtSnapshots.Text.Trim()); + optionDvdInstalled.Value = chkDvdInstalled.Checked; + optionBootFromCd.Value = chkBootFromCd.Checked; + optionNumLock.Value = chkNumLock.Checked; + optionStartShutdown.Value = chkStartShutdown.Checked; + optionPauseResume.Value = chkPauseResume.Checked; + optionReboot.Value = chkReboot.Checked; + optionReset.Value = chkReset.Checked; + optionReinstall.Value = chkReinstall.Checked; + + // external network + optionExternalNetwork.Value = chkExternalNetworkEnabled.Checked; + SummExternalAddressesNumberRow.Visible = radioExternalRandom.Checked && chkExternalNetworkEnabled.Checked; + litExternalAddressesNumber.Text = PortalAntiXSS.Encode(txtExternalAddressesNumber.Text.Trim()); + SummExternalAddressesListRow.Visible = radioExternalSelected.Checked && chkExternalNetworkEnabled.Checked; + + List ipAddresses = new List(); + foreach (ListItem li in listExternalAddresses.Items) + if (li.Selected) + ipAddresses.Add(li.Text); + litExternalAddresses.Text = PortalAntiXSS.Encode(String.Join(", ", ipAddresses.ToArray())); + + // private network + optionPrivateNetwork.Value = chkPrivateNetworkEnabled.Checked; + SummPrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked && chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); + litPrivateAddressesNumber.Text = PortalAntiXSS.Encode(txtPrivateAddressesNumber.Text.Trim()); + SummPrivateAddressesListRow.Visible = radioPrivateSelected.Checked && chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); + + string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); + litPrivateAddressesList.Text = PortalAntiXSS.Encode(String.Join(", ", privIps)); + + } + + protected void wizard_FinishButtonClick(object sender, WizardNavigationEventArgs e) + { + if (!Page.IsValid) + return; + + try + { + VirtualMachine virtualMachine = new VirtualMachine(); + + // the user controls + this.SaveSettingsControls(ref virtualMachine); + + // collect and prepare data + string hostname = String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim()); + + string adminPassword = (string)ViewState["Password"]; + + // external IPs + List extIps = new List(); + foreach (ListItem li in listExternalAddresses.Items) + if (li.Selected) extIps.Add(Utils.ParseInt(li.Value)); + + // private IPs + string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); + + string summaryEmail = chkSendSummary.Checked ? txtSummaryEmail.Text.Trim() : null; + + // create virtual machine + IntResult res = ES.Services.VPS2012.CreateVirtualMachine(PanelSecurity.PackageId, + hostname, listOperatingSystems.SelectedValue, adminPassword, summaryEmail, + Utils.ParseInt(ddlCpu.SelectedValue), Utils.ParseInt(txtRam.Text.Trim()), + Utils.ParseInt(txtHdd.Text.Trim()), Utils.ParseInt(txtSnapshots.Text.Trim()), + chkDvdInstalled.Checked, chkBootFromCd.Checked, chkNumLock.Checked, + chkStartShutdown.Checked, chkPauseResume.Checked, chkReboot.Checked, chkReset.Checked, chkReinstall.Checked, + chkExternalNetworkEnabled.Checked, Utils.ParseInt(txtExternalAddressesNumber.Text.Trim()), radioExternalRandom.Checked, extIps.ToArray(), + chkPrivateNetworkEnabled.Checked, Utils.ParseInt(txtPrivateAddressesNumber.Text.Trim()), radioPrivateRandom.Checked, privIps, + virtualMachine); + + if (res.IsSuccess) + { + Response.Redirect(EditUrl("ItemID", res.Value.ToString(), "vps_general", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_CREATE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_CREATE", ex); + } + } + + protected void wizard_SideBarButtonClick(object sender, WizardNavigationEventArgs e) + { + if (e.NextStepIndex < e.CurrentStepIndex) + return; + + // save password + if (wizard.ActiveStepIndex == 0) + ViewState["Password"] = password.Password; + + Page.Validate("Vps"); + + if (!Page.IsValid) + e.Cancel = true; + } + + protected void wizard_ActiveStepChanged(object sender, EventArgs e) + { + BindSummary(); + } + + protected void wizard_NextButtonClick(object sender, WizardNavigationEventArgs e) + { + // save password + if (wizard.ActiveStepIndex == 0) + ViewState["Password"] = password.Password; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.designer.cs new file mode 100644 index 00000000..4baed83d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.designer.cs @@ -0,0 +1,1374 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcCreate { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// wizard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Wizard wizard; + + /// + /// stepName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepName; + + /// + /// locNameStepTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNameStepTitle; + + /// + /// locHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHostname; + + /// + /// txtHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHostname; + + /// + /// HostnameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator HostnameValidator; + + /// + /// valCorrectHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectHostname; + + /// + /// txtDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDomain; + + /// + /// DomainValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator DomainValidator; + + /// + /// valNewDomainFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valNewDomainFormat; + + /// + /// locOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOperatingSystem; + + /// + /// listOperatingSystems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList listOperatingSystems; + + /// + /// OperatingSystemValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator OperatingSystemValidator; + + /// + /// locAdminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdminPassword; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.PasswordControl password; + + /// + /// chkSendSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendSummary; + + /// + /// txtSummaryEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSummaryEmail; + + /// + /// SummaryEmailValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SummaryEmailValidator; + + /// + /// stepConfig control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepConfig; + + /// + /// locConfigStepTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locConfigStepTitle; + + /// + /// GenerationSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Generation GenerationSetting; + + /// + /// secResources control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secResources; + + /// + /// ResourcesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ResourcesPanel; + + /// + /// lblCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCpu; + + /// + /// ddlCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlCpu; + + /// + /// locCores control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCores; + + /// + /// lblRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRam; + + /// + /// txtRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRam; + + /// + /// RequireRamValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireRamValidator; + + /// + /// locMB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMB; + + /// + /// lblHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblHdd; + + /// + /// txtHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHdd; + + /// + /// RequireHddValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireHddValidator; + + /// + /// locGB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGB; + + /// + /// DynamicMemorySetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.DynamicMemoryControl DynamicMemorySetting; + + /// + /// secSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSnapshots; + + /// + /// SnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SnapshotsPanel; + + /// + /// locSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots; + + /// + /// txtSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshots; + + /// + /// SnapshotsValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotsValidator; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// chkDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDvdInstalled; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// chkBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkBootFromCd; + + /// + /// chkNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNumLock; + + /// + /// secActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secActions; + + /// + /// ActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ActionsPanel; + + /// + /// chkStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkStartShutdown; + + /// + /// chkReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReset; + + /// + /// chkPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPauseResume; + + /// + /// chkReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReinstall; + + /// + /// chkReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReboot; + + /// + /// stepExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepExternalNetwork; + + /// + /// locExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalNetwork; + + /// + /// chkExternalNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExternalNetworkEnabled; + + /// + /// EmptyExternalAddressesMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl EmptyExternalAddressesMessage; + + /// + /// locNotEnoughExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNotEnoughExternalAddresses; + + /// + /// tableExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tableExternalNetwork; + + /// + /// radioExternalRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalRandom; + + /// + /// ExternalAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesNumberRow; + + /// + /// locExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddresses; + + /// + /// txtExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExternalAddressesNumber; + + /// + /// ExternalAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExternalAddressesValidator; + + /// + /// litMaxExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxExternalAddresses; + + /// + /// radioExternalSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalSelected; + + /// + /// ExternalAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesListRow; + + /// + /// listExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox listExternalAddresses; + + /// + /// locHoldCtrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHoldCtrl; + + /// + /// stepPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepPrivateNetwork; + + /// + /// locPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetwork; + + /// + /// chkPrivateNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPrivateNetworkEnabled; + + /// + /// tablePrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tablePrivateNetwork; + + /// + /// radioPrivateRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateRandom; + + /// + /// PrivateAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesNumberRow; + + /// + /// locPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddresses; + + /// + /// txtPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesNumber; + + /// + /// PrivateAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator PrivateAddressesValidator; + + /// + /// litMaxPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxPrivateAddresses; + + /// + /// radioPrivateSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateSelected; + + /// + /// PrivateAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesListRow; + + /// + /// txtPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesList; + + /// + /// locOnePerLine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOnePerLine; + + /// + /// locPrivateNetworkFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetworkFormat; + + /// + /// litPrivateNetworkFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateNetworkFormat; + + /// + /// locPrivateSubnetMask control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateSubnetMask; + + /// + /// litPrivateSubnetMask control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateSubnetMask; + + /// + /// stepSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepSummary; + + /// + /// locSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSummary; + + /// + /// locNameStepTitle2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNameStepTitle2; + + /// + /// Localize1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize Localize1; + + /// + /// litHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHostname; + + /// + /// Localize2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize Localize2; + + /// + /// litOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litOperatingSystem; + + /// + /// SummSummaryEmailRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummSummaryEmailRow; + + /// + /// locSendSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSendSummary; + + /// + /// litSummaryEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSummaryEmail; + + /// + /// locConfig2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locConfig2; + + /// + /// GenerationSettingsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Generation GenerationSettingsSummary; + + /// + /// locCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCpu; + + /// + /// litCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpu; + + /// + /// locRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRam; + + /// + /// litRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRam; + + /// + /// locHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHdd; + + /// + /// litHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHdd; + + /// + /// locSnapshots2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots2; + + /// + /// litSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSnapshots; + + /// + /// locDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdInstalled; + + /// + /// optionDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionDvdInstalled; + + /// + /// locBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBootFromCd; + + /// + /// optionBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionBootFromCd; + + /// + /// locNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNumLock; + + /// + /// optionNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionNumLock; + + /// + /// locStartShutdownAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locStartShutdownAllowed; + + /// + /// optionStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionStartShutdown; + + /// + /// locPauseResumeAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPauseResumeAllowed; + + /// + /// optionPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPauseResume; + + /// + /// locRebootAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRebootAllowed; + + /// + /// optionReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReboot; + + /// + /// locResetAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locResetAllowed; + + /// + /// optionReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReset; + + /// + /// locReinstallAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locReinstallAllowed; + + /// + /// optionReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReinstall; + + /// + /// locDynamicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDynamicMemory; + + /// + /// DynamicMemoryControlSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.DynamicMemoryControl DynamicMemoryControlSummary; + + /// + /// locExternalNetwork2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalNetwork2; + + /// + /// locExternalNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalNetworkEnabled; + + /// + /// optionExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionExternalNetwork; + + /// + /// SummExternalAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummExternalAddressesNumberRow; + + /// + /// locExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddressesNumber; + + /// + /// litExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExternalAddressesNumber; + + /// + /// SummExternalAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummExternalAddressesListRow; + + /// + /// locExternalAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddressesList; + + /// + /// litExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExternalAddresses; + + /// + /// locPrivateNetwork2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetwork2; + + /// + /// locPrivateNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetworkEnabled; + + /// + /// optionPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPrivateNetwork; + + /// + /// SummPrivateAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummPrivateAddressesNumberRow; + + /// + /// locPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddressesNumber; + + /// + /// litPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateAddressesNumber; + + /// + /// SummPrivateAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummPrivateAddressesListRow; + + /// + /// locPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddressesList; + + /// + /// litPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateAddressesList; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx new file mode 100644 index 00000000..7d150f05 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx @@ -0,0 +1,61 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcExternalNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcExternalNetwork" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PackageIPAddresses.ascx" TagName="PackageIPAddresses" TagPrefix="wsp" %> + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +
+ + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.cs new file mode 100644 index 00000000..e8b3ec31 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.WebPortal; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcExternalNetwork : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + packageAddresses.ManageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.designer.cs new file mode 100644 index 00000000..c31d05c7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcExternalNetwork { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// packageAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.PackageIPAddresses packageAddresses; + + /// + /// secQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas; + + /// + /// QuotasPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel QuotasPanel; + + /// + /// locIPQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locIPQuota; + + /// + /// addressesQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota addressesQuota; + + /// + /// locBandwidthQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBandwidthQuota; + + /// + /// bandwidthQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota bandwidthQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx new file mode 100644 index 00000000..8e1fbfce --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx @@ -0,0 +1,139 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcHome.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcHome" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+ + +
+
+ +
+
+ + + + + + + + + <%# Eval("ItemName") %> + + + + + + + + + <%# Eval("PackageName") %> + + + + + + + <%# Eval("UserName") %> + + + + + + + + + + + +   + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs new file mode 100644 index 00000000..b1adc433 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs @@ -0,0 +1,138 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcHome : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); + searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); + searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP")); + searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); + } + + // toggle columns + bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; + gvServers.Columns[3].Visible = !isUserSelected; + gvServers.Columns[4].Visible = !isUserSelected; + + // check package quotas + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + + btnCreate.Visible = manageAllowed; + btnImport.Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + gvServers.Columns[5].Visible = manageAllowed; // delete column + + // admin operations column + gvServers.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + } + + public string GetServerEditUrl(string itemID) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_general", + "ItemID=" + itemID); + } + + public string GetSpaceHomeUrl(string spaceId) + { + return EditUrl("SpaceID", spaceId, ""); + } + + public string GetUserHomeUrl(int userId) + { + return PortalUtils.GetUserHomePageUrl(userId); + } + + protected void odsServersPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOXES", e.Exception); + e.ExceptionHandled = true; + } + } + + protected void btnCreate_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vdc_create_server")); + } + + protected void btnImport_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vdc_import_server")); + } + + protected void gvServers_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + // get server ID + int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + // go to delete page + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_tools_delete", + "ItemID=" + itemId)); + } + else if (e.CommandName == "Detach") + { + // remove item from meta base + int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + int result = ES.Services.Packages.DetachPackageItem(itemId); + if (result < 0) + { + ShowResultMessage(result); + return; + } + + // refresh the list + gvServers.DataBind(); + } + else if (e.CommandName == "Move") + { + // get server ID + int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + // go to delete page + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_tools_move", + "ItemID=" + itemId)); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.designer.cs new file mode 100644 index 00000000..0425a5ad --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcHome { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnCreate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreate; + + /// + /// btnImport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnImport; + + /// + /// searchBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.SearchBox searchBox; + + /// + /// gvServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvServers; + + /// + /// odsServersPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsServersPaged; + + /// + /// secQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas; + + /// + /// QuotasPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel QuotasPanel; + + /// + /// locVpsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVpsQuota; + + /// + /// vpsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota vpsQuota; + + /// + /// locRamQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRamQuota; + + /// + /// ramQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota ramQuota; + + /// + /// locHddQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHddQuota; + + /// + /// hddQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota hddQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx new file mode 100644 index 00000000..65b9f276 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx @@ -0,0 +1,288 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcImportServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcImportServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="Generation" Src="UserControls/Generation.ascx" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemoryControl" Src="UserControls/DynamicMemoryControl.ascx" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
 
+ +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + +
+ + + + + +
+
+ + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+
+
+ +

+ + +

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.cs new file mode 100644 index 00000000..a9a41098 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.cs @@ -0,0 +1,234 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Portal.Code.Helpers; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcImportServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind hyper-V services + BindHyperVServices(); + + // bind virtual machines + BindVirtualMachines(); + + // bind OS templates + BindOsTemplates(); + + // bind IP addresses + BindExternalAddresses(); + BindManagementAddresses(); + } + + ToggleControls(); + } + + private void ToggleControls() + { + AdminPasswordPanel.Visible = EnableRemoteDesktop.Checked; + RequiredAdminPassword.Enabled = EnableRemoteDesktop.Checked; + VirtualMachinePanel.Visible = (VirtualMachines.SelectedValue != ""); + ExternalAddressesRow.Visible = (ExternalAdapters.SelectedIndex != 0); + ManagementAddressesRow.Visible = (ManagementAdapters.SelectedIndex != 0); + } + + public void BindHyperVServices() + { + // bind + HyperVServices.DataSource = ES.Services.Servers.GetRawServicesByGroupName(ResourceGroups.VPS2012).Tables[0].DefaultView; + HyperVServices.DataBind(); + + // add select value + HyperVServices.Items.Insert(0, new ListItem(GetLocalizedString("SelectHyperVService.Text"), "")); + } + + public void BindVirtualMachines() + { + // clear list + VirtualMachines.Items.Clear(); + + // bind + int serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0); + if (serviceId > 0) + { + VirtualMachines.DataSource = ES.Services.VPS2012.GetVirtualMachinesByServiceId(serviceId); + VirtualMachines.DataBind(); + } + + // add select value + VirtualMachines.Items.Insert(0, new ListItem(GetLocalizedString("SelectVirtualMachine.Text"), "")); + } + + public void BindOsTemplates() + { + // clear list + OsTemplates.Items.Clear(); + + int serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0); + if (serviceId > 0) + { + OsTemplates.DataSource = ES.Services.VPS2012.GetOperatingSystemTemplatesByServiceId(serviceId); + OsTemplates.DataBind(); + } + OsTemplates.Items.Insert(0, new ListItem(GetLocalizedString("SelectOsTemplate.Text"), "")); + } + + public void BindVirtualMachineDetails() + { + int serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0); + string vmId = VirtualMachines.SelectedValue; + if (serviceId > 0 && vmId != "") + { + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineExtendedInfo(serviceId, vmId); + if (vm != null) + { + // bind VM + CpuCores.Text = vm.CpuCores.ToString(); + RamSize.Text = vm.RamSize.ToString(); + HddSize.Text = vm.HddSize.ToString(); + VhdPath.Text = vm.VirtualHardDrivePath; + + this.BindSettingsControls(vm); + + // other settings + NumLockEnabled.Value = vm.NumLockEnabled; + BootFromCd.Value = vm.BootFromCD; + DvdInstalled.Value = vm.DvdDriveInstalled; + + // network adapters + ExternalAdapters.DataSource = vm.Adapters; + ExternalAdapters.DataBind(); + ExternalAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), "")); + + ManagementAdapters.DataSource = vm.Adapters; + ManagementAdapters.DataBind(); + ManagementAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), "")); + } + } + } + + public void BindExternalAddresses() + { + BindAddresses(ExternalAddresses, IPAddressPool.VpsExternalNetwork); + } + + public void BindManagementAddresses() + { + BindAddresses(ManagementAddresses, IPAddressPool.VpsManagementNetwork); + } + + public void BindAddresses(ListBox list, IPAddressPool pool) + { + IPAddressInfo[] ips = ES.Services.Servers.GetUnallottedIPAddresses(PanelSecurity.PackageId, ResourceGroups.VPS2012, pool); + foreach (IPAddressInfo ip in ips) + { + string txt = ip.ExternalIP; + if (!String.IsNullOrEmpty(ip.DefaultGateway)) + txt += "/" + ip.DefaultGateway; + list.Items.Add(new ListItem(txt, ip.AddressId.ToString())); + } + } + + protected void btnImport_Click(object sender, EventArgs e) + { + try + { + // external IPs + List extIps = new List(); + foreach (ListItem li in ExternalAddresses.Items) + if (li.Selected) extIps.Add(Utils.ParseInt(li.Value)); + + // management IPs + int manIp = 0; + foreach (ListItem li in ManagementAddresses.Items) + if (li.Selected) + { + manIp = Utils.ParseInt(li.Value); + break; + } + + // create virtual machine + IntResult res = ES.Services.VPS2012.ImportVirtualMachine(PanelSecurity.PackageId, + Utils.ParseInt(HyperVServices.SelectedValue), + VirtualMachines.SelectedValue, + OsTemplates.SelectedValue, adminPassword.Text, + AllowStartShutdown.Checked, AllowPause.Checked, AllowReboot.Checked, AllowReset.Checked, false, + ExternalAdapters.SelectedValue, extIps.ToArray(), + ManagementAdapters.SelectedValue, manIp); + + if (res.IsSuccess) + { + Response.Redirect(EditUrl("ItemID", res.Value.ToString(), "vps_general", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_IMPORT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_IMPORT", ex); + } + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + } + + protected void HyperVServices_SelectedIndexChanged(object sender, EventArgs e) + { + // bind VMs + BindVirtualMachines(); + + // bind OS templates + BindOsTemplates(); + } + + protected void VirtualMachines_SelectedIndexChanged(object sender, EventArgs e) + { + BindVirtualMachineDetails(); + ToggleControls(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.designer.cs new file mode 100644 index 00000000..eb489aea --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.designer.cs @@ -0,0 +1,645 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcImportServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHyperVService; + + /// + /// HyperVServices control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList HyperVServices; + + /// + /// RequireHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireHyperVService; + + /// + /// locVirtualMachine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVirtualMachine; + + /// + /// VirtualMachines control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList VirtualMachines; + + /// + /// RequiredVirtualMachine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredVirtualMachine; + + /// + /// secOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secOsTemplate; + + /// + /// OsTemplatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel OsTemplatePanel; + + /// + /// locOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOsTemplate; + + /// + /// OsTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList OsTemplates; + + /// + /// RequiredOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredOsTemplate; + + /// + /// EnableRemoteDesktop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox EnableRemoteDesktop; + + /// + /// AdminPasswordPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow AdminPasswordPanel; + + /// + /// locAdminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdminPassword; + + /// + /// adminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox adminPassword; + + /// + /// RequiredAdminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredAdminPassword; + + /// + /// VirtualMachinePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel VirtualMachinePanel; + + /// + /// secConfiguration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secConfiguration; + + /// + /// ConfigurationPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ConfigurationPanel; + + /// + /// GenerationSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Generation GenerationSetting; + + /// + /// locCPU control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCPU; + + /// + /// CpuCores control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal CpuCores; + + /// + /// locRAM control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRAM; + + /// + /// RamSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal RamSize; + + /// + /// locHDD control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHDD; + + /// + /// HddSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal HddSize; + + /// + /// locVhdPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVhdPath; + + /// + /// VhdPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal VhdPath; + + /// + /// DynamicMemorySetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.DynamicMemoryControl DynamicMemorySetting; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// BootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption BootFromCd; + + /// + /// locBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBootFromCd; + + /// + /// NumLockEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption NumLockEnabled; + + /// + /// locNumLockEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNumLockEnabled; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// DvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption DvdInstalled; + + /// + /// locDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdInstalled; + + /// + /// secAllowedActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secAllowedActions; + + /// + /// AllowedActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel AllowedActionsPanel; + + /// + /// AllowStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowStartShutdown; + + /// + /// AllowReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowReboot; + + /// + /// AllowPause control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowPause; + + /// + /// AllowReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowReset; + + /// + /// secExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secExternalNetwork; + + /// + /// ExternalNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ExternalNetworkPanel; + + /// + /// locExternalAdapter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAdapter; + + /// + /// ExternalAdapters control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ExternalAdapters; + + /// + /// ExternalAddressesRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesRow; + + /// + /// locExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddresses; + + /// + /// ExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox ExternalAddresses; + + /// + /// RequiredExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredExternalAddresses; + + /// + /// secManagementNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secManagementNetwork; + + /// + /// ManagementNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ManagementNetworkPanel; + + /// + /// locManagementAdapter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locManagementAdapter; + + /// + /// ManagementAdapters control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ManagementAdapters; + + /// + /// ManagementAddressesRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ManagementAddressesRow; + + /// + /// locManagementAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locManagementAddresses; + + /// + /// ManagementAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox ManagementAddresses; + + /// + /// RequiredManagementAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredManagementAddresses; + + /// + /// btnImport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnImport; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx new file mode 100644 index 00000000..60247599 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx @@ -0,0 +1,39 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcManagementNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcManagementNetwork" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PackageIPAddresses.ascx" TagName="PackageIPAddresses" TagPrefix="wsp" %> + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.cs new file mode 100644 index 00000000..121d9c43 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcManagementNetwork : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.designer.cs new file mode 100644 index 00000000..55cc9f69 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcManagementNetwork { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// packageAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.PackageIPAddresses packageAddresses; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx new file mode 100644 index 00000000..5e4cbd79 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx @@ -0,0 +1,121 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcPermissions.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcPermissions" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.cs new file mode 100644 index 00000000..b36dba6d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcPermissions : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnUpdateVdcPermissions_Click(object sender, EventArgs e) + { + System.Threading.Thread.Sleep(5000); + messageBox.ShowSuccessMessage("VDC_PERMISSIONS_VDC_UPDATED"); + } + + protected void btnUpdateVpsPermissions_Click(object sender, EventArgs e) + { + System.Threading.Thread.Sleep(5000); + messageBox.ShowSuccessMessage("VDC_PERMISSIONS_VPS_UPDATED"); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.designer.cs new file mode 100644 index 00000000..48ccd1ab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcPermissions { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secVdcPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secVdcPermissions; + + /// + /// VdcPermissionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel VdcPermissionsPanel; + + /// + /// gvVdcPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvVdcPermissions; + + /// + /// btnUpdateVdcPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateVdcPermissions; + + /// + /// secVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secVpsPermissions; + + /// + /// VpsPermissionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel VpsPermissionsPanel; + + /// + /// gvVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvVpsPermissions; + + /// + /// btnUpdateVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateVpsPermissions; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx new file mode 100644 index 00000000..694c1296 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx @@ -0,0 +1,98 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcPrivateNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcPrivateNetwork" %> +<%@ Import Namespace="WebsitePanel.Portal" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + +
+
+
+
+ +
+
+ + + + + + + + + <%# Eval("ItemName") %> + + + + + + +   + + + + + + + + + + + +
+ + + + + + + + + + +
+ + +
+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs new file mode 100644 index 00000000..62f0076e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs @@ -0,0 +1,66 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.WebPortal; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcPrivateNetwork : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); + searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); + } + } + + public string GetServerEditUrl(string itemID) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_general", + "ItemID=" + itemID); + } + + protected void odsPrivateAddressesPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOXES", e.Exception); + e.ExceptionHandled = true; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.designer.cs new file mode 100644 index 00000000..94d7c078 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcPrivateNetwork { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// searchBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.SearchBox searchBox; + + /// + /// gvAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvAddresses; + + /// + /// odsPrivateAddressesPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsPrivateAddressesPaged; + + /// + /// secQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas; + + /// + /// QuotasPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel QuotasPanel; + + /// + /// locVpsAddressesQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVpsAddressesQuota; + + /// + /// addressesPerVps control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota addressesPerVps; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx new file mode 100644 index 00000000..2151135a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="VirtualMachineImage.ashx.cs" Class="WebsitePanel.Portal.VPS2012.VirtualMachineImage" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx.cs new file mode 100644 index 00000000..4b09917e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx.cs @@ -0,0 +1,66 @@ +// Copyright (c) 2015, 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. + +using System.Text; +using System.Web; +using System.Web.Services; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + /// + /// Summary description for $codebehindclassname$ + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + public class VirtualMachineImage : IHttpHandler + { + + public void ProcessRequest(HttpContext context) + { + context.Response.Clear(); + context.Response.ContentType = "image/png"; + + int itemId = Utils.ParseInt(context.Request.QueryString["ItemID"]); + byte[] buffer = ES.Services.VPS2012.GetVirtualMachineThumbnail(itemId, + WebsitePanel.Providers.Virtualization.ThumbnailSize.Medium160x120); + if (buffer != null) + { + context.Response.OutputStream.Write(buffer, 0, buffer.Length); + } + } + + public bool IsReusable + { + get + { + return false; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx new file mode 100644 index 00000000..4ce22da5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="VirtualMachineSnapshotImage.ashx.cs" Class="WebsitePanel.Portal.VPS2012.VirtualMachineSnapshotImage" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx.cs new file mode 100644 index 00000000..12ad091c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx.cs @@ -0,0 +1,71 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.Services; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + /// + /// Summary description for $codebehindclassname$ + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + public class VirtualMachineSnapshotImage : IHttpHandler + { + + public void ProcessRequest(HttpContext context) + { + context.Response.Clear(); + context.Response.ContentType = "image/png"; + + HttpRequest req = context.Request; + + int itemId = Utils.ParseInt(req["ItemID"]); + string snapshotId = req["SnapshotID"]; + + byte[] res = ES.Services.VPS2012.GetSnapshotThumbnail(itemId, snapshotId, + WebsitePanel.Providers.Virtualization.ThumbnailSize.Medium160x120); + if (res != null) + { + context.Response.OutputStream.Write(res, 0, res.Length); + } + } + + public bool IsReusable + { + get + { + return false; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx new file mode 100644 index 00000000..84bcae9d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx @@ -0,0 +1,101 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsAddExternalAddress.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsAddExternalAddress" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + +

+ +

+ +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+ +

+ + +

+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.cs new file mode 100644 index 00000000..3cfabfb0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.cs @@ -0,0 +1,119 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsAddExternalAddress : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + ToggleControls(); + + if (!IsPostBack) + { + BindExternalIPAddresses(); + } + } + + private void BindExternalIPAddresses() + { + PackageIPAddress[] ips = ES.Services.Servers.GetPackageUnassignedIPAddresses(PanelSecurity.PackageId, 0, IPAddressPool.VpsExternalNetwork); + foreach (PackageIPAddress ip in ips) + { + string txt = ip.ExternalIP; + if (!String.IsNullOrEmpty(ip.DefaultGateway)) + txt += "/" + ip.DefaultGateway; + listExternalAddresses.Items.Add(new ListItem(txt, ip.PackageAddressID.ToString())); + } + + // toggle controls + int maxAddresses = listExternalAddresses.Items.Count; + litMaxExternalAddresses.Text = String.Format(GetLocalizedString("litMaxExternalAddresses.Text"), maxAddresses); + + bool empty = maxAddresses == 0; + EmptyExternalAddressesMessage.Visible = empty; + ExternalAddressesTable.Visible = !empty; + btnAdd.Enabled = !empty; + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack(); + } + + private void RedirectBack() + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_network", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + private void ToggleControls() + { + // external network + ExternalAddressesNumberRow.Visible = radioExternalRandom.Checked; + ExternalAddressesListRow.Visible = radioExternalSelected.Checked; + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + int number = Utils.ParseInt(txtExternalAddressesNumber.Text.Trim(), 0); + List addressIds = new List(); + foreach (ListItem li in listExternalAddresses.Items) + if (li.Selected) + addressIds.Add(Utils.ParseInt(li.Value, 0)); + + try + { + ResultObject res = ES.Services.VPS2012.AddVirtualMachineExternalIPAddresses(PanelRequest.ItemID, + radioExternalRandom.Checked, number, addressIds.ToArray()); + + if (res.IsSuccess) + { + RedirectBack(); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_ADDING_IP_ADDRESS", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_ADDING_IP_ADDRESS", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.designer.cs new file mode 100644 index 00000000..3608ce14 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.designer.cs @@ -0,0 +1,231 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsAddExternalAddress { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// EmptyExternalAddressesMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl EmptyExternalAddressesMessage; + + /// + /// locNotEnoughExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNotEnoughExternalAddresses; + + /// + /// ExternalAddressesTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable ExternalAddressesTable; + + /// + /// radioExternalRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalRandom; + + /// + /// ExternalAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesNumberRow; + + /// + /// locExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddresses; + + /// + /// txtExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExternalAddressesNumber; + + /// + /// ExternalAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExternalAddressesValidator; + + /// + /// litMaxExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxExternalAddresses; + + /// + /// radioExternalSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalSelected; + + /// + /// ExternalAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesListRow; + + /// + /// listExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox listExternalAddresses; + + /// + /// locHoldCtrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHoldCtrl; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx new file mode 100644 index 00000000..868b526e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx @@ -0,0 +1,96 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsAddPrivateAddress.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsAddPrivateAddress" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + +

+ +

+ + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+ +

+ + +

+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.cs new file mode 100644 index 00000000..76f01916 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.cs @@ -0,0 +1,118 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsAddPrivateAddress : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindControls(); + } + + ToggleControls(); + } + + private void BindControls() + { + // load adapter details + NetworkAdapterDetails nic = ES.Services.VPS2012.GetPrivateNetworkAdapterDetails(PanelRequest.ItemID); + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER)) + { + // set max number + QuotaValueInfo privQuota = cntx.Quotas[Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER]; + int maxPrivate = privQuota.QuotaAllocatedValue; + if (maxPrivate == -1) + maxPrivate = 10; + + maxPrivate -= nic.IPAddresses.Length; + + txtPrivateAddressesNumber.Text = maxPrivate.ToString(); + litMaxPrivateAddresses.Text = String.Format(GetLocalizedString("litMaxPrivateAddresses.Text"), maxPrivate); + btnAdd.Enabled = maxPrivate > 0; + } + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + int number = Utils.ParseInt(txtPrivateAddressesNumber.Text.Trim(), 0); + string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); + + try + { + ResultObject res = ES.Services.VPS2012.AddVirtualMachinePrivateIPAddresses(PanelRequest.ItemID, + radioPrivateRandom.Checked, number, privIps); + + if (res.IsSuccess) + { + RedirectBack(); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_ADDING_IP_ADDRESS", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_ADDING_IP_ADDRESS", ex); + } + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack(); + } + + private void RedirectBack() + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_network", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + private void ToggleControls() + { + // private network + PrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked; + PrivateAddressesListRow.Visible = radioPrivateSelected.Checked; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.designer.cs new file mode 100644 index 00000000..3ebff9d0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.designer.cs @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsAddPrivateAddress { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// tablePrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tablePrivateNetwork; + + /// + /// radioPrivateRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateRandom; + + /// + /// PrivateAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesNumberRow; + + /// + /// locPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddresses; + + /// + /// txtPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesNumber; + + /// + /// PrivateAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator PrivateAddressesValidator; + + /// + /// litMaxPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxPrivateAddresses; + + /// + /// radioPrivateSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateSelected; + + /// + /// PrivateAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesListRow; + + /// + /// txtPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesList; + + /// + /// locOnePerLine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOnePerLine; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx new file mode 100644 index 00000000..f5036c28 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx @@ -0,0 +1,37 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsAuditLog.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsAuditLog" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AuditLogControl.ascx" TagName="AuditLogControl" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.cs new file mode 100644 index 00000000..47d49b34 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsAuditLog : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.designer.cs new file mode 100644 index 00000000..d629a48c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsAuditLog { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// auditLog control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.AuditLogControl auditLog; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx new file mode 100644 index 00000000..39f25576 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx @@ -0,0 +1,262 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsConfiguration.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsConfiguration" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="Generation" Src="UserControls/Generation.ascx" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemoryControl" Src="UserControls/DynamicMemoryControl.ascx" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + +
+ +
+ ******** + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+
+ + + + + + + + + + + +
+ +
+
+ + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + +
+
+
+
+ +

+ +

+ + +
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.cs new file mode 100644 index 00000000..6acbe292 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.cs @@ -0,0 +1,135 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Portal.Code.Helpers; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsConfiguration : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack && Request["action"] == "changed") + messageBox.ShowSuccessMessage("VPS_CHANGE_VM_CONFIGURATION"); + + if (!IsPostBack) + { + // config + BindConfiguration(); + + // bind password policy + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.VPS_POLICY, "AdministratorPasswordPolicy"); + } + } + + private void BindConfiguration() + { + VirtualMachine vm = null; + + try + { + // load machine + vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + + if (vm == null) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM"); + return; + } + + // bind item + litOperatingSystem.Text = vm.OperatingSystemTemplate; + + litCpu.Text = String.Format(GetLocalizedString("CpuCores.Text"), vm.CpuCores); + litRam.Text = String.Format(GetLocalizedString("Ram.Text"), vm.RamSize); + litHdd.Text = String.Format(GetLocalizedString("Hdd.Text"), vm.HddSize); + litSnapshots.Text = vm.SnapshotsNumber.ToString(); + + optionDvdInstalled.Value = vm.DvdDriveInstalled; + optionBootFromCD.Value = vm.BootFromCD; + optionNumLock.Value = vm.NumLockEnabled; + + optionStartShutdown.Value = vm.StartTurnOffAllowed; + optionPauseResume.Value = vm.PauseResumeAllowed; + optionReset.Value = vm.ResetAllowed; + optionReboot.Value = vm.RebootAllowed; + optionReinstall.Value = vm.ReinstallAllowed; + + optionExternalNetwork.Value = vm.ExternalNetworkEnabled; + optionPrivateNetwork.Value = vm.PrivateNetworkEnabled; + + // toggle buttons + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + btnEdit.Visible = manageAllowed; + + this.BindSettingsControls(vm); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM", ex); + } + } + + protected void btnChangePassword_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.ChangeAdministratorPassword(PanelRequest.ItemID, password.Password); + + if (res.IsSuccess) + { + // show success message + messageBox.ShowSuccessMessage("VPS_CHANGE_ADMIN_PASSWORD"); + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_CHANGE_ADMIN_PASSWORD", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_CHANGE_ADMIN_PASSWORD", ex); + } + } + + protected void btnEdit_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_edit_config", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.designer.cs new file mode 100644 index 00000000..0e1944fa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.designer.cs @@ -0,0 +1,492 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsConfiguration { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secSoftware control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSoftware; + + /// + /// SoftwarePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SoftwarePanel; + + /// + /// locOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOperatingSystem; + + /// + /// litOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litOperatingSystem; + + /// + /// locAdministratorPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdministratorPassword; + + /// + /// btnChangePasswordPopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnChangePasswordPopup; + + /// + /// GenerationSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Generation GenerationSetting; + + /// + /// secResources control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secResources; + + /// + /// ResourcesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ResourcesPanel; + + /// + /// lblCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblCpu; + + /// + /// litCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpu; + + /// + /// lblRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblRam; + + /// + /// litRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRam; + + /// + /// lblHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblHdd; + + /// + /// litHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHdd; + + /// + /// DynamicMemorySetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.DynamicMemoryControl DynamicMemorySetting; + + /// + /// secSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSnapshots; + + /// + /// SnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SnapshotsPanel; + + /// + /// locSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots; + + /// + /// litSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSnapshots; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// optionDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionDvdInstalled; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// optionBootFromCD control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionBootFromCD; + + /// + /// optionNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionNumLock; + + /// + /// secActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secActions; + + /// + /// ActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ActionsPanel; + + /// + /// optionStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionStartShutdown; + + /// + /// optionReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReset; + + /// + /// optionPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPauseResume; + + /// + /// optionReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReinstall; + + /// + /// optionReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReboot; + + /// + /// secNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secNetwork; + + /// + /// NetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel NetworkPanel; + + /// + /// optionExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionExternalNetwork; + + /// + /// optionPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPrivateNetwork; + + /// + /// btnEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEdit; + + /// + /// ChangePasswordPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ChangePasswordPanel; + + /// + /// locChangePassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locChangePassword; + + /// + /// locNewPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNewPassword; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.PasswordControl password; + + /// + /// btnChangePassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnChangePassword; + + /// + /// btnCancelChangePassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelChangePassword; + + /// + /// ChangePasswordModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender ChangePasswordModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx new file mode 100644 index 00000000..024aeec9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx @@ -0,0 +1,62 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsDvd.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsDvd" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + +
+ +
+
+
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.cs new file mode 100644 index 00000000..d8be6bad --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.cs @@ -0,0 +1,101 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsDvd : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack && Request["action"] == "inserted") + messageBox.ShowSuccessMessage("VPS_DVD_INSERTED"); + + if (!IsPostBack) + { + BindDvdDisk(); + } + } + + private void BindDvdDisk() + { + LibraryItem disk = ES.Services.VPS2012.GetInsertedDvdDisk(PanelRequest.ItemID); + + if (disk != null) + { + txtInsertedDisk.Text = disk.Name; + btnInsertDisk.Enabled = false; + btnEjectDisk.Enabled = true; + } + else + { + txtInsertedDisk.Text = GetLocalizedString("NoDisk.Text"); + btnInsertDisk.Enabled = true; + btnEjectDisk.Enabled = false; + } + } + + protected void btnInsertDisk_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_insert_dvd", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnEjectDisk_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.EjectDvdDisk(PanelRequest.ItemID); + + if (res.IsSuccess) + { + // re-bind + messageBox.ShowSuccessMessage("VPS_DVD_EJECTED"); + BindDvdDisk(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_EJECT_DVD_DISK", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_EJECT_DVD_DISK", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.designer.cs new file mode 100644 index 00000000..a53e046c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsDvd { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locDvdDrive control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdDrive; + + /// + /// txtInsertedDisk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtInsertedDisk; + + /// + /// btnInsertDisk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnInsertDisk; + + /// + /// btnEjectDisk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEjectDisk; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx new file mode 100644 index 00000000..1d0a2e75 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx @@ -0,0 +1,201 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsEditConfiguration.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsEditConfiguration" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemoryControl" Src="UserControls/DynamicMemoryControl.ascx" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +

+ +

+ + + + + + + + + + + + +
+ + +
+ + + + + + +
+ + * +
+ + + + + + +
+ + * +
+
+ + + + + + + + + + + +
+ + + * +
+
+ + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + +
+ +
+ +
+
+ +

+ + +

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.cs new file mode 100644 index 00000000..21ccc0c6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.cs @@ -0,0 +1,191 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Portal.Code.Helpers; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsEditConfiguration : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindConfiguration(); + } + } + + private void BindConfiguration() + { + VirtualMachine vm = null; + + try + { + // load machine + vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + + if (vm == null) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM"); + return; + } + + // bind CPU cores + int maxCores = ES.Services.VPS2012.GetMaximumCpuCoresNumber(vm.PackageId); + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_CPU_NUMBER)) + { + QuotaValueInfo cpuQuota = cntx.Quotas[Quotas.VPS2012_CPU_NUMBER]; + + if (cpuQuota.QuotaAllocatedValue != -1 + && maxCores > cpuQuota.QuotaAllocatedValue) + maxCores = cpuQuota.QuotaAllocatedValue; + } + + for (int i = 1; i < maxCores + 1; i++) + ddlCpu.Items.Add(i.ToString()); + + // bind item + ddlCpu.SelectedValue = vm.CpuCores.ToString(); + txtRam.Text = vm.RamSize.ToString(); + txtHdd.Text = vm.HddSize.ToString(); + txtSnapshots.Text = vm.SnapshotsNumber.ToString(); + + chkDvdInstalled.Checked = vm.DvdDriveInstalled; + chkBootFromCd.Checked = vm.BootFromCD; + chkNumLock.Checked = vm.NumLockEnabled; + + chkStartShutdown.Checked = vm.StartTurnOffAllowed; + chkPauseResume.Checked = vm.PauseResumeAllowed; + chkReset.Checked = vm.ResetAllowed; + chkReboot.Checked = vm.RebootAllowed; + chkReinstall.Checked = vm.ReinstallAllowed; + + chkExternalNetworkEnabled.Checked = vm.ExternalNetworkEnabled; + chkPrivateNetworkEnabled.Checked = vm.PrivateNetworkEnabled; + + // other quotas + BindCheckboxOption(chkDvdInstalled, Quotas.VPS2012_DVD_ENABLED); + chkBootFromCd.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_BOOT_CD_ALLOWED); + + BindCheckboxOption(chkStartShutdown, Quotas.VPS2012_START_SHUTDOWN_ALLOWED); + BindCheckboxOption(chkPauseResume, Quotas.VPS2012_PAUSE_RESUME_ALLOWED); + BindCheckboxOption(chkReset, Quotas.VPS2012_RESET_ALOWED); + BindCheckboxOption(chkReboot, Quotas.VPS2012_REBOOT_ALLOWED); + BindCheckboxOption(chkReinstall, Quotas.VPS2012_REINSTALL_ALLOWED); + + BindCheckboxOption(chkExternalNetworkEnabled, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED); + BindCheckboxOption(chkPrivateNetworkEnabled, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED); + + this.BindSettingsControls(vm); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM", ex); + } + } + + private void BindCheckboxOption(CheckBox chk, string quotaName) + { + chk.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, quotaName); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack("cancel"); + } + + private void RedirectBack(string action) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_config", + "SpaceID=" + PanelSecurity.PackageId.ToString(), + "action=" + action)); + } + + protected void btnUpdate_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + + try + { + // check rights + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + if (!manageAllowed) + { + return; + } + + VirtualMachine virtualMachine = new VirtualMachine(); + + // the custom provider control + this.SaveSettingsControls(ref virtualMachine); + + ResultObject res = ES.Services.VPS2012.UpdateVirtualMachineConfiguration(PanelRequest.ItemID, + Utils.ParseInt(ddlCpu.SelectedValue), + Utils.ParseInt(txtRam.Text.Trim()), + Utils.ParseInt(txtHdd.Text.Trim()), + Utils.ParseInt(txtSnapshots.Text.Trim()), + chkDvdInstalled.Checked, + chkBootFromCd.Checked, + chkNumLock.Checked, + chkStartShutdown.Checked, + chkPauseResume.Checked, + chkReboot.Checked, + chkReset.Checked, + chkReinstall.Checked, + chkExternalNetworkEnabled.Checked, + chkPrivateNetworkEnabled.Checked, + virtualMachine); + + if (res.IsSuccess) + { + // redirect back + RedirectBack("changed"); + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_CHANGE_VM_CONFIGURATION", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_CHANGE_VM_CONFIGURATION", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.designer.cs new file mode 100644 index 00000000..b0942dc9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.designer.cs @@ -0,0 +1,447 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsEditConfiguration { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// secResources control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secResources; + + /// + /// ResourcesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ResourcesPanel; + + /// + /// lblCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCpu; + + /// + /// ddlCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlCpu; + + /// + /// locCores control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCores; + + /// + /// lblRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRam; + + /// + /// txtRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRam; + + /// + /// RequireRamValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireRamValidator; + + /// + /// locMB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMB; + + /// + /// lblHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblHdd; + + /// + /// txtHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHdd; + + /// + /// RequireHddValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireHddValidator; + + /// + /// locGB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGB; + + /// + /// DynamicMemorySetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.DynamicMemoryControl DynamicMemorySetting; + + /// + /// secSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSnapshots; + + /// + /// SnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SnapshotsPanel; + + /// + /// locSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots; + + /// + /// txtSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshots; + + /// + /// SnapshotsValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotsValidator; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// chkDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDvdInstalled; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// chkBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkBootFromCd; + + /// + /// chkNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNumLock; + + /// + /// secActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secActions; + + /// + /// ActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ActionsPanel; + + /// + /// chkStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkStartShutdown; + + /// + /// chkReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReset; + + /// + /// chkPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPauseResume; + + /// + /// chkReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReinstall; + + /// + /// chkReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReboot; + + /// + /// secNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secNetwork; + + /// + /// NetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel NetworkPanel; + + /// + /// chkExternalNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExternalNetworkEnabled; + + /// + /// chkPrivateNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPrivateNetworkEnabled; + + /// + /// btnUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdate; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx new file mode 100644 index 00000000..ef3ec791 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx @@ -0,0 +1,295 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsGeneral.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsGeneral" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Gauge.ascx" TagName="Gauge" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + +
+ + + + + + + + + + +
+ +   + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + + + + + + + + + + + +
    + + +
  • + +
  • +
    +
    +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ +
+
+
+ +
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.cs new file mode 100644 index 00000000..5f768272 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.cs @@ -0,0 +1,304 @@ +// Copyright (c) 2015, 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. + +using System; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Virtualization; +using System.Collections.Generic; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsGeneral : WebsitePanelModuleBase + { + private class ActionButton + { + public string Text { get; set; } + public string Command { get; set; } + public string Style { get; set; } + public string OnClientClick { get; set; } + } + + protected void Page_Load(object sender, EventArgs e) + { + BindGeneralDetails(); + } + + private void BindGeneralDetails() + { + VirtualMachine item = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + if (!String.IsNullOrEmpty(item.CurrentTaskId) + || item.ProvisioningStatus == VirtualMachineProvisioningStatus.Error) + { + DetailsTable.Visible = false; + return; + } + + VirtualMachine vm = null; + try + { + vm = ES.Services.VPS2012.GetVirtualMachineGeneralDetails(PanelRequest.ItemID); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_GET_VM_DETAILS", ex); + } + + if (vm != null) + { + bool displayRDP = (Request.Browser.Browser == "IE" + && Request.Browser.ActiveXControls + && Request.Browser.VBScript + && vm.State != VirtualMachineState.Off + && vm.State != VirtualMachineState.Paused + && vm.State != VirtualMachineState.Saved + && item.RemoteDesktopEnabled); + lnkHostname.Text = item.Hostname.ToUpper(); + lnkHostname.Visible = displayRDP; + + litHostname.Text = item.Hostname.ToUpper(); + litHostname.Visible = !displayRDP; + + litDomain.Text = item.Domain; + + if (!IsPostBack) + { + // set host name change form + txtHostname.Text = item.Hostname; + txtDomain.Text = item.Domain; + } + + litRdpPageUrl.Text = Page.ResolveUrl("~/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx?ItemID=" + PanelRequest.ItemID + "&Resolution="); + + TimeSpan uptime = TimeSpan.FromMilliseconds(vm.Uptime); + uptime = uptime.Subtract(TimeSpan.FromMilliseconds(uptime.Milliseconds)); + litUptime.Text = uptime.ToString(); + litStatus.Text = GetLocalizedString("State." + vm.State); + litCreated.Text = vm.CreatedDate.ToString(); + litHeartbeat.Text = GetLocalizedString("Heartbeat." + vm.Heartbeat); + + // CPU + cpuGauge.Progress = vm.CpuUsage; + litCpuPercentage.Text = String.Format(GetLocalizedString("CpuPercentage.Text"), vm.CpuUsage); + + // RAM + if (vm.RamSize > 0) + { + var totalRam = vm.RamSize; + + if (vm.DynamicMemory != null && vm.DynamicMemory.Enabled) + totalRam = vm.DynamicMemory.Maximum; + + int ramPercent = Convert.ToInt32((float)vm.RamUsage / (float)totalRam * 100); + ramGauge.Total = totalRam; + ramGauge.Progress = vm.RamUsage; + litRamPercentage.Text = String.Format(GetLocalizedString("MemoryPercentage.Text"), ramPercent); + litRamUsage.Text = String.Format(GetLocalizedString("MemoryUsage.Text"), vm.RamUsage, totalRam); + } + + // HDD + if (vm.HddLogicalDisks != null && vm.HddLogicalDisks.Length > 0) + { + HddRow.Visible = true; + + int freeHdd = 0; + int sizeHdd = 0; + + foreach (LogicalDisk disk in vm.HddLogicalDisks) + { + freeHdd += disk.FreeSpace; + sizeHdd += disk.Size; + } + + int usedHdd = sizeHdd - freeHdd; + + int hddPercent = Convert.ToInt32((float)usedHdd / (float)sizeHdd * 100); + hddGauge.Total = sizeHdd; + hddGauge.Progress = usedHdd; + litHddPercentage.Text = String.Format(GetLocalizedString("HddPercentage.Text"), hddPercent); + litHddUsage.Text = String.Format(GetLocalizedString("HddUsage.Text"), freeHdd, sizeHdd, vm.HddLogicalDisks.Length); + } + + // update image + imgThumbnail.ImageUrl = + String.Format("~/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx?ItemID={0}&rnd={1}", + PanelRequest.ItemID, DateTime.Now.Ticks); + + // load virtual machine meta item + VirtualMachine vmi = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + + // draw buttons + List buttons = new List(); + + if (vmi.StartTurnOffAllowed + && (vm.State == VirtualMachineState.Off + || vm.State == VirtualMachineState.Saved)) + buttons.Add(CreateActionButton("Start", "start.png")); + + if (vm.State == VirtualMachineState.Running) + { + if(vmi.RebootAllowed) + buttons.Add(CreateActionButton("Reboot", "reboot.png")); + + if(vmi.StartTurnOffAllowed) + buttons.Add(CreateActionButton("ShutDown", "shutdown.png")); + } + + if (vmi.StartTurnOffAllowed + && (vm.State == VirtualMachineState.Running + || vm.State == VirtualMachineState.Paused)) + buttons.Add(CreateActionButton("TurnOff", "turnoff.png")); + + if (vmi.PauseResumeAllowed + && vm.State == VirtualMachineState.Running) + buttons.Add(CreateActionButton("Pause", "pause.png")); + + if (vmi.PauseResumeAllowed + && vm.State == VirtualMachineState.Paused) + buttons.Add(CreateActionButton("Resume", "start2.png")); + + if (vmi.ResetAllowed + && (vm.State == VirtualMachineState.Running + || vm.State == VirtualMachineState.Paused)) + buttons.Add(CreateActionButton("Reset", "reset2.png")); + + repButtons.DataSource = buttons; + repButtons.DataBind(); + + // other actions + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + btnChangeHostnamePopup.Visible = manageAllowed; + } + else + { + DetailsTable.Visible = false; + messageBox.ShowErrorMessage("VPS_LOAD_VM_ITEM"); + } + } + + private ActionButton CreateActionButton(string command, string icon) + { + ActionButton btn = new ActionButton(); + btn.Command = command; + btn.Style = String.Format( + "background: transparent url({0}) left center no-repeat;", + PortalUtils.GetThemedImage(String.Format("VPS/{0}", icon))); + + string localizedText = GetLocalizedString("Command." + command); + btn.Text = localizedText != null ? localizedText : command; + + btn.OnClientClick = GetLocalizedString("OnClientClick." + command); + + return btn; + } + + protected void repButtons_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) + { + try + { + ResultObject res = null; + + string command = e.CommandName; + if (command == "Snapshot") + { + res = ES.Services.VPS2012.CreateSnapshot(PanelRequest.ItemID); + } + else + { + // parse command + VirtualMachineRequestedState state = (VirtualMachineRequestedState)Enum.Parse( + typeof(VirtualMachineRequestedState), command, true); + + // call services + res = ES.Services.VPS2012.ChangeVirtualMachineState(PanelRequest.ItemID, state); + } + + // check results + if (res.IsSuccess) + { + if (command == "Snapshot") + { + // go to snapshots screen + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_snapshots", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + else + { + // return + BindGeneralDetails(); + return; + } + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_CHANGE_VM_STATE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_CHANGE_VM_STATE", ex); + } + } + + protected void btnChangeHostname_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + + try + { + string hostname = String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim()); + + ResultObject res = ES.Services.VPS2012.UpdateVirtualMachineHostName(PanelRequest.ItemID, + hostname, chkUpdateComputerName.Checked); + + if (res.IsSuccess) + { + // show success message + messageBox.ShowSuccessMessage("VPS_CHANGE_VM_HOSTNAME"); + BindGeneralDetails(); + + // clear fields + //txtHostname.Text = ""; + //txtDomain.Text = ""; + chkUpdateComputerName.Checked = false; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_CHANGE_VM_HOSTNAME", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_CHANGE_VM_HOSTNAME", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.designer.cs new file mode 100644 index 00000000..11517fb3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.designer.cs @@ -0,0 +1,609 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsGeneral { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// operationTimer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.Timer operationTimer; + + /// + /// litRdpPageUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRdpPageUrl; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// DetailsTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable DetailsTable; + + /// + /// locHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHostname; + + /// + /// lnkHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkHostname; + + /// + /// litHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHostname; + + /// + /// btnChangeHostnamePopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnChangeHostnamePopup; + + /// + /// RdpPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel RdpPanel; + + /// + /// imgRdc control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgRdc; + + /// + /// locRdpText control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRdpText; + + /// + /// lnkRdpFull control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdpFull; + + /// + /// lnkRdp800 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdp800; + + /// + /// lnkRdp1024 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdp1024; + + /// + /// lnkRdp1280 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdp1280; + + /// + /// RdpPopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.PopupControlExtender RdpPopup; + + /// + /// RdpShadow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.DropShadowExtender RdpShadow; + + /// + /// locDomainTop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomainTop; + + /// + /// litDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDomain; + + /// + /// UpdatePanel2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel2; + + /// + /// locStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locStatus; + + /// + /// litStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litStatus; + + /// + /// locUptime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locUptime; + + /// + /// litUptime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litUptime; + + /// + /// locHeartbeat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHeartbeat; + + /// + /// litHeartbeat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHeartbeat; + + /// + /// locCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCreated; + + /// + /// litCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCreated; + + /// + /// UpdatePanel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel1; + + /// + /// imgThumbnail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgThumbnail; + + /// + /// repButtons control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater repButtons; + + /// + /// UpdatePanel3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel3; + + /// + /// locCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCpu; + + /// + /// cpuGauge control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Gauge cpuGauge; + + /// + /// litCpuPercentage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpuPercentage; + + /// + /// litCpuUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpuUsage; + + /// + /// locRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRam; + + /// + /// ramGauge control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Gauge ramGauge; + + /// + /// litRamPercentage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRamPercentage; + + /// + /// litRamUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRamUsage; + + /// + /// HddRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow HddRow; + + /// + /// locHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHdd; + + /// + /// hddGauge control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Gauge hddGauge; + + /// + /// litHddPercentage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHddPercentage; + + /// + /// litHddUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHddUsage; + + /// + /// ChangeHostnamePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ChangeHostnamePanel; + + /// + /// locChangeHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locChangeHostname; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locHostname1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHostname1; + + /// + /// txtHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHostname; + + /// + /// HostnameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator HostnameValidator; + + /// + /// valCorrectHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectHostname; + + /// + /// locDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomain; + + /// + /// txtDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDomain; + + /// + /// DomainValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator DomainValidator; + + /// + /// valNewDomainFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valNewDomainFormat; + + /// + /// chkUpdateComputerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkUpdateComputerName; + + /// + /// btnChangeHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnChangeHostname; + + /// + /// btnCancelHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelHostname; + + /// + /// ChangeHostnameModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender ChangeHostnameModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx new file mode 100644 index 00000000..096a9f3c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx @@ -0,0 +1,76 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsHelp.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsHelp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+
+
+ + +
+ +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.cs new file mode 100644 index 00000000..1a91d5ee --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.cs @@ -0,0 +1,93 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsHelp : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSummaryInfo(); + } + } + + private void BindSummaryInfo() + { + // bind user details + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); + if (package != null) + { + UserInfo user = ES.Services.Users.GetUserById(package.UserId); + if (user != null) + { + txtTo.Text = user.Email; + } + } + + // load template + string content = ES.Services.VPS2012.GetVirtualMachineSummaryText(PanelRequest.ItemID); + if (content != null) + litContent.Text = content; + } + + protected void btnSend_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.SendVirtualMachineSummaryLetter( + PanelRequest.ItemID, txtTo.Text.Trim(), txtBCC.Text.Trim()); + + if (res.IsSuccess) + { + // bind tree + messageBox.ShowSuccessMessage("VPS_ERROR_SEND_SUMMARY_LETTER"); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "ERROR_SEND_SUMMARY_LETTER", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_SEND_SUMMARY_LETTER", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.designer.cs new file mode 100644 index 00000000..1016a4c5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.designer.cs @@ -0,0 +1,168 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsHelp { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secEmail; + + /// + /// EmailPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel EmailPanel; + + /// + /// tblEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblEmail; + + /// + /// lblTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTo; + + /// + /// txtTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTo; + + /// + /// valRequireEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireEmail; + + /// + /// lblBCC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBCC; + + /// + /// txtBCC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBCC; + + /// + /// btnSend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSend; + + /// + /// litContent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litContent; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx new file mode 100644 index 00000000..7e329730 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx @@ -0,0 +1,71 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsInsertDvd.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsInsertDvd" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + +

+ +

+ + + + + + +
+ <%# Eval("Name") %> +
+
+ <%# Eval("Description") %> +
+
+
+ + + + + + +
+
+
+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.cs new file mode 100644 index 00000000..ccb35e77 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.cs @@ -0,0 +1,95 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsInsertDvd : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindDisks(); + } + } + + private void BindDisks() + { + gvDisks.DataSource = ES.Services.VPS2012.GetLibraryDisks(PanelRequest.ItemID); + gvDisks.DataBind(); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack("cancel"); + } + + protected void gvDisks_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "insert") + { + string path = e.CommandArgument.ToString(); + + try + { + ResultObject res = ES.Services.VPS2012.InsertDvdDisk(PanelRequest.ItemID, path); + + if (res.IsSuccess) + { + // return + RedirectBack("inserted"); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_INSERT_DVD_DISK", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_INSERT_DVD_DISK", ex); + } + } + } + + private void RedirectBack(string action) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_dvd", + "SpaceID=" + PanelSecurity.PackageId.ToString(), + "action=" + action)); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.designer.cs new file mode 100644 index 00000000..52f9dfb6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsInsertDvd { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// gvDisks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvDisks; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx new file mode 100644 index 00000000..83e4b413 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx @@ -0,0 +1,200 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsNetwork" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+   + +
+
+
+
+
+
+ +
+ + + +
+ +
+ + 0 +
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + <%# Eval("IPAddress")%> + + + + +
+   + +
+
+
+
+
+
+ +
+ + + +
+ +
+ + 0 +
+ +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.cs new file mode 100644 index 00000000..c8b86a8e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.cs @@ -0,0 +1,296 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsNetwork : WebsitePanelModuleBase + { + VirtualMachine vm = null; + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindVirtualMachine(); + BindExternalAddresses(); + BindPrivateAddresses(); + ToggleButtons(); + } + } + + private void BindVirtualMachine() + { + vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + + // external network + if (!vm.ExternalNetworkEnabled) + { + secExternalNetwork.Visible = false; + ExternalNetworkPanel.Visible = false; + } + + // private network + if (!vm.PrivateNetworkEnabled) + { + secPrivateNetwork.Visible = false; + PrivateNetworkPanel.Visible = false; + } + } + + private void BindExternalAddresses() + { + // load details + NetworkAdapterDetails nic = ES.Services.VPS2012.GetExternalNetworkAdapterDetails(PanelRequest.ItemID); + + // bind details + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + { + if (ip.IsPrimary) + { + litExtAddress.Text = ip.IPAddress; + litExtSubnet.Text = ip.SubnetMask; + litExtGateway.Text = ip.DefaultGateway; + break; + } + } + lblTotalExternal.Text = nic.IPAddresses.Length.ToString(); + + // bind IP addresses + gvExternalAddresses.DataSource = nic.IPAddresses; + gvExternalAddresses.DataBind(); + } + + private void BindPrivateAddresses() + { + // load details + NetworkAdapterDetails nic = ES.Services.VPS2012.GetPrivateNetworkAdapterDetails(PanelRequest.ItemID); + + // bind details + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + { + if (ip.IsPrimary) + { + litPrivAddress.Text = ip.IPAddress; + break; + } + } + litPrivSubnet.Text = nic.SubnetMask; + litPrivFormat.Text = nic.NetworkFormat; + lblTotalPrivate.Text = nic.IPAddresses.Length.ToString(); + + // bind IP addresses + gvPrivateAddresses.DataSource = nic.IPAddresses; + gvPrivateAddresses.DataBind(); + + if (nic.IsDHCP) + { + PrivateAddressesPanel.Visible = false; + litPrivAddress.Text = GetLocalizedString("Automatic.Text"); + } + } + + private void ToggleButtons() + { + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + + btnAddExternalAddress.Visible = manageAllowed; + btnSetPrimaryExternal.Visible = manageAllowed; + btnDeleteExternal.Visible = manageAllowed; + gvExternalAddresses.Columns[0].Visible = manageAllowed; + + btnAddPrivateAddress.Visible = manageAllowed; + btnSetPrimaryPrivate.Visible = manageAllowed; + btnDeletePrivate.Visible = manageAllowed; + gvPrivateAddresses.Columns[0].Visible = manageAllowed; + } + + protected void btnAddExternalAddress_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_add_external_ip", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnAddPrivateAddress_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_add_private_ip", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnSetPrimaryPrivate_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvPrivateAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.SetVirtualMachinePrimaryPrivateIPAddress(PanelRequest.ItemID, addressIds[0]); + + if (res.IsSuccess) + { + BindPrivateAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_SETTING_PRIMARY_IP", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_SETTING_PRIMARY_IP", ex); + } + } + + protected void btnDeletePrivate_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvPrivateAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.DeleteVirtualMachinePrivateIPAddresses(PanelRequest.ItemID, addressIds); + + if (res.IsSuccess) + { + BindPrivateAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_DELETING_IP_ADDRESS", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETING_IP_ADDRESS", ex); + } + } + + protected void btnSetPrimaryExternal_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvExternalAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.SetVirtualMachinePrimaryExternalIPAddress(PanelRequest.ItemID, addressIds[0]); + + if (res.IsSuccess) + { + BindExternalAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_SETTING_PRIMARY_IP", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_SETTING_PRIMARY_IP", ex); + } + } + + protected void btnDeleteExternal_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvExternalAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.DeleteVirtualMachineExternalIPAddresses(PanelRequest.ItemID, addressIds); + + if (res.IsSuccess) + { + BindExternalAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_DELETING_IP_ADDRESS", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETING_IP_ADDRESS", ex); + } + } + + private int[] GetSelectedItems(GridView gv) + { + List items = new List(); + + for (int i = 0; i < gv.Rows.Count; i++) + { + GridViewRow row = gv.Rows[i]; + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + if (chkSelect.Checked) + items.Add((int)gv.DataKeys[i].Value); + } + + return items.ToArray(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.designer.cs new file mode 100644 index 00000000..942ea529 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.designer.cs @@ -0,0 +1,339 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsNetwork { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secExternalNetwork; + + /// + /// ExternalNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ExternalNetworkPanel; + + /// + /// locExtAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExtAddress; + + /// + /// litExtAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExtAddress; + + /// + /// locExtSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExtSubnet; + + /// + /// litExtSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExtSubnet; + + /// + /// locExtGateway control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExtGateway; + + /// + /// litExtGateway control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExtGateway; + + /// + /// gvExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvExternalAddresses; + + /// + /// btnAddExternalAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddExternalAddress; + + /// + /// btnSetPrimaryExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetPrimaryExternal; + + /// + /// btnDeleteExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDeleteExternal; + + /// + /// locTotalExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalExternal; + + /// + /// lblTotalExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalExternal; + + /// + /// secPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPrivateNetwork; + + /// + /// PrivateNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PrivateNetworkPanel; + + /// + /// locPrivAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivAddress; + + /// + /// litPrivAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivAddress; + + /// + /// locPrivFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivFormat; + + /// + /// litPrivFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivFormat; + + /// + /// locPrivSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivSubnet; + + /// + /// litPrivSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivSubnet; + + /// + /// PrivateAddressesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PrivateAddressesPanel; + + /// + /// gvPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPrivateAddresses; + + /// + /// btnAddPrivateAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddPrivateAddress; + + /// + /// btnSetPrimaryPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetPrimaryPrivate; + + /// + /// btnDeletePrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDeletePrivate; + + /// + /// locTotalPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalPrivate; + + /// + /// lblTotalPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalPrivate; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx new file mode 100644 index 00000000..d95158a7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx @@ -0,0 +1,75 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsPermissions.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsPermissions" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.cs new file mode 100644 index 00000000..56fd13fc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsPermissions : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.designer.cs new file mode 100644 index 00000000..095004cc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.designer.cs @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsPermissions { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// chkOverride control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkOverride; + + /// + /// gvVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvVpsPermissions; + + /// + /// btnUpdateVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateVpsPermissions; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx new file mode 100644 index 00000000..c345ce97 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx @@ -0,0 +1,146 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsSnapshots.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsSnapshots" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + +
+ +
+ +
+
+ + + + + + + + +
+ +
+ +
+
+ +     + + +
+ +

+ + +

+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+ +
+
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.cs new file mode 100644 index 00000000..26a0cfae --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.cs @@ -0,0 +1,262 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsSnapshots : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSnapshotsTree(); + } + } + + private void BindSnapshotsTree() + { + VirtualMachineSnapshot[] snapshots = ES.Services.VPS2012.GetVirtualMachineSnapshots(PanelRequest.ItemID); + + // clear tree + SnapshotsTree.Nodes.Clear(); + + // fill tree by root nodes + AddChildNodes(SnapshotsTree.Nodes, null, snapshots); + + // select first node + if (SnapshotsTree.Nodes.Count > 0) + { + SnapshotsTree.Nodes[0].Selected = true; + } + + // refresh + BindSelectedNode(); + + // quotas + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + snapshotsQuota.QuotaUsedValue = snapshots.Length; + snapshotsQuota.QuotaValue = vm.SnapshotsNumber; + btnTakeSnapshot.Enabled = snapshots.Length < vm.SnapshotsNumber; + } + + private void BindSelectedNode() + { + TreeNode node = SnapshotsTree.SelectedNode; + + btnApply.Enabled = + btnRename.Enabled = + btnDelete.Enabled = + btnDeleteSubtree.Enabled = + SnapshotDetailsPanel.Visible = (node != null); + + NoSnapshotsPanel.Visible = (SnapshotsTree.Nodes.Count == 0); + + if (node != null) + { + // set name + txtSnapshotName.Text = node.Text; + + // load snapshot details + VirtualMachineSnapshot snapshot = ES.Services.VPS2012.GetSnapshot(PanelRequest.ItemID, node.Value); + if (snapshot != null) + litCreated.Text = snapshot.Created.ToString(); + + // set image + imgThumbnail.ImageUrl = + string.Format("~/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx?ItemID={0}&SnapshotID={1}&rnd={2}", + PanelRequest.ItemID, HttpUtility.UrlEncode(node.Value), DateTime.Now.Ticks); + } + } + + private void AddChildNodes(TreeNodeCollection parent, string parentId, VirtualMachineSnapshot[] snapshots) + { + foreach (VirtualMachineSnapshot snapshot in snapshots) + { + if (snapshot.ParentId == parentId) + { + // add node + TreeNode node = new TreeNode(snapshot.Name, snapshot.Id); + node.Expanded = true; + node.ImageUrl = PortalUtils.GetThemedImage("VPS/snapshot.png"); + parent.Add(node); + + // check if the current + if (snapshot.IsCurrent) + { + TreeNode nowNode = new TreeNode(GetLocalizedString("Now.Text"), ""); + nowNode.ImageUrl = PortalUtils.GetThemedImage("VPS/start2.png"); + nowNode.SelectAction = TreeNodeSelectAction.None; + node.ChildNodes.Add(nowNode); + } + + // fill children + AddChildNodes(node.ChildNodes, snapshot.Id, snapshots); + } + } + } + + protected void btnTakeSnapshot_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.CreateSnapshot(PanelRequest.ItemID); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_TAKE_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_TAKE_SNAPSHOT", ex); + } + } + + protected void btnApply_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.ApplySnapshot(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_APPLY_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_APPLY_SNAPSHOT", ex); + } + } + + protected void btnRenameSnapshot_Click(object sender, EventArgs e) + { + try + { + string newName = txtSnapshotName.Text.Trim(); + ResultObject res = ES.Services.VPS2012.RenameSnapshot(PanelRequest.ItemID, GetSelectedSnapshot(), newName); + + if (res.IsSuccess) + { + // bind tree + SnapshotsTree.SelectedNode.Text = newName; + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_RENAME_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_RENAME_SNAPSHOT", ex); + } + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.DeleteSnapshot(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE_SNAPSHOT", ex); + } + } + + protected void btnDeleteSubtree_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.DeleteSnapshotSubtree(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE_SNAPSHOT_SUBTREE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE_SNAPSHOT_SUBTREE", ex); + } + } + + private string GetSelectedSnapshot() + { + return SnapshotsTree.SelectedNode.Value; + } + + protected void SnapshotsTree_SelectedNodeChanged(object sender, EventArgs e) + { + BindSelectedNode(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.designer.cs new file mode 100644 index 00000000..7b57c599 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.designer.cs @@ -0,0 +1,267 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsSnapshots { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnTakeSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnTakeSnapshot; + + /// + /// SnapshotsTree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TreeView SnapshotsTree; + + /// + /// NoSnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl NoSnapshotsPanel; + + /// + /// locNoSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNoSnapshots; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// snapshotsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer snapshotsQuota; + + /// + /// SnapshotDetailsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableCell SnapshotDetailsPanel; + + /// + /// imgThumbnail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgThumbnail; + + /// + /// locCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCreated; + + /// + /// litCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCreated; + + /// + /// btnApply control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnApply; + + /// + /// btnRename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnRename; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDelete; + + /// + /// btnDeleteSubtree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDeleteSubtree; + + /// + /// RenamePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel RenamePanel; + + /// + /// locRenameSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRenameSnapshot; + + /// + /// txtSnapshotName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshotName; + + /// + /// SnapshotNameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotNameValidator; + + /// + /// btnRenameSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRenameSnapshot; + + /// + /// btnCancelRename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelRename; + + /// + /// RenameSnapshotModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender RenameSnapshotModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx new file mode 100644 index 00000000..3ec46195 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx @@ -0,0 +1,56 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsTools.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsTools" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + <%-- + + + --%> + + + + +
+ + + +
+ + + +
+
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.cs new file mode 100644 index 00000000..18d5fff1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsTools : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnReinstall_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_tools_reinstall", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_tools_delete", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.designer.cs new file mode 100644 index 00000000..bd6726f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsTools { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// locDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDelete; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx new file mode 100644 index 00000000..88a8006a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx @@ -0,0 +1,75 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsMoveServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsMoveServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +

+ + +

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.cs new file mode 100644 index 00000000..a5a2b367 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.cs @@ -0,0 +1,112 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsMoveServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindHyperVServices(); + BindSourceService(); + } + } + + public void BindHyperVServices() + { + // bind + HyperVServices.DataSource = ES.Services.Servers.GetRawServicesByGroupName(ResourceGroups.VPS2012).Tables[0].DefaultView; + HyperVServices.DataBind(); + + // add select value + HyperVServices.Items.Insert(0, new ListItem(GetLocalizedString("SelectHyperVService.Text"), "")); + } + + private void BindSourceService() + { + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + if (vm == null) + ReturnBack(); + + ListItem sourceItem = null; + foreach (ListItem item in HyperVServices.Items) + { + if (item.Value == vm.ServiceId.ToString()) + { + sourceItem = item; + SourceHyperVService.Text = item.Text; + break; + } + } + + if (sourceItem != null) + HyperVServices.Items.Remove(sourceItem); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + ReturnBack(); + } + + private void ReturnBack() + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + } + + protected void btnMove_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + + // move item + int destinationServiceId = Utils.ParseInt(HyperVServices.SelectedValue); + int result = ES.Services.Packages.MovePackageItem(PanelRequest.ItemID, destinationServiceId); + if (result < 0) + { + ShowResultMessage(result); + return; + } + + // redirect to properties screen + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_general", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.designer.cs new file mode 100644 index 00000000..9ce6aa99 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsMoveServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSourceService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSourceService; + + /// + /// SourceHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal SourceHyperVService; + + /// + /// locDestinationService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDestinationService; + + /// + /// HyperVServices control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList HyperVServices; + + /// + /// RequiredHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredHyperVService; + + /// + /// btnMove control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnMove; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx new file mode 100644 index 00000000..b0ed67de --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx @@ -0,0 +1,92 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsToolsDeleteServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsToolsDeleteServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +

+ +

+

+ +

+

+ +

+ +
+ + + + + + + + + + + + + + +
+ +
+ +
+ + + * +
+
+ +

+ + +

+
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.cs new file mode 100644 index 00000000..d8715d75 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.cs @@ -0,0 +1,116 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsToolsDeleteServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindFormDetails(); + } + + ToogleControls(); + } + + private void ToogleControls() + { + txtExportPath.Visible = chkExport.Checked; + ExportPathValidator.Enabled = chkExport.Checked; + } + + private void BindFormDetails() + { + // load VM item + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + if (!String.IsNullOrEmpty(vm.CurrentTaskId)) + { + messageBox.ShowWarningMessage("VPS_PROVISIONING_PROCESS"); + btnDelete.Enabled = false; + return; + } + + // load export settings + if (PanelSecurity.EffectiveUser.Role == WebsitePanel.EnterpriseServer.UserRole.Administrator) + { + txtExportPath.Text = ES.Services.VPS2012.GetDefaultExportPath(PanelRequest.ItemID); + } + else + { + AdminOptionsPanel.Visible = false; + } + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + if (!chkConfirmDelete.Checked) + { + messageBox.ShowWarningMessage("VPS_DELETE_CONFIRM"); + return; + } + + // delete machine + try + { + ResultObject res = ES.Services.VPS2012.DeleteVirtualMachine(PanelRequest.ItemID, + chkSaveFiles.Checked, chkExport.Checked, txtExportPath.Text.Trim()); + + if (res.IsSuccess) + { + // return to the list + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.designer.cs new file mode 100644 index 00000000..4186b99a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.designer.cs @@ -0,0 +1,186 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsToolsDeleteServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// locDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDescription; + + /// + /// chkConfirmDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkConfirmDelete; + + /// + /// AdminOptionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl AdminOptionsPanel; + + /// + /// locAdminOptions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdminOptions; + + /// + /// chkSaveFiles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSaveFiles; + + /// + /// chkExport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExport; + + /// + /// txtExportPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExportPath; + + /// + /// ExportPathValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExportPathValidator; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx new file mode 100644 index 00000000..fa853be3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx @@ -0,0 +1,109 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsToolsReinstallServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsToolsReinstallServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +

+ +

+

+ +

+

+ +

+ + + + + + + + + +
+ + + +
+ +
       + +
+
+ + + + + + + + + + +
+ +
+ +
+ + + * +
+ +

+ + + +

+
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.cs new file mode 100644 index 00000000..c0efc5f2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.cs @@ -0,0 +1,58 @@ +// Copyright (c) 2015, 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. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsToolsReinstallServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_tools", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnUpdate_Click(object sender, EventArgs e) + { + if (!chkConfirmReinstall.Checked) + { + messageBox.ShowWarningMessage("VPS_REINSTALL_CONFIRM"); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.designer.cs new file mode 100644 index 00000000..2c8b35d1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.designer.cs @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsToolsReinstallServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// locDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDescription; + + /// + /// chkConfirmReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkConfirmReinstall; + + /// + /// locPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPassword; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.PasswordControl password; + + /// + /// chkPreserveExistingFiles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPreserveExistingFiles; + + /// + /// locPreserveHelp control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPreserveHelp; + + /// + /// AdminOptionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable AdminOptionsPanel; + + /// + /// chkSaveVhd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSaveVhd; + + /// + /// chkExport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExport; + + /// + /// txtExportPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExportPath; + + /// + /// ExportPathValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExportPathValidator; + + /// + /// btnReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnReinstall; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index c9d9d90e..00fa7463 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -169,9 +169,11 @@ + + @@ -189,13 +191,14 @@ + - + @@ -283,9 +286,51 @@ OrganizationSettingsTabs.ascx ASPXCodeBehind + + HostedSharePointEnterpriseBackupSiteCollection.ascx + ASPXCodeBehind + OrganizationSettingsTabs.ascx + + HostedSharePointEnterpriseBackupSiteCollection.ascx + + + HostedSharePointEnterpriseEditSiteCollection.ascx + ASPXCodeBehind + + + HostedSharePointEnterpriseEditSiteCollection.ascx + + + HostedSharePointEnterpriseSiteCollections.ascx + ASPXCodeBehind + + + HostedSharePointEnterpriseSiteCollections.ascx + + + HostedSharePointEnterpriseRestoreSiteCollection.ascx + ASPXCodeBehind + + + HostedSharePointEnterpriseRestoreSiteCollection.ascx + + + HostedSharePointEnterpriseStorageSettings.ascx + ASPXCodeBehind + + + HostedSharePointEnterpriseStorageSettings.ascx + + + HostedSharePointEnterpriseStorageUsage.ascx + ASPXCodeBehind + + + HostedSharePointEnterpriseStorageUsage.ascx + HyperV2012R2_Settings.ascx ASPXCodeBehind @@ -297,6 +342,10 @@ UserPasswordExpirationNotificationView.ascx ASPXCodeBehind + + Connect.aspx + ASPXCodeBehind + UserPasswordExpirationNotificationView.ascx @@ -314,12 +363,240 @@ SettingsUserPasswordResetLetter.ascx - - HyperV2012R2_Create.ascx ASPXCodeBehind - - HyperV2012R2_Create.ascx + + Connect.aspx + + + TestVirtualMachineTemplate.aspx + ASPXCodeBehind + + + TestVirtualMachineTemplate.aspx + + + Breadcrumb.ascx + ASPXCodeBehind + + + Breadcrumb.ascx + + + DynamicMemoryControl.ascx + ASPXCodeBehind + + + DynamicMemoryControl.ascx + + + FormTitle.ascx + ASPXCodeBehind + + + FormTitle.ascx + + + Generation.ascx + ASPXCodeBehind + + + Generation.ascx + + + Menu.ascx + ASPXCodeBehind + + + Menu.ascx + + + ServerTabs.ascx + ASPXCodeBehind + + + ServerTabs.ascx + + + VdcAddExternalAddress.ascx + ASPXCodeBehind + + + VdcAddExternalAddress.ascx + + + VdcAuditLog.ascx + ASPXCodeBehind + + + VdcAuditLog.ascx + + + VdcCreateServer.ascx + ASPXCodeBehind + + + VdcCreateServer.ascx + + + VdcExternalNetwork.ascx + ASPXCodeBehind + + + VdcExternalNetwork.ascx + + + VdcHome.ascx + ASPXCodeBehind + + + VdcHome.ascx + + + VdcImportServer.ascx + ASPXCodeBehind + + + VdcImportServer.ascx + + + VdcManagementNetwork.ascx + ASPXCodeBehind + + + VdcManagementNetwork.ascx + + + VdcPermissions.ascx + ASPXCodeBehind + + + VdcPermissions.ascx + + + VdcPrivateNetwork.ascx + ASPXCodeBehind + + + VdcPrivateNetwork.ascx + + + VirtualMachineImage.ashx + + + VirtualMachineSnapshotImage.ashx + + + VpsDetailsAddExternalAddress.ascx + ASPXCodeBehind + + + VpsDetailsAddExternalAddress.ascx + + + VpsDetailsAddPrivateAddress.ascx + ASPXCodeBehind + + + VpsDetailsAddPrivateAddress.ascx + + + VpsDetailsAuditLog.ascx + ASPXCodeBehind + + + VpsDetailsAuditLog.ascx + + + VpsDetailsConfiguration.ascx + ASPXCodeBehind + + + VpsDetailsConfiguration.ascx + + + VpsDetailsDvd.ascx + ASPXCodeBehind + + + VpsDetailsDvd.ascx + + + VpsDetailsEditConfiguration.ascx + ASPXCodeBehind + + + VpsDetailsEditConfiguration.ascx + + + VpsDetailsGeneral.ascx + ASPXCodeBehind + + + VpsDetailsGeneral.ascx + + + VpsDetailsHelp.ascx + ASPXCodeBehind + + + VpsDetailsHelp.ascx + + + VpsDetailsInsertDvd.ascx + ASPXCodeBehind + + + VpsDetailsInsertDvd.ascx + + + VpsDetailsNetwork.ascx + ASPXCodeBehind + + + VpsDetailsNetwork.ascx + + + VpsDetailsPermissions.ascx + ASPXCodeBehind + + + VpsDetailsPermissions.ascx + + + VpsDetailsSnapshots.ascx + ASPXCodeBehind + + + VpsDetailsSnapshots.ascx + + + VpsDetailsTools.ascx + ASPXCodeBehind + + + VpsDetailsTools.ascx + + + VpsMoveServer.ascx + ASPXCodeBehind + + + VpsMoveServer.ascx + + + VpsToolsDeleteServer.ascx + ASPXCodeBehind + + + VpsToolsDeleteServer.ascx + + + VpsToolsReinstallServer.ascx + ASPXCodeBehind + + + VpsToolsReinstallServer.ascx SmarterMail100_EditAccount.ascx @@ -1527,46 +1804,46 @@ UserSelector.ascx - + HostedSharePointBackupSiteCollection.ascx ASPXCodeBehind - + HostedSharePointBackupSiteCollection.ascx - + HostedSharePointEditSiteCollection.ascx ASPXCodeBehind - + HostedSharePointEditSiteCollection.ascx - + HostedSharePointRestoreSiteCollection.ascx ASPXCodeBehind - + HostedSharePointRestoreSiteCollection.ascx - + HostedSharePointSiteCollections.ascx ASPXCodeBehind - + HostedSharePointSiteCollections.ascx - + HostedSharePointStorageSettings.ascx ASPXCodeBehind - + HostedSharePointStorageSettings.ascx - + HostedSharePointStorageUsage.ascx ASPXCodeBehind - + HostedSharePointStorageUsage.ascx @@ -4591,11 +4868,50 @@ + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4646,10 +4962,25 @@ - + Designer - + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + Designer @@ -4857,6 +5188,105 @@ + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + @@ -5949,6 +6379,7 @@ Designer + @@ -6203,12 +6634,12 @@ - - - - - - + + + + + + @@ -6242,7 +6673,7 @@ - + Designer @@ -6250,7 +6681,7 @@ - + Designer @@ -6676,16 +7107,16 @@ Designer - + Designer - + Designer - + Designer - + Designer @@ -7004,6 +7435,8 @@ + + Designer diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj index b375ef76..207bab8e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj @@ -105,6 +105,7 @@ + @@ -154,19 +155,36 @@ + + + + + + + + + + + + + + + + + @@ -176,7 +194,9 @@ + + @@ -196,6 +216,24 @@ + + + + + + + + + + + + + + + + + + @@ -276,7 +314,9 @@ Designer - + + Designer + @@ -295,6 +335,10 @@ + + + + diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index 4f45afb7..ec152a55 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -35,8 +35,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs REM %WSDL% %SERVER_URL%/ecStorehouse.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs /namespace:WebsitePanel.Ecommerce.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs -%WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs +REM %WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs REM %WSDL% %SERVER_URL%/esExchangeHostedEdition.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs @@ -47,6 +47,9 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\FilesProxy.cs REM %WSDL% %SERVER_URL%/esHostedSharePointServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersProxy.cs +REM %WSDL% %SERVER_URL%/esHostedSharePointServersEnt.asmx /out:.\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersEntProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersEntProxy.cs + REM %WSDL% %SERVER_URL%/esImport.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ImportProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ImportProxy.cs @@ -56,8 +59,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OCSProxy.cs REM %WSDL% %SERVER_URL%/esOperatingSystems.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs -%WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs +REM %WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs REM %WSDL% %SERVER_URL%/esPackages.asmx /out:.\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs @@ -83,6 +86,9 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\UsersProxy.cs REM %WSDL% %SERVER_URL%/esVirtualizationServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy.cs +REM %WSDL% %SERVER_URL%/esVirtualizationServer2012.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy2012.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy2012.cs + REM %WSDL% %SERVER_URL%/esWebApplicationGallery.asmx /out:.\WebsitePanel.EnterpriseServer.Client\WebApplicationGalleryProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebApplicationGalleryProxy.cs diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index 1ed0de0e..cd4f2b8a 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -17,8 +17,8 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\DatabaseServerProxy.cs REM %WSDL% %SERVER_URL%/DNSServer.asmx /out:.\WebsitePanel.Server.Client\DnsServerProxy.cs /namespace:WebsitePanel.Providers.DNS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\DnsServerProxy.cs -%WSDL% %SERVER_URL%/ExchangeServer.asmx /out:.\WebsitePanel.Server.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.Providers.Exchange /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerProxy.cs +REM %WSDL% %SERVER_URL%/ExchangeServer.asmx /out:.\WebsitePanel.Server.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.Providers.Exchange /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerProxy.cs REM %WSDL% %SERVER_URL%/ExchangeServerHostedEdition.asmx /out:.\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs /namespace:WebsitePanel.Providers.ExchangeHostedEdition /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs @@ -26,6 +26,9 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs REM %WSDL% %SERVER_URL%/HostedSharePointServer.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerProxy.cs +%WSDL% %SERVER_URL%/HostedSharePointServerEnt.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields +%WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs + REM %WSDL% %SERVER_URL%/OCSEdgeServer.asmx /out:.\WebsitePanel.Server.Client\OCSEdgeServerProxy.cs /namespace:WebsitePanel.Providers.OCS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OCSEdgeServerProxy.cs @@ -35,8 +38,8 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OCSServerProxy.cs REM %WSDL% %SERVER_URL%/OperatingSystem.asmx /out:.\WebsitePanel.Server.Client\OperatingSystemProxy.cs /namespace:WebsitePanel.Providers.OS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OperatingSystemProxy.cs -%WSDL% %SERVER_URL%/Organizations.asmx /out:.\WebsitePanel.Server.Client\OrganizationProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\OrganizationProxy.cs +REM %WSDL% %SERVER_URL%/Organizations.asmx /out:.\WebsitePanel.Server.Client\OrganizationProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OrganizationProxy.cs REM %WSDL% %SERVER_URL%/ServiceProvider.asmx /out:.\WebsitePanel.Server.Client\ServiceProviderProxy.cs /namespace:WebsitePanel.Providers /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ServiceProviderProxy.cs