This commit is contained in:
Virtuworks 2015-03-12 14:10:25 -04:00
commit c6afa62014
16 changed files with 403 additions and 165 deletions

View file

@ -162,4 +162,10 @@
<data name="litFileManagerEditableExtensions.Text" xml:space="preserve">
<value>(One (1) extension per line)</value>
</data>
<data name="lblRdsController.Text" xml:space="preserve">
<value>Main RDS Controller:</value>
</data>
<data name="RdsSettings.Text" xml:space="preserve">
<value>RDS</value>
</data>
</root>

View file

@ -54,11 +54,8 @@ namespace WebsitePanel.Portal
foreach (var rdsServer in rdsServers.Servers)
{
if (rdsServer.ItemId.HasValue)
{
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId.Value) != null;
}
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(null, rdsServer.FqdName);
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId) != null;
}
return rdsServers.Servers;

View file

@ -205,7 +205,7 @@
</tr>
<tr>
<td colspan="2">
<asp:CheckBox ID="cbAuthentication" Text="Allow connections only from computers runnig Remote Desktop with Network Level Authentication" runat="server"/>
<asp:CheckBox ID="cbAuthentication" Text="Allow connections only from computers running Remote Desktop with Network Level Authentication" runat="server"/>
</td>
</tr>
</table>

View file

@ -91,7 +91,7 @@
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Convert.ToBoolean(Eval("SslAvailable")) && Eval("ItemId") != null && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Convert.ToBoolean(Eval("SslAvailable")) && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
CommandName="InstallCertificate" CommandArgument='<%# Eval("Id") %>' ToolTip="Repair Certificate"
OnClientClick="if(confirm('Are you sure you want to install certificate?')) ShowProgressDialog('Installing certificate...'); else return false;"></asp:LinkButton>
</ItemTemplate>
@ -100,7 +100,7 @@
<ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton>
meta:resourcekey="cmdDelete" OnClientClick="if(confirm('Are you sure you want to delete selected rds server??')) ShowProgressDialog('Removeing RDS Server...'); else return false;"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>

View file

@ -88,6 +88,8 @@ namespace WebsitePanel.Portal
result = ES.Services.RDS.RemoveRdsServer(rdsServerId);
}
((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide();
if (!result.IsSuccess)
{
messageBox.ShowMessage(result, "REMOTE_DESKTOP_SERVICES_REMOVE_RDSSERVER", "RDS");
@ -136,7 +138,7 @@ namespace WebsitePanel.Portal
{
ViewInfoModal.Show();
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
var serverInfo = ES.Services.RDS.GetRdsServerInfo(rdsServer.ItemId.Value, rdsServer.FqdName);
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);
@ -149,14 +151,14 @@ namespace WebsitePanel.Portal
private void Restart(string serverId)
{
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
ES.Services.RDS.RestartRdsServer(rdsServer.ItemId.Value, rdsServer.FqdName);
ES.Services.RDS.RestartRdsServer(null, rdsServer.FqdName);
Response.Redirect(Request.Url.ToString(), true);
}
private void ShutDown(string serverId)
{
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
ES.Services.RDS.ShutDownRdsServer(rdsServer.ItemId.Value, rdsServer.FqdName);
ES.Services.RDS.ShutDownRdsServer(null, rdsServer.FqdName);
Response.Redirect(Request.Url.ToString(), true);
}

View file

@ -70,6 +70,18 @@
</tr>
</table>
</asp:Panel>
<wsp:CollapsiblePanel ID="RdsSettings" runat="server" TargetControlID="PanelRdsSettings" meta:resourcekey="RdsSettings" Text="RDS" />
<asp:Panel ID="PanelRdsSettings" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="SubHead" style="width:200px;"><asp:Localize ID="lblRdsController" runat="server" meta:resourcekey="lblRdsController" />
<td style="width:200px;">
<asp:DropDownList ID="ddlRdsController" runat="server" CssClass="HugeTextBox200"/>
</td>
</tr>
</table>
</asp:Panel>
</div>
<div class="FormFooter">
<asp:Button runat="server" ID="btnSaveSettings" meta:resourcekey="btnSaveSettings"

View file

@ -51,6 +51,7 @@ namespace WebsitePanel.Portal
public const string SMTP_ENABLE_SSL = "SmtpEnableSsl";
public const string BACKUPS_PATH = "BackupsPath";
public const string FILE_MANAGER_EDITABLE_EXTENSIONS = "EditableExtensions";
public const string RDS_MAIN_CONTROLLER = "RdsMainController";
/*
public const string FEED_ENABLE_MICROSOFT = "FeedEnableMicrosoft";
@ -136,6 +137,25 @@ namespace WebsitePanel.Portal
// Original WebsitePanel Extensions
txtFileManagerEditableExtensions.Text = FileManager.ALLOWED_EDIT_EXTENSIONS.Replace(",", System.Environment.NewLine);
}
// RDS
var services = ES.Services.RDS.GetRdsServices();
foreach(var service in services)
{
ddlRdsController.Items.Add(new ListItem(service.ServiceName, service.ServiceId.ToString()));
}
settings = ES.Services.System.GetSystemSettings(WSP.SystemSettings.RDS_SETTINGS);
if (settings != null && !string.IsNullOrEmpty(settings[RDS_MAIN_CONTROLLER]))
{
ddlRdsController.SelectedValue = settings[RDS_MAIN_CONTROLLER];
}
else if (ddlRdsController.Items.Count > 0)
{
ddlRdsController.SelectedValue = ddlRdsController.Items[0].Value;
}
}
private void SaveSettings()
@ -207,6 +227,16 @@ namespace WebsitePanel.Portal
result = ES.Services.System.SetSystemSettings(
WSP.SystemSettings.FILEMANAGER_SETTINGS, settings);
if (result < 0)
{
ShowResultMessage(result);
return;
}
settings = new WSP.SystemSettings();
settings[RDS_MAIN_CONTROLLER] = ddlRdsController.SelectedValue;
result = ES.Services.System.SetSystemSettings(WSP.SystemSettings.RDS_SETTINGS, settings);
if (result < 0)
{
ShowResultMessage(result);

View file

@ -1,31 +1,3 @@
// 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.
@ -220,6 +192,42 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFileManagerEditableExtensions;
/// <summary>
/// RdsSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel RdsSettings;
/// <summary>
/// PanelRdsSettings 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 PanelRdsSettings;
/// <summary>
/// lblRdsController 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 lblRdsController;
/// <summary>
/// ddlRdsController 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 ddlRdsController;
/// <summary>
/// btnSaveSettings control.
/// </summary>