RDS Server editing

This commit is contained in:
vfedosevich 2015-03-20 01:27:46 -07:00
parent 8a868a4ea8
commit ac9d689ee6
11 changed files with 565 additions and 5 deletions

View file

@ -173,6 +173,7 @@
<Controls>
<Control key="" src="WebsitePanel/RDSServers.ascx" title="RDSServers" type="View" />
<Control key="add_rdsserver" src="WebsitePanel/RDSServersAddserver.ascx" title="RDSServersAddserver" type="View" icon="computer_add_48.png" />
<Control key="edit_rdsserver" src="WebsitePanel/RDSServersEditServer.ascx" title="RDSServersEditServer" type="View" icon="computer_48.png" />
</Controls>
</ModuleDefinition>

View file

@ -795,4 +795,7 @@
<data name="ModuleTitle.RDSServersAddserver" xml:space="preserve">
<value>Add New RDS Server</value>
</data>
<data name="ModuleTitle.RDSServersEditServer" xml:space="preserve">
<value>Edit RDS Server</value>
</data>
</root>

View file

@ -5680,6 +5680,9 @@
<data name="ERROR.RDSSERVER_NOT_ADDED" xml:space="preserve">
<value>RDS Server not added</value>
</data>
<data name="ERROR.RDSSERVER_NOT_UPDATED" xml:space="preserve">
<value>RDS Server not updated</value>
</data>
<data name="Success.RDSSESSIONHOST_CERTIFICATE_INSTALLED" xml:space="preserve">
<value>Session host certificate has been installed</value>
</data>

View file

@ -0,0 +1,156 @@
<?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="btnUpdate.Text" xml:space="preserve">
<value>Update</value>
</data>
<data name="locFreeMemory.Text" xml:space="preserve">
<value>Free Memory:</value>
</data>
<data name="locFreeSpace.Text" xml:space="preserve">
<value>Free Space:</value>
</data>
<data name="locLoadPercentage.Text" xml:space="preserve">
<value>Load Percentage:</value>
</data>
<data name="locMemoryAllocated.Text" xml:space="preserve">
<value>Allocated Memory:</value>
</data>
<data name="locProcessor.Text" xml:space="preserve">
<value>Processor:</value>
</data>
<data name="locServerComments.Text" xml:space="preserve">
<value>Server Comments:</value>
</data>
<data name="locServerName.Text" xml:space="preserve">
<value>Server Fully Qualified Domain Name:</value>
</data>
<data name="locSize.Text" xml:space="preserve">
<value>Size:</value>
</data>
<data name="locStatus.Text" xml:space="preserve">
<value>Status:</value>
</data>
<data name="locVolumeName.Text" xml:space="preserve">
<value>Volume Name:</value>
</data>
<data name="secServerInfo.Text" xml:space="preserve">
<value>Server Info</value>
</data>
</root>

View file

@ -177,10 +177,10 @@
<data name="lbViewInfo.Text" xml:space="preserve">
<value>View Info</value>
</data>
<data name="locFreeSpace" xml:space="preserve">
<data name="locFreeSpace.Text" xml:space="preserve">
<value>Free Space:</value>
</data>
<data name="locSize" xml:space="preserve">
<data name="locSize.Text" xml:space="preserve">
<value>Size:</value>
</data>
<data name="locVolumeName.Text" xml:space="preserve">

View file

@ -55,10 +55,13 @@
DataSourceID="odsRDSServersPaged" EnableViewState="False"
EmptyDataText="gvRDSServers">
<Columns>
<asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name">
<asp:TemplateField SortExpression="Name" HeaderText="Server name">
<HeaderStyle Wrap="false" />
<ItemStyle Wrap="False" Width="15%"/>
</asp:BoundField>
<ItemTemplate>
<asp:LinkButton OnClientClick="ShowProgressDialog('Loading ...');return true;" CommandName="EditServer" CommandArgument='<%# Eval("Id")%>' ID="lbEditServer" runat="server" Text='<%#Eval("Name") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="10%"/></asp:BoundField>
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="10%"/></asp:BoundField>
<asp:BoundField DataField="Description" HeaderText="Comments"><ItemStyle Width="20%"/></asp:BoundField>

