rjack-solr 4.0.0.0-java → 4.1.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/History.rdoc +5 -0
  2. data/Manifest.txt +5 -4
  3. data/README.rdoc +1 -1
  4. data/init/rjack-solr +1 -1
  5. data/lib/rjack-solr/base.rb +1 -1
  6. data/lib/rjack-solr/solr-core-4.1.0.jar +0 -0
  7. data/lib/rjack-solr/solr-solrj-4.1.0.jar +0 -0
  8. data/pom.xml +2 -2
  9. data/webapp/META-INF/MANIFEST.MF +3 -3
  10. data/webapp/META-INF/NOTICE.txt +2 -2
  11. data/webapp/admin.html +1 -0
  12. data/webapp/css/styles/cloud.css +8 -1
  13. data/webapp/css/styles/common.css +21 -0
  14. data/webapp/css/styles/dashboard.css +2 -2
  15. data/webapp/css/styles/dataimport.css +183 -21
  16. data/webapp/css/styles/menu.css +2 -0
  17. data/webapp/css/styles/query.css +9 -3
  18. data/webapp/css/styles/schema-browser.css +12 -0
  19. data/webapp/img/ico/cross-button.png +0 -0
  20. data/webapp/img/ico/hammer.png +0 -0
  21. data/webapp/js/lib/console.js +11 -9
  22. data/webapp/js/lib/highlight.js +1 -1
  23. data/webapp/js/lib/jquery.autogrow.js +132 -0
  24. data/webapp/js/main.js +1 -0
  25. data/webapp/js/require.js +3 -1
  26. data/webapp/js/scripts/analysis.js +2 -2
  27. data/webapp/js/scripts/app.js +183 -78
  28. data/webapp/js/scripts/cloud.js +41 -20
  29. data/webapp/js/scripts/cores.js +5 -2
  30. data/webapp/js/scripts/dashboard.js +2 -1
  31. data/webapp/js/scripts/dataimport.js +415 -162
  32. data/webapp/js/scripts/file.js +1 -1
  33. data/webapp/js/scripts/index.js +3 -5
  34. data/webapp/js/scripts/logging.js +8 -0
  35. data/webapp/js/scripts/plugins.js +47 -7
  36. data/webapp/js/scripts/query.js +75 -49
  37. data/webapp/js/scripts/replication.js +4 -47
  38. data/webapp/js/scripts/schema-browser.js +46 -23
  39. data/webapp/tpl/cores.html +5 -0
  40. data/webapp/tpl/dashboard.html +4 -1
  41. data/webapp/tpl/dataimport.html +72 -12
  42. data/webapp/tpl/query.html +38 -3
  43. data/webapp/tpl/schema-browser.html +6 -0
  44. metadata +15 -12
  45. data/lib/rjack-solr/solr-core-4.0.0.jar +0 -0
  46. data/lib/rjack-solr/solr-solrj-4.0.0.jar +0 -0
@@ -14,6 +14,8 @@
14
14
  {
15
15
  display: block;
16
16
  padding: 4px 2px;
17
+ overflow: hidden;
18
+ text-overflow: ellipsis;
17
19
  }
18
20
 
19
21
  #menu-wrapper .active p
@@ -26,16 +26,22 @@
26
26
  width: 100%;
27
27
  }
28
28
 
29
+ #content #query #form input,
30
+ #content #query #form textarea
31
+ {
32
+ width: 98%;
33
+ }
34
+
29
35
  #content #query #form #start
30
36
  {
31
37
  float: left;
32
- margin-right: 2%;
33
- width: 49%;
38
+ width: 45%;
34
39
  }
35
40
 
36
41
  #content #query #form #rows
37
42
  {
38
- width: 49%;
43
+ float: right;
44
+ width: 45%;
39
45
  }
40
46
 
41
47
  #content #query #form .checkbox input
@@ -114,6 +114,18 @@
114
114
  padding-left: 5px;
115
115
  }
116
116
 
117
+ #content #schema-browser #data #field .partial
118
+ {
119
+ display: none;
120
+ }
121
+
122
+ #content #schema-browser #data #field .partial p
123
+ {
124
+ background-image: url( ../../img/ico/exclamation-button.png );
125
+ background-position: 0 50%;
126
+ padding-left: 21px;
127
+ }
128
+
117
129
  #content #schema-browser #data #field .field-options .options dt,
118
130
  #content #schema-browser #data #field .field-options .options dd
