Add service levels quota view to space stats & org stats pages. Change quota type.
Expand collapsible panel when user have level id on user settings page.
This commit is contained in:
parent
243c065ebb
commit
b5444f10ec
10 changed files with 334 additions and 60 deletions
|
@ -219,4 +219,7 @@
|
|||
<data name="locEnterpriseStorage.Text" xml:space="preserve">
|
||||
<value>Enterprise Storage</value>
|
||||
</data>
|
||||
<data name="locServiceLevels.Text" xml:space="preserve">
|
||||
<value>Service Levels</value>
|
||||
</data>
|
||||
</root>
|
|
@ -315,6 +315,14 @@
|
|||
</td>
|
||||
</tr>
|
||||
</asp:Panel>
|
||||
|
||||
<asp:Panel runat="server" ID="serviceLevelsStatsPanel">
|
||||
<tr>
|
||||
<td class="OrgStatsGroup" width="100%" colspan="2">
|
||||
<asp:Localize ID="locServiceLevels" runat="server" meta:resourcekey="locServiceLevels" ></asp:Localize>
|
||||
</td>
|
||||
</tr>
|
||||
</asp:Panel>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
|
@ -279,6 +281,14 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
}
|
||||
else
|
||||
enterpriseStorageStatsPanel.Visible = false;
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels))
|
||||
{
|
||||
serviceLevelsStatsPanel.Visible = true;
|
||||
BindServiceLevelsStats(cntx);
|
||||
}
|
||||
else
|
||||
serviceLevelsStatsPanel.Visible = false;
|
||||
}
|
||||
|
||||
private void BindCRMStats(OrganizationStatistics stats, OrganizationStatistics tenantStats)
|
||||
|
@ -379,5 +389,40 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
||||
}
|
||||
|
||||
private void BindServiceLevelsStats(PackageContext cntx)
|
||||
{
|
||||
foreach (var quota in Array.FindAll<QuotaValueInfo>(
|
||||
cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS)))
|
||||
{
|
||||
HtmlTableRow tr = new HtmlTableRow();
|
||||
tr.Attributes["class"] = "OrgStatsRow";
|
||||
HtmlTableCell col1 = new HtmlTableCell();
|
||||
col1.Attributes["class"] = "OrgStatsQuota";
|
||||
col1.Attributes["nowrap"] = "nowrap";
|
||||
HyperLink link = new HyperLink();
|
||||
link.ID = "lnk_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim();
|
||||
link.Text = quota.QuotaDescription;
|
||||
|
||||
col1.Controls.Add(link);
|
||||
|
||||
HtmlTableCell col2 = new HtmlTableCell();
|
||||
QuotaViewer quotaControl = (QuotaViewer)LoadControl("../UserControls/QuotaViewer.ascx");
|
||||
quotaControl.ID = quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim() + "Stats";
|
||||
quotaControl.QuotaTypeId = quota.QuotaTypeId;
|
||||
quotaControl.DisplayGauge = true;
|
||||
quotaControl.QuotaValue = quota.QuotaAllocatedValue;
|
||||
quotaControl.QuotaUsedValue = quota.QuotaUsedValue;
|
||||
if (quota.QuotaAllocatedValue != -1)
|
||||
quotaControl.QuotaAvailable = quota.QuotaAllocatedValue - quota.QuotaUsedValue;
|
||||
|
||||
col2.Controls.Add(quotaControl);
|
||||
|
||||
|
||||
tr.Controls.Add(col1);
|
||||
tr.Controls.Add(col2);
|
||||
serviceLevelsStatsPanel.Controls.Add(tr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -740,5 +740,23 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.QuotaViewer enterpriseStorageFoldersStats;
|
||||
|
||||
/// <summary>
|
||||
/// serviceLevelsStatsPanel 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 serviceLevelsStatsPanel;
|
||||
|
||||
/// <summary>
|
||||
/// locServiceLevels 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 locServiceLevels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,6 +128,8 @@ namespace WebsitePanel.Portal.HostedSolution
|
|||
|
||||
if (user.LevelId > 0 && secServiceLevels.Visible)
|
||||
{
|
||||
secServiceLevels.IsCollapsed = false;
|
||||
|
||||
ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId);
|
||||
|
||||
bool addLevel = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<%@ Register Src="UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %>
|
||||
|
||||
<div class="FormBody">
|
||||
<table cellpadding="3">
|
||||
<table id="tblQuotas" runat="server" cellpadding="3">
|
||||
<tr ID="pnlDiskspace" runat="server">
|
||||
<td class="SubHead" nowrap><asp:Label runat="server" meta:resourcekey="lblDiskspace" Text="Diskspace, MB:"/></td>
|
||||
<td class="Normal"><wsp:Quota ID="quotaDiskspace" runat="server" QuotaName="OS.Diskspace" DisplayGauge="True" /> (<asp:HyperLink
|
||||
|
@ -22,12 +22,12 @@
|
|||
<td class="SubHead" nowrap><asp:Label ID="lblSubDomains" runat="server" meta:resourcekey="lblSubDomains" Text="Sub-Domains:"></asp:Label></td>
|
||||
<td class="Normal"><wsp:Quota ID="quotaSubDomains" runat="server" QuotaName="OS.SubDomains" DisplayGauge="True" /></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr ID="pnlDomainPointers" runat="server">
|
||||
|
||||
<%-- <tr ID="pnlDomainPointers" runat="server">
|
||||
<td class="SubHead" nowrap><asp:Label ID="lblDomainPointers" runat="server" meta:resourcekey="lblDomainPointers" Text="Domain Pointers:"></asp:Label></td>
|
||||
<td class="Normal"><wsp:Quota ID="quotaDomainPointers" runat="server" QuotaName="OS.DomainPointers" DisplayGauge="True" /></td>
|
||||
</tr>
|
||||
-->
|
||||
</tr>--%>
|
||||
|
||||
<tr ID="pnlOrganizations" runat="server">
|
||||
<td class="SubHead" nowrap><asp:Label ID="lblOrganizations" runat="server" meta:resourcekey="lblOrganizations" Text="Organizations:"></asp:Label></td>
|
||||
<td class="Normal"><wsp:Quota ID="quotaOrganizations" runat="server" QuotaName="HostedSolution.Organizations" DisplayGauge="True" /></td>
|
||||
|
|
|
@ -131,6 +131,8 @@ namespace WebsitePanel.Portal
|
|||
|
||||
protected override void OnPreRender(EventArgs e)
|
||||
{
|
||||
//
|
||||
AddServiceLevelsQuotas();
|
||||
//
|
||||
SetVisibilityStatus4BriefQuotasBlock();
|
||||
//
|
||||
|
@ -175,5 +177,77 @@ namespace WebsitePanel.Portal
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//private void AddServiceLevelsQuotas()
|
||||
//{
|
||||
// foreach(var quota in Array.FindAll<QuotaValueInfo>(
|
||||
// cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS)))
|
||||
// {
|
||||
// HtmlGenericControl tr = new HtmlGenericControl();
|
||||
// tr.ID = "pnl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "");
|
||||
// tr.TagName = "tr";
|
||||
|
||||
// HtmlGenericControl col1 = new HtmlGenericControl();
|
||||
// col1.TagName = "td";
|
||||
// col1.Attributes["class"] = "SubHead";
|
||||
// col1.Attributes["nowrap"] = "nowrap";
|
||||
// Label lbl = new Label();
|
||||
// lbl.ID = "lbl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "");
|
||||
// lbl.Text = quota.QuotaDescription;
|
||||
// col1.Controls.Add(lbl);
|
||||
|
||||
// HtmlGenericControl col2 = new HtmlGenericControl();
|
||||
// col2.TagName = "td";
|
||||
// col2.Attributes["class"] = "Normal";
|
||||
// //Quota quotaControl = new Quota();
|
||||
// // quotaControl.ID = "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "");
|
||||
// // quotaControl.QuotaName = quota.QuotaName;
|
||||
// // quotaControl.Viewer = new QuotaViewer();
|
||||
// // quotaControl.DisplayGauge = true;
|
||||
// col2.InnerHtml = string.Format(
|
||||
// "<wsp:Quota ID=\"{0}\" runat=\"server\" QuotaName=\"{1}\" DisplayGauge=\"True\" />",
|
||||
// "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, ""),
|
||||
// quota.QuotaName);
|
||||
// //col2.Controls.Add(quotaControl);
|
||||
|
||||
// tr.Controls.Add(col1);
|
||||
// tr.Controls.Add(col2);
|
||||
// tblQuotas.Controls.Add((Control)tr);
|
||||
|
||||
// Control c1 = new Control();
|
||||
// }
|
||||
//}
|
||||
|
||||
private void AddServiceLevelsQuotas()
|
||||
{
|
||||
foreach (var quota in Array.FindAll<QuotaValueInfo>(
|
||||
cntx.QuotasArray, x => x.QuotaName.Contains(Quotas.SERVICE_LEVELS)))
|
||||
{
|
||||
HtmlTableRow tr = new HtmlTableRow();
|
||||
tr.ID = "pnl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim();
|
||||
HtmlTableCell col1 = new HtmlTableCell();
|
||||
col1.Attributes["class"] = "SubHead";
|
||||
col1.Attributes["nowrap"] = "nowrap";
|
||||
Label lbl = new Label();
|
||||
lbl.ID = "lbl_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim();
|
||||
lbl.Text = quota.QuotaDescription;
|
||||
|
||||
col1.Controls.Add(lbl);
|
||||
|
||||
HtmlTableCell col2 = new HtmlTableCell();
|
||||
col2.Attributes["class"] = "Normal";
|
||||
Quota quotaControl = (Quota)LoadControl("UserControls/Quota.ascx");
|
||||
quotaControl.ID = "quota_" + quota.QuotaName.Replace(Quotas.SERVICE_LEVELS, "").Replace(" ", string.Empty).Trim();
|
||||
quotaControl.QuotaName = quota.QuotaName;
|
||||
quotaControl.DisplayGauge = true;
|
||||
|
||||
col2.Controls.Add(quotaControl);
|
||||
|
||||
|
||||
tr.Controls.Add(col1);
|
||||
tr.Controls.Add(col2);
|
||||
tblQuotas.Controls.Add(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +1,3 @@
|
|||
// Copyright (c) 2014, 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.
|
||||
|
@ -40,6 +12,15 @@ namespace WebsitePanel.Portal {
|
|||
|
||||
public partial class SpaceQuotas {
|
||||
|
||||
/// <summary>
|
||||
/// tblQuotas control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlTable tblQuotas;
|
||||
|
||||
/// <summary>
|
||||
/// pnlDiskspace control.
|
||||
/// </summary>
|
||||
|
@ -148,33 +129,6 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.Quota quotaSubDomains;
|
||||
|
||||
/// <summary>
|
||||
/// pnlDomainPointers control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDomainPointers;
|
||||
|
||||
/// <summary>
|
||||
/// lblDomainPointers 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 lblDomainPointers;
|
||||
|
||||
/// <summary>
|
||||
/// quotaDomainPointers control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.Quota quotaDomainPointers;
|
||||
|
||||
/// <summary>
|
||||
/// pnlOrganizations control.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue