diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index c18c693f..6ba97450 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -12630,4 +12630,59 @@ SET Password = @Password, OneTimePasswordState = 0 WHERE UserID = @UserID RETURN -GO \ No newline at end of file +GO + +-- HyperV for config file +alter table ServiceProperties +alter column PropertyValue nvarchar(MAX) NULL +Go + + + + + +ALTER PROCEDURE [dbo].[UpdateServiceProperties] +( + @ServiceID int, + @Xml ntext +) +AS + +-- delete old properties +BEGIN TRAN +DECLARE @idoc int +--Create an internal representation of the XML document. +EXEC sp_xml_preparedocument @idoc OUTPUT, @xml + +-- Execute a SELECT statement that uses the OPENXML rowset provider. +DELETE FROM ServiceProperties +WHERE ServiceID = @ServiceID +AND PropertyName COLLATE Latin1_General_CI_AS IN +( + SELECT PropertyName + FROM OPENXML(@idoc, '/properties/property', 1) + WITH (PropertyName nvarchar(50) '@name') +) + +INSERT INTO ServiceProperties +( + ServiceID, + PropertyName, + PropertyValue +) +SELECT + @ServiceID, + PropertyName, + PropertyValue +FROM OPENXML(@idoc, '/properties/property',1) WITH +( + PropertyName nvarchar(50) '@name', + PropertyValue nvarchar(MAX) '@value' +) as PV + +-- remove document +exec sp_xml_removedocument @idoc + +COMMIT TRAN +RETURN +Go \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs index c957f141..2b8acf39 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs @@ -165,12 +165,11 @@ namespace WebsitePanel.EnterpriseServer { // load service settings StringDictionary settings = ServerController.GetServiceSettings(serviceId); - string path = settings["OsTemplatesPath"]; + string xml = settings["OsTemplates"]; - // get proxy - VirtualizationServer2012 vs = GetVirtualizationProxy(serviceId); + var config = new ConfigFile(xml); - return vs.GetLibraryItems(path); + return config.LibraryItems; } #endregion @@ -601,10 +600,7 @@ namespace WebsitePanel.EnterpriseServer private static string GetCorrectTemplateFilePath(string templatesPath, string osTemplateFile) { - if (osTemplateFile.Trim().EndsWith(".vhdx")) - return Path.Combine(templatesPath, osTemplateFile); - - return Path.Combine(templatesPath, osTemplateFile + ".vhd"); + return Path.Combine(templatesPath, osTemplateFile); } internal static void CreateVirtualMachineInternal(string taskId, VirtualMachine vm, LibraryItem osTemplate, @@ -2159,12 +2155,11 @@ namespace WebsitePanel.EnterpriseServer // load service settings StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); - string path = settings["DvdLibraryPath"]; + string xml = settings["DvdLibrary"]; - // get proxy - VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + var config = new ConfigFile(xml); - return vs.GetLibraryItems(path); + return config.LibraryItems; } public static ResultObject InsertDvdDisk(int itemId, string isoPath) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Config/ConfigFile.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Config/ConfigFile.cs new file mode 100644 index 00000000..56925c78 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Config/ConfigFile.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; + +namespace WebsitePanel.Providers.Virtualization +{ + public class ConfigFile + { + const string resultTemplate = @" + + + {0} +"; + + const string itemTemplate = @" + + {4} + {5} + + {6} + + + "; + + const string sysprepTemplate = @""; + + public ConfigFile(string xml) + { + Xml = xml; + Load(xml); + } + + public ConfigFile(LibraryItem[] libraryItems) + { + LibraryItems = libraryItems; + Load(libraryItems); + } + + + public LibraryItem[] LibraryItems { get; private set; } + + public string Xml { get; private set; } + + + private void Load(string xmlText) + { + // create list + List items = new List(); + + if (string.IsNullOrEmpty(xmlText)) + { + LibraryItems = items.ToArray(); + return; + } + + // load xml + XmlDocument xml = new XmlDocument(); + xml.LoadXml(xmlText); + + XmlNodeList nodeItems = xml.SelectNodes("/items/item"); + + foreach (XmlNode nodeItem in nodeItems) + { + LibraryItem item = new LibraryItem(); + item.Path = nodeItem.Attributes["path"].Value; + + // optional attributes + if (nodeItem.Attributes["diskSize"] != null) + item.DiskSize = Int32.Parse(nodeItem.Attributes["diskSize"].Value); + + if (nodeItem.Attributes["legacyNetworkAdapter"] != null) + item.LegacyNetworkAdapter = Boolean.Parse(nodeItem.Attributes["legacyNetworkAdapter"].Value); + + item.ProcessVolume = 0; // process (extend and sysprep) 1st volume by default + if (nodeItem.Attributes["processVolume"] != null) + item.ProcessVolume = Int32.Parse(nodeItem.Attributes["processVolume"].Value); + + if (nodeItem.Attributes["remoteDesktop"] != null) + item.RemoteDesktop = Boolean.Parse(nodeItem.Attributes["remoteDesktop"].Value); + + // inner nodes + item.Name = nodeItem.SelectSingleNode("name").InnerText; + var descriptionNode = nodeItem.SelectSingleNode("description"); + if (descriptionNode != null) + item.Description = descriptionNode.InnerText; + + // sysprep files + XmlNodeList nodesSyspep = nodeItem.SelectNodes("provisioning/sysprep"); + List sysprepFiles = new List(); + foreach (XmlNode nodeSyspep in nodesSyspep) + { + if (nodeSyspep.Attributes["file"] != null) + sysprepFiles.Add(nodeSyspep.Attributes["file"].Value); + } + item.SysprepFiles = sysprepFiles.ToArray(); + + // vmconfig + XmlNode nodeVmConfig = nodeItem.SelectSingleNode("provisioning/vmconfig"); + if (nodeVmConfig != null) + { + if (nodeVmConfig.Attributes["computerName"] != null) + item.ProvisionComputerName = Boolean.Parse(nodeVmConfig.Attributes["computerName"].Value); + + if (nodeVmConfig.Attributes["administratorPassword"] != null) + item.ProvisionAdministratorPassword = + Boolean.Parse(nodeVmConfig.Attributes["administratorPassword"].Value); + + if (nodeVmConfig.Attributes["networkAdapters"] != null) + item.ProvisionNetworkAdapters = Boolean.Parse(nodeVmConfig.Attributes["networkAdapters"].Value); + } + + items.Add(item); + } + + LibraryItems = items.ToArray(); + } + + private void Load(LibraryItem[] libraryItems) + { + List items = new List(); + + foreach (var libraryItem in libraryItems) + { + var sysprep = ""; + + if (libraryItem.SysprepFiles != null && libraryItem.SysprepFiles.Any()) + sysprep = string.Join("", libraryItem.SysprepFiles.Select(s => string.Format(sysprepTemplate, s)).ToArray()); + + items.Add(string.Format(itemTemplate, libraryItem.Path, libraryItem.LegacyNetworkAdapter, + libraryItem.RemoteDesktop, libraryItem.ProcessVolume, libraryItem.Name, libraryItem.Description, + sysprep, libraryItem.ProvisionComputerName, libraryItem.ProvisionAdministratorPassword, + libraryItem.ProvisionNetworkAdapters)); + } + + Xml = string.Format(resultTemplate, string.Join("", items.ToArray())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/LibraryItem.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Config/LibraryItem.cs similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/LibraryItem.cs rename to WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Config/LibraryItem.cs diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs index 479f1bc8..16807d3d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs @@ -77,9 +77,6 @@ namespace WebsitePanel.Providers.Virtualization JobResult RemoveKVPItems(string vmId, string[] itemNames); JobResult ModifyKVPItems(string vmId, KvpExchangeDataItem[] items); - // Library - LibraryItem[] GetLibraryItems(string path); - // Storage VirtualHardDiskInfo GetVirtualHardDiskInfo(string vhdPath); MountedDiskInfo MountVirtualHardDisk(string vhdPath); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 71bd8ac8..4877804e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -315,6 +315,7 @@ Code + @@ -325,7 +326,7 @@ Code - + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs index 6670be2b..771bc9db 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs @@ -877,87 +877,6 @@ namespace WebsitePanel.Providers.Virtualization } #endregion - #region Library - public LibraryItem[] GetLibraryItems(string path) - { - path = Path.Combine(FileUtils.EvaluateSystemVariables(path), Constants.LIBRARY_INDEX_FILE_NAME); - - // convert to UNC if it is a remote computer - path = VdsHelper.ConvertToUNC(ServerNameSettings, path); - - if (!File.Exists(path)) - { - HostedSolutionLog.LogWarning("The folder does not contain 'index.xml' file: {0}", path); - return null; - } - - // create list - List items = new List(); - - // load xml - XmlDocument xml = new XmlDocument(); - xml.Load(path); - - XmlNodeList nodeItems = xml.SelectNodes("/items/item"); - - if (nodeItems.Count == 0) - HostedSolutionLog.LogWarning("index.xml found, but contains 0 items: {0}", path); - - foreach (XmlNode nodeItem in nodeItems) - { - LibraryItem item = new LibraryItem(); - item.Path = nodeItem.Attributes["path"].Value; - - // optional attributes - if (nodeItem.Attributes["diskSize"] != null) - item.DiskSize = Int32.Parse(nodeItem.Attributes["diskSize"].Value); - - if (nodeItem.Attributes["legacyNetworkAdapter"] != null) - item.LegacyNetworkAdapter = Boolean.Parse(nodeItem.Attributes["legacyNetworkAdapter"].Value); - - item.ProcessVolume = 0; // process (extend and sysprep) 1st volume by default - if (nodeItem.Attributes["processVolume"] != null) - item.ProcessVolume = Int32.Parse(nodeItem.Attributes["processVolume"].Value); - - if (nodeItem.Attributes["remoteDesktop"] != null) - item.RemoteDesktop = Boolean.Parse(nodeItem.Attributes["remoteDesktop"].Value); - - // inner nodes - item.Name = nodeItem.SelectSingleNode("name").InnerText; - item.Description = nodeItem.SelectSingleNode("description").InnerText; - - // sysprep files - XmlNodeList nodesSyspep = nodeItem.SelectNodes("provisioning/sysprep"); - List sysprepFiles = new List(); - foreach (XmlNode nodeSyspep in nodesSyspep) - { - if (nodeSyspep.Attributes["file"] != null) - sysprepFiles.Add(nodeSyspep.Attributes["file"].Value); - } - item.SysprepFiles = sysprepFiles.ToArray(); - - // vmconfig - XmlNode nodeVmConfig = nodeItem.SelectSingleNode("provisioning/vmconfig"); - if (nodeVmConfig != null) - { - if (nodeVmConfig.Attributes["computerName"] != null) - item.ProvisionComputerName = Boolean.Parse(nodeVmConfig.Attributes["computerName"].Value); - - if (nodeVmConfig.Attributes["administratorPassword"] != null) - item.ProvisionAdministratorPassword = Boolean.Parse(nodeVmConfig.Attributes["administratorPassword"].Value); - - if (nodeVmConfig.Attributes["networkAdapters"] != null) - item.ProvisionNetworkAdapters = Boolean.Parse(nodeVmConfig.Attributes["networkAdapters"].Value); - } - - items.Add(item); - } - - return items.ToArray(); - } - - #endregion - #region KVP public List GetKVPItems(string vmId) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs index fcc0f0f6..2e586b60 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs @@ -541,25 +541,6 @@ namespace WebsitePanel.Server } #endregion - #region Library - [WebMethod, SoapHeader("settings")] - public LibraryItem[] GetLibraryItems(string path) - { - try - { - Log.WriteStart("'{0}' GetLibraryItems", ProviderSettings.ProviderName); - LibraryItem[] result = VirtualizationProvider.GetLibraryItems(path); - Log.WriteEnd("'{0}' GetLibraryItems", ProviderSettings.ProviderName); - return result; - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' GetLibraryItems", ProviderSettings.ProviderName), ex); - throw; - } - } - #endregion - #region KVP items [WebMethod, SoapHeader("settings")] public List GetKVPItems(string vmId) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HyperV2012R2_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HyperV2012R2_Settings.ascx.resx index 6f5392eb..b36c2719 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HyperV2012R2_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HyperV2012R2_Settings.ascx.resx @@ -443,4 +443,76 @@ The following substitution variables can be used in the pattern:<br/> Replication Server: + + Add DVD + + + Add OS Template + + + Remove + + + Remove + + + Can set an Administrator password + + + Can set a computer name + + + Can set Ip addresses + + + Use legacy adapter + + + Enter DVD description + + + Enter DVD file name + + + Enter DVD name + + + Description: + + + File name (with extension): + + + DVD Library + + + Name: + + + Index of the volume to expand: + + + Sysprep files (separated by ';'): + + + File name (with extension): + + + Name: + + + OS Templates + + + Enter OS template file name + + + Enter OS template name + + + Enter OS template process volume + + + Process volume should be a positive number + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx index b427d9a7..4c488b1d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx @@ -62,16 +62,7 @@
- - - - - - - - - + @@ -82,16 +73,6 @@ Text="*" meta:resourcekey="ExportedVpsPathValidator" Display="Dynamic" SetFocusOnError="true" /> - - - - - - - - -
@@ -137,6 +118,165 @@
+
+ + + + + + + + +
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ <%--
--%> +
+
+
+
+ +
+ + + + +
+ + + + + +
+ + + +
+
+ +
+ <%--
--%> +
+
+
+
+ +
+ + + + + + + + +
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + +
+ + + + +
+
+ +
+ <%--
--%> +
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs index dc710b28..a0748702 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs @@ -61,7 +61,6 @@ namespace WebsitePanel.Portal.ProviderControls // general settings txtVpsRootFolder.Text = settings["RootFolder"]; - txtOSTemplatesPath.Text = settings["OsTemplatesPath"]; txtExportedVpsPath.Text = settings["ExportedVpsPath"]; // CPU @@ -69,8 +68,15 @@ namespace WebsitePanel.Portal.ProviderControls txtCpuReserve.Text = settings["CpuReserve"]; txtCpuWeight.Text = settings["CpuWeight"]; + // OS Templates + txtOSTemplatesPath.Text = settings["OsTemplatesPath"]; + repOsTemplates.DataSource = new ConfigFile(settings["OsTemplates"]).LibraryItems; //ES.Services.VPS2012.GetOperatingSystemTemplatesByServiceId(PanelRequest.ServiceId).ToList(); + repOsTemplates.DataBind(); + // DVD library txtDvdLibraryPath.Text = settings["DvdLibraryPath"]; + repDvdLibrary.DataSource = new ConfigFile(settings["DvdLibrary"]).LibraryItems; + repDvdLibrary.DataBind(); // VHD type radioVirtualDiskType.SelectedValue = settings["VirtualDiskType"]; @@ -132,7 +138,6 @@ namespace WebsitePanel.Portal.ProviderControls // general settings settings["RootFolder"] = txtVpsRootFolder.Text.Trim(); - settings["OsTemplatesPath"] = txtOSTemplatesPath.Text.Trim(); settings["ExportedVpsPath"] = txtExportedVpsPath.Text.Trim(); // CPU @@ -140,7 +145,12 @@ namespace WebsitePanel.Portal.ProviderControls settings["CpuReserve"] = txtCpuReserve.Text.Trim(); settings["CpuWeight"] = txtCpuWeight.Text.Trim(); + // OS Templates + settings["OsTemplates"] = GetConfigXml(GetOsTemplates()); + settings["OsTemplatesPath"] = txtOSTemplatesPath.Text.Trim(); + // DVD library + settings["DvdLibrary"] = GetConfigXml(GetDvds()); settings["DvdLibraryPath"] = txtDvdLibraryPath.Text.Trim(); // VHD type @@ -301,7 +311,7 @@ namespace WebsitePanel.Portal.ProviderControls ReplicaPathErrorTr.Visible = ReplicaErrorTr.Visible = false; if (IsReplicaServer) BindCertificates(); if (EnabledReplica) BindReplicaServices(); - } + } protected void radioServer_SelectedIndexChanged(object sender, EventArgs e) { @@ -334,6 +344,7 @@ namespace WebsitePanel.Portal.ProviderControls SetUnsetReplication(); } + private void SetUnsetReplication() { if (!IsReplicaServer) @@ -354,5 +365,118 @@ namespace WebsitePanel.Portal.ProviderControls if (!result.IsSuccess) ReplicaErrorTr.Visible = true; } + + // OS Templates + protected void btnAddOsTemplate_Click(object sender, EventArgs e) + { + var templates = GetOsTemplates(); + + templates.Add(new LibraryItem()); + + RebindOsTemplate(templates); + } + + protected void btnRemoveOsTemplate_OnCommand(object sender, CommandEventArgs e) + { + var templates = GetOsTemplates(); + + templates.RemoveAt(Convert.ToInt32(e.CommandArgument)); + + RebindOsTemplate(templates); + } + + private List GetOsTemplates() + { + var result = new List(); + + foreach (RepeaterItem item in repOsTemplates.Items) + { + var template = new LibraryItem(); + int processVolume; + + template.Name = GetTextBoxText(item, "txtTemplateName"); + template.Path = GetTextBoxText(item, "txtTemplateFileName"); + + int.TryParse(GetTextBoxText(item, "txtProcessVolume"), out processVolume); + template.ProcessVolume = processVolume; + + template.LegacyNetworkAdapter = GetCheckBoxValue(item, "chkLegacyNetworkAdapter"); + template.RemoteDesktop = true; // obsolete + template.ProvisionComputerName = GetCheckBoxValue(item, "chkCanSetComputerName"); + template.ProvisionAdministratorPassword = GetCheckBoxValue(item, "chkCanSetAdminPass"); + template.ProvisionNetworkAdapters = GetCheckBoxValue(item, "chkCanSetNetwork"); + + var syspreps = GetTextBoxText(item, "txtSysprep").Split(new[] {";"}, StringSplitOptions.RemoveEmptyEntries); + template.SysprepFiles = syspreps.Select(s=>s.Trim()).ToArray(); + + result.Add(template); + } + + return result; + } + private void RebindOsTemplate(List templates) + { + repOsTemplates.DataSource = templates; + repOsTemplates.DataBind(); + } + + private string GetConfigXml(List items) + { + var templates = items.ToArray(); + return new ConfigFile(templates).Xml; + } + + private string GetTextBoxText(RepeaterItem item, string name) + { + return (item.FindControl(name) as TextBox).Text; + } + + private bool GetCheckBoxValue(RepeaterItem item, string name) + { + return (item.FindControl(name) as CheckBox).Checked; + } + + // DVD Library + protected void btnAddDvd_Click(object sender, EventArgs e) + { + var dvds = GetDvds(); + + dvds.Add(new LibraryItem()); + + RebindDvds(dvds); + } + + protected void btnRemoveDvd_OnCommand(object sender, CommandEventArgs e) + { + var dvds = GetDvds(); + + dvds.RemoveAt(Convert.ToInt32(e.CommandArgument)); + + RebindDvds(dvds); + } + + private List GetDvds() + { + var result = new List(); + + foreach (RepeaterItem item in repDvdLibrary.Items) + { + var dvd = new LibraryItem(); + + dvd.Name = GetTextBoxText(item, "txtDvdName"); + dvd.Description = GetTextBoxText(item, "txtDvdDescription"); + dvd.Path = GetTextBoxText(item, "txtDvdFileName"); + + result.Add(dvd); + } + + return result; + } + + private void RebindDvds(List dvds) + { + repDvdLibrary.DataSource = dvds; + repDvdLibrary.DataBind(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.designer.cs index 901e2bd5..14dad929 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.designer.cs @@ -147,33 +147,6 @@ namespace WebsitePanel.Portal.ProviderControls { /// protected global::System.Web.UI.WebControls.Localize locFolderVariables; - /// - /// locOSTemplatesPath control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locOSTemplatesPath; - - /// - /// txtOSTemplatesPath control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtOSTemplatesPath; - - /// - /// TemplatesPathValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator TemplatesPathValidator; - /// /// locExportedVpsPath control. /// @@ -201,33 +174,6 @@ namespace WebsitePanel.Portal.ProviderControls { /// protected global::System.Web.UI.WebControls.RequiredFieldValidator ExportedVpsPathValidator; - /// - /// locDvdIsoPath control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locDvdIsoPath; - - /// - /// txtDvdLibraryPath control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtDvdLibraryPath; - - /// - /// DvdLibraryPathValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator DvdLibraryPathValidator; - /// /// locProcessorSettings control. /// @@ -318,6 +264,114 @@ namespace WebsitePanel.Portal.ProviderControls { /// protected global::System.Web.UI.WebControls.RequiredFieldValidator CpuWeightValidator; + /// + /// locTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTemplates; + + /// + /// locOSTemplatesPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOSTemplatesPath; + + /// + /// txtOSTemplatesPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtOSTemplatesPath; + + /// + /// TemplatesPathValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator TemplatesPathValidator; + + /// + /// btnAddOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddOsTemplate; + + /// + /// repOsTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater repOsTemplates; + + /// + /// locDvdLibrary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdLibrary; + + /// + /// locDvdIsoPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdIsoPath; + + /// + /// txtDvdLibraryPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDvdLibraryPath; + + /// + /// DvdLibraryPathValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator DvdLibraryPathValidator; + + /// + /// btnAddDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddDvd; + + /// + /// repDvdLibrary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater repDvdLibrary; + /// /// locReplication control. ///