fixed bugs
This commit is contained in:
parent
4514eb02e9
commit
c6da249767
12 changed files with 83 additions and 55 deletions
|
@ -345,7 +345,14 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return new SystemFile[0];
|
||||
}
|
||||
|
||||
EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId));
|
||||
int serviceId = GetEnterpriseStorageServiceID(org.PackageId);
|
||||
|
||||
if (serviceId == 0)
|
||||
{
|
||||
return new SystemFile[0];
|
||||
}
|
||||
|
||||
EnterpriseStorage es = GetEnterpriseStorage(serviceId);
|
||||
|
||||
return es.GetFolders(org.OrganizationId);
|
||||
}
|
||||
|
|
|
@ -960,7 +960,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
SystemFile[] folders = EnterpriseStorageController.GetFolders(itemId);
|
||||
|
||||
stats.CreatedEnterpriseStorageFolders = folders.Count();
|
||||
|
||||
stats.UsedEnterpriseStorageSpace = (int)folders.Sum(x => x.Size);
|
||||
|
||||
stats.AllocatedEnterpriseStorageSpace = folders.Where(x => x.FRSMQuotaMB != -1).Sum(x => x.FRSMQuotaMB);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1020,10 +1023,13 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.EnterpriseStorage))
|
||||
{
|
||||
SystemFile[] folders = EnterpriseStorageController.GetFolders(itemId);
|
||||
SystemFile[] folders = EnterpriseStorageController.GetFolders(o.Id);
|
||||
|
||||
stats.CreatedEnterpriseStorageFolders = folders.Count();
|
||||
stats.UsedEnterpriseStorageSpace = (int)folders.Sum(x => x.Size);
|
||||
stats.CreatedEnterpriseStorageFolders += folders.Count();
|
||||
|
||||
stats.UsedEnterpriseStorageSpace += (int)folders.Sum(x => x.Size);
|
||||
|
||||
stats.AllocatedEnterpriseStorageSpace += folders.Where(x => x.FRSMQuotaMB != -1).Sum(x => x.FRSMQuotaMB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1069,12 +1075,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
stats.AllocatedEnterpriseStorageFolders = cntx.Quotas[Quotas.ENTERPRISESTORAGE_FOLDERS].QuotaAllocatedValue;
|
||||
}
|
||||
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.EnterpriseStorage))
|
||||
{
|
||||
stats.AllocatedEnterpriseStorageSpace = cntx.Quotas[Quotas.ENTERPRISESTORAGE_DISKSTORAGESPACE].QuotaAllocatedValue;
|
||||
}
|
||||
|
||||
return stats;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
@ -238,6 +238,18 @@ namespace WebsitePanel.Providers.OS
|
|||
return result;
|
||||
}
|
||||
|
||||
public int ConvertBytesToGB(long bytes)
|
||||
{
|
||||
int OneKb = 1024;
|
||||
int OneMb = OneKb * 1024;
|
||||
int OneGb = OneMb * 1024;
|
||||
|
||||
if (bytes == 0)
|
||||
return 0;
|
||||
|
||||
return (int)(bytes / OneGb);
|
||||
}
|
||||
|
||||
public int ConvertBytesToMB(long bytes)
|
||||
{
|
||||
int OneKb = 1024;
|
||||
|
@ -246,7 +258,7 @@ namespace WebsitePanel.Providers.OS
|
|||
if (bytes == 0)
|
||||
return 0;
|
||||
|
||||
return (int)bytes / OneMb;
|
||||
return (int)(bytes / OneMb);
|
||||
}
|
||||
|
||||
public void RemoveOldQuotaOnFolder(Runspace runSpace, string path)
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
<value>Folder Url:</value>
|
||||
</data>
|
||||
<data name="locFolderSize" xml:space="preserve">
|
||||
<value>Folder Limit Size (Mb):</value>
|
||||
<value>Folder Limit Size (Gb):</value>
|
||||
</data>
|
||||
<data name="valNumericFolderSize" xml:space="preserve">
|
||||
<value>*</value>
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
<data name="HSFormComments.Text" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="locQuota.Text" xml:space="preserve">
|
||||
<data name="locQuotaFolders.Text" xml:space="preserve">
|
||||
<value>Total Folders Allocated:</value>
|
||||
</data>
|
||||
<data name="Text.PageName" xml:space="preserve">
|
||||
|
@ -153,4 +153,7 @@
|
|||
<data name="gvFolderUrl.Header" xml:space="preserve">
|
||||
<value>Url</value>
|
||||
</data>
|
||||
<data name="locQuotaSpace.Text" xml:space="preserve">
|
||||
<value>Total Space Allocated (Mb):</value>
|
||||
</data>
|
||||
</root>
|
|
@ -36,7 +36,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel150"><asp:Localize ID="locFolderSize" runat="server" meta:resourcekey="locFolderSize" Text="Folder Limit Size (Mb):"></asp:Localize></td>
|
||||
<td class="FormLabel150"><asp:Localize ID="locFolderSize" runat="server" meta:resourcekey="locFolderSize" Text="Folder Limit Size (Gb):"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtFolderSize" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
|
||||
<asp:CompareValidator ID="valNumericFolderSize" runat="server" meta:resourcekey="valNumericFolderSize" ControlToValidate="txtFolderSize"
|
||||
|
|
|
@ -45,6 +45,12 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
public partial class EnterpriseStorageFolderGeneralSettings : WebsitePanelModuleBase
|
||||
{
|
||||
#region Constansts
|
||||
|
||||
const int OneMb = 1024;
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
|
@ -78,7 +84,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
if (folder.FRSMQuotaMB != -1)
|
||||
{
|
||||
txtFolderSize.Text = folder.FRSMQuotaMB.ToString();
|
||||
txtFolderSize.Text = ((int)(folder.FRSMQuotaMB / OneMb)).ToString();
|
||||
}
|
||||
|
||||
var esPermissions = ES.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(PanelRequest.ItemID,folder.Name);
|
||||
|
@ -127,8 +133,8 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
folder = ES.Services.EnterpriseStorage.RenameEnterpriseFolder(PanelRequest.ItemID, PanelRequest.FolderID, txtFolderName.Text);
|
||||
}
|
||||
|
||||
ES.Services.EnterpriseStorage.SetEnterpriseFolderSettings(PanelRequest.ItemID, folder, permissions.GetPemissions(),
|
||||
chkDirectoryBrowsing.Checked, txtFolderSize.Text.Length == 0 ? -1 : int.Parse(txtFolderSize.Text));
|
||||
ES.Services.EnterpriseStorage.SetEnterpriseFolderSettings(PanelRequest.ItemID, folder, permissions.GetPemissions(),
|
||||
chkDirectoryBrowsing.Checked, txtFolderSize.Text.Length == 0 ? -1 : int.Parse(txtFolderSize.Text) * OneMb);
|
||||
|
||||
|
||||
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
|
||||
|
|
|
@ -93,9 +93,15 @@
|
|||
</asp:ObjectDataSource>
|
||||
<br />
|
||||
|
||||
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Folders Used:"></asp:Localize>
|
||||
<asp:Localize ID="locQuotaFolders" runat="server" meta:resourcekey="locQuotaFolders" Text="Total Folders Allocated:"></asp:Localize>
|
||||
|
||||
<wsp:QuotaViewer ID="foldersQuota" runat="server" QuotaTypeId="2" />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<asp:Localize ID="locQuotaSpace" runat="server" meta:resourcekey="locQuotaSpace" Text="Total Space Allocated (Mb):"></asp:Localize>
|
||||
|
||||
<wsp:QuotaViewer ID="spaceQuota" runat="server" QuotaTypeId="2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -80,6 +80,10 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
btnAddFolder.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
spaceQuota.QuotaUsedValue = organizationStats.UsedEnterpriseStorageSpace;
|
||||
|
||||
spaceQuota.QuotaValue = organizationStats.AllocatedEnterpriseStorageSpace;
|
||||
}
|
||||
|
||||
protected void btnAddFolder_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -1,31 +1,3 @@
|
|||
// Copyright (c) 2012, 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.
|
||||
|
@ -167,13 +139,13 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
protected global::System.Web.UI.WebControls.ObjectDataSource odsEnterpriseFoldersPaged;
|
||||
|
||||
/// <summary>
|
||||
/// locQuota control.
|
||||
/// locQuotaFolders 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 locQuota;
|
||||
protected global::System.Web.UI.WebControls.Localize locQuotaFolders;
|
||||
|
||||
/// <summary>
|
||||
/// foldersQuota control.
|
||||
|
@ -183,5 +155,23 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.QuotaViewer foldersQuota;
|
||||
|
||||
/// <summary>
|
||||
/// locQuotaSpace 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 locQuotaSpace;
|
||||
|
||||
/// <summary>
|
||||
/// spaceQuota control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.QuotaViewer spaceQuota;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@
|
|||
<asp:HyperLink ID="lnkEnterpriseStorageSpace" runat="server" meta:resourcekey="lnkEnterpriseStorageSpace" />
|
||||
</td>
|
||||
<td>
|
||||
<wsp:QuotaViewer ID="enterpriseStorageSpaceStats" QuotaTypeId="3" runat="server" DisplayGauge="true" />
|
||||
<wsp:QuotaViewer ID="enterpriseStorageSpaceStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="OrgStatsRow">
|
||||
|
|
|
@ -150,7 +150,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
if (!hideItems)
|
||||
{
|
||||
|
||||
domainStats.QuotaUsedValue = orgStats.CreatedDomains;
|
||||
domainStats.QuotaValue = orgStats.AllocatedDomains;
|
||||
if (orgStats.AllocatedDomains != -1) domainStats.QuotaAvailable = tenantStats.AllocatedDomains - tenantStats.CreatedDomains;
|
||||
|
@ -170,9 +169,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
else
|
||||
organizationStatsPanel.Visible = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.Exchange))
|
||||
{
|
||||
|
@ -300,14 +296,18 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
private void BindEnterpriseStorageStats(OrganizationStatistics stats, OrganizationStatistics tenantStats)
|
||||
{
|
||||
enterpriseStorageSpaceStats.QuotaValue = stats.UsedEnterpriseStorageSpace;
|
||||
enterpriseStorageSpaceStats.QuotaValue = stats.AllocatedEnterpriseStorageSpace;
|
||||
enterpriseStorageSpaceStats.QuotaUsedValue = stats.UsedEnterpriseStorageSpace;
|
||||
|
||||
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
|
||||
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
||||
|
||||
enterpriseStorageFoldersStats.QuotaValue = stats.AllocatedEnterpriseStorageFolders;
|
||||
enterpriseStorageFoldersStats.QuotaUsedValue = stats.CreatedEnterpriseStorageFolders;
|
||||
if (stats.AllocatedEnterpriseStorageFolders != -1) enterpriseStorageFoldersStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders;
|
||||
if (stats.AllocatedEnterpriseStorageFolders != -1)
|
||||
{
|
||||
enterpriseStorageFoldersStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders;
|
||||
}
|
||||
|
||||
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
|
||||
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue