Full desktop connection icon
This commit is contained in:
parent
128fdaaa0b
commit
68375df8fc
7 changed files with 54 additions and 3 deletions
|
@ -1300,6 +1300,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
List<RemoteApplication> remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList();
|
List<RemoteApplication> remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList();
|
||||||
foreach (var app in remoteAppsToAdd)
|
foreach (var app in remoteAppsToAdd)
|
||||||
{
|
{
|
||||||
|
if (!string.IsNullOrEmpty(app.RequiredCommandLine))
|
||||||
|
{
|
||||||
|
app.RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName);
|
||||||
|
}
|
||||||
|
|
||||||
AddRemoteApplicationToCollection(itemId, collection, app);
|
AddRemoteApplicationToCollection(itemId, collection, app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,5 +35,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
public string FileVirtualPath { get; set; }
|
public string FileVirtualPath { get; set; }
|
||||||
public bool ShowInWebAccess { get; set; }
|
public bool ShowInWebAccess { get; set; }
|
||||||
|
public string RequiredCommandLine { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -742,6 +742,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
cmd.Parameters.Add("FilePath", remoteApp.FilePath);
|
cmd.Parameters.Add("FilePath", remoteApp.FilePath);
|
||||||
cmd.Parameters.Add("ShowInWebAccess", remoteApp.ShowInWebAccess);
|
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);
|
ExecuteShellCommand(runSpace, cmd, false);
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -1157,6 +1163,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess"))
|
ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var requiredCommandLine = GetPSObjectProperty(psObject, "RequiredCommandLine");
|
||||||
|
remoteApp.RequiredCommandLine = requiredCommandLine == null ? null : requiredCommandLine.ToString();
|
||||||
|
|
||||||
return remoteApp;
|
return remoteApp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,9 @@
|
||||||
<data name="btnDelete.Text" xml:space="preserve">
|
<data name="btnDelete.Text" xml:space="preserve">
|
||||||
<value>Delete</value>
|
<value>Delete</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="btnFullDesktopConnection.Text" xml:space="preserve">
|
||||||
|
<value>Add Full Desktop Connection</value>
|
||||||
|
</data>
|
||||||
<data name="gvAppName.HeaderText" xml:space="preserve">
|
<data name="gvAppName.HeaderText" xml:space="preserve">
|
||||||
<value>Remote Application Name</value>
|
<value>Remote Application Name</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<div class="FormButtonsBarClean">
|
<div class="FormButtonsBarClean">
|
||||||
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
|
<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="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>
|
</div>
|
||||||
<asp:GridView ID="gvApps" runat="server" meta:resourcekey="gvApps" AutoGenerateColumns="False"
|
<asp:GridView ID="gvApps" runat="server" meta:resourcekey="gvApps" AutoGenerateColumns="False"
|
||||||
Width="600px" CssSelectorClass="NormalGridView"
|
Width="600px" CssSelectorClass="NormalGridView"
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
|
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
|
||||||
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
|
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
|
||||||
|
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
|
|
|
@ -104,9 +104,25 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
List<RemoteApplication> selectedApps = GetPopUpGridViewApps();
|
List<RemoteApplication> selectedApps = GetPopUpGridViewApps();
|
||||||
|
|
||||||
BindApps(selectedApps.ToArray(), true);
|
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()
|
protected void BindPopupApps()
|
||||||
{
|
{
|
||||||
RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
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.DataSource = apps;
|
||||||
gvApps.DataBind();
|
gvApps.DataBind();
|
||||||
}
|
}
|
||||||
|
@ -174,6 +195,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
app.Alias = (string)gvApps.DataKeys[i][0];
|
app.Alias = (string)gvApps.DataKeys[i][0];
|
||||||
app.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text;
|
app.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text;
|
||||||
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
|
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
|
||||||
|
app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value;
|
||||||
|
|
||||||
if (state == SelectedState.All ||
|
if (state == SelectedState.All ||
|
||||||
(state == SelectedState.Selected && chkSelect.Checked) ||
|
(state == SelectedState.Selected && chkSelect.Checked) ||
|
||||||
|
|
|
@ -39,6 +39,15 @@ namespace WebsitePanel.Portal.RDS.UserControls {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.Button btnDelete;
|
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>
|
/// <summary>
|
||||||
/// gvApps control.
|
/// gvApps control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue