Skip to content
  • Leigh B. Stoller's avatar
    New script to set the node location. Linked from the shownode page. Only · 303132ed
    Leigh B. Stoller authored
    admin people allowed. Comment from script:
    
    # * Initially we come in with just a nodeid. Display a page of little maps
    #   and titles the user must select (a floor in a building) from. User clicks.
    # * Next time through we have a building and floor defined in addition to the
    #   the nodeid. We put up that big image with the current nodes on that floor.
    #   We use the external floormap program to generate that image, but without
    #   an imagemap. Instead, we use a form with an input type=image, which acts
    #   as a big submit button; when the user clicks in the image, the browser
    #   submits the form, but with the x,y coords added as form arguments.
    # * We get all of the above arguments on the final click, including x,y. Verify
    #   all the aguments, and then do the insert.
    # * If user goes to reset the node location, form includes an additional submit
    #   button that says to use the old coords. This allows us to change the contact
    #   info for a node without actually changing the location.
    
    Caveats:
    
    * We do not describe buildings in the DB, and so we are currently hardwired
      to MEB for the building, and the images for each floor are still
      hardwired in the external script (vis/floormap.in) that creates the
      image. Needs to be dealt with before we can export this stuff.
    
    * There is no way web interface to delete a location entry. That should be
      easy to deal with when needed, but in the meantime:
    
    	delete from location_info where node_id='pcXXX'
    
    * All nodes get a "Set Location Entry" on the shownode page menu; I leave
      it to admin people to not set the location for a non-wireless node; will
      fix later as needed.
    
    * Coordinates are all in pixels. As Russ points out, this is (way) less
      then ideal, but certainly simple.
    303132ed