I'm a cut and paste "programmer" that relies on the code of others to get things done. My limitations become clear when I try combine two snippets of code in a single widget. I'm hoping someone can help me with this.
I found this code to generate a list of sites, with each site linking to a summary page of status information.
Select distinct N.CustomProperties.DeviceType
, CASE WHEN D.Link is null then NULL
ELSE CONCAT(D.Link,'?filters=', d.InstanceSiteId, '_Orion.NodesCustomProperties_DeviceType:eq:',N.CustomProperties.Site)
END AS DashLink
From Orion.Nodes N
LEFT JOIN
(
SELECT TOP 1 InstanceSiteId, '/apps/platform/dashboard/' + TOSTRING(DashboardID) as Link
FROM Orion.Dashboards.Instances
WHERE DisplayName='Site Summary - Overview'
ORDER BY DashboardID
) D ON 1=1
where N.CustomProperties.Site is not null
I then found this code that builds a list of maps the exist for each node:
SELECT
[P].AccountID AS [Map Creator]
, [P].DisplayName AS [Map Name]
, '/ui/maps/viewer/' + [P].ProjectID AS [_LinkFor_Map Name]
, [P].EntityCount AS [Entities]
, ToLocal([P].CreateDateTime) AS [Created]
, ToLocal([P].UpdateDateTime) AS [Last Updated]
FROM Orion.Maps.Projects [P]
--WHERE ([P].AccountID LIKE '%${SEARCH_STRING}%' OR [P].DisplayName LIKE '%${SEARCH_STRING}%')
ORDER BY [Last Updated] DESC
What I'm trying to do is add a column in the Site List table with a link to the Orion map associated with each site. The goal is for a user to be able to click on the site name to get to the alerts status, and to click on the maps link to go directly to the site map. Hope this makes sense.
Thanks!
Joe