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,72 +1,72 @@
|
|
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
|
-
$( '.ping a', app.core_menu )
|
19
|
-
.live
|
20
|
-
(
|
21
|
-
'click',
|
22
|
-
function( event )
|
23
|
-
{
|
24
|
-
$.ajax
|
25
|
-
(
|
26
|
-
{
|
27
|
-
url : $( this ).attr( 'rel' ) + '?wt=json&ts=' + (new Date).getTime(),
|
28
|
-
dataType : 'json',
|
29
|
-
context: this,
|
30
|
-
beforeSend : function( arr, form, options )
|
31
|
-
{
|
32
|
-
loader.show( this );
|
33
|
-
},
|
34
|
-
success : function( response, text_status, xhr )
|
35
|
-
{
|
36
|
-
$( this )
|
37
|
-
.removeAttr( 'title' );
|
38
|
-
|
39
|
-
$( this ).parents( 'li' )
|
40
|
-
.removeClass( 'error' );
|
41
|
-
|
42
|
-
var qtime_element = $( '.qtime', this );
|
43
|
-
|
44
|
-
if( 0 === qtime_element.size() )
|
45
|
-
{
|
46
|
-
qtime_element = $( '<small class="qtime"> (<span></span>)</small>' );
|
47
|
-
|
48
|
-
$( this )
|
49
|
-
.append( qtime_element );
|
50
|
-
}
|
51
|
-
|
52
|
-
$( 'span', qtime_element )
|
53
|
-
.html( response.responseHeader.QTime + 'ms' );
|
54
|
-
},
|
55
|
-
error : function( xhr, text_status, error_thrown )
|
56
|
-
{
|
57
|
-
$( this )
|
58
|
-
.attr( 'title', '/admin/ping is not configured (' + xhr.status + ': ' + error_thrown + ')' );
|
59
|
-
|
60
|
-
$( this ).parents( 'li' )
|
61
|
-
.addClass( 'error' );
|
62
|
-
},
|
63
|
-
complete : function( xhr, text_status )
|
64
|
-
{
|
65
|
-
loader.hide( this );
|
66
|
-
}
|
67
|
-
}
|
68
|
-
);
|
69
|
-
|
70
|
-
return false;
|
71
|
-
}
|
72
|
-
);
|
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
|
+
$( '.ping a', app.core_menu )
|
19
|
+
.live
|
20
|
+
(
|
21
|
+
'click',
|
22
|
+
function( event )
|
23
|
+
{
|
24
|
+
$.ajax
|
25
|
+
(
|
26
|
+
{
|
27
|
+
url : $( this ).attr( 'rel' ) + '?wt=json&ts=' + (new Date).getTime(),
|
28
|
+
dataType : 'json',
|
29
|
+
context: this,
|
30
|
+
beforeSend : function( arr, form, options )
|
31
|
+
{
|
32
|
+
loader.show( this );
|
33
|
+
},
|
34
|
+
success : function( response, text_status, xhr )
|
35
|
+
{
|
36
|
+
$( this )
|
37
|
+
.removeAttr( 'title' );
|
38
|
+
|
39
|
+
$( this ).parents( 'li' )
|
40
|
+
.removeClass( 'error' );
|
41
|
+
|
42
|
+
var qtime_element = $( '.qtime', this );
|
43
|
+
|
44
|
+
if( 0 === qtime_element.size() )
|
45
|
+
{
|
46
|
+
qtime_element = $( '<small class="qtime"> (<span></span>)</small>' );
|
47
|
+
|
48
|
+
$( this )
|
49
|
+
.append( qtime_element );
|
50
|
+
}
|
51
|
+
|
52
|
+
$( 'span', qtime_element )
|
53
|
+
.html( response.responseHeader.QTime + 'ms' );
|
54
|
+
},
|
55
|
+
error : function( xhr, text_status, error_thrown )
|
56
|
+
{
|
57
|
+
$( this )
|
58
|
+
.attr( 'title', '/admin/ping is not configured (' + xhr.status + ': ' + error_thrown + ')' );
|
59
|
+
|
60
|
+
$( this ).parents( 'li' )
|
61
|
+
.addClass( 'error' );
|
62
|
+
},
|
63
|
+
complete : function( xhr, text_status )
|
64
|
+
{
|
65
|
+
loader.hide( this );
|
66
|
+
}
|
67
|
+
}
|
68
|
+
);
|
69
|
+
|
70
|
+
return false;
|
71
|
+
}
|
72
|
+
);
|
@@ -1,462 +1,462 @@
|
|
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 core_basepath = null;
|
19
|
-
var content_element = null;
|
20
|
-
var selected_type = null;
|
21
|
-
var context_path = null;
|
22
|
-
var active_context = null;
|
23
|
-
var changes = null;
|
24
|
-
var reference_xml = null;
|
25
|
-
|
26
|
-
var compute_plugin_data = function( response, changeset )
|
27
|
-
{
|
28
|
-
var types = [];
|
29
|
-
var sort_table = {};
|
30
|
-
var plugin_data = {};
|
31
|
-
|
32
|
-
var types_obj = {};
|
33
|
-
var plugin_key = null;
|
34
|
-
|
35
|
-
changes = { count : {}, list : {} }
|
36
|
-
|
37
|
-
for( var i = 0; i < response['solr-mbeans'].length; i++ )
|
38
|
-
{
|
39
|
-
if( !( i % 2 ) )
|
40
|
-
{
|
41
|
-
plugin_key = response['solr-mbeans'][i];
|
42
|
-
}
|
43
|
-
else
|
44
|
-
{
|
45
|
-
plugin_data[plugin_key] = response['solr-mbeans'][i];
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
for( var key in plugin_data )
|
50
|
-
{
|
51
|
-
sort_table[key] = {
|
52
|
-
url : [],
|
53
|
-
component : [],
|
54
|
-
handler : []
|
55
|
-
};
|
56
|
-
for( var part_key in plugin_data[key] )
|
57
|
-
{
|
58
|
-
if( plugin_data[key][part_key]['_changed_'] )
|
59
|
-
{
|
60
|
-
delete plugin_data[key][part_key]['_changed_'];
|
61
|
-
|
62
|
-
changes.count[key] = changes.count[key] || 0;
|
63
|
-
changes.count[key]++;
|
64
|
-
|
65
|
-
changes.list[key] = changes.list[key] || {};
|
66
|
-
changes.list[key][part_key] = true;
|
67
|
-
}
|
68
|
-
|
69
|
-
if( 0 < part_key.indexOf( '.' ) )
|
70
|
-
{
|
71
|
-
types_obj[key] = true;
|
72
|
-
sort_table[key]['handler'].push( part_key );
|
73
|
-
}
|
74
|
-
else if( 0 === part_key.indexOf( '/' ) )
|
75
|
-
{
|
76
|
-
types_obj[key] = true;
|
77
|
-
sort_table[key]['url'].push( part_key );
|
78
|
-
}
|
79
|
-
else
|
80
|
-
{
|
81
|
-
types_obj[key] = true;
|
82
|
-
sort_table[key]['component'].push( part_key );
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
for( var type in types_obj )
|
88
|
-
{
|
89
|
-
types.push( type );
|
90
|
-
}
|
91
|
-
types.sort();
|
92
|
-
|
93
|
-
return {
|
94
|
-
'plugin_data' : plugin_data,
|
95
|
-
'sort_table' : sort_table,
|
96
|
-
'types' : types
|
97
|
-
};
|
98
|
-
};
|
99
|
-
|
100
|
-
var render_plugin_data = function( plugin_data, plugin_sort, types )
|
101
|
-
{
|
102
|
-
var frame_element = $( '#frame', content_element );
|
103
|
-
var navigation_element = $( '#navigation ul', content_element );
|
104
|
-
|
105
|
-
var navigation_content = [];
|
106
|
-
for( var i = 0; i < types.length; i++ )
|
107
|
-
{
|
108
|
-
var type_url = active_context.params.splat[0] + '/' + active_context.params.splat[1] + '/' + types[i].toLowerCase();
|
109
|
-
|
110
|
-
var navigation_markup = '<li class="' + types[i].toLowerCase().esc() + '">' +
|
111
|
-
'<a href="#/' + type_url + '" rel="' + types[i].esc() + '">' + types[i].esc();
|
112
|
-
|
113
|
-
if( changes.count[types[i]] )
|
114
|
-
{
|
115
|
-
navigation_markup += ' <span>' + changes.count[types[i]].esc() + '</span>';
|
116
|
-
}
|
117
|
-
|
118
|
-
navigation_markup += '</a>' +
|
119
|
-
'</li>';
|
120
|
-
|
121
|
-
navigation_content.push( navigation_markup );
|
122
|
-
}
|
123
|
-
|
124
|
-
navigation_content.push( '<li class="PLUGINCHANGES"><a href="#">Watch Changes</a></li>' );
|
125
|
-
navigation_content.push( '<li class="RELOAD"><a href="#" onClick="window.location.reload()">Refresh Values</a></li>' );
|
126
|
-
|
127
|
-
navigation_element
|
128
|
-
.html( navigation_content.join( "\n" ) );
|
129
|
-
|
130
|
-
$( '.PLUGINCHANGES a', navigation_element )
|
131
|
-
.die( 'click' )
|
132
|
-
.live
|
133
|
-
(
|
134
|
-
'click',
|
135
|
-
function( event )
|
136
|
-
{
|
137
|
-
load_reference_xml();
|
138
|
-
|
139
|
-
changes = { count : {}, list : {} }
|
140
|
-
$( 'a > span', navigation_element ).remove();
|
141
|
-
$( '.entry.changed', frame_element ).removeClass( 'changed' );
|
142
|
-
|
143
|
-
$.blockUI
|
144
|
-
(
|
145
|
-
{
|
146
|
-
message: $('#recording'),
|
147
|
-
css: { width: '450px' }
|
148
|
-
}
|
149
|
-
);
|
150
|
-
|
151
|
-
return false;
|
152
|
-
}
|
153
|
-
);
|
154
|
-
|
155
|
-
$( '#recording button' )
|
156
|
-
.die( 'click' )
|
157
|
-
.live
|
158
|
-
(
|
159
|
-
'click',
|
160
|
-
function( event )
|
161
|
-
{
|
162
|
-
$.ajax
|
163
|
-
(
|
164
|
-
{
|
165
|
-
type: 'POST',
|
166
|
-
url: core_basepath + '/admin/mbeans',
|
167
|
-
dataType : 'json',
|
168
|
-
data: {
|
169
|
-
'stats': 'true',
|
170
|
-
'wt': 'json',
|
171
|
-
'diff': 'true',
|
172
|
-
'all': 'true',
|
173
|
-
'stream.body': reference_xml
|
174
|
-
},
|
175
|
-
success : function( response, text_status, xhr )
|
176
|
-
{
|
177
|
-
load_reference_xml();
|
178
|
-
|
179
|
-
app.plugin_data = compute_plugin_data( response );
|
180
|
-
render_plugin_data( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
|
181
|
-
}
|
182
|
-
}
|
183
|
-
);
|
184
|
-
$.unblockUI();
|
185
|
-
return false;
|
186
|
-
}
|
187
|
-
);
|
188
|
-
|
189
|
-
$( 'a[href="' + context_path + '"]', navigation_element )
|
190
|
-
.parent().addClass( 'current' );
|
191
|
-
|
192
|
-
var content = '<ul>';
|
193
|
-
for( var sort_key in plugin_sort[selected_type] )
|
194
|
-
{
|
195
|
-
plugin_sort[selected_type][sort_key].sort();
|
196
|
-
var plugin_type_length = plugin_sort[selected_type][sort_key].length;
|
197
|
-
|
198
|
-
for( var i = 0; i < plugin_type_length; i++ )
|
199
|
-
{
|
200
|
-
var bean = plugin_sort[selected_type][sort_key][i];
|
201
|
-
var classes = [ 'entry' ];
|
202
|
-
|
203
|
-
if( changes.list[selected_type] && changes.list[selected_type][bean] )
|
204
|
-
{
|
205
|
-
classes.push( 'changed' );
|
206
|
-
}
|
207
|
-
|
208
|
-
content += '<li class="' + classes.join( ' ' ) + '">' + "\n";
|
209
|
-
content += '<a href="' + context_path + '?entry=' + bean.esc() + '" data-bean="' + bean.esc() + '">';
|
210
|
-
content += '<span>' + bean.esc() + '</span>';
|
211
|
-
content += '</a>' + "\n";
|
212
|
-
content += '<ul class="detail">' + "\n";
|
213
|
-
|
214
|
-
var details = plugin_data[selected_type][ plugin_sort[selected_type][sort_key][i] ];
|
215
|
-
for( var detail_key in details )
|
216
|
-
{
|
217
|
-
if( 'stats' !== detail_key )
|
218
|
-
{
|
219
|
-
var detail_value = details[detail_key];
|
220
|
-
|
221
|
-
if( 'description' === detail_key )
|
222
|
-
{
|
223
|
-
// Link component list to their MBeans page
|
224
|
-
if(detail_value.match(/^Search using components: /)) {
|
225
|
-
var idx = detail_value.indexOf(':');
|
226
|
-
var url = '#/'+active_context.params.splat[0]+'/plugins/other?entry=';
|
227
|
-
var tmp = 'Search using components:<ul>';
|
228
|
-
$.each(detail_value.substr(idx+1).split(","), function(index, value) {
|
229
|
-
value = $.trim(value);
|
230
|
-
tmp += '<li><a href="'+url+value+'" class="linker">'+value+"</a></li>";
|
231
|
-
});
|
232
|
-
tmp += "</ul>";
|
233
|
-
detail_value = tmp;
|
234
|
-
}
|
235
|
-
}
|
236
|
-
|
237
|
-
content += '<li><dl class="clearfix">' + "\n";
|
238
|
-
content += '<dt>' + detail_key.esc() + ':</dt>' + "\n";
|
239
|
-
if($.isArray(detail_value)) {
|
240
|
-
$.each(detail_value, function(index, value) {
|
241
|
-
content += '<dd>' + value.esc() + '</dd>' + "\n";
|
242
|
-
});
|
243
|
-
}
|
244
|
-
else {
|
245
|
-
content += '<dd>' + new String( detail_value ).esc() + '</dd>' + "\n";
|
246
|
-
}
|
247
|
-
content += '</dl></li>' + "\n";
|
248
|
-
}
|
249
|
-
else if( 'stats' === detail_key && details[detail_key] )
|
250
|
-
{
|
251
|
-
content += '<li class="stats clearfix">' + "\n";
|
252
|
-
content += '<span>' + detail_key.esc() + ':</span>' + "\n";
|
253
|
-
content += '<ul>' + "\n";
|
254
|
-
|
255
|
-
for( var stats_key in details[detail_key] )
|
256
|
-
{
|
257
|
-
var stats_value = new String( details[detail_key][stats_key] );
|
258
|
-
stats_value = stats_value.replace( /([\(@])/g, '$1​' );
|
259
|
-
|
260
|
-
content += '<li><dl class="clearfix">' + "\n";
|
261
|
-
content += '<dt>' + stats_key.esc() + ':</dt>' + "\n";
|
262
|
-
content += '<dd>' + stats_value.esc() + '</dd>' + "\n";
|
263
|
-
content += '</dl></li>' + "\n";
|
264
|
-
}
|
265
|
-
|
266
|
-
content += '</ul></li>' + "\n";
|
267
|
-
}
|
268
|
-
}
|
269
|
-
|
270
|
-
content += '</ul>' + "\n";
|
271
|
-
}
|
272
|
-
}
|
273
|
-
content += '</ul>' + "\n";
|
274
|
-
|
275
|
-
frame_element
|
276
|
-
.html( content );
|
277
|
-
|
278
|
-
|
279
|
-
var path = active_context.path.split( '?entry=' );
|
280
|
-
var entries = ( path[1] || '' ).split( ',' );
|
281
|
-
|
282
|
-
var entry_count = entries.length;
|
283
|
-
for( var i = 0; i < entry_count; i++ )
|
284
|
-
{
|
285
|
-
$( 'a[data-bean="' + entries[i] + '"]', frame_element )
|
286
|
-
.parent().addClass( 'expanded' );
|
287
|
-
}
|
288
|
-
|
289
|
-
$( 'a', frame_element )
|
290
|
-
.off( 'click' )
|
291
|
-
.on
|
292
|
-
(
|
293
|
-
'click',
|
294
|
-
function( event )
|
295
|
-
{
|
296
|
-
var self = $( this );
|
297
|
-
var bean = self.data( 'bean' );
|
298
|
-
|
299
|
-
var split = '?entry=';
|
300
|
-
var path = active_context.path.split( split );
|
301
|
-
var entry = ( path[1] || '' );
|
302
|
-
|
303
|
-
var regex = new RegExp( bean.replace( /\//g, '\\/' ) + '(,|$)' );
|
304
|
-
var match = regex.test( entry );
|
305
|
-
|
306
|
-
var url = path[0] + split;
|
307
|
-
|
308
|
-
url += match
|
309
|
-
? entry.replace( regex, '' )
|
310
|
-
: entry + ',' + bean;
|
311
|
-
|
312
|
-
url = url.replace( /=,/, '=' );
|
313
|
-
url = url.replace( /,$/, '' );
|
314
|
-
url = url.replace( /\?entry=$/, '' );
|
315
|
-
|
316
|
-
active_context.redirect( url );
|
317
|
-
return false;
|
318
|
-
}
|
319
|
-
);
|
320
|
-
|
321
|
-
// Try to make links for anything with http (but leave the rest alone)
|
322
|
-
$( '.detail dd' ).each(function(index) {
|
323
|
-
var txt = $(this).html();
|
324
|
-
if(txt.indexOf("http") >= 0) {
|
325
|
-
$(this).linker({
|
326
|
-
className : 'linker'
|
327
|
-
});
|
328
|
-
}
|
329
|
-
});
|
330
|
-
|
331
|
-
// Add invisible whitespace after each slash
|
332
|
-
$( '.detail a.linker' ).each(function(index) {
|
333
|
-
$(this).html( $(this).html().replace( /\//g, '/​' ) );
|
334
|
-
});
|
335
|
-
|
336
|
-
|
337
|
-
$( '.entry', frame_element )
|
338
|
-
.each
|
339
|
-
(
|
340
|
-
function( i, entry )
|
341
|
-
{
|
342
|
-
$( '.detail > li', entry ).not( '.stats' ).filter( ':even' )
|
343
|
-
.addClass( 'odd' );
|
344
|
-
|
345
|
-
$( '.stats li:odd', entry )
|
346
|
-
.addClass( 'odd' );
|
347
|
-
}
|
348
|
-
);
|
349
|
-
};
|
350
|
-
|
351
|
-
var load_reference_xml = function()
|
352
|
-
{
|
353
|
-
$.ajax
|
354
|
-
(
|
355
|
-
{
|
356
|
-
type: 'GET',
|
357
|
-
url: core_basepath + '/admin/mbeans?stats=true&wt=xml',
|
358
|
-
dataType : 'text',
|
359
|
-
success: function( data )
|
360
|
-
{
|
361
|
-
reference_xml = data;
|
362
|
-
}
|
363
|
-
}
|
364
|
-
);
|
365
|
-
}
|
366
|
-
|
367
|
-
sammy.bind
|
368
|
-
(
|
369
|
-
'plugins_load',
|
370
|
-
function( event, params )
|
371
|
-
{
|
372
|
-
var callback = function()
|
373
|
-
{
|
374
|
-
params.callback( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
|
375
|
-
}
|
376
|
-
|
377
|
-
if( app.plugin_data )
|
378
|
-
{
|
379
|
-
callback( app.plugin_data );
|
380
|
-
return true;
|
381
|
-
}
|
382
|
-
|
383
|
-
$.ajax
|
384
|
-
(
|
385
|
-
{
|
386
|
-
url : core_basepath + '/admin/mbeans?stats=true&wt=json',
|
387
|
-
dataType : 'json',
|
388
|
-
beforeSend : function( xhr, settings )
|
389
|
-
{
|
390
|
-
},
|
391
|
-
success : function( response, text_status, xhr )
|
392
|
-
{
|
393
|
-
app.plugin_data = compute_plugin_data( response );
|
394
|
-
|
395
|
-
$.get
|
396
|
-
(
|
397
|
-
'tpl/plugins.html',
|
398
|
-
function( template )
|
399
|
-
{
|
400
|
-
$( '#content' )
|
401
|
-
.html( template );
|
402
|
-
|
403
|
-
callback( app.plugin_data );
|
404
|
-
}
|
405
|
-
);
|
406
|
-
},
|
407
|
-
error : function( xhr, text_status, error_thrown)
|
408
|
-
{
|
409
|
-
},
|
410
|
-
complete : function( xhr, text_status )
|
411
|
-
{
|
412
|
-
}
|
413
|
-
}
|
414
|
-
);
|
415
|
-
}
|
416
|
-
);
|
417
|
-
|
418
|
-
// #/:core/plugins/$type
|
419
|
-
sammy.get
|
420
|
-
(
|
421
|
-
new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
|
422
|
-
function( context )
|
423
|
-
{
|
424
|
-
core_basepath = this.active_core.attr( 'data-basepath' );
|
425
|
-
content_element = $( '#content' );
|
426
|
-
selected_type = context.params.splat[2].toUpperCase();
|
427
|
-
context_path = context.path.split( '?' ).shift();
|
428
|
-
active_context = context;
|
429
|
-
|
430
|
-
sammy.trigger
|
431
|
-
(
|
432
|
-
'plugins_load',
|
433
|
-
{
|
434
|
-
active_core : this.active_core,
|
435
|
-
callback : render_plugin_data
|
436
|
-
}
|
437
|
-
);
|
438
|
-
}
|
439
|
-
);
|
440
|
-
|
441
|
-
// #/:core/plugins
|
442
|
-
sammy.get
|
443
|
-
(
|
444
|
-
new RegExp( app.core_regex_base + '\\/(plugins)$' ),
|
445
|
-
function( context )
|
446
|
-
{
|
447
|
-
core_basepath = this.active_core.attr( 'data-basepath' );
|
448
|
-
delete app.plugin_data;
|
449
|
-
|
450
|
-
sammy.trigger
|
451
|
-
(
|
452
|
-
'plugins_load',
|
453
|
-
{
|
454
|
-
active_core : this.active_core,
|
455
|
-
callback : function( plugin_data, plugin_sort, types )
|
456
|
-
{
|
457
|
-
context.redirect( context.path + '/' + types[0].toLowerCase() );
|
458
|
-
}
|
459
|
-
}
|
460
|
-
);
|
461
|
-
}
|
462
|
-
);
|
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 core_basepath = null;
|
19
|
+
var content_element = null;
|
20
|
+
var selected_type = null;
|
21
|
+
var context_path = null;
|
22
|
+
var active_context = null;
|
23
|
+
var changes = null;
|
24
|
+
var reference_xml = null;
|
25
|
+
|
26
|
+
var compute_plugin_data = function( response, changeset )
|
27
|
+
{
|
28
|
+
var types = [];
|
29
|
+
var sort_table = {};
|
30
|
+
var plugin_data = {};
|
31
|
+
|
32
|
+
var types_obj = {};
|
33
|
+
var plugin_key = null;
|
34
|
+
|
35
|
+
changes = { count : {}, list : {} }
|
36
|
+
|
37
|
+
for( var i = 0; i < response['solr-mbeans'].length; i++ )
|
38
|
+
{
|
39
|
+
if( !( i % 2 ) )
|
40
|
+
{
|
41
|
+
plugin_key = response['solr-mbeans'][i];
|
42
|
+
}
|
43
|
+
else
|
44
|
+
{
|
45
|
+
plugin_data[plugin_key] = response['solr-mbeans'][i];
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
for( var key in plugin_data )
|
50
|
+
{
|
51
|
+
sort_table[key] = {
|
52
|
+
url : [],
|
53
|
+
component : [],
|
54
|
+
handler : []
|
55
|
+
};
|
56
|
+
for( var part_key in plugin_data[key] )
|
57
|
+
{
|
58
|
+
if( plugin_data[key][part_key]['_changed_'] )
|
59
|
+
{
|
60
|
+
delete plugin_data[key][part_key]['_changed_'];
|
61
|
+
|
62
|
+
changes.count[key] = changes.count[key] || 0;
|
63
|
+
changes.count[key]++;
|
64
|
+
|
65
|
+
changes.list[key] = changes.list[key] || {};
|
66
|
+
changes.list[key][part_key] = true;
|
67
|
+
}
|
68
|
+
|
69
|
+
if( 0 < part_key.indexOf( '.' ) )
|
70
|
+
{
|
71
|
+
types_obj[key] = true;
|
72
|
+
sort_table[key]['handler'].push( part_key );
|
73
|
+
}
|
74
|
+
else if( 0 === part_key.indexOf( '/' ) )
|
75
|
+
{
|
76
|
+
types_obj[key] = true;
|
77
|
+
sort_table[key]['url'].push( part_key );
|
78
|
+
}
|
79
|
+
else
|
80
|
+
{
|
81
|
+
types_obj[key] = true;
|
82
|
+
sort_table[key]['component'].push( part_key );
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
for( var type in types_obj )
|
88
|
+
{
|
89
|
+
types.push( type );
|
90
|
+
}
|
91
|
+
types.sort();
|
92
|
+
|
93
|
+
return {
|
94
|
+
'plugin_data' : plugin_data,
|
95
|
+
'sort_table' : sort_table,
|
96
|
+
'types' : types
|
97
|
+
};
|
98
|
+
};
|
99
|
+
|
100
|
+
var render_plugin_data = function( plugin_data, plugin_sort, types )
|
101
|
+
{
|
102
|
+
var frame_element = $( '#frame', content_element );
|
103
|
+
var navigation_element = $( '#navigation ul', content_element );
|
104
|
+
|
105
|
+
var navigation_content = [];
|
106
|
+
for( var i = 0; i < types.length; i++ )
|
107
|
+
{
|
108
|
+
var type_url = active_context.params.splat[0] + '/' + active_context.params.splat[1] + '/' + types[i].toLowerCase();
|
109
|
+
|
110
|
+
var navigation_markup = '<li class="' + types[i].toLowerCase().esc() + '">' +
|
111
|
+
'<a href="#/' + type_url + '" rel="' + types[i].esc() + '">' + types[i].esc();
|
112
|
+
|
113
|
+
if( changes.count[types[i]] )
|
114
|
+
{
|
115
|
+
navigation_markup += ' <span>' + changes.count[types[i]].esc() + '</span>';
|
116
|
+
}
|
117
|
+
|
118
|
+
navigation_markup += '</a>' +
|
119
|
+
'</li>';
|
120
|
+
|
121
|
+
navigation_content.push( navigation_markup );
|
122
|
+
}
|
123
|
+
|
124
|
+
navigation_content.push( '<li class="PLUGINCHANGES"><a href="#">Watch Changes</a></li>' );
|
125
|
+
navigation_content.push( '<li class="RELOAD"><a href="#" onClick="window.location.reload()">Refresh Values</a></li>' );
|
126
|
+
|
127
|
+
navigation_element
|
128
|
+
.html( navigation_content.join( "\n" ) );
|
129
|
+
|
130
|
+
$( '.PLUGINCHANGES a', navigation_element )
|
131
|
+
.die( 'click' )
|
132
|
+
.live
|
133
|
+
(
|
134
|
+
'click',
|
135
|
+
function( event )
|
136
|
+
{
|
137
|
+
load_reference_xml();
|
138
|
+
|
139
|
+
changes = { count : {}, list : {} }
|
140
|
+
$( 'a > span', navigation_element ).remove();
|
141
|
+
$( '.entry.changed', frame_element ).removeClass( 'changed' );
|
142
|
+
|
143
|
+
$.blockUI
|
144
|
+
(
|
145
|
+
{
|
146
|
+
message: $('#recording'),
|
147
|
+
css: { width: '450px' }
|
148
|
+
}
|
149
|
+
);
|
150
|
+
|
151
|
+
return false;
|
152
|
+
}
|
153
|
+
);
|
154
|
+
|
155
|
+
$( '#recording button' )
|
156
|
+
.die( 'click' )
|
157
|
+
.live
|
158
|
+
(
|
159
|
+
'click',
|
160
|
+
function( event )
|
161
|
+
{
|
162
|
+
$.ajax
|
163
|
+
(
|
164
|
+
{
|
165
|
+
type: 'POST',
|
166
|
+
url: core_basepath + '/admin/mbeans',
|
167
|
+
dataType : 'json',
|
168
|
+
data: {
|
169
|
+
'stats': 'true',
|
170
|
+
'wt': 'json',
|
171
|
+
'diff': 'true',
|
172
|
+
'all': 'true',
|
173
|
+
'stream.body': reference_xml
|
174
|
+
},
|
175
|
+
success : function( response, text_status, xhr )
|
176
|
+
{
|
177
|
+
load_reference_xml();
|
178
|
+
|
179
|
+
app.plugin_data = compute_plugin_data( response );
|
180
|
+
render_plugin_data( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
|
181
|
+
}
|
182
|
+
}
|
183
|
+
);
|
184
|
+
$.unblockUI();
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
);
|
188
|
+
|
189
|
+
$( 'a[href="' + context_path + '"]', navigation_element )
|
190
|
+
.parent().addClass( 'current' );
|
191
|
+
|
192
|
+
var content = '<ul>';
|
193
|
+
for( var sort_key in plugin_sort[selected_type] )
|
194
|
+
{
|
195
|
+
plugin_sort[selected_type][sort_key].sort();
|
196
|
+
var plugin_type_length = plugin_sort[selected_type][sort_key].length;
|
197
|
+
|
198
|
+
for( var i = 0; i < plugin_type_length; i++ )
|
199
|
+
{
|
200
|
+
var bean = plugin_sort[selected_type][sort_key][i];
|
201
|
+
var classes = [ 'entry' ];
|
202
|
+
|
203
|
+
if( changes.list[selected_type] && changes.list[selected_type][bean] )
|
204
|
+
{
|
205
|
+
classes.push( 'changed' );
|
206
|
+
}
|
207
|
+
|
208
|
+
content += '<li class="' + classes.join( ' ' ) + '">' + "\n";
|
209
|
+
content += '<a href="' + context_path + '?entry=' + bean.esc() + '" data-bean="' + bean.esc() + '">';
|
210
|
+
content += '<span>' + bean.esc() + '</span>';
|
211
|
+
content += '</a>' + "\n";
|
212
|
+
content += '<ul class="detail">' + "\n";
|
213
|
+
|
214
|
+
var details = plugin_data[selected_type][ plugin_sort[selected_type][sort_key][i] ];
|
215
|
+
for( var detail_key in details )
|
216
|
+
{
|
217
|
+
if( 'stats' !== detail_key )
|
218
|
+
{
|
219
|
+
var detail_value = details[detail_key];
|
220
|
+
|
221
|
+
if( 'description' === detail_key )
|
222
|
+
{
|
223
|
+
// Link component list to their MBeans page
|
224
|
+
if(detail_value.match(/^Search using components: /)) {
|
225
|
+
var idx = detail_value.indexOf(':');
|
226
|
+
var url = '#/'+active_context.params.splat[0]+'/plugins/other?entry=';
|
227
|
+
var tmp = 'Search using components:<ul>';
|
228
|
+
$.each(detail_value.substr(idx+1).split(","), function(index, value) {
|
229
|
+
value = $.trim(value);
|
230
|
+
tmp += '<li><a href="'+url+value+'" class="linker">'+value+"</a></li>";
|
231
|
+
});
|
232
|
+
tmp += "</ul>";
|
233
|
+
detail_value = tmp;
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
content += '<li><dl class="clearfix">' + "\n";
|
238
|
+
content += '<dt>' + detail_key.esc() + ':</dt>' + "\n";
|
239
|
+
if($.isArray(detail_value)) {
|
240
|
+
$.each(detail_value, function(index, value) {
|
241
|
+
content += '<dd>' + value.esc() + '</dd>' + "\n";
|
242
|
+
});
|
243
|
+
}
|
244
|
+
else {
|
245
|
+
content += '<dd>' + new String( detail_value ).esc() + '</dd>' + "\n";
|
246
|
+
}
|
247
|
+
content += '</dl></li>' + "\n";
|
248
|
+
}
|
249
|
+
else if( 'stats' === detail_key && details[detail_key] )
|
250
|
+
{
|
251
|
+
content += '<li class="stats clearfix">' + "\n";
|
252
|
+
content += '<span>' + detail_key.esc() + ':</span>' + "\n";
|
253
|
+
content += '<ul>' + "\n";
|
254
|
+
|
255
|
+
for( var stats_key in details[detail_key] )
|
256
|
+
{
|
257
|
+
var stats_value = new String( details[detail_key][stats_key] );
|
258
|
+
stats_value = stats_value.replace( /([\(@])/g, '$1​' );
|
259
|
+
|
260
|
+
content += '<li><dl class="clearfix">' + "\n";
|
261
|
+
content += '<dt>' + stats_key.esc() + ':</dt>' + "\n";
|
262
|
+
content += '<dd>' + stats_value.esc() + '</dd>' + "\n";
|
263
|
+
content += '</dl></li>' + "\n";
|
264
|
+
}
|
265
|
+
|
266
|
+
content += '</ul></li>' + "\n";
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
content += '</ul>' + "\n";
|
271
|
+
}
|
272
|
+
}
|
273
|
+
content += '</ul>' + "\n";
|
274
|
+
|
275
|
+
frame_element
|
276
|
+
.html( content );
|
277
|
+
|
278
|
+
|
279
|
+
var path = active_context.path.split( '?entry=' );
|
280
|
+
var entries = ( path[1] || '' ).split( ',' );
|
281
|
+
|
282
|
+
var entry_count = entries.length;
|
283
|
+
for( var i = 0; i < entry_count; i++ )
|
284
|
+
{
|
285
|
+
$( 'a[data-bean="' + entries[i].esc() + '"]', frame_element )
|
286
|
+
.parent().addClass( 'expanded' );
|
287
|
+
}
|
288
|
+
|
289
|
+
$( 'a', frame_element )
|
290
|
+
.off( 'click' )
|
291
|
+
.on
|
292
|
+
(
|
293
|
+
'click',
|
294
|
+
function( event )
|
295
|
+
{
|
296
|
+
var self = $( this );
|
297
|
+
var bean = self.data( 'bean' );
|
298
|
+
|
299
|
+
var split = '?entry=';
|
300
|
+
var path = active_context.path.split( split );
|
301
|
+
var entry = ( path[1] || '' );
|
302
|
+
|
303
|
+
var regex = new RegExp( bean.replace( /\//g, '\\/' ) + '(,|$)' );
|
304
|
+
var match = regex.test( entry );
|
305
|
+
|
306
|
+
var url = path[0] + split;
|
307
|
+
|
308
|
+
url += match
|
309
|
+
? entry.replace( regex, '' )
|
310
|
+
: entry + ',' + bean;
|
311
|
+
|
312
|
+
url = url.replace( /=,/, '=' );
|
313
|
+
url = url.replace( /,$/, '' );
|
314
|
+
url = url.replace( /\?entry=$/, '' );
|
315
|
+
|
316
|
+
active_context.redirect( url );
|
317
|
+
return false;
|
318
|
+
}
|
319
|
+
);
|
320
|
+
|
321
|
+
// Try to make links for anything with http (but leave the rest alone)
|
322
|
+
$( '.detail dd' ).each(function(index) {
|
323
|
+
var txt = $(this).html();
|
324
|
+
if(txt.indexOf("http") >= 0) {
|
325
|
+
$(this).linker({
|
326
|
+
className : 'linker'
|
327
|
+
});
|
328
|
+
}
|
329
|
+
});
|
330
|
+
|
331
|
+
// Add invisible whitespace after each slash
|
332
|
+
$( '.detail a.linker' ).each(function(index) {
|
333
|
+
$(this).html( $(this).html().replace( /\//g, '/​' ) );
|
334
|
+
});
|
335
|
+
|
336
|
+
|
337
|
+
$( '.entry', frame_element )
|
338
|
+
.each
|
339
|
+
(
|
340
|
+
function( i, entry )
|
341
|
+
{
|
342
|
+
$( '.detail > li', entry ).not( '.stats' ).filter( ':even' )
|
343
|
+
.addClass( 'odd' );
|
344
|
+
|
345
|
+
$( '.stats li:odd', entry )
|
346
|
+
.addClass( 'odd' );
|
347
|
+
}
|
348
|
+
);
|
349
|
+
};
|
350
|
+
|
351
|
+
var load_reference_xml = function()
|
352
|
+
{
|
353
|
+
$.ajax
|
354
|
+
(
|
355
|
+
{
|
356
|
+
type: 'GET',
|
357
|
+
url: core_basepath + '/admin/mbeans?stats=true&wt=xml',
|
358
|
+
dataType : 'text',
|
359
|
+
success: function( data )
|
360
|
+
{
|
361
|
+
reference_xml = data;
|
362
|
+
}
|
363
|
+
}
|
364
|
+
);
|
365
|
+
}
|
366
|
+
|
367
|
+
sammy.bind
|
368
|
+
(
|
369
|
+
'plugins_load',
|
370
|
+
function( event, params )
|
371
|
+
{
|
372
|
+
var callback = function()
|
373
|
+
{
|
374
|
+
params.callback( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
|
375
|
+
}
|
376
|
+
|
377
|
+
if( app.plugin_data )
|
378
|
+
{
|
379
|
+
callback( app.plugin_data );
|
380
|
+
return true;
|
381
|
+
}
|
382
|
+
|
383
|
+
$.ajax
|
384
|
+
(
|
385
|
+
{
|
386
|
+
url : core_basepath + '/admin/mbeans?stats=true&wt=json',
|
387
|
+
dataType : 'json',
|
388
|
+
beforeSend : function( xhr, settings )
|
389
|
+
{
|
390
|
+
},
|
391
|
+
success : function( response, text_status, xhr )
|
392
|
+
{
|
393
|
+
app.plugin_data = compute_plugin_data( response );
|
394
|
+
|
395
|
+
$.get
|
396
|
+
(
|
397
|
+
'tpl/plugins.html',
|
398
|
+
function( template )
|
399
|
+
{
|
400
|
+
$( '#content' )
|
401
|
+
.html( template );
|
402
|
+
|
403
|
+
callback( app.plugin_data );
|
404
|
+
}
|
405
|
+
);
|
406
|
+
},
|
407
|
+
error : function( xhr, text_status, error_thrown)
|
408
|
+
{
|
409
|
+
},
|
410
|
+
complete : function( xhr, text_status )
|
411
|
+
{
|
412
|
+
}
|
413
|
+
}
|
414
|
+
);
|
415
|
+
}
|
416
|
+
);
|
417
|
+
|
418
|
+
// #/:core/plugins/$type
|
419
|
+
sammy.get
|
420
|
+
(
|
421
|
+
new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
|
422
|
+
function( context )
|
423
|
+
{
|
424
|
+
core_basepath = this.active_core.attr( 'data-basepath' );
|
425
|
+
content_element = $( '#content' );
|
426
|
+
selected_type = context.params.splat[2].toUpperCase();
|
427
|
+
context_path = context.path.split( '?' ).shift();
|
428
|
+
active_context = context;
|
429
|
+
|
430
|
+
sammy.trigger
|
431
|
+
(
|
432
|
+
'plugins_load',
|
433
|
+
{
|
434
|
+
active_core : this.active_core,
|
435
|
+
callback : render_plugin_data
|
436
|
+
}
|
437
|
+
);
|
438
|
+
}
|
439
|
+
);
|
440
|
+
|
441
|
+
// #/:core/plugins
|
442
|
+
sammy.get
|
443
|
+
(
|
444
|
+
new RegExp( app.core_regex_base + '\\/(plugins)$' ),
|
445
|
+
function( context )
|
446
|
+
{
|
447
|
+
core_basepath = this.active_core.attr( 'data-basepath' );
|
448
|
+
delete app.plugin_data;
|
449
|
+
|
450
|
+
sammy.trigger
|
451
|
+
(
|
452
|
+
'plugins_load',
|
453
|
+
{
|
454
|
+
active_core : this.active_core,
|
455
|
+
callback : function( plugin_data, plugin_sort, types )
|
456
|
+
{
|
457
|
+
context.redirect( context.path + '/' + types[0].toLowerCase() );
|
458
|
+
}
|
459
|
+
}
|
460
|
+
);
|
461
|
+
}
|
462
|
+
);
|