@@ -9,7 +9,7 @@ | |||||
def format_date(d): | def format_date(d): | ||||
start = datetime.strptime(d, "%a %b %d %H:%M:%S %Y") | start = datetime.strptime(d, "%a %b %d %H:%M:%S %Y") | ||||
since = start.strftime("%b %d, %Y at %H:%M:%S UTC") | |||||
since = start.strftime("%b %d, %Y %H:%M:%S UTC") | |||||
diff = (datetime.utcnow() - start) | diff = (datetime.utcnow() - start) | ||||
if diff.days: | if diff.days: | ||||
uptime = "{0} days".format(diff.days) | uptime = "{0} days".format(diff.days) | ||||
@@ -36,7 +36,7 @@ | |||||
lines = result.splitlines()[1:] | lines = result.splitlines()[1:] | ||||
re_key = "^(.*?):\s" | re_key = "^(.*?):\s" | ||||
re_val = ":\s*(.*?)$" | re_val = ":\s*(.*?)$" | ||||
data = dict((re.search(re_key, line).group(1), re.search(re_val, line).group(1)) for line in lines) | |||||
data = dict((re.search(re_key, line).group(1), re.search(re_val, line).group(1)) for line in lines if re.search(re_key, line) and re.search(re_val, line)) | |||||
since, uptime = format_date(data["submission_time"]) | since, uptime = format_date(data["submission_time"]) | ||||
host = data["sge_o_host"] | host = data["sge_o_host"] | ||||
return ["online", since, uptime, host] | return ["online", since, uptime, host] | ||||
@@ -1,4 +1,4 @@ | |||||
<%page args="environ, title, slug=None"/>\ | |||||
<%page args="environ, title, slug=None, add_css=(), add_js=()"/>\ | |||||
<%namespace name="index" file="/index.mako" import="get_tools"/>\ | <%namespace name="index" file="/index.mako" import="get_tools"/>\ | ||||
<%! | <%! | ||||
from itertools import count | from itertools import count | ||||
@@ -20,7 +20,13 @@ | |||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||||
<title>${title} - earwig@toolserver</title> | <title>${title} - earwig@toolserver</title> | ||||
<link rel="stylesheet" href="${root}/static/css/main.css" type="text/css" /> | <link rel="stylesheet" href="${root}/static/css/main.css" type="text/css" /> | ||||
% for filename in add_css: | |||||
<link rel="stylesheet" href="${root}/static/css/${filename}" type="text/css" /> | |||||
% endfor | |||||
<script src="${root}/static/js/potd.js" type="text/javascript"></script> | <script src="${root}/static/js/potd.js" type="text/javascript"></script> | ||||
% for filename in add_js: | |||||
<script src="${root}/static/js/${filename}" type="text/javascript"></script> | |||||
% endfor | |||||
</head> | </head> | ||||
<body onload="potd_set_background()"> | <body onload="potd_set_background()"> | ||||
<div id="header"> | <div id="header"> | ||||
@@ -7,7 +7,7 @@ body { | |||||
} | } | ||||
ul, ol { | ul, ol { | ||||
line-height: 1.75; | |||||
line-height: 1.5; | |||||
} | } | ||||
div#header { | div#header { | ||||
@@ -18,9 +18,9 @@ div#header { | |||||
} | } | ||||
div#container { | div#container { | ||||
line-height: 1.5; | |||||
line-height: 1.25; | |||||
margin: 0 60px 100px 60px; | margin: 0 60px 100px 60px; | ||||
padding: 2px 15px 10px 15px; | |||||
padding: 5px 15px 10px 15px; | |||||
border: 1px solid #777; | border: 1px solid #777; | ||||
background-color: #FFF; | background-color: #FFF; | ||||
} | } | ||||
@@ -64,11 +64,6 @@ table#footer-box { | |||||
height: 100%; | height: 100%; | ||||
} | } | ||||
fieldset#result { | |||||
margin: 25px 5px 5px 5px; | |||||
border: 2px solid #676; | |||||
} | |||||
div.toolbox { | div.toolbox { | ||||
margin: 15px 0 15px 0; | margin: 15px 0 15px 0; | ||||
padding: 0 6px 0 6px; | padding: 0 6px 0 6px; | ||||
@@ -76,6 +71,12 @@ div.toolbox { | |||||
background-color: #F5F5F5; | background-color: #F5F5F5; | ||||
} | } | ||||
div.divider { | |||||
border-bottom: 1px solid #AAA; | |||||
margin-top: 15px; | |||||
margin-bottom: 15px; | |||||
} | |||||
p.toolname { | p.toolname { | ||||
font-size: 18px; | font-size: 18px; | ||||
margin: 6px 0 6px 0; | margin: 6px 0 6px 0; | ||||