extras-buildsys/www builders.psp, NONE, 1.1 config.psp, NONE, 1.1 index.psp, NONE, 1.1 indiv.psp, NONE, 1.1

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Thu Jul 21 04:07:56 UTC 2005


Author: dcbw

Update of /cvs/fedora/extras-buildsys/www
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31121/www

Added Files:
	builders.psp config.psp index.psp indiv.psp 
Log Message:
2005-07-21  Dan Williams <dcbw at redhat.com>

    * www/*
        - Add the web front-end




--- NEW FILE builders.psp ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%
curpage = 'builders'
%>
<%@ include file="template/main.psp"%>
<%@ include file="template/head.psp"%>

<center>
<br>
<br>

<%
import socket, xmlrpclib

args = {}
args['status'] = 'building'
try:
    (e, msg, jobs) = server.list_jobs(args)
    (e, msg, builders) = server.list_builders()
except socket.error, e:
    msg = str(e)
%>
        <p><h2>Could not contact the server.</h2><br>Error was:<%=msg%></p>
<%
except xmlrpclib.Fault, fault:
    msg = "XMLRPC Fault"
    e = -1

if e == -1:
%>
        <p><h2>The server could not process the request.</h2><br>Error was:  <%=msg%></p>
<%
else:
    for builder in builders:
        import urllib
        type, rest = urllib.splittype(builder['address'])
        addr, port = urllib.splitport(rest)
        addr = addr[2:]

        arch_list = ""
        for arch in builder['arches']:
            arch_list = arch_list + arch
            if arch != builder['arches'][len(builder['arches'])-1]:
                arch_list = arch_list + ", "
        # endfor

        unavail_color = ''
        if builder['status'] == 'unavailable':
            unavail_color = 'color="#ff4444"'
        # endif
%>

    <div id="builderlist">
    <table cellspacing="0" cellpadding="0">
        <tr>
            <td class="builderlist-head" align="left"><font class="builderlistaddr" <%=unavail_color%>><%=addr%>  (<%=builder['status']%>)</th>
            <td class="builderlist-head" align="right"><font class="builderlistarches"><%=arch_list%></font></th>
        </tr>
<%
        bjob = None
        for job in jobs:
            archjobs = job['archjobs']
            if not archjobs:
                continue
            job_text = 'Jobs:'
            for aj in archjobs:
                if aj['builder_addr'] == addr:
%>
        <tr>
            <td colspan="2" align="left">
                <div id="archjoblist">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td>
                            <font class="archjobtag">Job:</font>
                             <%=aj['parent_uid']%> (<%=job['package']%>/<%=aj['arch']%>)   
                            <font class="archjobtag">Status:</font>
                             <%=aj['status']%>/<%=aj['builder_status']%>
                        </td>
                    </tr>
                </table>
                </div>
            </td>
        </tr>
<%
                # endif
                job_text = ''
            # endfor
        # endfor
%>
    </table>
    </div>
    <br>

<%
    # endfor
# endif
%>

</center>

<%@ include file="template/foot.psp"%>

    </body>
</html>


--- NEW FILE config.psp ---
<%
config_opts = {}
config_opts['system_name'] = "Fedora Extras Build System"
config_opts['base_url'] = "http://127.0.0.1/"

%>


--- NEW FILE index.psp ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%
curpage = 'main'
%>
<%@ include file="template/main.psp"%>
<%@ include file="template/head.psp"%>

<%
import socket, xmlrpclib
try:
    args = {}
    args['status'] = 'waiting'
    (e, msg, waiting_jobs) = server.list_jobs(args)
    args['status'] = 'building'
    (e, msg, building_jobs) = server.list_jobs(args)
except socket.error, e:
    msg = str(e)
%>
        <p><h2>Could not contact the server.</h2><br>Error was:<%=msg%></p>
<%
except xmlrpclib.Fault, fault:
    msg = "XMLRPC Fault"
    e = -1

if e == -1:
%>
        <p><h2>The server could not process the request.</h2><br>Error was:  <%=msg%></p>
<%
else:
    i = 1
%>

<center>
<div id="joblist">
<table cellspacing=0 cellpadding=0>
<colgroup>
    <col align="left">
    <col align="left">
    <col align="left">
</colgroup>
<thead><tr>
    <th align="left" width="5%">Job ID</th>
    <th align="left" width="10%">Package Name</th>
    <th align="left" width="20%">Source</th>
    <th align="left" width="10%">Status</th>
    <th align="left" width="10%">Target</th>
    <th align="left" width="10%">Submitter</th>
</tr></thead>
<tbody>

<%
    i = 1
    for job in building_jobs:
        # Don't show finished jobs older than 1 day
        col = '#efefef'
        if int(i / 2.0) == (i / 2.0):
            col = '#dddddd'
        # endif
        source = job['source']
        if '/' in source:
            import os
            source = os.path.basename(source)
        # endif
%>
        <tr>
            <td bgcolor="<%=str(col)%>"><%=job['uid']%></td>
            <td bgcolor="<%=str(col)%>"><%=job['package']%></td>
            <td bgcolor="<%=str(col)%>"><%=source%></td>
            <td bgcolor="<%=str(col)%>"><font class="status-<%=job['status']%>"><%=job['status']%></font></td>
            <td bgcolor="<%=str(col)%>"><%=job['target']%></td>
            <td bgcolor="<%=str(col)%>"><%=job['username']%></td>
        <tr>
<%
        i = i + 1
    # endfor

    for job in waiting_jobs:
        # Don't show finished jobs older than 1 day
        col = '#efefef'
        if int(i / 2.0) == (i / 2.0):
            col = '#dddddd'
        # endif
        source = job['source']
        if '/' in source:
            import os
            source = os.path.basename(source)
        # endif
%>
        <tr>
            <td bgcolor="<%=str(col)%>"><%=job['uid']%></td>
            <td bgcolor="<%=str(col)%>"><%=job['package']%></td>
            <td bgcolor="<%=str(col)%>"><%=source%></td>
            <td bgcolor="<%=str(col)%>"><font class="status-<%=job['status']%>"><%=job['status']%></font></td>
            <td bgcolor="<%=str(col)%>"><%=job['target']%></td>
            <td bgcolor="<%=str(col)%>"><%=job['username']%></td>
        <tr>
<%
        i = i + 1
    # endfor

    # No jobs...
    if i == 1:
%>
        <tr>
            <td bgcolor="#efefef" colspan="5">No jobs found.</td>
        <tr>
<%
    # endif
%>

</tbody>
</table>
</div>
</center>

<%
# endtry
%>

<%@ include file="template/foot.psp"%>

    </body>
</html>


--- NEW FILE indiv.psp ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%
curpage = 'individual'
%>
<%@ include file="template/main.psp"%>
<%@ include file="template/head.psp"%>

<%
if not len(user_email):
%>
<form method="POST" action="indiv.psp">
    Email Address:  <input type="text" name="email">
    <input type="submit" value="Show...">
</form>
<%
else:
    import socket, xmlrpclib
    args = {}
    args['email'] = str(user_email)
    cur_status = ''
    if form.has_key('status') and form['status']:
        cur_status = str(form['status'])
        if cur_status != 'ALL':
            args['status'] = cur_status
    cur_target = ''
    if form.has_key('target') and form['target']:
        cur_target = str(form['target'])
        if cur_target != 'ALL':
            args['target'] = cur_target
    try:
        (e, msg, jobs) = server.list_jobs(args)
        targets = server.targets()
        targets.insert(0, 'ALL')
    except socket.error, e:
        msg = str(e)
%>
        <p><h2>Could not contact the server.</h2><br>Error was:<%=msg%></p>
<%
    except xmlrpclib.Fault, fault:
        msg = "XMLRPC Fault"
        e = -1

    if e == -1:
%>
        <p><h2>The server could not process the request.</h2><br>Error was:  <%=msg%></p>
<%
    else:
%>

<%
        # default cutoff is 1 day
        cutoff_time = 86400

        status_list = ['ALL', 'waiting', 'building', 'addtorepo', 'needsign', 'failed', 'killed']
%>

<center>
<div id="top-table">
<table cellspacing="0" cellpadding="0" width="100%">
    <tr>
        <td width="100%">
            <table cellspacing="0" cellpadding="0">
                <form method="POST" action="indiv.psp?email=<%=str(user_email)%>">
                <tr>
                    <td align="left"><strong>Filter by:</strong></td>
                    <td>
                        Status:
                        <select name="status">
<%
        for status in status_list:
            sel_string = ''
            if status == cur_status:
                sel_string = 'selected'
            # endif
%>
                            <option <%=str(sel_string)%>><%=str(status)%></option>
<%
        # endfor
%>
                        </select>
                    </td>
                    <td>
                        Target:
                        <select name="target">
<%
        for target in targets:
            sel_string = ''
            if target == cur_target:
                sel_string = 'selected'
            # endif
%>
                            <option <%=str(sel_string)%>><%=str(target)%></option>
<%
        # endfor
%>
                        </select>
                    </td>
                    <td><input type="submit" value="Filter"></td>
                </tr>
                </form>
            </table>
        </td>
    </tr>
</table>
</div>
<br>

<div id="joblist">
<table cellspacing=0 cellpadding=0>
<colgroup>
    <col align="left">
    <col align="left">
    <col align="left">
</colgroup>
<thead><tr>
    <th align="left" width="5%">Job ID</th>
    <th align="left" width="20%">Package Name</th>
    <th align="left" width="20%">Source</th>
    <th align="left" width="10%">Status</th>
    <th align="left" width="10%">Target</th>
</tr></thead>
<tbody>

<%
        i = 1
        for job in jobs:
            # Don't show finished jobs older than 1 day
            now = time.time()
            if job['status'] == 'killed' or job['status'] == 'needsign':
                if job['endtime'] != 0 and job['endtime'] < time.time() - cutoff_time:
                    continue
            col = '#efefef'
            if int(i / 2.0) == (i / 2.0):
                col = '#dddddd'
            # endif
            source = job['source']
            if '/' in source:
                import os
                source = os.path.basename(source)
            # endif
%>
        <tr>
            <td bgcolor="<%=str(col)%>"><%=job['uid']%></td>
            <td bgcolor="<%=str(col)%>"><%=job['package']%></td>
            <td bgcolor="<%=str(col)%>"><%=source%></td>
            <td bgcolor="<%=str(col)%>"><font class="status-<%=job['status']%>"><%=job['status']%></font></td>
            <td bgcolor="<%=str(col)%>"><%=job['target']%></td>
        <tr>
<%
            i = i + 1
        # endfor

        # No jobs...
        if i == 1:
%>
        <tr>
            <td bgcolor="#efefef" colspan="5">No jobs found.</td>
        <tr>
<%
        # endif
    # endtry
%>

</tbody>
</table>
</div>
</center>

<%
# endif
%>

<%@ include file="template/foot.psp"%>

    </body>
</html>




More information about the fedora-extras-commits mailing list