119
131
  {
Binary file
@@ -15,13 +15,15 @@
15
15
  limitations under the License.
16
16
  */
17
17
 
18
- if( 'undefined' === typeof( console ) )
18
+ window.console = window.console || {};
19
+
20
+ var names = ["log", "debug", "info", "warn", "error",
21
+ "assert", "dir", "dirxml", "group", "groupEnd", "time",
22
+ "timeEnd", "count", "trace", "profile", "profileEnd"];
23
+
24
+ var i = 0;
25
+ var l = names.length;
26
+ for( i = 0; i < l; i++ )
19
27
  {
20
- var console = {
21
- log : function() {},
22
- debug : function() {},
23
- dump : function() {},
24
- error : function() {},
25
- warn : function(){}
26
- };
27
- }
28
+ window.console[names[i]] = window.console[names[i]] || function() {};
29
+ }
@@ -1 +1 @@
1
- var hljs=new function(){var p={};var a={};function n(c){return c.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function k(s,r){if(!s){return false}for(var c=0;c<s.length;c++){if(s[c]==r){return true}}return false}function e(s,r,c){var t="m"+(s.cI?"i":"")+(c?"g":"");return new RegExp(r,t)}function j(r){for(var c=0;c<r.childNodes.length;c++){node=r.childNodes[c];if(node.nodeName=="CODE"){return node}if(!(node.nodeType==3&&node.nodeValue.match(/\s+/))){return null}}}function h(u,t){var s="";for(var r=0;r<u.childNodes.length;r++){if(u.childNodes[r].nodeType==3){var c=u.childNodes[r].nodeValue;if(t){c=c.replace(/\n/g,"")}s+=c}else{if(u.childNodes[r].nodeName=="BR"){s+="\n"}else{s+=h(u.childNodes[r])}}}s=s.replace(/\r/g,"\n");return s}function b(t){var r=t.className.split(/\s+/);r=r.concat(t.parentNode.className.split(/\s+/));for(var c=0;c<r.length;c++){var s=r[c].replace(/^language-/,"");if(p[s]||s=="no-highlight"){return s}}}function d(c){var r=[];(function(t,u){for(var s=0;s<t.childNodes.length;s++){if(t.childNodes[s].nodeType==3){u+=t.childNodes[s].nodeValue.length}else{if(t.childNodes[s].nodeName=="BR"){u+=1}else{r.push({event:"start",offset:u,node:t.childNodes[s]});u=arguments.callee(t.childNodes[s],u);r.push({event:"stop",offset:u,node:t.childNodes[s]})}}}return u})(c,0);return r}function m(z,A,y){var s=0;var x="";var u=[];function v(){if(z.length&&A.length){if(z[0].offset!=A[0].offset){return(z[0].offset<A[0].offset)?z:A}else{return(z[0].event=="start"&&A[0].event=="stop")?A:z}}else{return z.length?z:A}}function t(E){var F="<"+E.nodeName.toLowerCase();for(var C=0;C<E.attributes.length;C++){var D=E.attributes[C];F+=" "+D.nodeName.toLowerCase();if(D.nodeValue!=undefined){F+='="'+n(D.nodeValue)+'"'}}return F+">"}function B(C){return"</"+C.nodeName.toLowerCase()+">"}while(z.length||A.length){var w=v().splice(0,1)[0];x+=n(y.substr(s,w.offset-s));s=w.offset;if(w.event=="start"){x+=t(w.node);u.push(w.node)}else{if(w.event=="stop"){var r=u.length;do{r--;var c=u[r];x+=B(c)}while(c!=w.node);u.splice(r,1);while(r<u.length){x+=t(u[r]);r++}}}}x+=y.substr(s);return x}function g(K,E){function A(r,N){for(var M=0;M<N.sm.length;M++){if(N.sm[M].bR.test(r)){return N.sm[M]}}return null}function x(M,r){if(D[M].e&&D[M].eR.test(r)){return 1}if(D[M].eW){var N=x(M-1,r);return N?N+1:0}return 0}function y(r,M){return M.iR&&M.iR.test(r)}function B(P,O){var N=[];for(var M=0;M<P.sm.length;M++){N.push(P.sm[M].b)}var r=D.length-1;do{if(D[r].e){N.push(D[r].e)}r--}while(D[r+1].eW);if(P.i){N.push(P.i)}return e(O,"("+N.join("|")+")",true)}function t(N,M){var O=D[D.length-1];if(!O.t){O.t=B(O,I)}O.t.lastIndex=M;var r=O.t.exec(N);if(r){return[N.substr(M,r.index-M),r[0],false]}else{return[N.substr(M),"",true]}}function c(P,r){var M=I.cI?r[0].toLowerCase():r[0];for(var O in P.keywordGroups){if(!P.keywordGroups.hasOwnProperty(O)){continue}var N=P.keywordGroups[O].hasOwnProperty(M);if(N){return[O,N]}}return false}function G(N,Q){if(!Q.k||!Q.l){return n(N)}if(!Q.lR){var P="("+Q.l.join("|")+")";Q.lR=e(I,P,true)}var O="";var R=0;Q.lR.lastIndex=0;var M=Q.lR.exec(N);while(M){O+=n(N.substr(R,M.index-R));var r=c(Q,M);if(r){u+=r[1];O+='<span class="'+r[0]+'">'+n(M[0])+"</span>"}else{O+=n(M[0])}R=Q.lR.lastIndex;M=Q.lR.exec(N)}O+=n(N.substr(R,N.length-R));return O}function L(r,N){if(N.subLanguage&&a[N.subLanguage]){var M=g(N.subLanguage,r);u+=M.keyword_count;C+=M.r;return M.value}else{return G(r,N)}}function J(N,r){var M=N.nM?"":'<span class="'+N.displayClassName+'">';if(N.rB){s+=M;N.buffer=""}else{if(N.eB){s+=n(r)+M;N.buffer=""}else{s+=M;N.buffer=r}}D[D.length]=N}function F(M,O,R){var P=D[D.length-1];if(R){s+=L(P.buffer+M,P);return false}var S=A(O,P);if(S){s+=L(P.buffer+M,P);J(S,O);C+=S.r;return S.rB}var r=x(D.length-1,O);if(r){var T=P.nM?"":"</span>";if(P.rE){s+=L(P.buffer+M,P)+T}else{if(P.eE){s+=L(P.buffer+M,P)+T+n(O)}else{s+=L(P.buffer+M+O,P)+T}}while(r>1){T=D[D.length-2].nM?"":"</span>";s+=T;r--;D.length--}var Q=D[D.length-1];D.length--;D[D.length-1].buffer="";if(Q.starts){for(var N=0;N<I.m.length;N++){if(I.m[N].cN==Q.starts){J(I.m[N],"");break}}}return P.rE}if(y(O,P)){throw"Illegal"}}var I=p[K];var D=[I.dM];var C=0;var u=0;var s="";try{var w=0;I.dM.buffer="";do{var z=t(E,w);var v=F(z[0],z[1],z[2]);w+=z[0].length;if(!v){w+=z[1].length}}while(!z[2]);if(D.length>1){throw"Illegal"}return{language:K,r:C,keyword_count:u,value:s}}catch(H){if(H=="Illegal"){return{language:null,r:0,keyword_count:0,value:n(E)}}else{throw H}}}function i(){function r(y,x){if(y.compiled){return}if(y.b){y.bR=e(x,"^"+y.b)}if(y.e){y.eR=e(x,"^"+y.e)}if(y.i){y.iR=e(x,"^(?:"+y.i+")")}if(y.r==undefined){y.r=1}if(!y.displayClassName){y.displayClassName=y.cN}if(!y.cN){y.nM=true}for(var w in y.k){if(!y.k.hasOwnProperty(w)){continue}if(y.k[w] instanceof Object){y.keywordGroups=y.k}else{y.keywordGroups={keyword:y.k}}break}y.sm=[];if(y.c){for(var v=0;v<y.c.length;v++){if(y.c[v] instanceof Object){y.sm.push(y.c[v])}else{for(var u=0;u<x.m.length;u++){if(x.m[u].cN==y.c[v]){y.sm.push(x.m[u])}}}}}y.compiled=true;for(var v=0;v<y.sm.length;v++){r(y.sm[v],x)}}for(var t in p){if(!p.hasOwnProperty(t)){continue}var c=[p[t].dM].concat(p[t].m);for(var s=0;s<c.length;s++){r(c[s],p[t])}}}function f(){if(f.called){return}f.called=true;i();a=p}function q(v,A,r){f();var C=h(v,r);var t=b(v);if(t=="no-highlight"){return}if(t){var y=g(t,C)}else{var y={language:"",keyword_count:0,r:0,value:n(C)};var z=y;for(var B in a){if(!a.hasOwnProperty(B)){continue}var w=g(B,C);if(w.keyword_count+w.r>z.keyword_count+z.r){z=w}if(w.keyword_count+w.r>y.keyword_count+y.r){z=y;y=w}}}var u=v.className;if(!u.match(y.language)){u=u?(u+" "+y.language):y.language}var c=d(v);if(c.length){var s=document.createElement("pre");s.innerHTML=y.value;y.value=m(c,d(s),C)}if(A){y.value=y.value.replace(/^((<[^>]+>|\t)+)/gm,function(D,G,F,E){return G.replace(/\t/g,A)})}if(r){y.value=y.value.replace(/\n/g,"<br>")}if(/MSIE [678]/.test(navigator.userAgent)&&v.tagName=="CODE"&&v.parentNode.tagName=="PRE"){var s=v.parentNode;var x=document.createElement("div");x.innerHTML="<pre><code>"+y.value+"</code></pre>";v=x.firstChild.firstChild;x.firstChild.cN=s.cN;s.parentNode.replaceChild(x.firstChild,s)}else{v.innerHTML=y.value}v.className=u;v.dataset={};v.dataset.result={language:y.language,kw:y.keyword_count,re:y.r};if(z&&z.language){v.dataset.second_best={language:z.language,kw:z.keyword_count,re:z.r}}}function l(){if(l.called){return}l.called=true;f();if(arguments.length){for(var c=0;c<arguments.length;c++){if(p[arguments[c]]){a[arguments[c]]=p[arguments[c]]}}}var s=document.getElementsByTagName("pre");for(var c=0;c<s.length;c++){var r=j(s[c]);if(r){q(r,hljs.tabReplace)}}}function o(){var c=arguments;var r=function(){l.apply(null,c)};if(window.addEventListener){window.addEventListener("DOMContentLoaded",r,false);window.addEventListener("load",r,false)}else{if(window.attachEvent){window.attachEvent("onload",r)}else{window.onload=r}}}this.LANGUAGES=p;this.initHighlightingOnLoad=o;this.highlightBlock=q;this.initHighlighting=l;this.IMR="\\b|\\B";this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:["escape"],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:["escape"],r:0};this.BE={cN:"escape",b:"\\\\.",e:this.IMR,nM:true,r:0};this.CLCM={cN:"comment",b:"//",e:"$",r:0};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NUMBER_MODE={cN:"number",b:this.NR,e:this.IMR,r:0};this.CNM={cN:"number",b:this.CNR,e:this.IMR,r:0};this.inherit=function(c,t){var s={};for(var r in c){s[r]=c[r]}if(t){for(var r in t){s[r]=t[r]}}return s}}();var initHighlightingOnLoad=hljs.initHighlightingOnLoad;(function(){var d="[A-Za-z0-9\\._:-]+";var k={cN:"pi",b:"<\\?",e:"\\?>",r:10};var i={cN:"doctype",b:"<!DOCTYPE",e:">",r:10};var j={cN:"comment",b:"<!--",e:"-->"};var g={cN:"tag",b:"</?",e:"/?>",c:["title","tag_internal"]};var e={cN:"title",b:d,e:hljs.IMR};var b={cN:"tag_internal",b:hljs.IMR,eW:true,nM:true,c:["attribute","value_container"],r:0};var f={cN:"attribute",b:d,e:hljs.IMR,r:0};var a={cN:"value_container",b:'="',rB:true,e:'"',nM:true,c:[{cN:"value",b:'"',eW:true}]};var c={cN:"value_container",b:"='",rB:true,e:"'",nM:true,c:[{cN:"value",b:"'",eW:true}]};hljs.LANGUAGES.xml={dM:{c:["pi","doctype","comment","cdata","tag"]},cI:true,m:[{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},k,i,j,g,hljs.inherit(e,{r:1.75}),b,f,a,c]};var h={code:1,kbd:1,font:1,noscript:1,style:1,img:1,title:1,menu:1,tt:1,tr:1,param:1,li:1,tfoot:1,th:1,input:1,td:1,dl:1,blockquote:1,fieldset:1,big:1,dd:1,abbr:1,optgroup:1,dt:1,button:1,isindex:1,p:1,small:1,div:1,dir:1,em:1,frame:1,meta:1,sub:1,bdo:1,label:1,acronym:1,sup:1,body:1,basefont:1,base:1,br:1,address:1,strong:1,legend:1,ol:1,script:1,caption:1,s:1,col:1,h2:1,h3:1,h1:1,h6:1,h4:1,h5:1,table:1,select:1,noframes:1,span:1,area:1,dfn:1,strike:1,cite:1,thead:1,head:1,option:1,form:1,hr:1,"var":1,link:1,b:1,colgroup:1,ul:1,applet:1,del:1,iframe:1,pre:1,frameset:1,ins:1,tbody:1,html:1,samp:1,map:1,object:1,a:1,xmlns:1,center:1,textarea:1,i:1,q:1,u:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,figure:1,figurecaption:1,time:1,mark:1,wbr:1,embed:1,video:1,audio:1,source:1,canvas:1,datalist:1,keygen:1,output:1,progress:1,meter:1,details:1,summary:1,command:1};hljs.LANGUAGES.html={dM:{c:["comment","pi","doctype","vbscript","tag"]},cI:true,m:[{cN:"tag",b:"<style",e:">",l:[hljs.IR],k:{style:1},c:["tag_internal"],starts:"css"},{cN:"tag",b:"<script",e:">",l:[hljs.IR],k:{script:1},c:["tag_internal"],starts:"javascript"},{cN:"css",e:"</style>",rE:true,subLanguage:"css"},{cN:"javascript",e:"<\/script>",rE:true,subLanguage:"javascript"},{cN:"vbscript",b:"<%",e:"%>",subLanguage:"vbscript"},j,k,i,hljs.inherit(g),hljs.inherit(e,{l:[hljs.IR],k:h}),hljs.inherit(b),f,a,c,{cN:"value_container",b:"=",e:hljs.IMR,c:[{cN:"unquoted_value",displayClassName:"value",b:"[^\\s/>]+",e:hljs.IMR}]}]}})();
1
+ var hljs=new function(){function l(o){return o.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[];function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.substr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.ruby=function(e){var a="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var j="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g={keyword:"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include"};var c={cN:"yardoctag",b:"@[A-Za-z]+"};var k=[{cN:"comment",b:"#",e:"$",c:[c]},{cN:"comment",b:"^\\=begin",e:"^\\=end",c:[c],r:10},{cN:"comment",b:"^__END__",e:"\\n$"}];var d={cN:"subst",b:"#\\{",e:"}",l:a,k:g};var i=[e.BE,d];var b=[{cN:"string",b:"'",e:"'",c:i,r:0},{cN:"string",b:'"',e:'"',c:i,r:0},{cN:"string",b:"%[qw]?\\(",e:"\\)",c:i},{cN:"string",b:"%[qw]?\\[",e:"\\]",c:i},{cN:"string",b:"%[qw]?{",e:"}",c:i},{cN:"string",b:"%[qw]?<",e:">",c:i,r:10},{cN:"string",b:"%[qw]?/",e:"/",c:i,r:10},{cN:"string",b:"%[qw]?%",e:"%",c:i,r:10},{cN:"string",b:"%[qw]?-",e:"-",c:i,r:10},{cN:"string",b:"%[qw]?\\|",e:"\\|",c:i,r:10}];var h={cN:"function",bWK:true,e:" |$|;",k:"def",c:[{cN:"title",b:j,l:a,k:g},{cN:"params",b:"\\(",e:"\\)",l:a,k:g}].concat(k)};var f=k.concat(b.concat([{cN:"class",bWK:true,e:"$|;",k:"class module",c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(k)},h,{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:b.concat([{b:j}]),r:0},{cN:"symbol",b:a+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:k.concat([{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[e.BE,d]}]),r:0}]));d.c=f;h.c[1].c=f;return{l:a,k:g,c:f}}(hljs);hljs.LANGUAGES.diff=function(a){return{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}(hljs);hljs.LANGUAGES.javascript=function(a){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",i:"\\n",c:[{b:"\\\\/"}]},{b:"<",e:">;",sL:"xml"}],r:0},{cN:"function",bWK:true,e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[a.CLCM,a.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.php=function(a){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var b=[a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),{cN:"string",b:'b"',e:'"',c:[a.BE]},{cN:"string",b:"b'",e:"'",c:[a.BE]}];var c=[a.BNM,a.CNM];var d={cN:"title",b:a.UIR};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler",c:[a.CLCM,a.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"}]},{cN:"comment",eB:true,b:"__halt_compiler.+?;",eW:true},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[a.BE]},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"},e,{cN:"function",bWK:true,e:"{",k:"function",i:"\\$|\\[|%",c:[d,{cN:"params",b:"\\(",e:"\\)",c:["self",e,a.CBLCLM].concat(b).concat(c)}]},{cN:"class",bWK:true,e:"{",k:"class",i:"[:\\(\\$]",c:[{bWK:true,eW:true,k:"extends",c:[d]},d]},{b:"=>"}].concat(b).concat(c)}}(hljs);hljs.LANGUAGES.python=function(a){var f={cN:"prompt",b:"^(>>>|\\.\\.\\.) "};var c=[{cN:"string",b:"(u|b)?r?'''",e:"'''",c:[f],r:10},{cN:"string",b:'(u|b)?r?"""',e:'"""',c:[f],r:10},{cN:"string",b:"(u|r|ur)'",e:"'",c:[a.BE],r:10},{cN:"string",b:'(u|r|ur)"',e:'"',c:[a.BE],r:10},{cN:"string",b:"(b|br)'",e:"'",c:[a.BE]},{cN:"string",b:'(b|br)"',e:'"',c:[a.BE]}].concat([a.ASM,a.QSM]);var e={cN:"title",b:a.UIR};var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM,f].concat(c)};var b={bWK:true,e:":",i:"[${=;\\n]",c:[e,d],r:10};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10",built_in:"None True False Ellipsis NotImplemented"},i:"(</|->|\\?)",c:c.concat([f,a.HCM,a.inherit(b,{cN:"function",k:"def"}),a.inherit(b,{cN:"class",k:"class"}),a.CNM,{cN:"decorator",b:"@",e:"$"},{b:"\\b(print|exec)\\("}])}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);
@@ -0,0 +1,132 @@
1
+ /*
2
+ * Auto Expanding Text Area (1.2.2)
3
+ * by Chrys Bader (www.chrysbader.com)
4
+ * chrysb@gmail.com
5
+ *
6
+ * Special thanks to:
7
+ * Jake Chapa - jake@hybridstudio.com
8
+ * John Resig - jeresig@gmail.com
9
+ *
10
+ * Copyright (c) 2008 Chrys Bader (www.chrysbader.com)
11
+ * Licensed under the GPL (GPL-LICENSE.txt) license.
12
+ *
13
+ *
14
+ * NOTE: This script requires jQuery to work. Download jQuery at www.jquery.com
15
+ *
16
+ */
17
+
18
+ (function(jQuery) {
19
+
20
+ var self = null;
21
+
22
+ jQuery.fn.autogrow = function(o)
23
+ {
24
+ return this.each(function() {
25
+ new jQuery.autogrow(this, o);
26
+ });
27
+ };
28
+
29
+
30
+ /**
31
+ * The autogrow object.
32
+ *
33
+ * @constructor
34
+ * @name jQuery.autogrow
35
+ * @param Object e The textarea to create the autogrow for.
36
+ * @param Hash o A set of key/value pairs to set as configuration properties.
37
+ * @cat Plugins/autogrow
38
+ */
39
+
40
+ jQuery.autogrow = function (e, o)
41
+ {
42
+ this.options = o || {};
43
+ this.dummy = null;
44
+ this.interval = null;
45
+ this.line_height = this.options.lineHeight || parseInt(jQuery(e).css('line-height'), 10);
46
+ this.min_height = this.options.minHeight || parseInt(jQuery(e).css('min-height'), 10);
47
+ this.max_height = this.options.maxHeight || parseInt(jQuery(e).css('max-height'), 10);
48
+ this.textarea = jQuery(e);
49
+
50
+ if(this.line_height == NaN)
51
+ this.line_height = 0;
52
+
53
+ // Only one textarea activated at a time, the one being used
54
+ this.init();
55
+ };
56
+
57
+ jQuery.autogrow.fn = jQuery.autogrow.prototype = {
58
+ autogrow: '1.2.2'
59
+ };
60
+
61
+ jQuery.autogrow.fn.extend = jQuery.autogrow.extend = jQuery.extend;
62
+
63
+ jQuery.autogrow.fn.extend({
64
+
65
+ init: function() {
66
+ var self = this;
67
+ this.textarea.css({overflow: 'hidden', display: 'block'});
68
+ this.textarea.bind('focus', function() { self.startExpand(); } ).bind('blur', function() { self.stopExpand(); });
69
+ this.checkExpand();
70
+ },
71
+
72
+ startExpand: function() {
73
+ var self = this;
74
+ this.interval = window.setInterval(function() {self.checkExpand();}, 400);
75
+ },
76
+
77
+ stopExpand: function() {
78
+ clearInterval(this.interval);
79
+ },
80
+
81
+ checkExpand: function() {
82
+
83
+ if (this.dummy == null)
84
+ {
85
+ this.dummy = jQuery('<div></div>');
86
+ this.dummy.css({
87
+ 'font-size' : this.textarea.css('font-size'),
88
+ 'font-family': this.textarea.css('font-family'),
89
+ 'width' : this.textarea.css('width'),
90
+ // IE shits its pants if you uncomment the next line!
91
+ //'padding' : this.textarea.css('padding'),
92
+ 'line-height': this.line_height + 'px',
93
+ 'overflow-x' : 'hidden',
94
+ 'position' : 'absolute',
95
+ 'top' : 0,
96
+ 'left' : -9999
97
+ }).appendTo('body');
98
+ }
99
+
100
+ // Strip HTML tags
101
+ var html = this.textarea.val().replace(/(<|>)/g, '');
102
+
103
+ // IE is different, as per usual
104
+ if ($.browser.msie)
105
+ {
106
+ html = html.replace(/\n/g, '<BR>new');
107
+ }
108
+ else
109
+ {
110
+ html = html.replace(/\n/g, '<br>new');
111
+ }
112
+
113
+ if (this.dummy.html() != html)
114
+ {
115
+ this.dummy.html(html);
116
+
117
+ if (this.max_height > 0 && (this.dummy.height() + this.line_height > this.max_height))
118
+ {
119
+ this.textarea.css('overflow-y', 'auto');
120
+ }
121
+ else
122
+ {
123
+ this.textarea.css('overflow-y', 'hidden');
124
+ if (this.textarea.height() < this.dummy.height() + this.line_height || (this.dummy.height() < this.textarea.height()))
125
+ {
126
+ this.textarea.animate({height: (this.dummy.height() + this.line_height) + 'px'}, 100);
127
+ }
128
+ }
129
+ }
130
+ }
131
+ });
132
+ })(jQuery);
@@ -20,6 +20,7 @@ require
20
20
  [
21
21
  'lib/order!lib/console',
22
22
  'lib/order!jquery',
23
+ 'lib/order!lib/jquery.autogrow',
23
24
  'lib/order!lib/jquery.cookie',
24
25
  'lib/order!lib/jquery.form',
25
26
  'lib/order!lib/jquery.jstree',
@@ -9359,7 +9359,9 @@ jQuery.extend({
9359
9359
  }
9360
9360
  done( 0, statusText );
9361
9361
  return this;
9362
- }
9362
+ },
9363
+
9364
+ url : s.url
9363
9365
  };
