Ignore:
Timestamp:
04/11/09 12:09:52 (11 years ago)
Author:
astephen
Message:

More

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/jobs.py

    r5938 r5968  
    88from cows_wps.lib.ui.proc_config import * 
    99 
     10from cows_wps.model.managers import requestManager 
     11from cows_wps.process_handler.context.process_status import STATUS 
     12 
    1013log = logging.getLogger(__name__) 
    11  
    1214 
    1315class JobsController(BaseController): 
     
    2729        return resp 
    2830 
     31 
    2932    def index(self): 
    3033        """ 
    31         View all jobs running at the moment. 
     34        Reads jobs list and shows. 
    3235        """ 
    33         resp = """Lots of jobs will be listed here when plugged in...""" 
     36        requestManager.updateRunningRequests() 
    3437 
     38        resp = '<table border="2"><tr><td>Job id</td><td>type</td><td>user</td><td>status</td></tr>\n' 
     39        for r in requestManager.getAllRequest(): 
     40            status = r.job.status 
     41            type = r.job.type 
     42            job_id = r.job.job_id 
     43            user = r.user_id 
     44            row = "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n" % (job_id, type, user, status) 
     45            resp += row 
     46 
     47        resp += "</table>"  
    3548        renderer = UIPageRenderer() 
    36         resp = renderer.render("Jobs currently running", 
    37                                [("Job list", resp)]) 
     49        resp = renderer.render("Job list page", 
     50                               [("All jobs", resp)]) 
    3851        return resp 
Note: See TracChangeset for help on using the changeset viewer.