views:

156

answers:

1

We have a web application that manages inventory for our computer support group. One of the things that we will be using this for is to drive a "Computers Currently In Use" map for our larger computer labs so that users can find an open computer more easily (the lab in our Main library has around 150 computers). The image used for the background of the display of this page is managed through the administrative part of the application as are the relationships between what stations are located in the lab and where they are located.

We'd like to make it so that admins can "turn off" the display of the map page for each location when the map is being updated in the administrative interface. My idea is to extend the table that holds the location data to indicate whether the location is available for map display, and check this when the map is updated. If the check indicates that the map should not be displayed, the page would draw a suitable message instead of displaying the map image and "in use" overlay data.

In the hopes that someone else may have done this, or something like it, before, I'd like to hear your suggestions on alternatives.

The map page will be refreshed periodically (one every 2 minutes) via AJAX by passing down the image url to use and the overlay data (positions of table and number of computers available at each). I'm thinking that when the page detects a transition from "don't display" to "display" it would refresh the page via HTTP GET.

+2  A: 

This shouldn't be difficult to do using polling, since there are a small number of users checking for computer availability. You could probably poll a few times per minute without overburdening the server.

I would use a map with a bunch of absolutely position DIVs overlaying the map representing each computer. The background of each DIV would be either a "available" or "not available" image. You could then simply spit out some JavaScript in your Ajax response to add/remove class names from each DIV representing its current state. Changing the class name would change the background image f the DIV.

You could display a "loading" spinner while the status is being edited by the administrator (which would just be another class name).

Diodeus