Skip to content

Commit

Permalink
Add support for Device Status Widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandbanks committed Jul 25, 2024
1 parent 4e40afa commit 373d8a0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions LogicMonitor.Api/Converters/WidgetConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected override Widget Create(Type objectType, JObject jObject)
"netflowgraph" => new NetflowGraphWidget(),
"groupnetflow" => new GroupNetflowWidget(),
"dynamictable" => new DynamicTableWidget(),
"devicestatus" => new DeviceStatusWidget(),
_ => throw new NotSupportedException($"WidgetConverter.cs needs updating to include {type} widgets."),
};
}
Expand Down
26 changes: 26 additions & 0 deletions LogicMonitor.Api/Dashboards/DeviceStatusWidget.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace LogicMonitor.Api.Dashboards;

/// <summary>
/// A Device Status Widget
/// </summary>
[DataContract]
public class DeviceStatusWidget : Widget, IWidget
{
/// <summary>
/// The Device ID
/// </summary>
[DataMember(Name = "deviceId")]
public string DeviceId { get; set; } = string.Empty;

/// <summary>
/// The Device Display Name
/// </summary>
[DataMember(Name = "deviceDisplayName")]
public string DeviceDisplayName { get; set; } = string.Empty;

/// <summary>
/// The Display Settings
/// </summary>
[DataMember(Name = "displaySettings")]
public DisplaySettings DisplaySettings { get; set; } = new();
}
2 changes: 1 addition & 1 deletion LogicMonitor.Api/Dashboards/Widget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace LogicMonitor.Api.Dashboards;
public class Widget : NamedItem, IHasEndpoint, IWidget
{
/// <summary>
/// alert | batchjob | flash | gmap | ngraph | ograph | cgraph | sgraph | netflowgraph | groupNetflowGraph | netflow | groupNetflow | html | bigNumber | gauge | pieChart | table | dynamicTable | deviceSLA | text | statsd | deviceStatus | serviceAlert | noc | websiteOverview | websiteOverallStatus | websiteIndividualStatus | websiteSLA | savedMap
/// alert | batchjob | flash | gmap | ngraph | ograph | cgraph | sgraph | netflowgraph | groupNetflowGraph | netflow | groupNetflow | html | bigNumber | gauge | pieChart | table | dynamicTable | deviceSLA | text | statsd | deviceStatus | serviceAlert | noc | websiteOverview | websiteOverallStatus | websiteIndividualStatus | websiteSLA | savedMap | devicestatus
/// </summary>
[DataMember(Name = "type")]
public string Type { get; set; } = string.Empty;
Expand Down
3 changes: 1 addition & 2 deletions LogicMonitor.Api/LogicMonitor.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

<!-- Update the following before releasing to nuget -->
<PackageReleaseNotes>
Version 204 support added
Added ApiToken.LastAuthenticatedIp.
Add support for Device Status Widgets
</PackageReleaseNotes>
<UserSecretsId>57aaa0e7-815d-4065-9339-f3f070bed01e</UserSecretsId>

Expand Down

0 comments on commit 373d8a0

Please sign in to comment.