View file

@ -125,6 +125,10 @@ namespace WebsitePanel.Portal
{
InstallCertificate(e.CommandArgument.ToString());
}
else if (e.CommandName == "EditServer")
{
EditServer(e.CommandArgument.ToString());
}
}
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
@ -186,7 +190,11 @@ namespace WebsitePanel.Portal
}
messageBoxPanel.Update();
// Response.Redirect(Request.Url.ToString(), true);
}
private void EditServer(string serverId)
{
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "edit_rdsserver", "SpaceID=" + PanelSecurity.PackageId, "ServerId=" + serverId));
}
}
}

View file

@ -0,0 +1,111 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSServersEditServer.ascx.cs" Inherits="WebsitePanel.Portal.RDSServersEditServer" %>
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<div class="FormContentRDSConf">
<table>
<tr>
<td class="FormLabel260"><asp:Localize ID="locServerName" runat="server" meta:resourcekey="locServerName" Text="Server Fully Qualified Domain Name:"></asp:Localize></td>
<td class="FormLabel260">
<asp:Label runat="server" ID="lblServerName"/>
</td>
</tr>
<tr>
<td class="FormLabel260"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="300px"></asp:TextBox>
</td>
</tr>
</table>
<wsp:CollapsiblePanel id="secServerInfo" runat="server" TargetControlID="panelHardwareInfo" meta:resourcekey="secServerInfo" IsCollapsed="true" Text=""/>
<asp:Panel runat="server" ID="panelHardwareInfo">
<table>
<tr>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locStatus" runat="server" Text="Status:"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litStatus" runat="server"/>
</td>
<td/>
<td/>
</tr>
<tr>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locProcessor" runat="server" Text="Processor:"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litProcessor" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locLoadPercentage" Text="Load Percentage:" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litLoadPercentage" runat="server"/>
</td>
</tr>
<tr>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locMemoryAllocated" runat="server" Text="Allocated Memory:"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litMemoryAllocated" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locFreeMemory" Text="Free Memory:" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litFreeMemory" runat="server"/>
</td>
</tr>
</table>
<table>
<asp:Repeater ID="rpServerDrives" runat="server" EnableViewState="false">
<ItemTemplate>
<tr>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litDeviceId" runat="server" Text='<%# Eval("DeviceId") %>'/>
</td>
<td class="FormLabel150" style="width: 150px;"/>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locVolumeName" Text="Volume Name:" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litVolumeName" Text='<%# Eval("VolumeName") %>' runat="server"/>
</td>
</tr>
<tr>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locSize" Text="Size:" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litSize" Text='<%# Eval("SizeMb") + " MB" %>' runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="locFreeSpace" Text="Free Space:" runat="server"/>
</td>
<td class="FormLabel150" style="width: 150px;">
<asp:Literal ID="litFreeSpace" Text='<%# Eval("FreeSpaceMb") + " MB" %>' runat="server"/>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</asp:Panel>
</div>
<div class="FormFooterRDSConf">
<asp:Button ID="btnUpdate" runat="server" meta:resourcekey="btnUpdate" Text="Update" CssClass="Button2"
OnClick="btnUpdate_Click" OnClientClick="ShowProgressDialog('Updating server...');" />
<asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel" Text="Cancel"
CssClass="Button1" OnClick="btnCancel_Click" CausesValidation="False" />
</div>
</div>

