This commit is contained in:
Virtuworks 2015-01-29 12:12:20 -05:00
commit 53d0df7aba
20 changed files with 922 additions and 4 deletions

View file

@ -150,4 +150,5 @@
<Control key="rds_application_edit_users" general_key="rds_collections" />
<Control key="rds_edit_collection" general_key="rds_collections" />
<Control key="rds_edit_collection_settings" general_key="rds_collections" />
<Control key="rds_collection_user_sessions" general_key="rds_collections" />
</Controls>

View file

@ -581,6 +581,7 @@
<Control key="rds_application_edit_users" src="WebsitePanel/RDS/RDSEditApplicationUsers.ascx" title="RDSEditApplicationUsers" type="View" />
<Control key="rds_edit_collection" src="WebsitePanel/RDS/RDSEditCollection.ascx" title="RDSEditCollection" type="View" />
<Control key="rds_edit_collection_settings" src="WebsitePanel/RDS/RDSEditCollectionSettings.ascx" title="RDSEditCollectionSettings" type="View" />
<Control key="rds_collection_user_sessions" src="WebsitePanel/RDS/RDSUserSessions.ascx" title="RDSUserSessions" type="View" />
</Controls>
</ModuleDefinition>

View file

@ -5641,4 +5641,10 @@
<data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve">
<value>RDS Collection settings not updated</value>
</data>
<data name="ERROR.REMOTE_DESKTOP_SERVICES_LOG_OFF_USER" xml:space="preserve">
<value>RDS User logging off error</value>
</data>
<data name="ERROR.REMOTE_DESKTOP_SERVICES_USER_SESSIONS" xml:space="preserve">
<value>GEtting RDS User sessions error</value>
</data>
</root>

View file

@ -0,0 +1,150 @@
<?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="gvHostServer.HeaderText" xml:space="preserve">
<value>Host Server</value>
</data>
<data name="gvRDSUserSessions.Empty" xml:space="preserve">
<value>No user sessions.</value>
</data>
<data name="gvSessionState.HeaderText" xml:space="preserve">
<value>Session State</value>
</data>
<data name="gvUserName.HeaderText" xml:space="preserve">
<value>User Name</value>
</data>
<data name="locTitle" xml:space="preserve">
<value>Edit RDS Collection</value>
</data>
<data name="secRdsUserSessions" xml:space="preserve">
<value>RDS User Sessions</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>RDS User Sessions</value>
</data>
<data name="cmdLogOff.OnClientClick" xml:space="preserve">
<value>if(!confirm('Are you sure you want to log off user?')) return false; else ShowProgressDialog('Logging off user...');</value>
</data>
<data name="cmdLogOff.Text" xml:space="preserve">
<value>Log Off</value>
</data>
<data name="cmdLogOff.ToolTip" xml:space="preserve">
<value>Log Off</value>
</data>
</root>

View file

@ -0,0 +1,74 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSUserSessions.ascx.cs" Inherits="WebsitePanel.Portal.RDS.RDSUserSessions" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="UserControls/RDSCollectionTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %>
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="imgEditRDSCollection" SkinID="EnterpriseStorageSpace48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit RDS Collection"></asp:Localize>
-
<asp:Literal ID="litCollectionName" runat="server" Text="" />
</div>
<div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="rds_collection_user_sessions" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="secRdsUserSessions" runat="server"
TargetControlID="panelRdsUserSessions" meta:resourcekey="secRdsUserSessions" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelRdsUserSessions">
<div style="padding: 10px;">
<asp:GridView ID="gvRDSUserSessions" runat="server" AutoGenerateColumns="False" EnableViewState="true"
Width="100%" EmptyDataText="gvRDSUserSessions" CssSelectorClass="NormalGridView"
OnRowCommand="gvRDSCollections_RowCommand" AllowPaging="True" AllowSorting="True">
<Columns>
<asp:TemplateField meta:resourcekey="gvUserName" HeaderText="gvUserName">
<ItemStyle Width="30%" Wrap="false"/>
<ItemTemplate>
<asp:Literal ID="litUserName" runat="server" Text='<%# Eval("UserName") %>'/>
<asp:HiddenField ID="hfUnifiedSessionId" runat="server" Value='<%# Eval("UnifiedSessionId") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvHostServer" HeaderText="gvHostServer">
<ItemStyle Width="30%" Wrap="false"/>
<ItemTemplate>
<asp:Literal ID="litHostServer" runat="server" Text='<%# Eval("HostServer") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvSessionState" HeaderText="gvSessionState">
<ItemStyle Width="30%" Wrap="false"/>
<ItemTemplate>
<asp:Literal ID="litSessionState" runat="server" Text='<%# Eval("SessionState") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkLogOff" runat="server" Text="Log Off" CommandName="LogOff" CommandArgument='<%# Eval("UnifiedSessionId") + ";" + Eval("HostServer") %>'
meta:resourcekey="cmdLogOff" OnClientClick="return confirm('Are you sure you want to log off selected user?')"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</asp:Panel>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.RemoteDesktopServices;
namespace WebsitePanel.Portal.RDS
{
public partial class RDSUserSessions : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
buttonPanel.ButtonSaveVisible = false;
if (!IsPostBack)
{
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
litCollectionName.Text = collection.Name;
BindGrid();
}
}
protected void gvRDSCollections_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "LogOff")
{
var arguments = e.CommandArgument.ToString().Split(';');
string unifiedSessionId = arguments[0];
string hostServer = arguments[1];
try
{
ES.Services.RDS.LogOffRdsUser(PanelRequest.ItemID, unifiedSessionId, hostServer);
BindGrid();
}
catch (Exception ex)
{
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_LOG_OFF_USER", ex);
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
{
return;
}
}
protected void btnSaveExit_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
{
return;
}
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId));
}
private void BindGrid()
{
var userSessions = new List<RdsUserSession>();
try
{
userSessions = ES.Services.RDS.GetRdsUserSessions(PanelRequest.CollectionID).ToList();
}
catch(Exception ex)
{
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_USER_SESSIONS", ex);
}
gvRDSUserSessions.DataSource = userSessions;
gvRDSUserSessions.DataBind();
}
}
}

