wsp-10327 Add Dynamic Memory to VPS - Portal Part.
This commit is contained in:
parent
8fa9792b83
commit
054908269c
24 changed files with 855 additions and 125 deletions
|
@ -26,26 +26,13 @@
|
|||
// (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.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.Mail;
|
||||
using WebsitePanel.Providers.Virtualization;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for IVirtualMachineCreateControl
|
||||
/// </summary>
|
||||
public interface IVirtualMachineCreateControl
|
||||
public interface IVirtualMachineSettingsControl
|
||||
{
|
||||
bool IsEditMode { get; set; }
|
||||
void BindItem(VirtualMachine item);
|
||||
void SaveItem(VirtualMachine item);
|
||||
}
|
|
@ -117,16 +117,4 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ddlGenerationItem.1" xml:space="preserve">
|
||||
<value>First</value>
|
||||
</data>
|
||||
<data name="ddlGenerationItem.2" xml:space="preserve">
|
||||
<value>Second</value>
|
||||
</data>
|
||||
<data name="locGeneration.Text" xml:space="preserve">
|
||||
<value>Generation:</value>
|
||||
</data>
|
||||
<data name="secGeneration.Text" xml:space="preserve">
|
||||
<value>Generation</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -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" %>
|
||||
|
||||
<wsp:CollapsiblePanel id="secGeneration" runat="server" TargetControlID="GenerationPanel" meta:resourcekey="secGeneration" Text="Generation">
|
||||
</wsp:CollapsiblePanel>
|
||||
<asp:Panel ID="GenerationPanel" runat="server" Height="0" Style="overflow: hidden; padding: 5px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="FormLabel150">
|
||||
<asp:Localize ID="locGeneration" runat="server"
|
||||
meta:resourcekey="locGeneration" Text="Generation:"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="ddlGeneration" runat="server" CssClass="NormalTextBox" resourcekey="ddlGeneration">
|
||||
<asp:ListItem Value="1">1</asp:ListItem>
|
||||
<asp:ListItem Value="2">2</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
<wsp:Generation runat="server" ID="GenerationSetting"></wsp:Generation>
|
||||
<wsp:DynamicMemory runat="server" ID="DynamicMemorySetting"></wsp:DynamicMemory>
|
||||
|
|
|
@ -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<IVirtualMachineSettingsControl> SettingContols
|
||||
{
|
||||
get
|
||||
{
|
||||
return Controls
|
||||
.Cast<Control>()
|
||||
.Where(c => c is IVirtualMachineSettingsControl)
|
||||
.Cast<IVirtualMachineSettingsControl>()
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,39 +13,21 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
public partial class HyperV2012R2_Create {
|
||||
|
||||
/// <summary>
|
||||
/// secGeneration control.
|
||||
/// GenerationSetting control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secGeneration;
|
||||
protected global::WebsitePanel.Portal.VPS.UserControls.Generation GenerationSetting;
|
||||
|
||||
/// <summary>
|
||||
/// GenerationPanel control.
|
||||
/// DynamicMemorySetting control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel GenerationPanel;
|
||||
|
||||
/// <summary>
|
||||
/// locGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// ddlGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlGeneration;
|
||||
protected global::WebsitePanel.Portal.VPS.UserControls.DynamicMemory DynamicMemorySetting;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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" %>
|
||||
|
||||
<wsp:DynamicMemory runat="server" ID="DynamicMemorySetting"></wsp:DynamicMemory>
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal.ProviderControls {
|
||||
|
||||
|
||||
public partial class HyperV2012R2_Edit {
|
||||
|
||||
/// <summary>
|
||||
/// DynamicMemorySetting control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.VPS.UserControls.DynamicMemory DynamicMemorySetting;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="locDymanicMemory.Text" xml:space="preserve">
|
||||
<value>Dymanic memory:</value>
|
||||
</data>
|
||||
<data name="secDymanicMemory.Text" xml:space="preserve">
|
||||
<value>Dymanic memory</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ddlGenerationItem.1" xml:space="preserve">
|
||||
<value>First</value>
|
||||
</data>
|
||||
<data name="ddlGenerationItem.2" xml:space="preserve">
|
||||
<value>Second</value>
|
||||
</data>
|
||||
<data name="locGeneration.Text" xml:space="preserve">
|
||||
<value>Generation:</value>
|
||||
</data>
|
||||
<data name="secGeneration.Text" xml:space="preserve">
|
||||
<value>Generation</value>
|
||||
</data>
|
||||
</root>
|
|
@ -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" %>
|
||||
|
||||
<wsp:CollapsiblePanel id="secDymanicMemory" runat="server" TargetControlID="DymanicMemoryPanel" meta:resourcekey="secDymanicMemory" Text="Dymanic memory">
|
||||
</wsp:CollapsiblePanel>
|
||||
<asp:Panel ID="DymanicMemoryPanel" runat="server" Height="0" Style="overflow: hidden; padding: 5px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="FormLabel150">
|
||||
<asp:Localize ID="locDymanicMemory" runat="server"
|
||||
meta:resourcekey="locDymanicMemory" Text="Dymanic Memory:"></asp:Localize></td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal.VPS.UserControls {
|
||||
|
||||
|
||||
public partial class DynamicMemory {
|
||||
|
||||
/// <summary>
|
||||
/// secDymanicMemory control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secDymanicMemory;
|
||||
|
||||
/// <summary>
|
||||
/// DymanicMemoryPanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel DymanicMemoryPanel;
|
||||
|
||||
/// <summary>
|
||||
/// locDymanicMemory control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locDymanicMemory;
|
||||
}
|
||||
}
|
|
@ -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" %>
|
||||
|
||||
<wsp:CollapsiblePanel ID="secGeneration" runat="server" TargetControlID="GenerationPanel" meta:ResourceKey="secGeneration" Text="Generation"></wsp:CollapsiblePanel>
|
||||
<asp:Panel ID="GenerationPanel" runat="server" Height="0" Style="overflow: hidden; padding: 5px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="FormLabel150">
|
||||
<asp:Localize ID="locGeneration" runat="server" meta:resourcekey="locGeneration" Text="Generation:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<% if (IsEditMode)
|
||||
{ %>
|
||||
<asp:DropDownList ID="ddlGeneration" runat="server" CssClass="NormalTextBox" resourcekey="ddlGeneration">
|
||||
<asp:ListItem Value="1">1</asp:ListItem>
|
||||
<asp:ListItem Value="2">2</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<% } else { %>
|
||||
<asp:Label runat="server" ID="lblGeneration"/>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal.VPS.UserControls {
|
||||
|
||||
|
||||
public partial class Generation {
|
||||
|
||||
/// <summary>
|
||||
/// secGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// GenerationPanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel GenerationPanel;
|
||||
|
||||
/// <summary>
|
||||
/// locGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// ddlGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// lblGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblGeneration;
|
||||
}
|
||||
}
|
|
@ -189,6 +189,7 @@
|
|||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
<%-- Additional Custom Settings. Provider Control --%>
|
||||
<asp:PlaceHolder ID="createSettingsProviderControl" runat="server"></asp:PlaceHolder>
|
||||
|
||||
<wsp:CollapsiblePanel id="secSnapshots" runat="server"
|
||||
|
@ -451,6 +452,10 @@
|
|||
<td><asp:Localize ID="locRam" runat="server" meta:resourcekey="locRam" Text="RAM, MB:" /></td>
|
||||
<td><asp:Literal ID="litRam" runat="server"></asp:Literal></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><asp:Localize ID="locGeneration" runat="server" meta:resourcekey="locGeneration" Text="Generation:" /></td>
|
||||
<td><asp:Literal ID="litGeneration" runat="server"></asp:Literal></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><asp:Localize ID="locHdd" runat="server" meta:resourcekey="locHdd" Text="Hard disk size, GB:" /></td>
|
||||
<td><asp:Literal ID="litHdd" runat="server"></asp:Literal></td>
|
||||
|
|
|
@ -61,18 +61,19 @@ namespace WebsitePanel.Portal.VPS
|
|||
try
|
||||
{
|
||||
LoadProviderControl(PanelSecurity.PackageId, "VPS", createSettingsProviderControl, "Create.ascx");
|
||||
if (CreareSettingsProviderControl != null) CreareSettingsProviderControl.IsEditMode = true;
|
||||
}
|
||||
catch { /* skip */ }
|
||||
}
|
||||
|
||||
private IVirtualMachineCreateControl CreareSettingsProviderControl
|
||||
private IVirtualMachineSettingsControl CreareSettingsProviderControl
|
||||
{
|
||||
get
|
||||
{
|
||||
if (createSettingsProviderControl.Controls.Count == 0)
|
||||
return null;
|
||||
|
||||
return (IVirtualMachineCreateControl)createSettingsProviderControl.Controls[0];
|
||||
return (IVirtualMachineSettingsControl)createSettingsProviderControl.Controls[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,11 +137,7 @@ namespace WebsitePanel.Portal.VPS
|
|||
ddlCpu.SelectedIndex = ddlCpu.Items.Count - 1; // select last (maximum) item
|
||||
|
||||
// the custom provider control
|
||||
if (CreareSettingsProviderControl != null)
|
||||
{
|
||||
IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)createSettingsProviderControl.Controls[0];
|
||||
ctrl.BindItem(new VirtualMachine());
|
||||
}
|
||||
if (CreareSettingsProviderControl != null) CreareSettingsProviderControl.BindItem(new VirtualMachine());
|
||||
|
||||
// external network details
|
||||
if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS_EXTERNAL_NETWORK_ENABLED))
|
||||
|
@ -266,6 +263,11 @@ namespace WebsitePanel.Portal.VPS
|
|||
|
||||
private void BindSummary()
|
||||
{
|
||||
VirtualMachine virtualMachine = new VirtualMachine();
|
||||
|
||||
// the custom provider control
|
||||
if (CreareSettingsProviderControl != null) CreareSettingsProviderControl.SaveItem(virtualMachine);
|
||||
|
||||
// general
|
||||
litHostname.Text = PortalAntiXSS.Encode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim()));
|
||||
litOperatingSystem.Text = listOperatingSystems.SelectedItem.Text;
|
||||
|
@ -276,6 +278,7 @@ namespace WebsitePanel.Portal.VPS
|
|||
// config
|
||||
litCpu.Text = PortalAntiXSS.Encode(ddlCpu.SelectedValue);
|
||||
litRam.Text = PortalAntiXSS.Encode(txtRam.Text.Trim());
|
||||
litGeneration.Text = CreareSettingsProviderControl != null ? PortalAntiXSS.Encode(virtualMachine.Generation.ToString()) : "1";
|
||||
litHdd.Text = PortalAntiXSS.Encode(txtHdd.Text.Trim());
|
||||
litSnapshots.Text = PortalAntiXSS.Encode(txtSnapshots.Text.Trim());
|
||||
optionDvdInstalled.Value = chkDvdInstalled.Checked;
|
||||
|
@ -319,11 +322,7 @@ namespace WebsitePanel.Portal.VPS
|
|||
VirtualMachine virtualMachine = new VirtualMachine();
|
||||
|
||||
// the custom provider control
|
||||
if (CreareSettingsProviderControl != null)
|
||||
{
|
||||
IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)createSettingsProviderControl.Controls[0];
|
||||
ctrl.SaveItem(virtualMachine);
|
||||
}
|
||||
if (CreareSettingsProviderControl != null) CreareSettingsProviderControl.SaveItem(virtualMachine);
|
||||
|
||||
// collect and prepare data
|
||||
string hostname = String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim());
|
||||
|
|
|
@ -993,6 +993,24 @@ namespace WebsitePanel.Portal.VPS {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal litRam;
|
||||
|
||||
/// <summary>
|
||||
/// locGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// litGeneration control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal litGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// locHdd control.
|
||||
/// </summary>
|
||||
|
|
|
@ -80,6 +80,9 @@
|
|||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
<%-- Additional Custom Settings. Provider Control --%>
|
||||
<asp:PlaceHolder ID="editSettingsProviderControl" runat="server"></asp:PlaceHolder>
|
||||
|
||||
<wsp:CollapsiblePanel id="secSnapshots" runat="server"
|
||||
TargetControlID="SnapshotsPanel" meta:resourcekey="secSnapshots" Text="Snapshots">
|
||||
</wsp:CollapsiblePanel>
|
||||
|
|
|
@ -41,12 +41,34 @@ namespace WebsitePanel.Portal.VPS
|
|||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadCustomProviderControls();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BindConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadCustomProviderControls()
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadProviderControl(PanelSecurity.PackageId, "VPS", editSettingsProviderControl, "Edit.ascx");
|
||||
}
|
||||
catch { /* skip */ }
|
||||
}
|
||||
|
||||
private IVirtualMachineSettingsControl EditSettingsProviderControl
|
||||
{
|
||||
get
|
||||
{
|
||||
if (editSettingsProviderControl.Controls.Count == 0)
|
||||
return null;
|
||||
|
||||
return (IVirtualMachineSettingsControl)editSettingsProviderControl.Controls[0];
|
||||
}
|
||||
}
|
||||
|
||||
private void BindConfiguration()
|
||||
{
|
||||
VirtualMachine vm = null;
|
||||
|
@ -96,8 +118,8 @@ namespace WebsitePanel.Portal.VPS
|
|||
chkExternalNetworkEnabled.Checked = vm.ExternalNetworkEnabled;
|
||||
chkPrivateNetworkEnabled.Checked = vm.PrivateNetworkEnabled;
|
||||
|
||||
// toggle controls
|
||||
|
||||
// the custom provider control
|
||||
if (EditSettingsProviderControl != null) EditSettingsProviderControl.BindItem(vm);
|
||||
|
||||
// other quotas
|
||||
BindCheckboxOption(chkDvdInstalled, Quotas.VPS_DVD_ENABLED);
|
||||
|
@ -146,6 +168,11 @@ namespace WebsitePanel.Portal.VPS
|
|||
return;
|
||||
}
|
||||
|
||||
VirtualMachine virtualMachine = new VirtualMachine();
|
||||
|
||||
// the custom provider control
|
||||
if (EditSettingsProviderControl != null) EditSettingsProviderControl.SaveItem(virtualMachine);
|
||||
|
||||
ResultObject res = ES.Services.VPS.UpdateVirtualMachineConfiguration(PanelRequest.ItemID,
|
||||
Utils.ParseInt(ddlCpu.SelectedValue),
|
||||
Utils.ParseInt(txtRam.Text.Trim()),
|
||||
|
|
|
@ -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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
@ -239,6 +210,15 @@ namespace WebsitePanel.Portal.VPS {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locGB;
|
||||
|
||||
/// <summary>
|
||||
/// editSettingsProviderControl control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder editSettingsProviderControl;
|
||||
|
||||
/// <summary>
|
||||
/// secSnapshots control.
|
||||
/// </summary>
|
||||
|
@ -463,14 +443,5 @@ namespace WebsitePanel.Portal.VPS {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCancel;
|
||||
|
||||
/// <summary>
|
||||
/// FormComments control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize FormComments;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@
|
|||
<Compile Include="Code\ProviderControls\IDatabaseEditUserControl.cs" />
|
||||
<Compile Include="Code\ProviderControls\IFtpEditAccountControl.cs" />
|
||||
<Compile Include="Code\ProviderControls\IHostingServiceProviderSettings.cs" />
|
||||
<Compile Include="Code\ProviderControls\IVirtualMachineCreateControl.cs" />
|
||||
<Compile Include="Code\ProviderControls\IVirtualMachineSettingsControl.cs" />
|
||||
<Compile Include="Code\ProviderControls\IMailEditAccountControl.cs" />
|
||||
<Compile Include="Code\ProviderControls\IMailEditDomainControl.cs" />
|
||||
<Compile Include="Code\ProviderControls\IMailEditForwardingControl.cs" />
|
||||
|
@ -265,6 +265,13 @@
|
|||
<Compile Include="ProviderControls\HyperV2012R2_Settings.ascx.designer.cs">
|
||||
<DependentUpon>HyperV2012R2_Settings.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VPS\ProviderControls\HyperV2012R2_Edit.ascx.cs">
|
||||
<DependentUpon>HyperV2012R2_Edit.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VPS\ProviderControls\HyperV2012R2_Edit.ascx.designer.cs">
|
||||
<DependentUpon>HyperV2012R2_Edit.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VPS\ProviderControls\HyperV2012R2_Create.ascx.cs">
|
||||
<DependentUpon>HyperV2012R2_Create.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -4062,6 +4069,20 @@
|
|||
<Compile Include="VPSForPC\VpsEventsLog.ascx.designer.cs">
|
||||
<DependentUpon>VpsEventsLog.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VPS\UserControls\DynamicMemory.ascx.cs">
|
||||
<DependentUpon>DynamicMemory.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VPS\UserControls\DynamicMemory.ascx.designer.cs">
|
||||
<DependentUpon>DynamicMemory.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VPS\UserControls\Generation.ascx.cs">
|
||||
<DependentUpon>Generation.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VPS\UserControls\Generation.ascx.designer.cs">
|
||||
<DependentUpon>Generation.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VPS\VpsMoveServer.ascx.cs">
|
||||
<DependentUpon>VpsMoveServer.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -4539,6 +4560,7 @@
|
|||
<Content Include="ExchangeServer\UserControls\EnterpriseStorageEditFolderTabs.ascx" />
|
||||
<Content Include="ExchangeServer\UserControls\EnterpriseStorageOwaUsersList.ascx" />
|
||||
<Content Include="ProviderControls\HyperV2012R2_Settings.ascx" />
|
||||
<Content Include="VPS\ProviderControls\HyperV2012R2_Edit.ascx" />
|
||||
<Content Include="VPS\ProviderControls\HyperV2012R2_Create.ascx" />
|
||||
<Content Include="ProviderControls\SmarterMail100_EditAccount.ascx" />
|
||||
<Content Include="ProviderControls\SmarterMail100_EditDomain.ascx" />
|
||||
|
@ -4781,6 +4803,8 @@
|
|||
<Content Include="UserControls\UserDetails.ascx" />
|
||||
<Content Include="UserControls\UserLookup.ascx" />
|
||||
<Content Include="UserControls\UsernameControl.ascx" />
|
||||
<Content Include="VPS\UserControls\DynamicMemory.ascx" />
|
||||
<Content Include="VPS\UserControls\Generation.ascx" />
|
||||
<Content Include="WebSitesHeliconZooControl.ascx" />
|
||||
<Content Include="WebsitesSSL.ascx" />
|
||||
<Content Include="LyncPhoneNumbers.ascx" />
|
||||
|
@ -4792,6 +4816,15 @@
|
|||
<Content Include="UserControls\App_LocalResources\DomainActions.ascx.resx" />
|
||||
<Content Include="UserControls\App_LocalResources\MailAccountActions.ascx.resx" />
|
||||
<EmbeddedResource Include="UserControls\App_LocalResources\WebsiteActions.ascx.resx" />
|
||||
<Content Include="VPS\UserControls\App_LocalResources\Generation.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="VPS\UserControls\App_LocalResources\DynamicMemory.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="VPS\ProviderControls\App_LocalResources\HyperV2012R2_Edit.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App_LocalResources\BandwidthReport.ascx.resx">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue