Announcement

Collapse
No announcement yet.

Xport AR Web Management

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

  • Xport AR Web Management

    Hello,

    I would like to adapt the original web interface of the XPort AR to customize its SNMP agent.
    I think I have identified the concept of the ajax web page management but i did not locate the ?ajax_funcs.js? file on the XPort AR file system. I suppose it?s in this file is the correspondence between ?SnmpPage? argument and physical ?snmp.html? page.

    Thanks for your enlighten.

    Pascal, from France

  • #2
    Customizing the SNMP web page

    The correspondence between "SnmpPage" and the files "snmp.html", "snmp.js" and "snmp_doc.html" is built into the firmware and cannot be changed.

    There are several ways you can perform customization:

    The buttons at the left of the web page come from "index.html"; you may remove or add buttons by editing this file. One of the buttons is "SNMP".

    The presentation of the SNMP information is governed by the files "snmp.html", "snmp.js", and "snmp_doc.html"; they may be edited to change presentation, but this will not modify or extend the underlying behavior.

    You may create your own custom code and register it under a URL of your choice, such as "SnmpCustomPage". You would create web files of your own to work with it. Edit "index.html" to add your customized version and, if you like, remove the original.

    Comment


    • #3
      Customizing the SNMP web page

      Thanks scook.
      I've do that.

      I have created files : snmpcustom.js, SnmpCustom.html and SnmpCustom_doc.html (these files are simple copies of SNMP original files) and i have added the line in the "index.html" file.

      <li class="navTitle"><a href="javascript:void(0)" onclick="var jsExists = window.snmpcustomJS; return ajax_AddToHistory('SnmpCustomPage', [true, (!jsExists ? 'snmpcustomJS' : '')]);">NEW SNMP</a></li>
      But nothing when i click on the link "NEW SNMP"

      I use the SDK Xport AR and PARADIGM C++ V6 to custom the SNMP agent.

      I just want to create a submenu on SNMP Web Page (like HTML page) to order SNMP informations.

      Pascal
      Last edited by vigitronic; 12-22-2008, 09:48 AM.

      Comment


      • #4
        Customizing the SNMP Web page with user supplied code

        Good, so far. Now you need to supply your own code.
        In your initialization, add:

        AjaxRegister("SnmpCustomPage", WebMgrSnmpCustomPage);

        Then in your code, add:

        int WebMgrSnmpCustomPage(HttpClient *pClient, void *pOpaque)
        {
        (void)pOpaque;

        AjaxStartResponse(pClient);

        if(HttpGetQueryVar(pClient, "snmpcustomJS") != NULL)
        {
        AjaxSendScriptStart(pClient, "snmpcustomJS");
        HttpSendFileContents(pClient, "/http/config/snmpcustom.js");
        AjaxSendScriptEnd(pClient);
        }

        AjaxSendAssignStart(pClient, "contentData", "innerHTML");
        HttpSendFileContents(pClient, "/http/config/snmpcustom.html");
        AjaxSendAssignEnd(pClient);

        AjaxSendAssignStart(pClient, "documentData", "innerHTML");
        HttpSendFileContents(pClient, "/http/config/snmpcustom_doc.html");
        AjaxSendAssignEnd(pClient);

        /* Your custom info goes here. */
        AjaxSendAssign(pClient, "snmpstatus", "innerHTML", "Demo info here");

        AjaxEndResponse(pClient);

        return TRUE;
        }

        Comment


        • #5
          Customizing the SNMP Web page with user supplied code

          One more thing. There is a "navigation" area at the top of many web pages. The original SNMP page does not have any navigation. To duplicate its function, you will need to clear it:
          AjaxSendClear(pClient, "subnavData", "innerHTML");

          This results in your code looking like:
          int WebMgrSnmpCustomPage(HttpClient *pClient, void *pOpaque)
          {
          (void)pOpaque;

          AjaxStartResponse(pClient);

          if(HttpGetQueryVar(pClient, "snmpcustomJS") != NULL)
          {
          AjaxSendScriptStart(pClient, "snmpcustomJS");
          HttpSendFileContents(pClient, "/http/config/snmpcustom.js");
          AjaxSendScriptEnd(pClient);
          }

          AjaxSendClear(pClient, "subnavData", "innerHTML");

          AjaxSendAssignStart(pClient, "contentData", "innerHTML");
          HttpSendFileContents(pClient, "/http/config/snmpcustom.html");
          AjaxSendAssignEnd(pClient);

          AjaxSendAssignStart(pClient, "documentData", "innerHTML");
          HttpSendFileContents(pClient, "/http/config/snmpcustom_doc.html");
          AjaxSendAssignEnd(pClient);

          /* Your custom info goes here. */
          AjaxSendAssign(pClient, "snmpstatus", "innerHTML", "Demo info here");

          AjaxEndResponse(pClient);

          return TRUE;
          }

          Comment

          Working...
          X