View file

@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <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.RDS {
public partial class RDSUserSessions {
/// <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>
/// imgEditRDSCollection 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.Image imgEditRDSCollection;
/// <summary>
/// locTitle 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 locTitle;
/// <summary>
/// litCollectionName 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 litCollectionName;
/// <summary>
/// tabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.RDS.UserControls.RdsServerTabs tabs;
/// <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>
/// secRdsUserSessions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secRdsUserSessions;
/// <summary>
/// panelRdsUserSessions 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 panelRdsUserSessions;
/// <summary>
/// gvRDSUserSessions 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.GridView gvRDSUserSessions;
/// <summary>
/// buttonPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel;
}
}

View file

@ -129,4 +129,7 @@
<data name="Tab.Settings" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Tab.UserSessions" xml:space="preserve">
<value>User Sessions</value>
</data>
</root>

View file

@ -5,13 +5,13 @@
<asp:DataList ID="rdsTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" EnableViewState="false">
<ItemStyle Wrap="False" />
<ItemTemplate >
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClientClick="ShowProgressDialog('Adding server...'); return false;">
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked();">
<%# Eval("Name") %>
</asp:HyperLink>
</ItemTemplate>
<SelectedItemStyle Wrap="False" />
<SelectedItemTemplate>
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClientClick="ShowProgressDialog('Adding server...'); return false;">
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked;">
<%# Eval("Name") %>
</asp:HyperLink>
</SelectedItemTemplate>
@ -19,4 +19,12 @@
</td>
</tr>
</table>
<br />
<br />
<script type="text/javascript">
function tabClicked() {
ShowProgressDialog('Loading');
ShowProgressDialogInternal();
return true;
}
</script>

View file

@ -24,6 +24,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
tabsList.Add(CreateTab("rds_edit_collection_settings", "Tab.Settings"));
tabsList.Add(CreateTab("rds_collection_edit_apps", "Tab.RdsApplications"));
tabsList.Add(CreateTab("rds_collection_edit_users", "Tab.RdsUsers"));
tabsList.Add(CreateTab("rds_collection_user_sessions", "Tab.UserSessions"));
int idx = 0;

View file

@ -330,6 +330,13 @@
<Compile Include="RDS\RDSCollections.ascx.designer.cs">
<DependentUpon>RDSCollections.ascx</DependentUpon>
</Compile>
<Compile Include="RDS\RDSUserSessions.ascx.cs">
<DependentUpon>RDSUserSessions.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="RDS\RDSUserSessions.ascx.designer.cs">
<DependentUpon>RDSUserSessions.ascx</DependentUpon>
</Compile>
<Compile Include="RDS\UserControls\RDSCollectionApps.ascx.cs">
<DependentUpon>RDSCollectionApps.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4365,6 +4372,7 @@
<Content Include="RDS\RDSEditCollectionUsers.ascx" />
<Content Include="RDS\RDSCreateCollection.ascx" />
<Content Include="RDS\RDSCollections.ascx" />
<Content Include="RDS\RDSUserSessions.ascx" />
<Content Include="RDS\UserControls\RDSCollectionApps.ascx" />
<Content Include="RDS\UserControls\RDSCollectionServers.ascx" />
<Content Include="RDS\UserControls\RDSCollectionUsers.ascx" />
@ -4386,6 +4394,7 @@
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionTabs.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="RDS\App_LocalResources\RDSUserSessions.ascx.resx" />
<EmbeddedResource Include="ScheduleTaskControls\App_LocalResources\DomainLookupView.ascx.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DomainLookupView.ascx.Designer.cs</LastGenOutput>
@ -5702,7 +5711,9 @@
<Content Include="RDS\App_LocalResources\RDSEditCollectionUsers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="RDS\App_LocalResources\RDSEditCollectionApps.ascx.resx" />
<Content Include="RDS\App_LocalResources\RDSEditCollectionApps.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionUsers.ascx.resx" />
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionServers.ascx.resx" />
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionApps.ascx.resx" />