View file

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Portal
{
public partial class RDSServersEditServer : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var rdsServer = ES.Services.RDS.GetRdsServer(PanelRequest.ServerId);
lblServerName.Text = rdsServer.FqdName;
txtServerComments.Text = rdsServer.Description;
var serverInfo = ES.Services.RDS.GetRdsServerInfo(null, rdsServer.FqdName);
litProcessor.Text = string.Format("{0}x{1} MHz", serverInfo.NumberOfCores, serverInfo.MaxClockSpeed);
litLoadPercentage.Text = string.Format("{0}%", serverInfo.LoadPercentage);
litMemoryAllocated.Text = string.Format("{0} MB", serverInfo.MemoryAllocatedMb);
litFreeMemory.Text = string.Format("{0} MB", serverInfo.FreeMemoryMb);
litStatus.Text = serverInfo.Status;
rpServerDrives.DataSource = serverInfo.Drives;
rpServerDrives.DataBind();
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
try
{
var rdsServer = ES.Services.RDS.GetRdsServer(PanelRequest.ServerId);
rdsServer.Description = txtServerComments.Text;
ResultObject result = ES.Services.RDS.UpdateRdsServer(rdsServer);
if (!result.IsSuccess && result.ErrorCodes.Count > 0)
{
messageBox.ShowMessage(result, "RDSSERVER_NOT_UPDATED", "");
return;
}
RedirectToBrowsePage();
}
catch (Exception ex)
{
ShowErrorMessage("RDSSERVER_NOT_UPDATED", ex);
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
RedirectToBrowsePage();
}
}
}

View file

@ -0,0 +1,204 @@
//------------------------------------------------------------------------------
// <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 {
public partial class RDSServersEditServer {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// locServerName 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 locServerName;
/// <summary>
/// lblServerName 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 lblServerName;
/// <summary>
/// locServerComments 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 locServerComments;
/// <summary>
/// txtServerComments 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.TextBox txtServerComments;
/// <summary>
/// secServerInfo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secServerInfo;
/// <summary>
/// panelHardwareInfo 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 panelHardwareInfo;
/// <summary>
/// locStatus 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 locStatus;
/// <summary>
/// litStatus 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 litStatus;
/// <summary>
/// locProcessor 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 locProcessor;
/// <summary>
/// litProcessor 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 litProcessor;
/// <summary>
/// locLoadPercentage 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 locLoadPercentage;
/// <summary>
/// litLoadPercentage 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 litLoadPercentage;
/// <summary>
/// locMemoryAllocated 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 locMemoryAllocated;
/// <summary>
/// litMemoryAllocated 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 litMemoryAllocated;
/// <summary>
/// locFreeMemory 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 locFreeMemory;
/// <summary>
/// litFreeMemory 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 litFreeMemory;
/// <summary>
/// rpServerDrives 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.Repeater rpServerDrives;
/// <summary>
/// btnUpdate 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.Button btnUpdate;
/// <summary>
/// btnCancel 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.Button btnCancel;
}
}

View file

@ -330,6 +330,13 @@
<Compile Include="RDSServers.ascx.designer.cs">
<DependentUpon>RDSServers.ascx</DependentUpon>
</Compile>
<Compile Include="RDSServersEditServer.ascx.cs">
<DependentUpon>RDSServersEditServer.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="RDSServersEditServer.ascx.designer.cs">
<DependentUpon>RDSServersEditServer.ascx</DependentUpon>
</Compile>
<Compile Include="RDS\AssignedRDSServers.ascx.cs">
<DependentUpon>AssignedRDSServers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4514,7 +4521,9 @@
<SubType>Designer</SubType>
</Content>
<Content Include="App_LocalResources\SettingsRdsSetupLetter.ascx.resx" />
<Content Include="App_LocalResources\RDSServersEditServer.ascx.resx" />
<EmbeddedResource Include="RDS\App_LocalResources\RDSEditCollectionSettings.ascx.resx" />
<Content Include="RDSServersEditServer.ascx" />
<Content Include="RDS\AssignedRDSServers.ascx" />
<Content Include="RDS\AddRDSServer.ascx" />
<Content Include="RDS\RDSEditApplicationUsers.ascx" />