Commit 20d543b9 authored by ale's avatar ale
Browse files

move to bootstrap 3, jquery 2, and jsRender

parent 8d95228c
This diff is collapsed.
This diff is collapsed.
#searchForm input {
font-size: 16px;
body {
padding-top: 55px;
}
.log:hover {
background-color: #eef;
}
.timestamp {
color: #666;
}
.host {
font-weight: bold;
}
#log_pagination_div {
display: none;
font-size: 85%;
padding-bottom: 3px;
padding-left: 30px;
padding-right: 30px;
}
#log_pagination_prev {
cursor: pointer;
}
#log_pagination_next {
cursor: pointer;
#query_field.loading {
background: url('../spinner.gif') no-repeat top right white;
}
#query_time {
float: right;
margin-right: 30px;
color: #aaa;
.timestamp {
color: #666;
}
#show_stats_btn {
display: block;
float: right;
margin-bottom: -3px;
padding-left: 20px;
padding-right: 5px;
padding-top: 2px;
border: 1px solid black;
.host {
font-weight: bold;
}
.btn_open {
background: url(img/arrow_open.png) top left no-repeat;
}
.btn_closed {
background: url(img/arrow_closed.png) top left no-repeat;
}
#log_stats {
display: none;
width: 100%;
......@@ -63,7 +27,7 @@
}
#log_viewer {
border-top: 1px solid #666;
/* border-top: 1px solid #666; */
padding-top: 3px;
font-family: 'Ubuntu Mono', monospace;
word-wrap: break-word;
......@@ -83,16 +47,6 @@
-webkit-border-radius: 7px;
}
#header {
padding-right: 40px;
background: url(/static/rstar32.gif) no-repeat top right;
}
#error {
display: block;
color: red;
}
.chart {
float: left;
margin: 5px;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* jQuery Templates Plugin 1.0.0pre
* http://github.com/jquery/jquery-tmpl
* Requires jQuery 1.4.2
*
* Copyright 2011, Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,m,k){if(d[0]&&a.isArray(d[0])){var g=a.makeArray(arguments),h=d[0],j=h.length,i=0,f;while(i<j&&!(f=a.data(h[i++],"tmplItem")));if(f&&c)g[2]=function(b){a.tmpl.afterManip(this,b,k)};r.apply(this,g)}else r.apply(this,arguments);c=0;!e&&a.tmpl.complete(b);return this}});a.extend({tmpl:function(d,h,e,c){var i,k=!c;if(k){c=p;d=a.template[d]||a.template(null,d);f={}}else if(!d){d=c.tmpl;b[c.key]=c;c.nodes=[];c.wrapped&&n(c,c.wrapped);return a(j(c,null,c.tmpl(a,c)))}if(!d)return[];if(typeof h==="function")h=h.call(c||{});e&&e.wrapped&&n(e,e.wrapped);i=a.isArray(h)?a.map(h,function(a){return a?g(e,c,d,a):null}):[g(e,c,d,h)];return k?a(j(c,null,i)):i},tmplItem:function(b){var c;if(b instanceof a)b=b[0];while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||p},template:function(c,b){if(b){if(typeof b==="string")b=o(b);else if(b instanceof a)b=b[0]||{};if(b.nodeType)b=a.data(b,"tmpl")||a.data(b,"tmpl",o(b.innerHTML));return typeof c==="string"?(a.template[c]=b):b}return c?typeof c!=="string"?a.template(null,c):a.template[c]||a.template(null,q.test(c)?c:a(c)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function j(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:j(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=k(c).concat(b);if(d)b=b.concat(k(d))});return b?b:k(c)}function k(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,k,g,b,c,d){var j=a.tmpl.tag[k],i,e,f;if(!j)throw"Unknown template tag: "+k;i=j._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=h(b);d=d?","+h(d)+")":c?")":"";e=c?b.indexOf(".")>-1?b+h(c):"("+b+").call($item"+d:b;f=c?e:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else f=e=i.$1||"null";g=h(g);return"');"+j[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(f).split("$1").join(e).split("$2").join(g||i.$2||"")+"__.push('"})+"');}return __;")}function n(c,b){c._wrap=j(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function h(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,h;for(e=0,p=o.length;e<p;e++){if((k=o[e]).nodeType!==1)continue;j=k.getElementsByTagName("*");for(h=j.length-1;h>=0;h--)m(j[h]);m(k)}function m(j){var p,h=j,k,e,m;if(m=j.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(p=h.getAttribute(d)));if(p!==m){h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[h]||f[h]);e.key=++i;b[i]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;h=a.data(j.parentNode,"tmplItem");h=h?h.key:0}if(e){k=e;while(k&&k.key!=h){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery);
\ No newline at end of file
/*! JsRender v1.0.0-beta: http://github.com/BorisMoore/jsrender and http://jsviews.com/jsviews
informal pre V1.0 commit counter: 52 */
(function(n,t,i){"use strict";function bt(n){return n}function bi(n){return n}function kt(n){e._dbgMode=n;vt=n?"Error: #index in nested view: use #getIndex()":"";d("dbg",ei.dbg=lt.dbg=n?bi:bt)}function dt(n){return{getTgt:n,map:function(t){var i=this,r;i.src!==t&&(i.src&&i.unmap(),typeof t=="object"&&(r=n.apply(i,arguments),i.src=t,i.tgt=r))}}}function ft(n,t){t&&t.onError&&t.onError(n)===!1||(this.name="JsRender Error",this.message=n||"JsRender error")}function u(n,t){var i;n=n||{};for(i in t)n[i]=t[i];return n}function gt(n,t,i){return(!l.rTag||n)&&(p=n?n.charAt(0):p,w=n?n.charAt(1):w,o=t?t.charAt(0):o,a=t?t.charAt(1):a,g=i||g,n="\\"+p+"(\\"+g+")?\\"+w,t="\\"+o+"\\"+a,y="(?:(?:(\\w+(?=[\\/\\s\\"+o+"]))|(?:(\\w+)?(:)|(>)|!--((?:[^-]|-(?!-))*)--|(\\*)))\\s*((?:[^\\"+o+"]|\\"+o+"(?!\\"+a+"))*?)",l.rTag=y+")",y=new RegExp(n+y+"(\\/)?|(?:\\/(\\w+)))"+t,"g"),at=new RegExp("<.*>|([^\\\\]|^)[{}]|"+n+".*"+t)),[p,w,o,a,g]}function ki(n,t){t||(t=n,n=i);var e,f,o,u,r=this,s=!t||t==="root";if(n){if(u=r.type===t?r:i,!u)if(e=r.views,r._.useKey){for(f in e)if(u=e[f].get(n,t))break}else for(f=0,o=e.length;!u&&f<o;f++)u=e[f].get(n,t)}else if(s)while(r.parent.parent)u=r=r.parent;else while(r&&!u)u=r.type===t?r:i,r=r.parent;return u}function ni(){var n=this.get("item");return n?n.index:i}function ti(){return this.index}function di(t){var f,e=this,o=e.linkCtx,r=(e.ctx||{})[t];return r===i&&o&&o.ctx&&(r=o.ctx[t]),r===i&&(r=ei[t]),r&&(typeof r!="function"||r._wrp||(f=function(){return r.apply(!this||this===n?e:this,arguments)},f._wrp=1,u(f,r))),f||r}function gi(n,t,u){var f,e,h,o=+u===u&&u,s=t.linkCtx;if(o&&(u=(o=t.tmpl.bnds[o-1])(t.data,t,r)),e=u.args[0],n||o){f=s&&s.tag||{_:{inline:!s,bnd:o},tagName:n+":",flow:!0,_is:"tag"};for(h in u.props)rt.test(h)&&(f[h]=u.props[h]);s&&(s.tag=f,f.linkCtx=f.linkCtx||s,u.ctx=c(u.ctx,s.view.ctx));f.tagCtx=u;u.view=t;f.ctx=u.ctx||{};delete u.ctx;t._.tag=f;e=et(f,f.convert||n!=="true"&&n)[0];e=e!=i?e:"";e=o&&t._.onRender?t._.onRender(e,t,o):e;t._.tag=i}return e}function et(n,t){var r=n.tagCtx,u=r.view,i=r.args;return t=t&&(""+t===t?u.getRsc("converters",t)||v("Unknown converter: '"+t+"'"):t),i=!i.length&&!r.index&&n.autoBind?[u.data]:t?i.slice(0):i,t&&(t.depends&&(n.depends=l.getDeps(n.depends,n,t.depends,t)),i[0]=t.apply(n,i)),i}function nr(n,t){for(var f,e,u=this;f===i&&u;)e=u.tmpl[n],f=e&&e[t],u=u.parent;return f||r[n][t]}function tr(n,t,f,e,o){var ct,h,wt,at,ut,a,vt,w,l,ft,tt,bt,k,yt,pt,nt,y,st,d,kt,g="",ht=+e===e&&e,p=t.linkCtx||0,it=t.ctx,dt=f||t.tmpl;for(n._is==="tag"&&(h=n,n=h.tagName),h=h||p.tag,ht&&(e=(bt=dt.bnds[ht-1])(t.data,t,r)),vt=e.length,a=0;a<vt;a++){if(l=e[a],d=l.props,tt=l.tmpl,tt=l.content=tt&&dt.tmpls[tt-1],f=l.props.tmpl,a||f&&h||(k=t.getRsc("tags",n)||v("Unknown tag: {{"+n+"}}")),f=f||(h?h:k).template||tt,f=""+f===f?t.getRsc("templates",f)||s(f):f,u(l,{tmpl:f,render:ot,index:a,view:t,ctx:c(l.ctx,it)}),!h){k._ctr?(h=new k._ctr,yt=!!h.init,h.attr=h.attr||k.attr||i):h={render:k.render};h._={inline:!p};p&&(p.attr=h.attr=p.attr||h.attr,p.tag=h,h.linkCtx=p);(h._.bnd=bt||p.fn)?h._.arrVws={}:h.dataBoundOnly&&v("{^{"+n+"}} tag must be data-bound");h.tagName=n;h.parent=ut=it&&it.tag;h._is="tag";h._def=k;for(st in d=l.props)rt.test(st)&&(h[st]=d[st])}l.tag=h;h.map&&h.tagCtxs&&(l.map=h.tagCtxs[a].map);h.flow||(ft=l.ctx=l.ctx||{},wt=h.parents=ft.parentTags=it&&c(ft.parentTags,it.parentTags)||{},ut&&(wt[ut.tagName]=ut),ft.tag=h)}for(h.tagCtxs=e,t._.tag=h,h.rendering={},a=0;a<vt;a++)l=h.tagCtx=e[a],d=l.props,y=et(h,h.convert),(pt=d.map||h).map&&(y.length||d.map)&&(nt=l.map=u(l.map||{unmap:pt.unmap},d),nt.src!==y[0]&&(nt.src&&nt.unmap(),pt.map.apply(nt,y)),y=[nt.tgt]),h.ctx=l.ctx,!a&&yt&&(kt=h.template,h.init(l,p,h.ctx),yt=i,h.template!==kt&&(h._.tmpl=h.template)),w=i,ct=h.render,(ct=h.render)&&(w=ct.apply(h,y)),y=y.length?y:[t],w=w!==i?w:l.render(y[0],!0)||(o?i:""),g=g?g+(w||""):w;return delete h.rendering,h.tagCtx=h.tagCtxs[0],h.ctx=h.tagCtx.ctx,h._.inline&&(at=h.attr)&&at!==b&&(g=at==="text"?lt.html(g):""),ht&&t._.onRender?t._.onRender(g,t,ht):g}function nt(n,t,i,r,u,f,e,o){var a,h,c,v=t==="array",l={key:0,useKey:v?0:1,id:""+wi++,onRender:o,bnds:{}},s={data:r,tmpl:u,content:e,views:v?[]:{},parent:i,type:t,get:ki,getIndex:ti,getRsc:nr,hlp:di,_:l,_is:"view"};return i?(a=i.views,h=i._,h.useKey?(a[l.key="_"+h.useKey++]=s,s.index=vt,s.getIndex=ni,c=h.tag,l.bnd=v&&(!c||!!c._.bnd&&c)):a.splice(l.key=s.index=f,0,s),s.ctx=n||i.ctx):s.ctx=n,s}function ir(n){var t,i,r,u,f;for(t in k)if(u=k[t],(f=u.compile)&&(i=n[t+"s"]))for(r in i)i[r]=f(r,i[r],n,t,u)}function rr(n,t,i){var u,r;return typeof t=="function"?t={depends:t.depends,render:t}:((r=t.template)&&(t.template=""+r===r?s[r]||s(r):r),t.init!==!1&&(u=t._ctr=function(){},(u.prototype=t).constructor=u)),i&&(t._parentTmpl=i),t}function ii(r,u,f,e,o,h){function v(i){if(""+i===i||i.nodeType>0){try{a=i.nodeType>0?i:!at.test(i)&&t&&t(n.document).find(i)[0]}catch(u){}return a&&(i=a.getAttribute(wt),r=r||i,i=s[i],i||(r=r||"_"+pi++,a.setAttribute(wt,r),i=s[r]=ii(r,a.innerHTML,f,e,o,h))),i}}var l,a;return u=u||"",l=v(u),h=h||(u.markup?u:{}),h.tmplName=r,f&&(h._parentTmpl=f),!l&&u.markup&&(l=v(u.markup))&&l.fn&&(l.debug!==u.debug||l.allowCode!==u.allowCode)&&(l=l.markup),l!==i?(r&&!f&&(ut[r]=function(){return u.render.apply(u,arguments)}),l.fn||u.fn?l.fn&&(u=r&&r!==l.tmplName?c(h,l):l):(u=ri(l,h),st(l.replace(ci,"\\$&"),u)),ir(h),u):void 0}function ri(n,t){var i,o=e.wrapMap||{},r=u({markup:n,tmpls:[],links:{},tags:{},bnds:[],_is:"template",render:ot},t);return t.htmlTag||(i=vi.exec(n),r.htmlTag=i?i[1].toLowerCase():""),i=o[r.htmlTag],i&&i!==o.div&&(r.markup=f.trim(r.markup)),r}function ur(n,t){function u(e,o,s){var a,h,v,c;if(e&&""+e!==e&&!e.nodeType&&!e.markup){for(v in e)u(v,e[v],o);return r}return o===i&&(o=e,e=i),e&&""+e!==e&&(s=o,o=e,e=i),c=s?s[f]=s[f]||{}:u,h=t.compile,(a=l.onBeforeStoreItem)&&(h=a(c,e,o,h)||h),e?o===null?delete c[e]:c[e]=h?o=h(e,o,s,n,t):o:o=h(i,o),h&&o&&(o._is=n),(a=l.onStoreItem)&&a(c,e,o,h),o}var f=n+"s";r[f]=u;k[n]=t}function ot(n,t,u,e,o,h){var w,et,tt,y,it,rt,ut,k,p,ft,d,ot,l,a=this,st=!a.attr||a.attr===b,g="";if(!!t===t&&(u=t,t=i),o===!0&&(ut=!0,o=0),a.tag?(k=a,a=a.tag,ft=a._,ot=a.tagName,l=ft.tmpl||k.tmpl,t=c(t,a.ctx),p=k.content,k.props.link===!1&&(t=t||{},t.link=!1),e=e||k.view,n=arguments.length?n:e):l=a.jquery&&(a[0]||v('Unknown template: "'+a.selector+'"'))||a,l&&(!e&&n&&n._is==="view"&&(e=n),e&&(p=p||e.content,h=h||e._.onRender,n===e&&(n=e.data),t=c(t,e.ctx)),e&&e.data!==i||((t=t||{}).root=n),l.fn||(l=s[l]||s(l)),l)){if(h=(t&&t.link)!==!1&&st&&h,d=h,h===!0&&(d=i,h=e._.onRender),t=l.helpers?c(l.helpers,t):t,f.isArray(n)&&!u)for(y=ut?e:o!==i&&e||nt(t,"array",e,n,l,o,p,h),w=0,et=n.length;w<et;w++)tt=n[w],it=nt(t,"item",y,tt,l,(o||0)+w,p,h),rt=l.fn(tt,it,r),g+=y._.onRender?y._.onRender(rt,it):rt;else y=ut?e:nt(t,ot||"data",e,n,l,o,p,h),ft&&!a.flow&&(y.tag=a),g+=l.fn(n,y,r);return d?d(g,y):g}return""}function v(n){throw new l.Error(n);}function h(n){v("Syntax error\n"+n)}function st(n,t,i,r){function v(t){t-=f;t&&s.push(n.substr(f,t).replace(it,"\\n"))}function c(t){t&&h('Unmatched or missing tag: "{{/'+t+'}}" in template:\n'+n)}function p(e,y,p,k,d,g,nt,tt,ut,ft,et,ot){g&&(d=":",k=b);ft=ft||i;var pt,lt,at=y&&[],ct="",st="",vt="",yt=!ft&&!d&&!nt;p=p||(ut=ut||"#data",d);v(ot);f=ot+e.length;tt?w&&s.push(["*","\n"+ut.replace(hi,"$1")+"\n"]):p?(p==="else"&&(ai.test(ut)&&h('for "{{else if expr}}" use "{{else expr}}"'),at=u[6],u[7]=n.substring(u[7],ot),u=o.pop(),s=u[3],yt=!0),ut&&(ut=ut.replace(it," "),ct=ht(ut,at,t).replace(li,function(n,t,i){return t?vt+=i+",":st+=i+",",a=a||rt.test(i.split(":")[0]),""})),st=st.slice(0,-1),ct=ct.slice(0,-1),pt=st&&st.indexOf("noerror:true")+1&&st||"",l=[p,k||!!r||a||"",ct,yt&&[],'\n\tparams:"'+ut+'",\n\tprops:{'+st+"}"+(vt?",ctx:{"+vt.slice(0,-1)+"}":""),pt,at||0],s.push(l),yt&&(o.push(u),u=l,u[7]=f)):et&&(lt=u[0],c(et!==lt&&lt!=="else"&&et),u[7]=n.substring(u[7],ot),u=o.pop());c(!u&&et);s=u[3]}var l,a,w=t&&t.allowCode,e=[],f=0,o=[],s=e,u=[,,,e];return c(o[0]&&o[0][3].pop()[0]),n.replace(y,p),v(n.length),(f=e[e.length-1])&&c(""+f!==f&&+f[7]===f[7]&&f[0]),ui(e,i?n:t,i)}function ui(n,i,r){var a,f,o,l,v,p,ht,ct,lt,at,et,w,s,ot,y,tt,k,rt,vt,d,yt,pt,st,ut,g,c=0,u="",nt="",ft={},wt=n.length;for(""+i===i?(y=r?'data-link="'+i.replace(it," ").slice(1,-1)+'"':i,i=0):(y=i.tmplName||"unnamed",i.allowCode&&(ft.allowCode=!0),i.debug&&(ft.debug=!0),w=i.bnds,ot=i.tmpls),a=0;a<wt;a++)if(f=n[a],""+f===f)u+='\nret+="'+f+'";';else if(o=f[0],o==="*")u+=""+f[1];else{if(l=f[1],v=f[2],rt=f[3],p=f[4],nt=f[5],vt=f[7],(pt=o==="else")||(c=0,w&&(s=f[6])&&(c=w.push(s))),(st=o===":")?(l&&(o=l===b?">":l+o),nt&&(ut="prm"+a,nt="try{var "+ut+"=["+v+"][0];}catch(e){"+ut+'="";}\n',v=ut)):(rt&&(tt=ri(vt,ft),tt.tmplName=y+"/"+o,ui(rt,tt),ot.push(tt)),pt||(k=o,yt=u,u=""),d=n[a+1],d=d&&d[0]==="else"),p+=",\n\targs:["+v+"]}",st&&(s||l&&l!==b)){if(g=new Function("data,view,j,u"," // "+y+" "+c+" "+o+"\n"+nt+"return {"+p+";"),g.paths=s,g._ctxs=o,r)return g;et=1}if(u+=st?"\n"+(s?"":nt)+(r?"return ":"ret+=")+(et?(et=0,at=!0,'c("'+l+'",view,'+(s?(w[c-1]=g,c):"{"+p)+");"):o===">"?(ct=!0,"h("+v+");"):(lt=!0,"(v="+v+")!="+(r?"=":"")+'u?v:"";')):(ht=!0,"{view:view,tmpl:"+(rt?ot.length:"0")+","+p+","),k&&!d){if(u="["+u.slice(0,-1)+"]",(r||s)&&(u=new Function("data,view,j,u"," // "+y+" "+c+" "+k+"\nreturn "+u+";"),s&&((w[c-1]=u).paths=s),u._ctxs=o,r))return u;u=yt+'\nret+=t("'+k+'",view,this,'+(c||u)+");";s=0;k=0}}u="// "+y+"\nvar j=j||"+(t?"jQuery.":"js")+"views"+(lt?",v":"")+(ht?",t=j._tag":"")+(at?",c=j._cnvt":"")+(ct?",h=j.converters.html":"")+(r?";\n":',ret="";\n')+(e.tryCatch?"try{\n":"")+(ft.debug?"debugger;":"")+u+(r?"\n":"\nreturn ret;\n")+(e.tryCatch?"\n}catch(e){return j._err(e);}":"");try{u=new Function("data,view,j,u",u)}catch(bt){h("Compiled template code:\n\n"+u,bt)}return i&&(i.fn=u),u}function ht(n,t,i){function b(b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,ct,lt,at,vt,yt,pt,wt,bt){function dt(n,i,r,f,e,o,h,l){if(r&&(t&&(u==="linkTo"&&(s=t._jsvto=t._jsvto||[],s.push(nt)),(!u||c)&&t.push(nt.slice(i.length))),r!==".")){var a=(f?'view.hlp("'+f+'")':e?"view":"data")+(l?(o?"."+o:f?"":e?"":"."+r)+(h||""):(l=f?"":e?o||"":r,""));return a=a+(l?"."+l:""),i+(a.slice(0,9)==="view.data"?a.slice(5):a)}return n}var kt;if(tt=tt||"",d=d||k||ot,nt=nt||ut,ft=ft||yt||"",!it||e||f)return t&&vt&&!e&&!f&&(!u||c||s)&&(kt=v[r],bt.length-1>wt-kt&&(kt=bt.slice(kt,wt+1),vt=w+":"+kt+o,vt=y[vt]=y[vt]||st(p+vt+a,i,!0),vt.paths||ht(kt,vt.paths=[],i),(s||t).push({_jsvOb:vt}))),e?(e=!ct,e?b:'"'):f?(f=!lt,f?b:'"'):(d?(r++,v[r]=wt++,d):"")+(pt?r?"":u?(u=c=s=!1,"\b"):",":rt?(r&&h(n),u=nt,c=g,"\b"+nt+":"):nt?nt.split("^").join(".").replace(oi,dt)+(ft?(l[++r]=!0,nt.charAt(0)!=="."&&(v[r]=wt),ft):tt):tt?tt:at?(l[r--]=!1,at)+(ft?(l[++r]=!0,ft):""):et?(l[r]||h(n),","):k?"":(e=ct,f=lt,'"'));h(n)}var u,s,c,y=i.links,l={},v={0:-1},r=0,f=!1,e=!1;return(n+" ").replace(/\)\^/g,").").replace(si,b)}function c(n,t){return n&&n!==t?t?u(u({},t),n):n:t&&u({},t)}function fi(n){return pt[n]||(pt[n]="&#"+n.charCodeAt(0)+";")}function fr(n){var i,t,r=[];if(typeof n=="object")for(i in n)t=n[i],t&&t.toJSON&&!t.toJSON()||typeof t!="function"&&r.push({key:i,prop:n[i]});return r}if((!t||!t.views)&&!n.jsviews){var f,tt,y,at,vt,p="{",w="{",o="}",a="}",g="^",oi=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,si=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*\.|\s*\^|\s*$)|[)\]])([([]?))|(\s+)/g,it=/[ \t]*(\r\n|\n|\r)/g,hi=/\\(['"])/g,ci=/['"\\]/g,li=/\x08(~)?([^\x08]+)\x08/g,ai=/^if\s/,vi=/<(\w+)[>\s]/,yt=/[\x00`><"'&]/g,rt=/^on[A-Z]|^convert(Back)?$/,yi=yt,pi=0,wi=0,pt={"&":"&amp;","<":"&lt;",">":"&gt;","\x00":"&#0;","'":"&#39;",'"':"&#34;","`":"&#96;"},b="html",wt="data-jsv-tmpl",ut={},k={template:{compile:ii},tag:{compile:rr},helper:{},converter:{}},r={jsviews:"v1.0.0-beta",render:ut,settings:function(n){u(e,n);kt(e._dbgMode);e.jsv&&e.jsv()},sub:{View:nt,Error:ft,tmplFn:st,cvt:et,parse:ht,extend:u,error:v,syntaxError:h,DataMap:dt},_cnvt:gi,_tag:tr,_err:function(n){return e._dbgMode?"Error: "+(n.message||n)+". ":""}};(ft.prototype=new Error).constructor=ft;ni.depends=function(){return[this.get("item"),"index"]};ti.depends=function(){return["index"]};for(tt in k)ur(tt,k[tt]);var ct,s=r.templates,lt=r.converters,ei=r.helpers,d=r.tags,l=r.sub,e=r.settings;t?(f=t,f.fn.render=ot,(ct=f.observable)&&(u(l,ct.sub),delete ct.sub)):(f=n.jsviews={},f.isArray=Array&&Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"});f.render=ut;f.views=r;f.templates=s=r.templates;e({debugMode:kt,delimiters:gt,_dbgMode:!0,tryCatch:!0});d({"else":function(){},"if":{render:function(n){var t=this;return t.rendering.done||!n&&(arguments.length||!t.tagCtx.index)?"":(t.rendering.done=!0,t.selected=t.tagCtx.index,t.tagCtx.render(t.tagCtx.view,!0))},onUpdate:function(n,t,i){for(var r,f,u=0;(r=this.tagCtxs[u])&&r.args.length;u++)if(r=r.args[0],f=!r!=!i[u].args[0],!this.convert&&!!r||f)return f;return!1},flow:!0},"for":{render:function(n){var u,t=this,r=t.tagCtx,e="",o=0;return t.rendering.done||((u=!arguments.length)&&(n=r.view.data),n!==i&&(e+=r.render(n,u),o+=f.isArray(n)?n.length:1),(t.rendering.done=o)&&(t.selected=r.index)),e},flow:!0,autoBind:!0},include:{flow:!0,autoBind:!0},"*":{render:bt,flow:!0}});d({props:u(u({},d["for"]),dt(fr))});d.props.autoBind=!0;lt({html:function(n){return n!=i?String(n).replace(yi,fi):""},attr:function(n){return n!=i?String(n).replace(yt,fi):n===null?n:""},url:function(n){return n!=i?encodeURI(String(n)):n===null?n:""}});gt()}})(this,this.jQuery);
/*
//# sourceMappingURL=jsrender.min.js.map
*/
\ No newline at end of file
......@@ -69,12 +69,14 @@ lens.Lens = function(config) {
this.pagination_prev_elem.click(function() { lensobj.pagePrev(); });
// Create the rendering templates.
var log_template_id = _merge('log_template_id', '#log_template');
this.log_template = $.template(null, $(log_template_id));
this.log_template = $.templates(log_template_id);
var error_template_id = _merge('error_template_id', '#error_template');
this.error_template = $.template(null, $(error_template_id));
this.error_template = $.templates(error_template_id);
var chart_template_id = _merge('chart_template_id', '#chart_template');
this.chart_template = $.template(null, $(chart_template_id));
this.chart_template = $.templates(chart_template_id);
// Reset internal state.
this.resetDefaultQueryParams();
......@@ -192,15 +194,16 @@ lens.Lens.prototype.loadFilterLinks = function() {
* @param {Array[string]} logs list of logs
*/
lens.Lens.prototype.renderLogs = function(logs) {
var out = '';
this.results_view_elem.html('');
var template = this.log_template;
var results_view_id = this.results_view_id;
// Render logs in reverse order, to have the timestamps sorted correctly.
$.each(logs, function(idx, elem) {
$.tmpl(template, {log: elem}).prependTo(results_view_id);
// TODO: Render logs in reverse order, to have the timestamps sorted
// correctly.
var a = [];
$.each(logs, function(idx, entry) {
a.push({'log': entry});
});
a.reverse();
this.results_view_elem.html(
this.log_template.render(a));
this.results_view_elem.show();
this.loadAttrLinks();
......@@ -258,6 +261,7 @@ lens.Lens.prototype.render = function(logs, facets, elapsed) {
this.renderPagination(logs);
// Render stats.
/**
this.stats_view_elem.html('');
if (facets.host) {
this.renderChart('host', 'Top 5 hosts', facets.host.terms);
......@@ -265,16 +269,15 @@ lens.Lens.prototype.render = function(logs, facets, elapsed) {
if (facets.program) {
this.renderChart('program', 'Top 5 programs', facets.program.terms);
}
/*
if (facets.timestamp) {
this.renderHistogram('timestamp', 'Time distribution',
facets.timestamp.entries);
}
*/
//if (facets.timestamp) {
// this.renderHistogram('timestamp', 'Time distribution',
// facets.timestamp.entries);
//}
this.stats_view_elem.show();
**/
// Show query time.
$('#query_time').text('query time: ' + elapsed + ' ms');
//$('#query_time').text('query time: ' + elapsed + ' ms');
};
/**
......@@ -369,14 +372,15 @@ lens.Lens.prototype.pageNext = function() {
*/
lens.Lens.prototype.ajaxError = function(jqxhr, textStatus, errorThrown) {
this.clearLoading();
$('#error').html('');
$.tmpl(this.error_template,
{error: textStatus,
errorThrown: errorThrown}
).appendTo('#error');
$('#error').attr(
'data-title',
this.error_template.render(
{error: textStatus,
errorThrown: errorThrown}));
this.pagination_div_elem.hide();
this.results_view_elem.html('');
$('#error').show();
$('#error').tooltip('show');
};
/**
......@@ -390,13 +394,15 @@ lens.Lens.prototype.clearError = function() {
* Show 'loading' icon.
*/
lens.Lens.prototype.showLoading = function() {
$('#loading').show();
// $('#loading').show();
this.query_field_elem.toggleClass('loading', true);
};
/**
* Hide 'loading' icon.
*/
lens.Lens.prototype.clearLoading = function() {
$('#loading').hide();
// $('#loading').hide();
this.query_field_elem.toggleClass('loading', false);
};
lens2/static/spinner.gif

673 Bytes | W: | H:

lens2/static/spinner.gif

4.08 KB | W: | H:

lens2/static/spinner.gif
lens2/static/spinner.gif
lens2/static/spinner.gif
lens2/static/spinner.gif
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,20 +3,157 @@
<html>
<head>
<title>A/I Log Search</title>
<link href="/static/favicon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="/static/lens2.css">
<link href="//fonts.googleapis.com/css?family=Ubuntu+Mono" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/static/strftime.min.js"></script>
<script type="text/javascript" src="/static/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/static/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="/static/protovis.min.js"></script>
<script type="text/javascript" src="/static/graphs.js"></script>
<script type="text/javascript" src="/static/lens2.js?v=123"></script>
<script type="text/javascript">
<link href="{{ url_for('static', filename='favicon.ico') }}"
type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css"
href="{{ url_for('static', filename='css/lens2.css') }}">
<link rel="stylesheet" type="text/css"
href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
<link href="//fonts.googleapis.com/css?family=Ubuntu+Mono"
rel="stylesheet" type="text/css">
</head>
<body>
{# Header, navigation bar and search #}
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">LENS</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<form id="searchForm" class="navbar-form navbar-left"
action="{{ url_for('api.api_search') }}" method="post"
role="search">
<div class="form-group">
<input type="text" class="form-control"
name="q" id="query_field" size="70"
placeholder="Search...">
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</form>
<p class="navbar-text">
{# The loading spinner gif #}
<img id="loading" style="display:none;"
src="{{ url_for('static', filename='spinner.gif') }}">
{# A pop-up for errors #}
<span id="error" class="glyphicon glyphicon-warning-sign"
data-toggle="tooltip" data-placement="bottom" data-html="true"
data-title="" style="color:red;display:none;"></span>
</p>
<ul class="nav navbar-nav navbar-right">
<li>
{# Pagination and time-based navigation #}
<div class="button-group" id="log_pagination_div">
<button type="button" class="btn btn-default btn-sm navbar-btn"
id="log_pagination_prev" style="display:none;">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
<button type="button" disabled="disabled"
class="btn btn-default btn-sm navbar-btn"
id="log_pagination_title"></button>
<button type="button" class="btn btn-default btn-sm navbar-btn"
id="log_pagination_next" style="display:none;">
<span class="glyphicon glyphicon-chevron-right"></span>
</button>
</div>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle"
data-toggle="dropdown">
<span class="glyphicon glyphicon-cog"></span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="#">Reset</a></li>
<li><a href="#">Stats</a></li>
<li class="divider"></li>
<li><a href="https://login.autistici.org/logout">Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div id="log_container">
<div id="log_stats">
<b>Result set analysis</b><br>
<div id="log_stats_inner"></div>
<div style="clear:both;"></div>
</div>
<div id="log_viewer"></div>
</div>
{# JSRender templates #}
{% raw %}
<script id="log_template" type="text/x-jsrender">
<div class="log">
<span class="timestamp">{{>~timestampToString(log.timestamp)}}</span>
<a class="host">{{>log.host}}</a>
<a class="program">{{>log.program}}</a>{{if log.pid}}[<a class="pid">{{>log.pid}}</a>]{{/if}}
{{if log.facility}}<a class="facility">{{>log.facility}}</a>.<span class="severity">{{>log.severity}}</span>{{/if}}
<span class="msg">{{:~replaceAttrsInMsg(log)}}</span>
</div>
</script>
<script id="error_template" type="text/x-jsrender">
ERROR: {{>error}}<br>
<span class="error_detail">{{>errorThrown}}</span>
</script>
<script id="chart_template" type="text/x-jsrender">
<div class="chart">
<h4>{{>title}}:</h4>
<div id="chart_graph_{{>name}}"></div>
</div>
</script>
{% endraw %}
{# Load the Javascript #}
{% set javascripts = ('strftime.min.js',
'jquery-2.1.0.min.js',
'jsrender.min.js',
'bootstrap.min.js',
'protovis.min.js',
'graphs.js',
'lens2.js') %}
{% for script in javascripts %}
<script src="{{ url_for('static', filename=script) }}"></script>
{% endfor %}
<script>
var lens_instance;
$(document).ready(function() {
$.views.helpers({
timestampToString: lens.util.timestampToString,
replaceAttrsInMsg: lens.util.replaceAttrsInMsg,
});
lens_instance = new lens.Lens();
$('#query_field').focus();
......@@ -26,73 +163,16 @@ $(document).ready(function() {
return false;
});
/*
$('#show_stats_btn').click(
function() {
$('#log_stats').toggle('fast');
$(this).toggleClass('btn_open btn_closed');
});
*/
});
</script>
</head>
<body>
<div id="header">
<div id="searchDiv">
<form id="searchForm" action="/search" method="post">
<input type="text" id="query_field" name="q" size="90" value="{{ query or '' | e }}">
<input type="submit" value="Search">
<span id="loading" style="display:none;">
<img src="/static/spinner.gif" border="0">
</span>
<span id="error" style="display:none;"></span>
</form>
</div>
<div id="log_pagination_div">
<a id="show_stats_btn" class="btn_closed">Stats</a>
<div id="query_time"></div>
<a id="log_pagination_prev" style="display:none;">
&lt;-- Previous
</a>
<span id="log_pagination_title"></span>
<a id="log_pagination_next" style="display:none;">
Next --&gt;
</a>
</div>
</div>
<div id="log_container">
<div id="log_stats">
<b>Result set analysis</b><br>
<div id="log_stats_inner"></div>
<div style="clear:both;"></div>
</div>
<div id="log_viewer"></div>
</div>
{% raw %}
<div id="log_template" style="display:none;">
<div class="log">
<span class="timestamp">${lens.util.timestampToString(log.timestamp)}</span>