Skip to content

Commit

Permalink
feat: added new features like adding an id (portal Alias), database t…
Browse files Browse the repository at this point in the history
…ier info and database size info.
  • Loading branch information
Airam Hernández Hernández committed Jul 20, 2023
1 parent f6edddb commit d62b9a6
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DNNPulse.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="DNNPulse" type="Module" version="01.00.00">
<package name="DNNPulse" type="Module" version="01.01.00">
<friendlyName>DNNPulse</friendlyName>
<description>intelequia.com DNNPulse module</description>
<iconFile>~/Images/icon_extensions_32px.png</iconFile>
Expand Down Expand Up @@ -51,7 +51,7 @@
<attributes>
<businessControllerClass>Intelequia.Modules.DNNPulse.Components.FeatureController, DNNPulse</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<upgradeVersionsList>01.00.00</upgradeVersionsList>
<upgradeVersionsList>01.01.00</upgradeVersionsList>
</attributes>
</eventMessage>
</component>
Expand Down
16 changes: 15 additions & 1 deletion Data/Provider/SqlDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,21 @@ public override Model.DNNPulse GetDNNPulse()
}
else
{
query.DNNVersion = name;
if (type == "DNNVersion")
{
query.DNNVersion = name;
}
else
{
if (type == "DatabaseSize")
{
query.DatabaseSize = name;
}
else
{
query.DatabaseTier = name;
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Model/DNNPulse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public DNNPulse()
public List<String> PortalAlias { get; set; }
public List<String> ModulesName { get; set; }
public List<String> ModulesVersion { get; set; }
public string DatabaseSize { get; set; }
public string DatabaseTier { get; set; }

}
}
3 changes: 3 additions & 0 deletions Model/JsonBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class Properties
public string DNNVersion { get; set; }
public string modules { get; set; }
public string[] portalAliases { get; set; }
public string databaseSize { get; set; }
public string databaseType { get; set; }
public string id { get; set; }
}

public class Module
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("01.00.00.00")]
[assembly: AssemblyFileVersion("01.00.00.00")]
[assembly: AssemblyVersion("01.01.00.00")]
[assembly: AssemblyFileVersion("01.01.00.00")]
38 changes: 34 additions & 4 deletions Providers/DataProviders/SqlDataProvider/01.00.00.SqlDataProvider
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ BEGIN

DECLARE @ModulesVersions TABLE
(
ModuleName Varchar(100),
ModuleName VARCHAR(100),
ModuleVersion VARCHAR(100)
);

DECLARE @DatabaseSize TABLE
(
Size VARCHAR(100)
);

DECLARE @DatabaseTier TABLE
(
Tier VARCHAR(100)
);
INSERT INTO @DNNVersion (DNNVersion)
SELECT TOP 1 CONCAT(major, '.' , minor, '.' ,build)
FROM Version
Expand All @@ -39,20 +48,41 @@ BEGIN
FROM DesktopModules
ORDER BY ModuleName ASC, Version ASC;

INSERT INTO @DatabaseSize (Size)
SELECT SUM(size/128.0) AS DatabaseDataSpaceAllocatedInMB
FROM sys.database_files
GROUP BY type_desc
HAVING type_desc = 'ROWS'

INSERT INTO @DatabaseTier (Tier)
SELECT service_objective
FROM sys.database_service_objectives
WHERE database_id = DB_ID();

SELECT *
FROM (
SELECT 'DNNVersion' AS Type, DNNVersion as Name
SELECT 'DNNVersion' AS TYPE, DNNVersion AS NAME
FROM @DNNVersion

UNION ALL

SELECT 'PortalAlias' as Type, HTTPALIAS as Name
SELECT 'PortalAlias' AS TYPE, HTTPALIAS AS NAME
FROM @PortalAliases

UNION ALL

SELECT 'Modules' as Type, CONCAT(ModuleName, ' - ', ModuleVersion) as Name
SELECT 'Modules' AS TYPE, CONCAT(ModuleName, ' - ', ModuleVersion) AS NAME
FROM @ModulesVersions

UNION ALL

SELECT 'DatabaseSize' AS TYPE, Size AS NAME
FROM @DatabaseSize

UNION ALL

SELECT 'DatabaseTier' AS TYPE, Tier AS NAME
FROM @DatabaseTier
) AS DNNPulse

END
Expand Down
12 changes: 10 additions & 2 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
<p class="Owner">
<b>Version 1.0.0</b>
</p>
<p>Initial realease.<br /><br /></p>

<p>Initial realease.<br /><br /></p>
<p class="Owner">
<b>Version 1.1.0</b>
</p>
<p>Added new features:
<ul>
<li>Database Size information added.</li>
<li>Database Tier information added.</li>
</ul>
<br /><br /></p>
</div>
4 changes: 4 additions & 0 deletions Tasks/PulseTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -81,7 +82,10 @@ public static JsonBase GetMappedJsonBase(Model.DNNPulse dnnPulse)
Properties jsonProperties = new Properties
{
DNNVersion = dnnPulse.DNNVersion,
databaseSize = dnnPulse.DatabaseSize,
databaseType = dnnPulse.DatabaseTier,
portalAliases = dnnPulse.PortalAlias.ToArray(),
id = dnnPulse.PortalAlias.FirstOrDefault()
};
for (int cont = 0; cont < dnnPulse.ModulesName.Count; cont++)
{
Expand Down

0 comments on commit d62b9a6

Please sign in to comment.