Full desktop connection icon

This commit is contained in:
vfedosevich 2015-01-30 00:32:12 -08:00
parent 128fdaaa0b
commit 68375df8fc
7 changed files with 54 additions and 3 deletions

View file

@ -1300,6 +1300,11 @@ namespace WebsitePanel.EnterpriseServer
List<RemoteApplication> remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList();
foreach (var app in remoteAppsToAdd)
{
if (!string.IsNullOrEmpty(app.RequiredCommandLine))
{
app.RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName);
}
AddRemoteApplicationToCollection(itemId, collection, app);
}

View file

@ -35,5 +35,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
public string FilePath { get; set; }
public string FileVirtualPath { get; set; }
public bool ShowInWebAccess { get; set; }
public string RequiredCommandLine { get; set; }
}
}

View file

@ -742,6 +742,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
cmd.Parameters.Add("FilePath", remoteApp.FilePath);
cmd.Parameters.Add("ShowInWebAccess", remoteApp.ShowInWebAccess);
if (!string.IsNullOrEmpty(remoteApp.RequiredCommandLine))
{
cmd.Parameters.Add("CommandLineSetting", "Require");
cmd.Parameters.Add("RequiredCommandLine", remoteApp.RequiredCommandLine);
}
ExecuteShellCommand(runSpace, cmd, false);
result = true;
@ -1157,6 +1163,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess"))
};
var requiredCommandLine = GetPSObjectProperty(psObject, "RequiredCommandLine");
remoteApp.RequiredCommandLine = requiredCommandLine == null ? null : requiredCommandLine.ToString();
return remoteApp;
}

View file

@ -138,6 +138,9 @@
<data name="btnDelete.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="btnFullDesktopConnection.Text" xml:space="preserve">
<value>Add Full Desktop Connection</value>
</data>
<data name="gvAppName.HeaderText" xml:space="preserve">
<value>Remote Application Name</value>
</data>

View file

@ -6,6 +6,7 @@
<div class="FormButtonsBarClean">
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
<asp:Button ID="btnFullDesktopConnection" runat="server" Text="" CssClass="Button1" OnClick="btnFullDesktopConnection_Click" meta:resourcekey="btnFullDesktopConnection"/>
</div>
<asp:GridView ID="gvApps" runat="server" meta:resourcekey="gvApps" AutoGenerateColumns="False"
Width="600px" CssSelectorClass="NormalGridView"
@ -26,6 +27,7 @@
<ItemTemplate>
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>

View file

@ -104,9 +104,25 @@ namespace WebsitePanel.Portal.RDS.UserControls
List<RemoteApplication> selectedApps = GetPopUpGridViewApps();
BindApps(selectedApps.ToArray(), true);
}
protected void btnFullDesktopConnection_Click(object sender, EventArgs e)
{
var newApps = new RemoteApplication[]
{
new RemoteApplication
{
DisplayName = "Session Host",
FilePath = "%SystemRoot%\\system32\\mstsc.exe",
Alias = "mstsc",
RequiredCommandLine = "/v:",
ShowInWebAccess = true
}
};
BindApps(newApps, true);
}
protected void BindPopupApps()
{
RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
@ -156,6 +172,11 @@ namespace WebsitePanel.Portal.RDS.UserControls
}
}
if (apps.Any(a => a.DisplayName.Equals("session host", StringComparison.CurrentCultureIgnoreCase)))
{
btnFullDesktopConnection.Enabled = false;
}
gvApps.DataSource = apps;
gvApps.DataBind();
}
@ -174,6 +195,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
app.Alias = (string)gvApps.DataKeys[i][0];
app.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text;
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value;
if (state == SelectedState.All ||
(state == SelectedState.Selected && chkSelect.Checked) ||

View file

@ -39,6 +39,15 @@ namespace WebsitePanel.Portal.RDS.UserControls {
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDelete;
/// <summary>
/// btnFullDesktopConnection 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 btnFullDesktopConnection;
/// <summary>
/// gvApps control.
/// </summary>