Announcement

Collapse
No announcement yet.

Reference ID

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Reference ID

    Hello,

    Is there a way to show al my devices by Reference ID


    Ed

    #2
    How do you mean...if you mean display it in the device management page then no by default (HST say you can hover the link and see it at the bottom of your browser but IMHO it would be better if it was a selectable column or a proper tooltip, although you could look at making a small page yourself if you wanted the reference and the names/locations of the devices.

    Comment


      #3

      Comment


        #4
        Originally posted by mrhappy View Post
        ..... although you could look at making a small page yourself if you wanted the reference and the names/locations of the devices.
        Do you know of any examples of code for building custom pages?

        Scott

        Comment


          #5
          Originally posted by ScottRennie View Post
          Do you know of any examples of code for building custom pages?

          Scott
          There are probably others but this is a very basic page that will build a HTML table of the devices in HS and give you the reference, location and name of device in different columns. Would need some tarting up a bit...

          Code:
          <%@ Page Language="VB" %>
          <script runat="server">
          
          Dim hs As Scheduler.hsapplication
          
            Sub Page_Load(Sender As Object, E As EventArgs)
                  ' for use with the HS web server
                  hs = Context.Items("Content")
          End Sub
          
          Private Function GetHeadContent() As String
                  Try
                      Return hs.GetPageHeader("", "Google Calendar", "", "", False, False, True, False, False)
                  Catch ex As Exception
                  End Try
                  Return ""
              End Function
          
          Private Function GetFootContent() As String
                  Try
                      Return hs.GetPageFooter(False)
                  Catch ex As Exception
                  End Try
                  Return ""
          End Function
          
          Private Function GetBodyContent() As String
                  Try
                      Return hs.GetPageHeader("", "Google Calendar", "", "", False, True, False, True, False)
                  Catch ex As Exception
                  End Try
                  Return ""
              End Function
          
          Private Function GetTableContent() As String
                  Try
          		Dim td As New StringBuilder
          
          		Dim dv As Scheduler.Classes.DeviceClass
          		Dim EN As Scheduler.Classes.clsDeviceEnumeration
          	
          		EN = hs.GetDeviceEnumerator
          
          		hs.writelog("Test", "GetTableContent Entered")
          
          		td.Append("<table><tr><td>Reference</td><td>Location</td><td>Device Name</td></tr>")
          	
          		Do
          
          		dv = EN.GetNext
          		td.Append("<tr><td>" & dv.Ref(Nothing) & "</td><td>" & dv.Location(Nothing) & "</td><td>" & dv.Name
          
          (Nothing) & "</td><tr>")
          
          		Loop Until EN.Finished
          
          		td.Append("</table>")
          
          		Return td.ToString
          
          	Catch ex As Exception : Return "Unknown Error"
                  End Try
          End Function
          
          </script>
          <html>
          <head runat="server">
          <%response.write(GetHeadContent())%>
          </head>
          <body>
          <% response.write(GetBodyContent()) %>
          <br><br>
          <% response.write(GetTableContent()) %>
          <br><br>
          <% response.write(GetFootContent()) %>
          </body>
          </html>

          Comment

          Working...
          X