sunspot_solr 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sunspot-solr +2 -6
- data/lib/sunspot/solr/server.rb +2 -3
- data/solr/README.txt +181 -181
- data/solr/bin/post +29 -19
- data/solr/bin/solr +247 -428
- data/solr/bin/solr.cmd +102 -256
- data/solr/bin/solr.in.cmd +15 -7
- data/solr/bin/solr.in.sh +26 -12
- data/solr/server/README.txt +110 -113
- data/solr/server/contexts/solr-jetty-context.xml +8 -8
- data/solr/server/etc/jetty-http.xml +47 -0
- data/solr/server/etc/jetty-https-ssl.xml +175 -159
- data/solr/server/etc/jetty-https.xml +53 -0
- data/solr/server/etc/jetty-ssl.xml +46 -0
- data/solr/server/etc/jetty.xml +189 -167
- data/solr/server/etc/webdefault.xml +527 -527
- data/solr/server/lib/javax.servlet-api-3.1.0.jar +0 -0
- data/solr/server/lib/jetty-continuation-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-deploy-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-http-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-io-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-jmx-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-rewrite-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-security-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-server-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-servlet-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-servlets-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-util-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-webapp-9.2.11.v20150529.jar +0 -0
- data/solr/server/lib/jetty-xml-9.2.11.v20150529.jar +0 -0
- data/solr/server/modules/http.mod +9 -0
- data/solr/server/modules/https.mod +9 -0
- data/solr/server/modules/server.mod +11 -0
- data/solr/server/modules/ssl.mod +9 -0
- data/solr/server/resources/jetty-logging.properties +1 -0
- data/solr/server/resources/log4j.properties +24 -24
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-exec-1.3.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{hadoop-annotations-2.3.0.jar → hadoop-annotations-2.6.0.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.6.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.6.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.6.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/htrace-core-3.0.4.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.4.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.4.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.4.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.5.4.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.5.4.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-common-5.0.0.jar → lucene-analyzers-common-5.3.1.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-kuromoji-5.0.0.jar → lucene-analyzers-kuromoji-5.3.1.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-phonetic-5.0.0.jar → lucene-analyzers-phonetic-5.3.1.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-expressions-5.0.0.jar → lucene-expressions-5.3.1.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-grouping-5.0.0.jar → lucene-grouping-5.3.1.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-queryparser-5.0.0.jar → lucene-queryparser-5.3.1.jar} +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-sandbox-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.3.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.3.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/t-digest-3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/web.xml +169 -181
- data/solr/server/solr-webapp/webapp/WEB-INF/weblogic.xml +28 -28
- data/solr/server/solr-webapp/webapp/admin.html +164 -163
- data/solr/server/solr-webapp/webapp/css/angular/analysis.css +304 -0
- data/solr/server/solr-webapp/webapp/css/angular/chosen.css +465 -0
- data/solr/server/solr-webapp/webapp/css/angular/cloud.css +398 -0
- data/solr/server/solr-webapp/webapp/css/angular/common.css +724 -0
- data/solr/server/solr-webapp/webapp/css/angular/cores.css +233 -0
- data/solr/server/solr-webapp/webapp/css/angular/dataimport.css +370 -0
- data/solr/server/solr-webapp/webapp/css/angular/documents.css +179 -0
- data/solr/server/solr-webapp/webapp/css/angular/files.css +53 -0
- data/solr/server/solr-webapp/webapp/css/angular/index.css +206 -0
- data/solr/server/solr-webapp/webapp/css/angular/logging.css +376 -0
- data/solr/server/solr-webapp/webapp/css/angular/menu.css +321 -0
- data/solr/server/solr-webapp/webapp/css/angular/plugins.css +212 -0
- data/solr/server/solr-webapp/webapp/css/angular/query.css +162 -0
- data/solr/server/solr-webapp/webapp/css/angular/replication.css +500 -0
- data/solr/server/solr-webapp/webapp/css/angular/schema-browser.css +567 -0
- data/solr/server/solr-webapp/webapp/css/angular/segments.css +173 -0
- data/solr/server/solr-webapp/webapp/css/angular/threads.css +161 -0
- data/solr/server/solr-webapp/webapp/css/chosen.css +421 -421
- data/solr/server/solr-webapp/webapp/css/styles/analysis.css +311 -311
- data/solr/server/solr-webapp/webapp/css/styles/cloud.css +410 -410
- data/solr/server/solr-webapp/webapp/css/styles/common.css +701 -701
- data/solr/server/solr-webapp/webapp/css/styles/cores.css +244 -244
- data/solr/server/solr-webapp/webapp/css/styles/dashboard.css +155 -155
- data/solr/server/solr-webapp/webapp/css/styles/dataimport.css +403 -403
- data/solr/server/solr-webapp/webapp/css/styles/documents.css +197 -197
- data/solr/server/solr-webapp/webapp/css/styles/files.css +54 -54
- data/solr/server/solr-webapp/webapp/css/styles/index.css +207 -207
- data/solr/server/solr-webapp/webapp/css/styles/java-properties.css +52 -52
- data/solr/server/solr-webapp/webapp/css/styles/logging.css +391 -391
- data/solr/server/solr-webapp/webapp/css/styles/menu.css +329 -328
- data/solr/server/solr-webapp/webapp/css/styles/plugins.css +195 -195
- data/solr/server/solr-webapp/webapp/css/styles/query.css +173 -173
- data/solr/server/solr-webapp/webapp/css/styles/replication.css +515 -515
- data/solr/server/solr-webapp/webapp/css/styles/schema-browser.css +578 -578
- data/solr/server/solr-webapp/webapp/css/styles/segments.css +145 -0
- data/solr/server/solr-webapp/webapp/css/styles/threads.css +172 -172
- data/solr/server/solr-webapp/webapp/img/chosen-sprite-2x.png +0 -0
- data/solr/server/solr-webapp/webapp/img/filetypes/README +27 -27
- data/solr/server/solr-webapp/webapp/img/solr.svg +39 -39
- data/solr/server/solr-webapp/webapp/index.html +208 -0
- data/solr/server/solr-webapp/webapp/js/angular/app.js +713 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/analysis.js +199 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/cloud.js +528 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/core-overview.js +225 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/cores.js +465 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/dataimport.js +284 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/documents.js +139 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/files.js +92 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/index.js +95 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/java-properties.js +45 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/logging.js +146 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/plugins.js +166 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/query.js +99 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/replication.js +227 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/schema-browser.js +432 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/segments.js +94 -0
- data/solr/server/solr-webapp/webapp/js/angular/controllers/threads.js +51 -0
- data/solr/server/solr-webapp/webapp/js/angular/services.js +214 -0
- data/solr/server/solr-webapp/webapp/js/lib/ZeroClipboard.js +342 -342
- data/solr/server/solr-webapp/webapp/js/lib/chosen.js +982 -982
- data/solr/server/solr-webapp/webapp/js/lib/console.js +29 -29
- data/solr/server/solr-webapp/webapp/js/lib/d3.js +9373 -9373
- data/solr/server/solr-webapp/webapp/js/lib/highlight.js +31 -31
- data/solr/server/solr-webapp/webapp/js/lib/jquery-1.7.2.min.js +30 -30
- data/solr/server/solr-webapp/webapp/js/lib/jquery.ajaxfileupload.js +184 -184
- data/solr/server/solr-webapp/webapp/js/lib/jquery.blockUI.js +523 -523
- data/solr/server/solr-webapp/webapp/js/lib/jquery.cookie.js +71 -71
- data/solr/server/solr-webapp/webapp/js/lib/jquery.form.js +806 -806
- data/solr/server/solr-webapp/webapp/js/lib/jquery.jstree.js +3534 -3534
- data/solr/server/solr-webapp/webapp/js/lib/jquery.sammy.js +1863 -1863
- data/solr/server/solr-webapp/webapp/js/lib/jquery.timeago.js +189 -189
- data/solr/server/solr-webapp/webapp/js/lib/linker.js +48 -48
- data/solr/server/solr-webapp/webapp/js/lib/naturalSort.js +82 -0
- data/solr/server/solr-webapp/webapp/js/lib/order.js +216 -216
- data/solr/server/solr-webapp/webapp/js/main.js +60 -58
- data/solr/server/solr-webapp/webapp/js/require.js +11349 -11349
- data/solr/server/solr-webapp/webapp/js/scripts/analysis.js +545 -545
- data/solr/server/solr-webapp/webapp/js/scripts/app.js +680 -679
- data/solr/server/solr-webapp/webapp/js/scripts/cloud.js +877 -877
- data/solr/server/solr-webapp/webapp/js/scripts/cores.js +719 -719
- data/solr/server/solr-webapp/webapp/js/scripts/dashboard.js +562 -562
- data/solr/server/solr-webapp/webapp/js/scripts/dataimport.js +812 -812
- data/solr/server/solr-webapp/webapp/js/scripts/documents.js +370 -370
- data/solr/server/solr-webapp/webapp/js/scripts/files.js +265 -265
- data/solr/server/solr-webapp/webapp/js/scripts/index.js +340 -340
- data/solr/server/solr-webapp/webapp/js/scripts/java-properties.js +106 -106
- data/solr/server/solr-webapp/webapp/js/scripts/logging.js +578 -576
- data/solr/server/solr-webapp/webapp/js/scripts/ping.js +72 -72
- data/solr/server/solr-webapp/webapp/js/scripts/plugins.js +462 -462
- data/solr/server/solr-webapp/webapp/js/scripts/query.js +229 -229
- data/solr/server/solr-webapp/webapp/js/scripts/replication.js +527 -527
- data/solr/server/solr-webapp/webapp/js/scripts/schema-browser.js +1229 -1229
- data/solr/server/solr-webapp/webapp/js/scripts/segments.js +206 -0
- data/solr/server/solr-webapp/webapp/js/scripts/threads.js +158 -158
- data/solr/server/solr-webapp/webapp/libs/angular-chosen.js +139 -0
- data/solr/server/solr-webapp/webapp/libs/angular-cookies.js +229 -0
- data/solr/server/solr-webapp/webapp/libs/angular-cookies.min.js +31 -0
- data/solr/server/solr-webapp/webapp/libs/angular-resource.min.js +36 -0
- data/solr/server/solr-webapp/webapp/libs/angular-route.js +1018 -0
- data/solr/server/solr-webapp/webapp/libs/angular-route.min.js +38 -0
- data/solr/server/solr-webapp/webapp/libs/angular-sanitize.js +703 -0
- data/solr/server/solr-webapp/webapp/libs/angular-sanitize.min.js +39 -0
- data/solr/server/solr-webapp/webapp/libs/angular.js +26093 -0
- data/solr/server/solr-webapp/webapp/libs/angular.min.js +273 -0
- data/solr/server/solr-webapp/webapp/libs/chosen.jquery.js +1194 -0
- data/solr/server/solr-webapp/webapp/libs/chosen.jquery.min.js +30 -0
- data/solr/server/solr-webapp/webapp/libs/d3.js +9373 -0
- data/solr/server/solr-webapp/webapp/libs/highlight.js +31 -0
- data/solr/server/solr-webapp/webapp/libs/jquery-2.1.3.min.js +29 -0
- data/solr/server/solr-webapp/webapp/libs/jquery.jstree.js +3534 -0
- data/solr/server/solr-webapp/webapp/libs/ngtimeago.js +102 -0
- data/solr/server/solr-webapp/webapp/partials/analysis.html +128 -0
- data/solr/server/solr-webapp/webapp/partials/cloud.html +104 -0
- data/solr/server/solr-webapp/webapp/partials/core_overview.html +227 -0
- data/solr/server/solr-webapp/webapp/partials/cores.html +231 -0
- data/solr/server/solr-webapp/webapp/partials/dataimport.html +209 -0
- data/solr/server/solr-webapp/webapp/partials/documents.html +118 -0
- data/solr/server/solr-webapp/webapp/partials/files.html +47 -0
- data/solr/server/solr-webapp/webapp/partials/index.html +261 -0
- data/solr/server/solr-webapp/webapp/partials/java-properties.html +27 -0
- data/solr/server/solr-webapp/webapp/partials/logging-levels.html +56 -0
- data/solr/server/solr-webapp/webapp/partials/logging.html +56 -0
- data/solr/server/solr-webapp/webapp/partials/plugins.html +72 -0
- data/solr/server/solr-webapp/webapp/partials/query.html +356 -0
- data/solr/server/solr-webapp/webapp/partials/replication.html +239 -0
- data/solr/server/solr-webapp/webapp/partials/schema-browser.html +206 -0
- data/solr/server/solr-webapp/webapp/partials/segments.html +99 -0
- data/solr/server/solr-webapp/webapp/partials/threads.html +65 -0
- data/solr/server/solr-webapp/webapp/tpl/analysis.html +83 -83
- data/solr/server/solr-webapp/webapp/tpl/cloud.html +87 -87
- data/solr/server/solr-webapp/webapp/tpl/cores.html +226 -226
- data/solr/server/solr-webapp/webapp/tpl/dashboard.html +201 -201
- data/solr/server/solr-webapp/webapp/tpl/dataimport.html +183 -183
- data/solr/server/solr-webapp/webapp/tpl/documents.html +107 -107
- data/solr/server/solr-webapp/webapp/tpl/files.html +44 -44
- data/solr/server/solr-webapp/webapp/tpl/index.html +250 -250
- data/solr/server/solr-webapp/webapp/tpl/logging.html +23 -23
- data/solr/server/solr-webapp/webapp/tpl/plugins.html +39 -39
- data/solr/server/solr-webapp/webapp/tpl/query.html +361 -361
- data/solr/server/solr-webapp/webapp/tpl/replication.html +216 -216
- data/solr/server/solr-webapp/webapp/tpl/schema-browser.html +192 -192
- data/solr/server/solr-webapp/webapp/tpl/segments.html +49 -0
- data/solr/server/solr-webapp/webapp/tpl/threads.html +56 -56
- data/solr/server/solr/README.txt +77 -77
- data/solr/server/solr/solr.xml +51 -51
- data/solr/server/solr/zoo.cfg +17 -17
- data/solr/server/start.jar +0 -0
- data/spec/server_spec.rb +3 -8
- metadata +132 -43
- data/solr/server/lib/jetty-continuation-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-deploy-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-http-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-io-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-jmx-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-security-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-server-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-servlet-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-util-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-webapp-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/jetty-xml-8.1.10.v20130312.jar +0 -0
- data/solr/server/lib/servlet-api-3.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/.gitignore +0 -1
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.3.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.3.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.3.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.3.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.3.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.1.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.1.1.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.0.0.jar +0 -0
- data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.0.0.jar +0 -0
- data/solr/server/webapps/solr.war +0 -0
@@ -1,679 +1,680 @@
|
|
1
|
-
/*
|
2
|
-
Licensed to the Apache Software Foundation (ASF) under one or more
|
3
|
-
contributor license agreements. See the NOTICE file distributed with
|
4
|
-
this work for additional information regarding copyright ownership.
|
5
|
-
The ASF licenses this file to You under the Apache License, Version 2.0
|
6
|
-
(the "License"); you may not use this file except in compliance with
|
7
|
-
the License. You may obtain a copy of the License at
|
8
|
-
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
See the License for the specific language governing permissions and
|
15
|
-
limitations under the License.
|
16
|
-
*/
|
17
|
-
|
18
|
-
var loader = {
|
19
|
-
|
20
|
-
show : function( element )
|
21
|
-
{
|
22
|
-
$( element )
|
23
|
-
.addClass( 'loader' );
|
24
|
-
},
|
25
|
-
|
26
|
-
hide : function( element )
|
27
|
-
{
|
28
|
-
$( element )
|
29
|
-
.removeClass( 'loader' );
|
30
|
-
}
|
31
|
-
|
32
|
-
};
|
33
|
-
|
34
|
-
Number.prototype.esc = function()
|
35
|
-
{
|
36
|
-
return new String( this ).esc();
|
37
|
-
}
|
38
|
-
|
39
|
-
String.prototype.esc = function()
|
40
|
-
{
|
41
|
-
return this.replace( /</g, '<' ).replace( />/g, '>' );
|
42
|
-
}
|
43
|
-
|
44
|
-
SolrDate = function( date )
|
45
|
-
{
|
46
|
-
// ["Sat Mar 03 11:00:00 CET 2012", "Sat", "Mar", "03", "11:00:00", "CET", "2012"]
|
47
|
-
var parts = date.match( /^(\w+)\s+(\w+)\s+(\d+)\s+(\d+\:\d+\:\d+)\s+(\w+)\s+(\d+)$/ );
|
48
|
-
|
49
|
-
// "Sat Mar 03 2012 10:37:33"
|
50
|
-
return new Date( parts[1] + ' ' + parts[2] + ' ' + parts[3] + ' ' + parts[6] + ' ' + parts[4] );
|
51
|
-
}
|
52
|
-
|
53
|
-
var sammy = $.sammy
|
54
|
-
(
|
55
|
-
function()
|
56
|
-
{
|
57
|
-
this.bind
|
58
|
-
(
|
59
|
-
'run',
|
60
|
-
function( event, config )
|
61
|
-
{
|
62
|
-
if( 0 === config.start_url.length )
|
63
|
-
{
|
64
|
-
location.href = '#/';
|
65
|
-
return false;
|
66
|
-
}
|
67
|
-
}
|
68
|
-
);
|
69
|
-
|
70
|
-
this.bind
|
71
|
-
(
|
72
|
-
'error',
|
73
|
-
function( message, original_error )
|
74
|
-
{
|
75
|
-
alert( original_error.message );
|
76
|
-
}
|
77
|
-
);
|
78
|
-
|
79
|
-
// activate_core
|
80
|
-
this.before
|
81
|
-
(
|
82
|
-
{},
|
83
|
-
function( context )
|
84
|
-
{
|
85
|
-
app.clear_timeout();
|
86
|
-
|
87
|
-
var menu_wrapper = $( '#menu-wrapper' );
|
88
|
-
|
89
|
-
$( 'li[id].active', menu_wrapper )
|
90
|
-
.removeClass( 'active' );
|
91
|
-
|
92
|
-
$( 'li.active', menu_wrapper )
|
93
|
-
.removeClass( 'active' );
|
94
|
-
|
95
|
-
// global dashboard doesn't have params.splat
|
96
|
-
if( !this.params.splat )
|
97
|
-
{
|
98
|
-
this.params.splat = [ '~index' ];
|
99
|
-
}
|
100
|
-
|
101
|
-
var selector = '~' === this.params.splat[0][0]
|
102
|
-
? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
|
103
|
-
: '#core-selector #' + this.params.splat[0].replace( /\./g, '__' );
|
104
|
-
|
105
|
-
var active_element = $( selector, menu_wrapper );
|
106
|
-
|
107
|
-
if( 0 === active_element.size() )
|
108
|
-
{
|
109
|
-
this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
|
110
|
-
return false;
|
111
|
-
}
|
112
|
-
|
113
|
-
if( active_element.hasClass( 'global' ) )
|
114
|
-
{
|
115
|
-
active_element
|
116
|
-
.addClass( 'active' );
|
117
|
-
|
118
|
-
if( this.params.splat[1] )
|
119
|
-
{
|
120
|
-
$( '.' + this.params.splat[1], active_element )
|
121
|
-
.addClass( 'active' );
|
122
|
-
}
|
123
|
-
|
124
|
-
$( '#core-selector option[selected]' )
|
125
|
-
.removeAttr( 'selected' )
|
126
|
-
.trigger( 'liszt:updated' );
|
127
|
-
|
128
|
-
$( '#core-selector .chzn-container > a' )
|
129
|
-
.addClass( 'chzn-default' );
|
130
|
-
}
|
131
|
-
else
|
132
|
-
{
|
133
|
-
active_element
|
134
|
-
.attr( 'selected', 'selected' )
|
135
|
-
.trigger( 'liszt:updated' );
|
136
|
-
|
137
|
-
if( !this.params.splat[1] )
|
138
|
-
{
|
139
|
-
this.params.splat[1] = 'overview';
|
140
|
-
}
|
141
|
-
|
142
|
-
$( '#core-menu .' + this.params.splat[1] )
|
143
|
-
.addClass( 'active' );
|
144
|
-
|
145
|
-
this.active_core = active_element;
|
146
|
-
}
|
147
|
-
|
148
|
-
check_fixed_menu();
|
149
|
-
}
|
150
|
-
);
|
151
|
-
}
|
152
|
-
);
|
153
|
-
|
154
|
-
var solr_admin = function( app_config )
|
155
|
-
{
|
156
|
-
that = this,
|
157
|
-
|
158
|
-
menu_element = null,
|
159
|
-
|
160
|
-
is_multicore = null,
|
161
|
-
cores_data = null,
|
162
|
-
active_core = null,
|
163
|
-
|
164
|
-
config = app_config,
|
165
|
-
params = null,
|
166
|
-
dashboard_values = null,
|
167
|
-
schema_browser_data = null,
|
168
|
-
|
169
|
-
plugin_data = null,
|
170
|
-
|
171
|
-
this.menu_element = $( '#core-selector select' );
|
172
|
-
this.core_menu = $( '#core-menu ul' );
|
173
|
-
|
174
|
-
this.config = config;
|
175
|
-
this.timeout = null;
|
176
|
-
|
177
|
-
this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
|
178
|
-
|
179
|
-
browser = {
|
180
|
-
locale : null,
|
181
|
-
language : null,
|
182
|
-
country : null
|
183
|
-
};
|
184
|
-
|
185
|
-
show_global_error = function( error )
|
186
|
-
{
|
187
|
-
var main = $( '#main' );
|
188
|
-
|
189
|
-
$( 'div[id$="-wrapper"]', main )
|
190
|
-
.remove();
|
191
|
-
|
192
|
-
main
|
193
|
-
.addClass( 'error' )
|
194
|
-
.append( error );
|
195
|
-
|
196
|
-
var pre_tags = $( 'pre', main );
|
197
|
-
if( 0 !== pre_tags.size() )
|
198
|
-
{
|
199
|
-
hljs.highlightBlock( pre_tags.get(0) );
|
200
|
-
}
|
201
|
-
};
|
202
|
-
|
203
|
-
sort_cores_data = function sort_cores_data( cores_status )
|
204
|
-
{
|
205
|
-
// build array of core-names for sorting
|
206
|
-
var core_names = [];
|
207
|
-
for( var core_name in cores_status )
|
208
|
-
{
|
209
|
-
core_names.push( core_name );
|
210
|
-
}
|
211
|
-
core_names.sort();
|
212
|
-
|
213
|
-
var core_count = core_names.length;
|
214
|
-
var cores = {};
|
215
|
-
|
216
|
-
for( var i = 0; i < core_count; i++ )
|
217
|
-
{
|
218
|
-
var core_name = core_names[i];
|
219
|
-
cores[core_name] = cores_status[core_name];
|
220
|
-
}
|
221
|
-
|
222
|
-
return cores;
|
223
|
-
};
|
224
|
-
|
225
|
-
this.set_cores_data = function set_cores_data( cores )
|
226
|
-
{
|
227
|
-
that.cores_data = sort_cores_data( cores.status );
|
228
|
-
|
229
|
-
that.menu_element
|
230
|
-
.empty();
|
231
|
-
|
232
|
-
var core_list = [];
|
233
|
-
core_list.push( '<option></option>' );
|
234
|
-
|
235
|
-
var core_count = 0;
|
236
|
-
for( var core_name in that.cores_data )
|
237
|
-
{
|
238
|
-
core_count++;
|
239
|
-
var core_path = config.solr_path + '/' + core_name;
|
240
|
-
var classes = [];
|
241
|
-
|
242
|
-
if( cores.status[core_name]['isDefaultCore'] )
|
243
|
-
{
|
244
|
-
classes.push( 'default' );
|
245
|
-
}
|
246
|
-
|
247
|
-
var core_tpl = '<option '
|
248
|
-
+ ' id="' + core_name.replace( /\./g, '__' ) + '" '
|
249
|
-
+ ' class="' + classes.join( ' ' ) + '"'
|
250
|
-
+ ' data-basepath="' + core_path + '"'
|
251
|
-
+ ' schema="' + cores.status[core_name]['schema'] + '"'
|
252
|
-
+ ' config="' + cores.status[core_name]['config'] + '"'
|
253
|
-
+ ' value="#/' + core_name + '"'
|
254
|
-
+ ' title="' + core_name + '"'
|
255
|
-
+ '>'
|
256
|
-
+ core_name
|
257
|
-
+ '</option>';
|
258
|
-
|
259
|
-
core_list.push( core_tpl );
|
260
|
-
}
|
261
|
-
|
262
|
-
var has_cores = 0 !== core_count;
|
263
|
-
if( has_cores )
|
264
|
-
{
|
265
|
-
that.menu_element
|
266
|
-
.append( core_list.join( "\n" ) )
|
267
|
-
.trigger( 'liszt:updated' );
|
268
|
-
}
|
269
|
-
|
270
|
-
var core_selector = $( '#core-selector' );
|
271
|
-
core_selector.find( '#has-cores' ).toggle( has_cores );
|
272
|
-
core_selector.find( '#has-no-cores' ).toggle( !has_cores );
|
273
|
-
|
274
|
-
if( has_cores )
|
275
|
-
{
|
276
|
-
var cores_element = core_selector.find( '#has-cores' );
|
277
|
-
var selector_width = cores_element.width();
|
278
|
-
|
279
|
-
cores_element.find( '.chzn-container' )
|
280
|
-
.css( 'width', selector_width + 'px' );
|
281
|
-
|
282
|
-
cores_element.find( '.chzn-drop' )
|
283
|
-
.css( 'width', ( selector_width - 2 ) + 'px' );
|
284
|
-
}
|
285
|
-
|
286
|
-
this.check_for_init_failures( cores );
|
287
|
-
};
|
288
|
-
|
289
|
-
this.remove_init_failures = function remove_init_failures()
|
290
|
-
{
|
291
|
-
$( '#init-failures' )
|
292
|
-
.hide()
|
293
|
-
.find( 'ul' )
|
294
|
-
.empty();
|
295
|
-
}
|
296
|
-
|
297
|
-
this.check_for_init_failures = function check_for_init_failures( cores )
|
298
|
-
{
|
299
|
-
if( !cores.initFailures )
|
300
|
-
{
|
301
|
-
this.remove_init_failures();
|
302
|
-
return false;
|
303
|
-
}
|
304
|
-
|
305
|
-
var failures = [];
|
306
|
-
for( var core_name in cores.initFailures )
|
307
|
-
{
|
308
|
-
failures.push
|
309
|
-
(
|
310
|
-
'<li>' +
|
311
|
-
'<strong>' + core_name.esc() + ':</strong>' + "\n" +
|
312
|
-
cores.initFailures[core_name].esc() + "\n" +
|
313
|
-
'</li>'
|
314
|
-
);
|
315
|
-
}
|
316
|
-
|
317
|
-
if( 0 === failures.length )
|
318
|
-
{
|
319
|
-
this.remove_init_failures();
|
320
|
-
return false;
|
321
|
-
}
|
322
|
-
|
323
|
-
$( '#init-failures' )
|
324
|
-
.show()
|
325
|
-
.find( 'ul' )
|
326
|
-
.html( failures.join( "\n" ) );
|
327
|
-
}
|
328
|
-
|
329
|
-
this.run = function()
|
330
|
-
{
|
331
|
-
var navigator_language = navigator.userLanguage || navigator.language;
|
332
|
-
var language_match = navigator_language.match( /^(\w{2})([-_](\w{2}))?$/ );
|
333
|
-
if( language_match )
|
334
|
-
{
|
335
|
-
if( language_match[1] )
|
336
|
-
{
|
337
|
-
browser.language = language_match[1].toLowerCase();
|
338
|
-
}
|
339
|
-
if( language_match[3] )
|
340
|
-
{
|
341
|
-
browser.country = language_match[3].toUpperCase();
|
342
|
-
}
|
343
|
-
if( language_match[1] && language_match[3] )
|
344
|
-
{
|
345
|
-
browser.locale = browser.language + '_' + browser.country
|
346
|
-
}
|
347
|
-
}
|
348
|
-
|
349
|
-
$.ajax
|
350
|
-
(
|
351
|
-
{
|
352
|
-
url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
|
353
|
-
dataType : 'json',
|
354
|
-
beforeSend : function( arr, form, options )
|
355
|
-
{
|
356
|
-
$( '#content' )
|
357
|
-
.html( '<div id="index"><div class="loader">Loading ...</div></div>' );
|
358
|
-
},
|
359
|
-
success : function( response )
|
360
|
-
{
|
361
|
-
that.set_cores_data( response );
|
362
|
-
|
363
|
-
that.menu_element
|
364
|
-
.chosen()
|
365
|
-
.off( 'change' )
|
366
|
-
.on
|
367
|
-
(
|
368
|
-
'change',
|
369
|
-
function( event )
|
370
|
-
{
|
371
|
-
location.href = $( 'option:selected', this ).val();
|
372
|
-
return false;
|
373
|
-
}
|
374
|
-
)
|
375
|
-
.on
|
376
|
-
(
|
377
|
-
'liszt:updated',
|
378
|
-
function( event )
|
379
|
-
{
|
380
|
-
var core_name = $( 'option:selected', this ).text();
|
381
|
-
|
382
|
-
that.core_menu
|
383
|
-
.html
|
384
|
-
(
|
385
|
-
//Keep this in alphabetical order after the overview
|
386
|
-
'<li class="overview"><a href="#/' + core_name + '"><span>Overview</span></a></li>' + "\n" +
|
387
|
-
'<li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n" +
|
388
|
-
'<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n" +
|
389
|
-
'<li class="documents"><a href="#/' + core_name + '/documents"><span>Documents</span></a></li>' + "\n" +
|
390
|
-
'<li class="files"><a href="#/' + core_name + '/files"><span>Files</span></a></li>' + "\n" +
|
391
|
-
'<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
|
392
|
-
'<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
|
393
|
-
'<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
|
394
|
-
'<li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n" +
|
395
|
-
'<li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>'
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
.
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
var
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
var
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
'<p>
|
485
|
-
'
|
486
|
-
|
487
|
-
|
488
|
-
'
|
489
|
-
'
|
490
|
-
'
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
var
|
514
|
-
var
|
515
|
-
var
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
var
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
this.timeout
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
'
|
586
|
-
'
|
587
|
-
'
|
588
|
-
'
|
589
|
-
'
|
590
|
-
'
|
591
|
-
'
|
592
|
-
'
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
(
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
var
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
(
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
3
|
+
contributor license agreements. See the NOTICE file distributed with
|
4
|
+
this work for additional information regarding copyright ownership.
|
5
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
6
|
+
(the "License"); you may not use this file except in compliance with
|
7
|
+
the License. You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
var loader = {
|
19
|
+
|
20
|
+
show : function( element )
|
21
|
+
{
|
22
|
+
$( element )
|
23
|
+
.addClass( 'loader' );
|
24
|
+
},
|
25
|
+
|
26
|
+
hide : function( element )
|
27
|
+
{
|
28
|
+
$( element )
|
29
|
+
.removeClass( 'loader' );
|
30
|
+
}
|
31
|
+
|
32
|
+
};
|
33
|
+
|
34
|
+
Number.prototype.esc = function()
|
35
|
+
{
|
36
|
+
return new String( this ).esc();
|
37
|
+
}
|
38
|
+
|
39
|
+
String.prototype.esc = function()
|
40
|
+
{
|
41
|
+
return this.replace( /</g, '<' ).replace( />/g, '>' );
|
42
|
+
}
|
43
|
+
|
44
|
+
SolrDate = function( date )
|
45
|
+
{
|
46
|
+
// ["Sat Mar 03 11:00:00 CET 2012", "Sat", "Mar", "03", "11:00:00", "CET", "2012"]
|
47
|
+
var parts = date.match( /^(\w+)\s+(\w+)\s+(\d+)\s+(\d+\:\d+\:\d+)\s+(\w+)\s+(\d+)$/ );
|
48
|
+
|
49
|
+
// "Sat Mar 03 2012 10:37:33"
|
50
|
+
return new Date( parts[1] + ' ' + parts[2] + ' ' + parts[3] + ' ' + parts[6] + ' ' + parts[4] );
|
51
|
+
}
|
52
|
+
|
53
|
+
var sammy = $.sammy
|
54
|
+
(
|
55
|
+
function()
|
56
|
+
{
|
57
|
+
this.bind
|
58
|
+
(
|
59
|
+
'run',
|
60
|
+
function( event, config )
|
61
|
+
{
|
62
|
+
if( 0 === config.start_url.length )
|
63
|
+
{
|
64
|
+
location.href = '#/';
|
65
|
+
return false;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
);
|
69
|
+
|
70
|
+
this.bind
|
71
|
+
(
|
72
|
+
'error',
|
73
|
+
function( message, original_error )
|
74
|
+
{
|
75
|
+
alert( original_error.message );
|
76
|
+
}
|
77
|
+
);
|
78
|
+
|
79
|
+
// activate_core
|
80
|
+
this.before
|
81
|
+
(
|
82
|
+
{},
|
83
|
+
function( context )
|
84
|
+
{
|
85
|
+
app.clear_timeout();
|
86
|
+
|
87
|
+
var menu_wrapper = $( '#menu-wrapper' );
|
88
|
+
|
89
|
+
$( 'li[id].active', menu_wrapper )
|
90
|
+
.removeClass( 'active' );
|
91
|
+
|
92
|
+
$( 'li.active', menu_wrapper )
|
93
|
+
.removeClass( 'active' );
|
94
|
+
|
95
|
+
// global dashboard doesn't have params.splat
|
96
|
+
if( !this.params.splat )
|
97
|
+
{
|
98
|
+
this.params.splat = [ '~index' ];
|
99
|
+
}
|
100
|
+
|
101
|
+
var selector = '~' === this.params.splat[0][0]
|
102
|
+
? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
|
103
|
+
: '#core-selector #' + this.params.splat[0].replace( /\./g, '__' );
|
104
|
+
|
105
|
+
var active_element = $( selector, menu_wrapper );
|
106
|
+
|
107
|
+
if( 0 === active_element.size() )
|
108
|
+
{
|
109
|
+
this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
|
110
|
+
return false;
|
111
|
+
}
|
112
|
+
|
113
|
+
if( active_element.hasClass( 'global' ) )
|
114
|
+
{
|
115
|
+
active_element
|
116
|
+
.addClass( 'active' );
|
117
|
+
|
118
|
+
if( this.params.splat[1] )
|
119
|
+
{
|
120
|
+
$( '.' + this.params.splat[1], active_element )
|
121
|
+
.addClass( 'active' );
|
122
|
+
}
|
123
|
+
|
124
|
+
$( '#core-selector option[selected]' )
|
125
|
+
.removeAttr( 'selected' )
|
126
|
+
.trigger( 'liszt:updated' );
|
127
|
+
|
128
|
+
$( '#core-selector .chzn-container > a' )
|
129
|
+
.addClass( 'chzn-default' );
|
130
|
+
}
|
131
|
+
else
|
132
|
+
{
|
133
|
+
active_element
|
134
|
+
.attr( 'selected', 'selected' )
|
135
|
+
.trigger( 'liszt:updated' );
|
136
|
+
|
137
|
+
if( !this.params.splat[1] )
|
138
|
+
{
|
139
|
+
this.params.splat[1] = 'overview';
|
140
|
+
}
|
141
|
+
|
142
|
+
$( '#core-menu .' + this.params.splat[1] )
|
143
|
+
.addClass( 'active' );
|
144
|
+
|
145
|
+
this.active_core = active_element;
|
146
|
+
}
|
147
|
+
|
148
|
+
check_fixed_menu();
|
149
|
+
}
|
150
|
+
);
|
151
|
+
}
|
152
|
+
);
|
153
|
+
|
154
|
+
var solr_admin = function( app_config )
|
155
|
+
{
|
156
|
+
that = this,
|
157
|
+
|
158
|
+
menu_element = null,
|
159
|
+
|
160
|
+
is_multicore = null,
|
161
|
+
cores_data = null,
|
162
|
+
active_core = null,
|
163
|
+
|
164
|
+
config = app_config,
|
165
|
+
params = null,
|
166
|
+
dashboard_values = null,
|
167
|
+
schema_browser_data = null,
|
168
|
+
|
169
|
+
plugin_data = null,
|
170
|
+
|
171
|
+
this.menu_element = $( '#core-selector select' );
|
172
|
+
this.core_menu = $( '#core-menu ul' );
|
173
|
+
|
174
|
+
this.config = config;
|
175
|
+
this.timeout = null;
|
176
|
+
|
177
|
+
this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
|
178
|
+
|
179
|
+
browser = {
|
180
|
+
locale : null,
|
181
|
+
language : null,
|
182
|
+
country : null
|
183
|
+
};
|
184
|
+
|
185
|
+
show_global_error = function( error )
|
186
|
+
{
|
187
|
+
var main = $( '#main' );
|
188
|
+
|
189
|
+
$( 'div[id$="-wrapper"]', main )
|
190
|
+
.remove();
|
191
|
+
|
192
|
+
main
|
193
|
+
.addClass( 'error' )
|
194
|
+
.append( error );
|
195
|
+
|
196
|
+
var pre_tags = $( 'pre', main );
|
197
|
+
if( 0 !== pre_tags.size() )
|
198
|
+
{
|
199
|
+
hljs.highlightBlock( pre_tags.get(0) );
|
200
|
+
}
|
201
|
+
};
|
202
|
+
|
203
|
+
sort_cores_data = function sort_cores_data( cores_status )
|
204
|
+
{
|
205
|
+
// build array of core-names for sorting
|
206
|
+
var core_names = [];
|
207
|
+
for( var core_name in cores_status )
|
208
|
+
{
|
209
|
+
core_names.push( core_name );
|
210
|
+
}
|
211
|
+
core_names.sort();
|
212
|
+
|
213
|
+
var core_count = core_names.length;
|
214
|
+
var cores = {};
|
215
|
+
|
216
|
+
for( var i = 0; i < core_count; i++ )
|
217
|
+
{
|
218
|
+
var core_name = core_names[i];
|
219
|
+
cores[core_name] = cores_status[core_name];
|
220
|
+
}
|
221
|
+
|
222
|
+
return cores;
|
223
|
+
};
|
224
|
+
|
225
|
+
this.set_cores_data = function set_cores_data( cores )
|
226
|
+
{
|
227
|
+
that.cores_data = sort_cores_data( cores.status );
|
228
|
+
|
229
|
+
that.menu_element
|
230
|
+
.empty();
|
231
|
+
|
232
|
+
var core_list = [];
|
233
|
+
core_list.push( '<option></option>' );
|
234
|
+
|
235
|
+
var core_count = 0;
|
236
|
+
for( var core_name in that.cores_data )
|
237
|
+
{
|
238
|
+
core_count++;
|
239
|
+
var core_path = config.solr_path + '/' + core_name;
|
240
|
+
var classes = [];
|
241
|
+
|
242
|
+
if( cores.status[core_name]['isDefaultCore'] )
|
243
|
+
{
|
244
|
+
classes.push( 'default' );
|
245
|
+
}
|
246
|
+
|
247
|
+
var core_tpl = '<option '
|
248
|
+
+ ' id="' + core_name.replace( /\./g, '__' ) + '" '
|
249
|
+
+ ' class="' + classes.join( ' ' ) + '"'
|
250
|
+
+ ' data-basepath="' + core_path + '"'
|
251
|
+
+ ' schema="' + cores.status[core_name]['schema'] + '"'
|
252
|
+
+ ' config="' + cores.status[core_name]['config'] + '"'
|
253
|
+
+ ' value="#/' + core_name + '"'
|
254
|
+
+ ' title="' + core_name + '"'
|
255
|
+
+ '>'
|
256
|
+
+ core_name
|
257
|
+
+ '</option>';
|
258
|
+
|
259
|
+
core_list.push( core_tpl );
|
260
|
+
}
|
261
|
+
|
262
|
+
var has_cores = 0 !== core_count;
|
263
|
+
if( has_cores )
|
264
|
+
{
|
265
|
+
that.menu_element
|
266
|
+
.append( core_list.join( "\n" ) )
|
267
|
+
.trigger( 'liszt:updated' );
|
268
|
+
}
|
269
|
+
|
270
|
+
var core_selector = $( '#core-selector' );
|
271
|
+
core_selector.find( '#has-cores' ).toggle( has_cores );
|
272
|
+
core_selector.find( '#has-no-cores' ).toggle( !has_cores );
|
273
|
+
|
274
|
+
if( has_cores )
|
275
|
+
{
|
276
|
+
var cores_element = core_selector.find( '#has-cores' );
|
277
|
+
var selector_width = cores_element.width();
|
278
|
+
|
279
|
+
cores_element.find( '.chzn-container' )
|
280
|
+
.css( 'width', selector_width + 'px' );
|
281
|
+
|
282
|
+
cores_element.find( '.chzn-drop' )
|
283
|
+
.css( 'width', ( selector_width - 2 ) + 'px' );
|
284
|
+
}
|
285
|
+
|
286
|
+
this.check_for_init_failures( cores );
|
287
|
+
};
|
288
|
+
|
289
|
+
this.remove_init_failures = function remove_init_failures()
|
290
|
+
{
|
291
|
+
$( '#init-failures' )
|
292
|
+
.hide()
|
293
|
+
.find( 'ul' )
|
294
|
+
.empty();
|
295
|
+
}
|
296
|
+
|
297
|
+
this.check_for_init_failures = function check_for_init_failures( cores )
|
298
|
+
{
|
299
|
+
if( !cores.initFailures )
|
300
|
+
{
|
301
|
+
this.remove_init_failures();
|
302
|
+
return false;
|
303
|
+
}
|
304
|
+
|
305
|
+
var failures = [];
|
306
|
+
for( var core_name in cores.initFailures )
|
307
|
+
{
|
308
|
+
failures.push
|
309
|
+
(
|
310
|
+
'<li>' +
|
311
|
+
'<strong>' + core_name.esc() + ':</strong>' + "\n" +
|
312
|
+
cores.initFailures[core_name].esc() + "\n" +
|
313
|
+
'</li>'
|
314
|
+
);
|
315
|
+
}
|
316
|
+
|
317
|
+
if( 0 === failures.length )
|
318
|
+
{
|
319
|
+
this.remove_init_failures();
|
320
|
+
return false;
|
321
|
+
}
|
322
|
+
|
323
|
+
$( '#init-failures' )
|
324
|
+
.show()
|
325
|
+
.find( 'ul' )
|
326
|
+
.html( failures.join( "\n" ) );
|
327
|
+
}
|
328
|
+
|
329
|
+
this.run = function()
|
330
|
+
{
|
331
|
+
var navigator_language = navigator.userLanguage || navigator.language;
|
332
|
+
var language_match = navigator_language.match( /^(\w{2})([-_](\w{2}))?$/ );
|
333
|
+
if( language_match )
|
334
|
+
{
|
335
|
+
if( language_match[1] )
|
336
|
+
{
|
337
|
+
browser.language = language_match[1].toLowerCase();
|
338
|
+
}
|
339
|
+
if( language_match[3] )
|
340
|
+
{
|
341
|
+
browser.country = language_match[3].toUpperCase();
|
342
|
+
}
|
343
|
+
if( language_match[1] && language_match[3] )
|
344
|
+
{
|
345
|
+
browser.locale = browser.language + '_' + browser.country
|
346
|
+
}
|
347
|
+
}
|
348
|
+
|
349
|
+
$.ajax
|
350
|
+
(
|
351
|
+
{
|
352
|
+
url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
|
353
|
+
dataType : 'json',
|
354
|
+
beforeSend : function( arr, form, options )
|
355
|
+
{
|
356
|
+
$( '#content' )
|
357
|
+
.html( '<div id="index"><div class="loader">Loading ...</div></div>' );
|
358
|
+
},
|
359
|
+
success : function( response )
|
360
|
+
{
|
361
|
+
that.set_cores_data( response );
|
362
|
+
|
363
|
+
that.menu_element
|
364
|
+
.chosen()
|
365
|
+
.off( 'change' )
|
366
|
+
.on
|
367
|
+
(
|
368
|
+
'change',
|
369
|
+
function( event )
|
370
|
+
{
|
371
|
+
location.href = $( 'option:selected', this ).val();
|
372
|
+
return false;
|
373
|
+
}
|
374
|
+
)
|
375
|
+
.on
|
376
|
+
(
|
377
|
+
'liszt:updated',
|
378
|
+
function( event )
|
379
|
+
{
|
380
|
+
var core_name = $( 'option:selected', this ).text();
|
381
|
+
|
382
|
+
that.core_menu
|
383
|
+
.html
|
384
|
+
(
|
385
|
+
//Keep this in alphabetical order after the overview
|
386
|
+
'<li class="overview"><a href="#/' + core_name + '"><span>Overview</span></a></li>' + "\n" +
|
387
|
+
'<li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n" +
|
388
|
+
'<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n" +
|
389
|
+
'<li class="documents"><a href="#/' + core_name + '/documents"><span>Documents</span></a></li>' + "\n" +
|
390
|
+
'<li class="files"><a href="#/' + core_name + '/files"><span>Files</span></a></li>' + "\n" +
|
391
|
+
'<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
|
392
|
+
'<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
|
393
|
+
'<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
|
394
|
+
'<li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n" +
|
395
|
+
'<li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' +
|
396
|
+
'<li class="segments"><a href="#/' + core_name + '/segments"><span>Segments info</span></a></li>'
|
397
|
+
)
|
398
|
+
.show();
|
399
|
+
|
400
|
+
if( !core_name )
|
401
|
+
{
|
402
|
+
that.core_menu
|
403
|
+
.hide()
|
404
|
+
.empty();
|
405
|
+
}
|
406
|
+
}
|
407
|
+
);
|
408
|
+
|
409
|
+
check_fixed_menu();
|
410
|
+
$( window ).resize( check_fixed_menu );
|
411
|
+
|
412
|
+
var system_url = config.solr_path + '/admin/info/system?wt=json';
|
413
|
+
$.ajax
|
414
|
+
(
|
415
|
+
{
|
416
|
+
url : system_url,
|
417
|
+
dataType : 'json',
|
418
|
+
beforeSend : function( arr, form, options )
|
419
|
+
{
|
420
|
+
},
|
421
|
+
success : function( response )
|
422
|
+
{
|
423
|
+
that.dashboard_values = response;
|
424
|
+
|
425
|
+
var environment_args = null;
|
426
|
+
var cloud_args = null;
|
427
|
+
|
428
|
+
if( response.jvm && response.jvm.jmx && response.jvm.jmx.commandLineArgs )
|
429
|
+
{
|
430
|
+
var command_line_args = response.jvm.jmx.commandLineArgs.join( ' | ' );
|
431
|
+
|
432
|
+
environment_args = command_line_args.match( /-Dsolr.environment=((dev|test|prod)?[\w\d]*)/i );
|
433
|
+
}
|
434
|
+
|
435
|
+
if( response.mode )
|
436
|
+
{
|
437
|
+
cloud_args = response.mode.match( /solrcloud/i );
|
438
|
+
}
|
439
|
+
|
440
|
+
// environment
|
441
|
+
|
442
|
+
var wrapper = $( '#wrapper' );
|
443
|
+
var environment_element = $( '#environment' );
|
444
|
+
if( environment_args )
|
445
|
+
{
|
446
|
+
wrapper
|
447
|
+
.addClass( 'has-environment' );
|
448
|
+
|
449
|
+
if( environment_args[1] )
|
450
|
+
{
|
451
|
+
environment_element
|
452
|
+
.html( environment_args[1] );
|
453
|
+
}
|
454
|
+
|
455
|
+
if( environment_args[2] )
|
456
|
+
{
|
457
|
+
environment_element
|
458
|
+
.addClass( environment_args[2] );
|
459
|
+
}
|
460
|
+
}
|
461
|
+
else
|
462
|
+
{
|
463
|
+
wrapper
|
464
|
+
.removeClass( 'has-environment' );
|
465
|
+
}
|
466
|
+
|
467
|
+
// cloud
|
468
|
+
|
469
|
+
var cloud_nav_element = $( '#menu #cloud' );
|
470
|
+
if( cloud_args )
|
471
|
+
{
|
472
|
+
cloud_nav_element
|
473
|
+
.show();
|
474
|
+
}
|
475
|
+
|
476
|
+
// sammy
|
477
|
+
|
478
|
+
sammy.run( location.hash );
|
479
|
+
},
|
480
|
+
error : function()
|
481
|
+
{
|
482
|
+
show_global_error
|
483
|
+
(
|
484
|
+
'<div class="message"><p>Unable to load environment info from <code>' + system_url.esc() + '</code>.</p>' +
|
485
|
+
'<p>This interface requires that you activate the admin request handlers in all SolrCores by adding the ' +
|
486
|
+
'following configuration to your <code>solrconfig.xml</code>:</p></div>' + "\n" +
|
487
|
+
|
488
|
+
'<div class="code"><pre class="syntax language-xml"><code>' +
|
489
|
+
'<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->'.esc() + "\n" +
|
490
|
+
'<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />'.esc() +
|
491
|
+
'</code></pre></div>'
|
492
|
+
);
|
493
|
+
},
|
494
|
+
complete : function()
|
495
|
+
{
|
496
|
+
loader.hide( this );
|
497
|
+
}
|
498
|
+
}
|
499
|
+
);
|
500
|
+
},
|
501
|
+
error : function()
|
502
|
+
{
|
503
|
+
},
|
504
|
+
complete : function()
|
505
|
+
{
|
506
|
+
}
|
507
|
+
}
|
508
|
+
);
|
509
|
+
};
|
510
|
+
|
511
|
+
this.convert_duration_to_seconds = function convert_duration_to_seconds( str )
|
512
|
+
{
|
513
|
+
var seconds = 0;
|
514
|
+
var arr = new String( str || '' ).split( '.' );
|
515
|
+
var parts = arr[0].split( ':' ).reverse();
|
516
|
+
var parts_count = parts.length;
|
517
|
+
|
518
|
+
for( var i = 0; i < parts_count; i++ )
|
519
|
+
{
|
520
|
+
seconds += ( parseInt( parts[i], 10 ) || 0 ) * Math.pow( 60, i );
|
521
|
+
}
|
522
|
+
|
523
|
+
// treat more or equal than .5 as additional second
|
524
|
+
if( arr[1] && 5 <= parseInt( arr[1][0], 10 ) )
|
525
|
+
{
|
526
|
+
seconds++;
|
527
|
+
}
|
528
|
+
|
529
|
+
return seconds;
|
530
|
+
};
|
531
|
+
|
532
|
+
this.convert_seconds_to_readable_time = function convert_seconds_to_readable_time( seconds )
|
533
|
+
{
|
534
|
+
seconds = parseInt( seconds || 0, 10 );
|
535
|
+
var minutes = Math.floor( seconds / 60 );
|
536
|
+
var hours = Math.floor( minutes / 60 );
|
537
|
+
|
538
|
+
var text = [];
|
539
|
+
if( 0 !== hours )
|
540
|
+
{
|
541
|
+
text.push( hours + 'h' );
|
542
|
+
seconds -= hours * 60 * 60;
|
543
|
+
minutes -= hours * 60;
|
544
|
+
}
|
545
|
+
|
546
|
+
if( 0 !== minutes )
|
547
|
+
{
|
548
|
+
text.push( minutes + 'm' );
|
549
|
+
seconds -= minutes * 60;
|
550
|
+
}
|
551
|
+
|
552
|
+
if( 0 !== seconds )
|
553
|
+
{
|
554
|
+
text.push( ( '0' + seconds ).substr( -2 ) + 's' );
|
555
|
+
}
|
556
|
+
|
557
|
+
return text.join( ' ' );
|
558
|
+
};
|
559
|
+
|
560
|
+
this.clear_timeout = function clear_timeout()
|
561
|
+
{
|
562
|
+
if( !app.timeout )
|
563
|
+
{
|
564
|
+
return false;
|
565
|
+
}
|
566
|
+
|
567
|
+
console.debug( 'Clearing Timeout #' + this.timeout );
|
568
|
+
clearTimeout( this.timeout );
|
569
|
+
this.timeout = null;
|
570
|
+
};
|
571
|
+
|
572
|
+
this.format_json = function format_json( json_str )
|
573
|
+
{
|
574
|
+
if( JSON.stringify && JSON.parse )
|
575
|
+
{
|
576
|
+
json_str = JSON.stringify( JSON.parse( json_str ), undefined, 2 );
|
577
|
+
}
|
578
|
+
|
579
|
+
return json_str.esc();
|
580
|
+
};
|
581
|
+
|
582
|
+
this.format_number = function format_number( number )
|
583
|
+
{
|
584
|
+
var sep = {
|
585
|
+
'de_CH' : '\'',
|
586
|
+
'de' : '.',
|
587
|
+
'en' : ',',
|
588
|
+
'es' : '.',
|
589
|
+
'it' : '.',
|
590
|
+
'ja' : ',',
|
591
|
+
'sv' : ' ',
|
592
|
+
'tr' : '.',
|
593
|
+
'_' : '' // fallback
|
594
|
+
};
|
595
|
+
|
596
|
+
return ( number || 0 ).toString().replace
|
597
|
+
(
|
598
|
+
/\B(?=(\d{3})+(?!\d))/g,
|
599
|
+
sep[ browser.locale ] || sep[ browser.language ] || sep['_']
|
600
|
+
);
|
601
|
+
};
|
602
|
+
|
603
|
+
check_fixed_menu = function check_fixed_menu()
|
604
|
+
{
|
605
|
+
$( '#wrapper' ).toggleClass( 'scroll', $( window ).height() < $( '#menu-wrapper' ).height() + $( '#header' ).height() + 40 );
|
606
|
+
}
|
607
|
+
|
608
|
+
};
|
609
|
+
|
610
|
+
var connection_check_delay = 1000;
|
611
|
+
var connection_working = true;
|
612
|
+
|
613
|
+
var connection_check = function connection_check()
|
614
|
+
{
|
615
|
+
$.ajax
|
616
|
+
(
|
617
|
+
{
|
618
|
+
url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
|
619
|
+
dataType : 'json',
|
620
|
+
context : $( '.blockUI #connection_status span' ),
|
621
|
+
beforeSend : function( arr, form, options )
|
622
|
+
{
|
623
|
+
this
|
624
|
+
.addClass( 'loader' );
|
625
|
+
},
|
626
|
+
success : function( response )
|
627
|
+
{
|
628
|
+
connection_working = true;
|
629
|
+
|
630
|
+
this
|
631
|
+
.html( 'Instance is available - <a href="javascript:location.reload();">Reload the page</a>' );
|
632
|
+
|
633
|
+
this.parents( '#connection_status' )
|
634
|
+
.addClass( 'online' );
|
635
|
+
|
636
|
+
this.parents( '.blockUI' )
|
637
|
+
.css( 'borderColor', '#080' );
|
638
|
+
},
|
639
|
+
error : function()
|
640
|
+
{
|
641
|
+
connection_check_delay += connection_check_delay;
|
642
|
+
window.setTimeout( connection_check, connection_check_delay );
|
643
|
+
},
|
644
|
+
complete : function()
|
645
|
+
{
|
646
|
+
this
|
647
|
+
.removeClass( 'loader' );
|
648
|
+
}
|
649
|
+
}
|
650
|
+
);
|
651
|
+
};
|
652
|
+
|
653
|
+
var connection_error = function connection_error()
|
654
|
+
{
|
655
|
+
connection_working = false;
|
656
|
+
|
657
|
+
$.blockUI
|
658
|
+
(
|
659
|
+
{
|
660
|
+
message: $( '#connection_status' ),
|
661
|
+
css: { width: '450px', borderColor: '#f00' }
|
662
|
+
}
|
663
|
+
);
|
664
|
+
|
665
|
+
window.setTimeout( connection_check, connection_check_delay );
|
666
|
+
}
|
667
|
+
|
668
|
+
$( document ).ajaxError
|
669
|
+
(
|
670
|
+
function( event, xhr, settings, thrownError )
|
671
|
+
{
|
672
|
+
if( connection_working && 0 === xhr.status )
|
673
|
+
{
|
674
|
+
connection_error();
|
675
|
+
}
|
676
|
+
}
|
677
|
+
);
|
678
|
+
|
679
|
+
$.ajaxSetup( { cache: false } );
|
680
|
+
var app = new solr_admin( app_config );
|