9364
9366
 
9365
9367
  // Callback for when everything is done
@@ -18,7 +18,7 @@
18
18
  // #/:core/analysis
19
19
  sammy.get
20
20
  (
21
- /^#\/([\w\d-]+)\/(analysis)$/,
21
+ new RegExp( app.core_regex_base + '\\/(analysis)$' ),
22
22
  function( context )
23
23
  {
24
24
  var active_core = this.active_core;
@@ -129,7 +129,7 @@ sammy.get
129
129
  {
130
130
  fields++;
131
131
  $( '[name="' + key + '"]', analysis_form )
132
- .val( decodeURIComponent( context.params[key].replace( /\+/g, '%20' ) ) );
132
+ .val( context.params[key].replace( /\+/g, ' ' ) );
133
133
  }
134
134
  }
135
135
 
@@ -82,11 +82,7 @@ var sammy = $.sammy
82
82
  {},
83
83
  function( context )
84
84
  {
85
- if( app.timeout )
86
- {
87
- console.debug( 'Clearing Timeout #' + app.timeout );
88
- clearTimeout( app.timeout );
89
- }
85
+ app.clear_timeout();
90
86
 
91
87
  var menu_wrapper = $( '#menu-wrapper' );
92
88
 
@@ -100,7 +96,7 @@ var sammy = $.sammy
100
96
  {
101
97
  var selector = '~' === this.params.splat[0][0]
102
98
  ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
103
- : '#menu-selector #' + this.params.splat[0];
99
+ : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' );
104
100
 
105
101
  var active_element = $( selector, menu_wrapper );
106
102
 
@@ -131,7 +127,7 @@ var sammy = $.sammy
131
127
 
132
128
  var solr_admin = function( app_config )
133
129
  {
134
- self = this,
130
+ that = this,
135
131
 
136
132
  menu_element = null,
137
133
 
@@ -152,6 +148,8 @@ var solr_admin = function( app_config )
152
148
 
153
149
  this.timeout = null;
154
150
 
151
+ this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
152
+
155
153
  show_global_error = function( error )
156
154
  {
157
155
  var main = $( '#main' );
@@ -170,6 +168,110 @@ var solr_admin = function( app_config )
170
168
  }
171
169
  };
172
170
 
171
+ sort_cores_data = function sort_cores_data( cores_status )
172
+ {
173
+ // build array of core-names for sorting
174
+ var core_names = [];
175
+ for( var core_name in cores_status )
176
+ {
177
+ core_names.push( core_name );
178
+ }
179
+ core_names.sort();
180
+
181
+ var core_count = core_names.length;
182
+ var cores = {};
183
+
184
+ for( var i = 0; i < core_count; i++ )
185
+ {
186
+ var core_name = core_names[i];
187
+ cores[core_name] = cores_status[core_name];
188
+ }
189
+
190
+ return cores;
191
+ };
192
+
193
+ this.set_cores_data = function set_cores_data( cores )
194
+ {
195
+ that.cores_data = sort_cores_data( cores.status );
196
+
197
+ that.menu_element
198
+ .empty();
199
+
200
+ var core_count = 0;
201
+ for( var core_name in that.cores_data )
202
+ {
203
+ core_count++;
204
+ var core_path = config.solr_path + '/' + core_name;
205
+ var classes = [];
206
+
207
+ if( !environment_basepath )
208
+ {
209
+ environment_basepath = core_path;
210
+ }
211
+
212
+ if( cores.status[core_name]['isDefaultCore'] )
213
+ {
214
+ classes.push( 'default' );
215
+ }
216
+
217
+ var core_tpl = '<li id="' + core_name.replace( /\./g, '__' ) + '" '
218
+ + ' class="' + classes.join( ' ' ) + '"'
219
+ + ' data-basepath="' + core_path + '"'
220
+ + ' schema="' + cores.status[core_name]['schema'] + '"'
221
+ + ' config="' + cores.status[core_name]['config'] + '"'
222
+ + '>' + "\n"
223
+ + ' <p><a href="#/' + core_name + '" title="' + core_name + '">' + core_name + '</a></p>' + "\n"
224
+ + ' <ul>' + "\n"
225
+
226
+ + ' <li class="ping"><a rel="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"
227
+ + ' <li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"
228
+ + ' <li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"
229
+ + ' <li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"
230
+ + ' <li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"
231
+ + ' <li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"
232
+ + ' <li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"
233
+ + ' <li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n"
234
+ + ' <li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
235
+
236
+ + ' </ul>' + "\n"
237
+ + '</li>';
238
+
239
+ that.menu_element
240
+ .append( core_tpl );
241
+ }
242
+
243
+ if( cores.initFailures )
244
+ {
245
+ var failures = [];
246
+ for( var core_name in cores.initFailures )
247
+ {
248
+ failures.push
249
+ (
250
+ '<li>' +
251
+ '<strong>' + core_name.esc() + ':</strong>' + "\n" +
252
+ cores.initFailures[core_name].esc() + "\n" +
253
+ '</li>'
254
+ );
255
+ }
256
+
257
+ if( 0 !== failures.length )
258
+ {
259
+ var init_failures = $( '#init-failures' );
260
+
261
+ init_failures.show();
262
+ $( 'ul', init_failures ).html( failures.join( "\n" ) );
263
+ }
264
+ }
265
+
266
+ if( 0 === core_count )
267
+ {
268
+ show_global_error
269
+ (
270
+ '<div class="message">There are no SolrCores running. <br/> Using the Solr Admin UI currently requires at least one SolrCore.</div>'
271
+ );
272
+ } // else: we have at least one core....
273
+ };
274
+
173
275
  this.run = function()
174
276
  {
175
277
  $.ajax
@@ -184,85 +286,17 @@ var solr_admin = function( app_config )
184
286
  },
185
287
  success : function( response )
186
288
  {
187
- self.cores_data = response.status;
188
- var core_count = 0;
289
+ that.set_cores_data( response );
189
290
 
190
291
  for( var core_name in response.status )
191
292
  {
192
- core_count++;
193
293
  var core_path = config.solr_path + '/' + core_name;
194
- var schema = response['status'][core_name]['schema'];
195
- var solrconfig = response['status'][core_name]['config'];
196
- var classes = [];
197
-
198
294
  if( !environment_basepath )
199
295
  {
200
296
  environment_basepath = core_path;
201
297
  }
202
-
203
- if( response['status'][core_name]['isDefaultCore'] )
204
- {
205
- classes.push( 'default' );
206
- }
207
-
208
- var core_tpl = '<li id="' + core_name + '" '
209
- + ' class="' + classes.join( ' ' ) + '"'
210
- + ' data-basepath="' + core_path + '"'
211
- + ' schema="' + schema + '"'
212
- + ' config="' + solrconfig + '"'
213
- + '>' + "\n"
214
- + ' <p><a href="#/' + core_name + '">' + core_name + '</a></p>' + "\n"
215
- + ' <ul>' + "\n"
216
-
217
- + ' <li class="ping"><a rel="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"
218
- + ' <li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"
219
- + ' <li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"
220
- + ' <li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"
221
- + ' <li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"
222
- + ' <li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"
223
- + ' <li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"
224
- + ' <li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n"
225
- + ' <li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
226
-
227
- + ' </ul>' + "\n"
228
- + '</li>';
229
-
230
- self.menu_element
231
- .append( core_tpl );
232
298
  }
233
299
 
234
- if( response.initFailures )
235
- {
236
- var failures = [];
237
- for( var core_name in response.initFailures )
238
- {
239
- failures.push
240
- (
241
- '<li>' +
242
- '<strong>' + core_name.esc() + ':</strong>' + "\n" +
243
- response.initFailures[core_name].esc() + "\n" +
244
- '</li>'
245
- );
246
- }
247
-
248
- if( 0 !== failures.length )
249
- {
250
- var init_failures = $( '#init-failures' );
251
-
252
- init_failures.show();
253
- $( 'ul', init_failures ).html( failures.join( "\n" ) );
254
- }
255
- }
256
-
257
- if( 0 === core_count )
258
- {
259
- show_global_error
260
- (
261
- '<div class="message">There are no SolrCores running. <br/> Using the Solr Admin UI currently requires at least one SolrCore.</div>'
262
- );
263
- return;
264
- } // else: we have at least one core....
265
-
266
300
  var system_url = environment_basepath + '/admin/system?wt=json';
267
301
  $.ajax
268
302
  (
@@ -274,7 +308,7 @@ var solr_admin = function( app_config )
274
308
  },
275
309
  success : function( response )
276
310
  {
277
- self.dashboard_values = response;
311
+ that.dashboard_values = response;
278
312
 
279
313
  var environment_args = null;
280
314
  var cloud_args = null;
@@ -361,7 +395,78 @@ var solr_admin = function( app_config )
361
395
  }
362
396
  }
363
397
  );
364
- }
398
+ };
399
+
400
+ this.convert_duration_to_seconds = function convert_duration_to_seconds( str )
401
+ {
402
+ var seconds = 0;
403
+ var arr = new String( str || '' ).split( '.' );
404
+ var parts = arr[0].split( ':' ).reverse();
405
+ var parts_count = parts.length;
406
+
407
+ for( var i = 0; i < parts_count; i++ )
408
+ {
409
+ seconds += ( parseInt( parts[i], 10 ) || 0 ) * Math.pow( 60, i );
410
+ }
411
+
412
+ // treat more or equal than .5 as additional second
413
+ if( arr[1] && 5 <= parseInt( arr[1][0], 10 ) )
414
+ {
415
+ seconds++;
416
+ }
417
+
418
+ return seconds;
419
+ };
420
+
421
+ this.convert_seconds_to_readable_time = function convert_seconds_to_readable_time( seconds )
422
+ {
423
+ seconds = parseInt( seconds || 0, 10 );
424
+ var minutes = Math.floor( seconds / 60 );
425
+ var hours = Math.floor( minutes / 60 );
426
+
427
+ var text = [];
428
+ if( 0 !== hours )
429
+ {
430
+ text.push( hours + 'h' );
431
+ seconds -= hours * 60 * 60;
432
+ minutes -= hours * 60;
433
+ }
434
+
435
+ if( 0 !== minutes )
436
+ {
437
+ text.push( minutes + 'm' );
438
+ seconds -= minutes * 60;
439
+ }
440
+
441
+ if( 0 !== seconds )
442
+ {
443
+ text.push( ( '0' + seconds ).substr( -2 ) + 's' );
444
+ }
445
+
446
+ return text.join( ' ' );
447
+ };
448
+
449
+ this.clear_timeout = function clear_timeout()
450
+ {
451
+ if( !app.timeout )
452
+ {
453
+ return false;
454
+ }
455
+
456
+ console.debug( 'Clearing Timeout #' + this.timeout );
457
+ clearTimeout( this.timeout );
458
+ this.timeout = null;
459
+ };
460
+
461
+ this.format_json = function format_json( json_str )
462
+ {
463
+ if( JSON.stringify && JSON.parse )
464
+ {
465
+ json_str = JSON.stringify( JSON.parse( json_str ), undefined, 2 );
466
+ }
467
+
468
+ return json_str;
469
+ };
365
470
 
366
471
  };
367
472