Commit f027763d authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

+ filter fieldset

parent e69c2282
......@@ -28,6 +28,52 @@ div.list{
border:2px solid gray;
}
li.button{
margin-left:auto;
margin-right:10px;
padding:10px;
border:2px solid gray;
}
.icon{
background-position: 0% 40%;
background-repeat: no-repeat;
padding-left: 20px;
margin-right:10px;
padding-top: 2px;
padding-bottom: 3px;
}
.icon.apply{
background-image: url(/static/apply.png)
}
.icon.clear{
background-image: url(/static/clear.png)
}
.icon.tag{
background-image: url(/static/tag.gif)
}
.icon.delete{
background-image: url(/static/delete.gif)
}
.icon.log{
background-image: url(/static/log.png)
}
.icon img{
width:10px;
height:10px;
}
a{
color:blue;
font-weight: bold;
text-decoration: none;
}
a:hover { text-decoration: underline; }
#pipelist{
width:60%;
}
......@@ -40,6 +86,12 @@ h1{
font-family:Helvetica,Arial,sans-serif;
}
.text{
color: orange;
font-weight: bold;
font-family:Helvetica,Arial,sans-serif;
}
/* color codes for node status */
.done{
color: #006400;
......
......@@ -53,6 +53,16 @@ class Web:
self.name = name
## Pipeline data base file.
self.db_file = db_file
def get_lst_tag (self):
"""
"""
return []
def get_lst_date (self):
"""
"""
return []
@cherrypy.expose
@read_access
......@@ -73,7 +83,47 @@ class Web:
l = conn.execute('select seg, curr_dir, seg_id, tag from segments order by curr_dir').fetchall()
html = html_tmp
html += '<h1>Pipelines in %s </h1> <a href="log?logdir=%s">logs</a> <div class="list"><ul class="mktree" id="segtree"> '%(self.name,l[0][1].split("seg")[0]+"log")
html += '<h1>Pipelines in %s </h1>'%self.name
## Filter fieldset
html += '<fieldset id="filters"><legend><span class="text">Filters</span></legend>'
html += '<table width="100%"><tr><td><table>'
## Tag checkbox
html += '<tr valign="top" id="tr_tag_id" class="filter"> <td style="width:150px;"><input id="cb_tag" type="checkbox"/><label for="cb_tag_id">Tag</label></td>'
## Tag select
lst_tag = self.get_lst_tag()
html += '<td style="width:150px;"><select id="se_tag_id">'
for t in lst_tag:
html +='<option value="%s">%s</option>'%(t[0], t)
html += '</select></td>'
## Date checkbox
html += '<tr valign="top" id="tr_date_id" class="filter"> <td style="width:150px;"><input id="cb_date" type="checkbox" /><label for="cb_date_id">Date</label></td>'
## Date input
lst_date = self.get_lst_date()
html += '<td style="width:150px;"><select id="se_date_id">'
for t in lst_date:
html +='<option value="%s">%s</option>'%(t[0], t)
html += '</select></td>'
html += '<tr></tr>'
#<a href='"del_from_checkbox?">Delete</a><br><a align=left href="tag_from_checkbox">Tag</a><br> '
html += '</table>'
html += '</td><td></td></tr></table>'
html += '<p class="buttons">'
html += '<a class="icon apply" href="#"><small>Apply</small></a>'
html += '<a class="icon clear" href="#"><small>Clear</small></a>'
html += '<a class="icon tag" href="#"><small>Tag</small></a>'
html += '<a class="icon delete" href="#"><small>Delete</small></a>'
html += '<a class="icon log" href="log?logdir=%s"><small>Browse log</small></a>'%(l[0][1].split("seg")[0]+"log")
html +='</p></fieldset>'
html += '<br><div class="list"><ul class="mktree" id="segtree">'
indent = -1
# select a subset
......@@ -99,7 +149,8 @@ class Web:
print s
for stat in e:
ss = '<a href="product?segid=%s&status=%s" class=%s>%d</a>, '%(s[2],stat[0], stat[0], stat[1]) + ss
ss += '<a href="javascript:confirmation(\'delseg?segid=%d\')"> (delete)</a><spacer> <a href="javascript:edit_tag(\'tag?segid=%d\')"> (tag)</a>'%(s[2],s[2])
ss += '<INPUT type="checkbox" name="%s" value="0">'%(s[2])
#ss += '<a href="delseg?segid=%d"> (delete)</a>'%(s[2])
diff = s[1].count('/') - indent
if diff == 1:
html += '<ul> <li id=%d ><a href="code?segid=%d">%s</a> : %s\n'%(s[2],s[2],s[0],ss)
......@@ -112,6 +163,8 @@ class Web:
indent += diff
conn.close()
html += '</li></ul>'*(indent-l[0][1].count('/')+1)
if not highlight:
html += '</div></body></html>'
return html
......@@ -191,6 +244,12 @@ class Web:
html += '</ul></div></body></html>'
return html
def del_from_checkbox ():
"""
"""
@cherrypy.expose
@write_access
def delseg(self, segid=None):
......@@ -245,7 +304,7 @@ class Web:
""" Print the content of the log directory.
"""
directory = logdir
html = html_tmp + '<h1> Content of %s </h1> <a href="/%s/">Back</a><div class="list"><a href="delete_log?logdir=%s">Delete logs</a><ul>'%(directory,self.name,logdir)
html = html_tmp + '<h1> Content of %s </h1> <a href="/%s/">Back</a><div class="list"><a class="icon delete" href="delete_log?logdir=%s"><small>Delete logs</small></a><ul>'%(directory,self.name,logdir)
for filename in sorted(glob(os.path.join(directory,'*')), reverse=True):
absPath = os.path.abspath(filename)
html += '<li><a href="serve_log?filename='+absPath+ '">' + os.path.basename(filename) + "</a> </li>"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment