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
@@ -0,0 +1,199 @@
|
|
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
|
+
solrAdminApp.controller('AnalysisController',
|
19
|
+
function($scope, $location, $routeParams, Luke, Analysis) {
|
20
|
+
$scope.resetMenu("analysis");
|
21
|
+
|
22
|
+
$scope.refresh = function() {
|
23
|
+
Luke.schema({core: $routeParams.core}, function(data) {
|
24
|
+
$scope.fieldsAndTypes = [];
|
25
|
+
for (var field in data.schema.fields) {
|
26
|
+
$scope.fieldsAndTypes.push({
|
27
|
+
group: "Fields",
|
28
|
+
value: "fieldname=" + field,
|
29
|
+
label: field});
|
30
|
+
}
|
31
|
+
for (var type in data.schema.types) {
|
32
|
+
$scope.fieldsAndTypes.push({
|
33
|
+
group: "Types",
|
34
|
+
value: "fieldtype=" + type,
|
35
|
+
label: type});
|
36
|
+
}
|
37
|
+
$scope.core = $routeParams.core;
|
38
|
+
});
|
39
|
+
|
40
|
+
$scope.parseQueryString();
|
41
|
+
// @todo - set defaultSearchField either to context["analysis.fieldname"] or context["analysis.fieldtype"]
|
42
|
+
|
43
|
+
};
|
44
|
+
$scope.verbose = true;
|
45
|
+
|
46
|
+
var getShortComponentName = function(longname) {
|
47
|
+
var short = -1 !== longname.indexOf( '$' )
|
48
|
+
? longname.split( '$' )[1]
|
49
|
+
: longname.split( '.' ).pop();
|
50
|
+
return short.match( /[A-Z]/g ).join( '' );
|
51
|
+
};
|
52
|
+
|
53
|
+
var getCaptionsForComponent = function(data) {
|
54
|
+
var captions = [];
|
55
|
+
for (var key in data[0]) {
|
56
|
+
key = key.replace(/.*#/,'');
|
57
|
+
if (key != "match" && key!="positionHistory") {
|
58
|
+
captions.push(key.replace(/.*#/,''));
|
59
|
+
}
|
60
|
+
}
|
61
|
+
return captions;
|
62
|
+
};
|
63
|
+
|
64
|
+
var getTokensForComponent = function(data) {
|
65
|
+
var tokens = [];
|
66
|
+
var previousPosition = 0;
|
67
|
+
var index=0;
|
68
|
+
for (var i in data) {
|
69
|
+
var tokenhash = data[i];
|
70
|
+
var positionDifference = tokenhash.position - previousPosition;
|
71
|
+
for (var j=positionDifference; j>1; j--) {
|
72
|
+
tokens.push({position: tokenhash.position - j+1, blank:true, index:index++});
|
73
|
+
}
|
74
|
+
|
75
|
+
var token = {position: tokenhash.position, keys:[], index:index++};
|
76
|
+
|
77
|
+
for (key in tokenhash) {
|
78
|
+
if (key == "match" || key=="positionHistory") {
|
79
|
+
//@ todo do something
|
80
|
+
} else {
|
81
|
+
token.keys.push({name:key, value:tokenhash[key]});
|
82
|
+
}
|
83
|
+
}
|
84
|
+
tokens.push(token);
|
85
|
+
previousPosition = tokenhash.position;
|
86
|
+
}
|
87
|
+
return tokens;
|
88
|
+
};
|
89
|
+
|
90
|
+
var extractComponents = function(data, result, name) {
|
91
|
+
if (data) {
|
92
|
+
result[name] = [];
|
93
|
+
for (var i = 0; i < data.length; i += 2) {
|
94
|
+
var component = {
|
95
|
+
name: data[i],
|
96
|
+
short: getShortComponentName(data[i]),
|
97
|
+
captions: getCaptionsForComponent(data[i + 1]),
|
98
|
+
tokens: getTokensForComponent(data[i + 1])
|
99
|
+
};
|
100
|
+
result[name].push(component);
|
101
|
+
}
|
102
|
+
}
|
103
|
+
};
|
104
|
+
|
105
|
+
var processAnalysisData = function(analysis, fieldOrType) {
|
106
|
+
var fieldname;
|
107
|
+
for (fieldname in analysis[fieldOrType]) {console.log(fieldname);break;}
|
108
|
+
var response = {};
|
109
|
+
extractComponents(analysis[fieldOrType][fieldname].index, response, "index");
|
110
|
+
extractComponents(analysis[fieldOrType][fieldname].query, response, "query");
|
111
|
+
return response;
|
112
|
+
};
|
113
|
+
|
114
|
+
$scope.updateQueryString = function() {
|
115
|
+
|
116
|
+
var parts = $scope.fieldOrType.split("=");
|
117
|
+
var fieldOrType = parts[0];
|
118
|
+
var name = parts[1];
|
119
|
+
|
120
|
+
if ($scope.indexText) {
|
121
|
+
$location.search("analysis.fieldvalue", $scope.indexText);
|
122
|
+
}
|
123
|
+
if ($scope.queryText) {
|
124
|
+
$location.search("analysis.query", $scope.queryText);
|
125
|
+
}
|
126
|
+
|
127
|
+
if (fieldOrType == "fieldname") {
|
128
|
+
$location.search("analysis.fieldname", name);
|
129
|
+
$location.search("analysis.fieldtype", null);
|
130
|
+
} else {
|
131
|
+
$location.search("analysis.fieldtype", name);
|
132
|
+
$location.search("analysis.fieldname", null);
|
133
|
+
}
|
134
|
+
$location.search("verbose_output", $scope.verbose ? "1" : "0");
|
135
|
+
};
|
136
|
+
|
137
|
+
$scope.parseQueryString = function () {
|
138
|
+
var params = {};
|
139
|
+
var search = $location.search();
|
140
|
+
|
141
|
+
if (Object.keys(search).length == 0) {
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
for (var key in search) {
|
145
|
+
params[key]=search[key];
|
146
|
+
}
|
147
|
+
$scope.indexText = search["analysis.fieldvalue"];
|
148
|
+
$scope.queryText = search["analysis.query"];
|
149
|
+
if (search["analysis.fieldname"]) {
|
150
|
+
$scope.fieldOrType = "fieldname=" + search["analysis.fieldname"];
|
151
|
+
$scope.schemaBrowserUrl = "field=" + search["analysis.fieldname"];
|
152
|
+
} else {
|
153
|
+
$scope.fieldOrType = "fieldtype=" + search["analysis.fieldtype"];
|
154
|
+
$scope.schemaBrowserUrl = "type=" + search["analysis.fieldtype"];
|
155
|
+
}
|
156
|
+
if (search["verbose_output"] == undefined) {
|
157
|
+
$scope.verbose = true;
|
158
|
+
} else {
|
159
|
+
$scope.verbose = search["verbose_output"] == "1";
|
160
|
+
}
|
161
|
+
|
162
|
+
if ($scope.fieldOrType || $scope.indexText || $scope.queryText) {
|
163
|
+
params.core = $routeParams.core;
|
164
|
+
var parts = $scope.fieldOrType.split("=");
|
165
|
+
var fieldOrType = parts[0] == "fieldname" ? "field_names" : "field_types";
|
166
|
+
|
167
|
+
Analysis.field(params, function(data) {
|
168
|
+
$scope.result = processAnalysisData(data.analysis, fieldOrType);
|
169
|
+
});
|
170
|
+
}
|
171
|
+
};
|
172
|
+
|
173
|
+
$scope.changeFieldOrType = function() {
|
174
|
+
var parts = $scope.fieldOrType.split("=");
|
175
|
+
if (parts[0]=='fieldname') {
|
176
|
+
$scope.schemaBrowserUrl = "field=" + parts[1];
|
177
|
+
} else {
|
178
|
+
$scope.schemaBrowserUrl = "type=" + parts[1];
|
179
|
+
}
|
180
|
+
};
|
181
|
+
|
182
|
+
$scope.toggleVerbose = function() {
|
183
|
+
$scope.verbose = !$scope.verbose;
|
184
|
+
$location.search("verbose_output", $scope.verbose ? "1" : "0");
|
185
|
+
};
|
186
|
+
|
187
|
+
$scope.refresh();
|
188
|
+
}
|
189
|
+
);
|
190
|
+
|
191
|
+
/***************
|
192
|
+
|
193
|
+
function(error) {
|
194
|
+
if (error.status == 404) {
|
195
|
+
$scope.isHandlerMissing = true;
|
196
|
+
} else {
|
197
|
+
$scope.analysisError = error.error.msg;
|
198
|
+
}
|
199
|
+
****/
|
@@ -0,0 +1,528 @@
|
|
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
|
+
solrAdminApp.controller('CloudController',
|
19
|
+
function($scope, $location, Zookeeper) {
|
20
|
+
|
21
|
+
$scope.showDebug = false;
|
22
|
+
|
23
|
+
$scope.$on("cloud-dump", function(event) {
|
24
|
+
$scope.showDebug = true;
|
25
|
+
});
|
26
|
+
|
27
|
+
$scope.closeDebug = function() {
|
28
|
+
$scope.showDebug = false;
|
29
|
+
}
|
30
|
+
|
31
|
+
var view = $location.search().view ? $location.search().view : "graph";
|
32
|
+
if (view == "tree") {
|
33
|
+
$scope.resetMenu("cloud-tree", true);
|
34
|
+
treeSubController($scope, Zookeeper);
|
35
|
+
} else if (view == "rgraph") {
|
36
|
+
$scope.resetMenu("cloud-rgraph", true);
|
37
|
+
graphSubController($scope, Zookeeper, true);
|
38
|
+
} else if (view == "graph") {
|
39
|
+
$scope.resetMenu("cloud-graph", true);
|
40
|
+
graphSubController($scope, Zookeeper, false);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
);
|
44
|
+
|
45
|
+
var treeSubController = function($scope, Zookeeper) {
|
46
|
+
$scope.showTree = true;
|
47
|
+
$scope.showGraph = false;
|
48
|
+
$scope.tree = {};
|
49
|
+
$scope.showData = false;
|
50
|
+
|
51
|
+
$scope.showTreeLink = function(link) {
|
52
|
+
var path = decodeURIComponent(link.replace(/.*[\\?&]path=([^&#]*).*/, "$1"));
|
53
|
+
Zookeeper.detail({path: path}, function(data) {
|
54
|
+
$scope.znode = data.znode;
|
55
|
+
var path = data.znode.path.split( '.' );
|
56
|
+
if(path.length >1) {
|
57
|
+
$scope.lang = path.pop();
|
58
|
+
}
|
59
|
+
$scope.showData = true;
|
60
|
+
});
|
61
|
+
};
|
62
|
+
|
63
|
+
$scope.hideData = function() {
|
64
|
+
$scope.showData = false;
|
65
|
+
};
|
66
|
+
|
67
|
+
$scope.initTree = function() {
|
68
|
+
Zookeeper.simple(function(data) {
|
69
|
+
$scope.tree = data.tree;
|
70
|
+
});
|
71
|
+
};
|
72
|
+
|
73
|
+
$scope.initTree();
|
74
|
+
};
|
75
|
+
|
76
|
+
var graphSubController = function ($scope, Zookeeper, isRadial) {
|
77
|
+
$scope.showTree = false;
|
78
|
+
$scope.showGraph = true;
|
79
|
+
|
80
|
+
$scope.filterType = "status";
|
81
|
+
|
82
|
+
$scope.helperData = {
|
83
|
+
protocol: [],
|
84
|
+
host: [],
|
85
|
+
hostname: [],
|
86
|
+
port: [],
|
87
|
+
pathname: []
|
88
|
+
};
|
89
|
+
|
90
|
+
$scope.next = function() {
|
91
|
+
$scope.pos += $scope.rows;
|
92
|
+
$scope.initGraph();
|
93
|
+
}
|
94
|
+
|
95
|
+
$scope.previous = function() {
|
96
|
+
$scope.pos = Math.max(0, $scope.pos - $scope.rows);
|
97
|
+
$scope.initGraph();
|
98
|
+
}
|
99
|
+
|
100
|
+
$scope.resetGraph = function() {
|
101
|
+
$scope.pos = 0;
|
102
|
+
$scope.initGraph();
|
103
|
+
}
|
104
|
+
|
105
|
+
$scope.initGraph = function() {
|
106
|
+
Zookeeper.liveNodes(function (data) {
|
107
|
+
var live_nodes = {};
|
108
|
+
for (var c in data.tree[0].children) {
|
109
|
+
live_nodes[data.tree[0].children[c].data.title] = true;
|
110
|
+
}
|
111
|
+
|
112
|
+
var params = {view: "graph"};
|
113
|
+
if ($scope.rows) {
|
114
|
+
params.start = $scope.pos;
|
115
|
+
params.rows = $scope.rows;
|
116
|
+
}
|
117
|
+
|
118
|
+
var filter = ($scope.filterType=='status') ? $scope.pagingStatusFilter : $scope.pagingFilter;
|
119
|
+
|
120
|
+
if (filter) {
|
121
|
+
params.filterType = $scope.filterType;
|
122
|
+
params.filter = filter;
|
123
|
+
}
|
124
|
+
|
125
|
+
Zookeeper.clusterState(params, function (data) {
|
126
|
+
eval("var state=" + data.znode.data); // @todo fix horrid means to parse JSON
|
127
|
+
|
128
|
+
var leaf_count = 0;
|
129
|
+
var graph_data = {
|
130
|
+
name: null,
|
131
|
+
children: []
|
132
|
+
};
|
133
|
+
|
134
|
+
for (var c in state) {
|
135
|
+
var shards = [];
|
136
|
+
for (var s in state[c].shards) {
|
137
|
+
var nodes = [];
|
138
|
+
for (var n in state[c].shards[s].replicas) {
|
139
|
+
leaf_count++;
|
140
|
+
var replica = state[c].shards[s].replicas[n]
|
141
|
+
|
142
|
+
var uri = replica.base_url;
|
143
|
+
var parts = uri.match(/^(\w+:)\/\/(([\w\d\.-]+)(:(\d+))?)(.+)$/);
|
144
|
+
var uri_parts = {
|
145
|
+
protocol: parts[1],
|
146
|
+
host: parts[2],
|
147
|
+
hostname: parts[3],
|
148
|
+
port: parseInt(parts[5] || 80, 10),
|
149
|
+
pathname: parts[6]
|
150
|
+
};
|
151
|
+
|
152
|
+
$scope.helperData.protocol.push(uri_parts.protocol);
|
153
|
+
$scope.helperData.host.push(uri_parts.host);
|
154
|
+
$scope.helperData.hostname.push(uri_parts.hostname);
|
155
|
+
$scope.helperData.port.push(uri_parts.port);
|
156
|
+
$scope.helperData.pathname.push(uri_parts.pathname);
|
157
|
+
|
158
|
+
var status = replica.state;
|
159
|
+
|
160
|
+
if (!live_nodes[replica.node_name]) {
|
161
|
+
status = 'gone';
|
162
|
+
}
|
163
|
+
|
164
|
+
var node = {
|
165
|
+
name: uri,
|
166
|
+
data: {
|
167
|
+
type: 'node',
|
168
|
+
state: status,
|
169
|
+
leader: 'true' === replica.leader,
|
170
|
+
uri: uri_parts
|
171
|
+
}
|
172
|
+
};
|
173
|
+
nodes.push(node);
|
174
|
+
}
|
175
|
+
|
176
|
+
var shard = {
|
177
|
+
name: s,
|
178
|
+
data: {
|
179
|
+
type: 'shard'
|
180
|
+
},
|
181
|
+
children: nodes
|
182
|
+
};
|
183
|
+
shards.push(shard);
|
184
|
+
}
|
185
|
+
|
186
|
+
var collection = {
|
187
|
+
name: c,
|
188
|
+
data: {
|
189
|
+
type: 'collection'
|
190
|
+
},
|
191
|
+
children: shards
|
192
|
+
};
|
193
|
+
graph_data.children.push(collection);
|
194
|
+
}
|
195
|
+
|
196
|
+
$scope.helperData.protocol = $.unique($scope.helperData.protocol);
|
197
|
+
$scope.helperData.host = $.unique($scope.helperData.host);
|
198
|
+
$scope.helperData.hostname = $.unique($scope.helperData.hostname);
|
199
|
+
$scope.helperData.port = $.unique($scope.helperData.port);
|
200
|
+
$scope.helperData.pathname = $.unique($scope.helperData.pathname);
|
201
|
+
|
202
|
+
if (!isRadial && data.znode && data.znode.paging) {
|
203
|
+
$scope.showPaging = true;
|
204
|
+
|
205
|
+
var parr = data.znode.paging.split('|');
|
206
|
+
if (parr.length < 3) {
|
207
|
+
$scope.showPaging = false;
|
208
|
+
} else {
|
209
|
+
$scope.start = Math.max(parseInt(parr[0]), 0);
|
210
|
+
$scope.prevEnabled = ($scope.start > 0);
|
211
|
+
$scope.rows = parseInt(parr[1]);
|
212
|
+
$scope.total = parseInt(parr[2]);
|
213
|
+
|
214
|
+
if ($scope.rows == -1) {
|
215
|
+
$scope.showPaging = false;
|
216
|
+
} else {
|
217
|
+
var filterType = parr.length > 3 ? parr[3] : '';
|
218
|
+
|
219
|
+
if (filterType == '' || filterType == 'none') filterType = 'status';
|
220
|
+
|
221
|
+
+$('#cloudGraphPagingFilterType').val(filterType);
|
222
|
+
|
223
|
+
var filter = parr.length > 4 ? parr[4] : '';
|
224
|
+
var page = Math.floor($scope.start / $scope.rows) + 1;
|
225
|
+
var pages = Math.ceil($scope.total / $scope.rows);
|
226
|
+
$scope.last = Math.min($scope.start + $scope.rows, $scope.total);
|
227
|
+
$scope.nextEnabled = ($scope.last < $scope.total);
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
231
|
+
else {
|
232
|
+
$scope.showPaging = false;
|
233
|
+
}
|
234
|
+
$scope.graphData = graph_data;
|
235
|
+
$scope.leafCount = leaf_count;
|
236
|
+
$scope.isRadial = isRadial;
|
237
|
+
});
|
238
|
+
});
|
239
|
+
};
|
240
|
+
|
241
|
+
$scope.initGraph();
|
242
|
+
};
|
243
|
+
|
244
|
+
solrAdminApp.directive('graph', function() {
|
245
|
+
return {
|
246
|
+
restrict: 'EA',
|
247
|
+
scope: {
|
248
|
+
data: "=",
|
249
|
+
leafCount: "=",
|
250
|
+
helperData: "=",
|
251
|
+
isRadial: "="
|
252
|
+
},
|
253
|
+
link: function (scope, element, attrs) {
|
254
|
+
var helper_path_class = function (p) {
|
255
|
+
var classes = ['link'];
|
256
|
+
classes.push('lvl-' + p.target.depth);
|
257
|
+
|
258
|
+
if (p.target.data && p.target.data.leader) {
|
259
|
+
classes.push('leader');
|
260
|
+
}
|
261
|
+
|
262
|
+
if (p.target.data && p.target.data.state) {
|
263
|
+
classes.push(p.target.data.state);
|
264
|
+
}
|
265
|
+
|
266
|
+
return classes.join(' ');
|
267
|
+
};
|
268
|
+
|
269
|
+
var helper_node_class = function (d) {
|
270
|
+
var classes = ['node'];
|
271
|
+
classes.push('lvl-' + d.depth);
|
272
|
+
|
273
|
+
if (d.data && d.data.leader) {
|
274
|
+
classes.push('leader');
|
275
|
+
}
|
276
|
+
|
277
|
+
if (d.data && d.data.state) {
|
278
|
+
classes.push(d.data.state);
|
279
|
+
}
|
280
|
+
|
281
|
+
return classes.join(' ');
|
282
|
+
};
|
283
|
+
|
284
|
+
var helper_node_text = function (d) {
|
285
|
+
if (!d.data || !d.data.uri) {
|
286
|
+
return d.name;
|
287
|
+
}
|
288
|
+
|
289
|
+
var name = d.data.uri.hostname;
|
290
|
+
|
291
|
+
if (1 !== scope.helperData.protocol.length) {
|
292
|
+
name = d.data.uri.protocol + '//' + name;
|
293
|
+
}
|
294
|
+
|
295
|
+
if (1 !== scope.helperData.port.length) {
|
296
|
+
name += ':' + d.data.uri.port;
|
297
|
+
}
|
298
|
+
|
299
|
+
if (1 !== scope.helperData.pathname.length) {
|
300
|
+
name += d.data.uri.pathname;
|
301
|
+
}
|
302
|
+
|
303
|
+
return name;
|
304
|
+
};
|
305
|
+
|
306
|
+
scope.$watch("data", function(newValue, oldValue) {
|
307
|
+
if (newValue) {
|
308
|
+
if (scope.isRadial) {
|
309
|
+
radialGraph(element, scope.data, scope.leafCount);
|
310
|
+
} else {
|
311
|
+
flatGraph(element, scope.data, scope.leafCount);
|
312
|
+
}
|
313
|
+
}
|
314
|
+
});
|
315
|
+
|
316
|
+
var flatGraph = function(element, graphData, leafCount) {
|
317
|
+
var w = element.width(),
|
318
|
+
h = leafCount * 20;
|
319
|
+
|
320
|
+
var tree = d3.layout.tree().size([h, w - 400]);
|
321
|
+
|
322
|
+
var diagonal = d3.svg.diagonal().projection(function (d) {
|
323
|
+
return [d.y, d.x];
|
324
|
+
});
|
325
|
+
|
326
|
+
d3.select('#canvas', element).html('');
|
327
|
+
var vis = d3.select('#canvas', element).append('svg')
|
328
|
+
.attr('width', w)
|
329
|
+
.attr('height', h)
|
330
|
+
.append('g')
|
331
|
+
.attr('transform', 'translate(100, 0)');
|
332
|
+
|
333
|
+
var nodes = tree.nodes(graphData);
|
334
|
+
|
335
|
+
var link = vis.selectAll('path.link')
|
336
|
+
.data(tree.links(nodes))
|
337
|
+
.enter().append('path')
|
338
|
+
.attr('class', helper_path_class)
|
339
|
+
.attr('d', diagonal);
|
340
|
+
|
341
|
+
var node = vis.selectAll('g.node')
|
342
|
+
.data(nodes)
|
343
|
+
.enter().append('g')
|
344
|
+
.attr('class', helper_node_class)
|
345
|
+
.attr('transform', function (d) {
|
346
|
+
return 'translate(' + d.y + ',' + d.x + ')';
|
347
|
+
})
|
348
|
+
|
349
|
+
node.append('circle')
|
350
|
+
.attr('r', 4.5);
|
351
|
+
|
352
|
+
node.append('text')
|
353
|
+
.attr('dx', function (d) {
|
354
|
+
return 0 === d.depth ? -8 : 8;
|
355
|
+
})
|
356
|
+
.attr('dy', function (d) {
|
357
|
+
return 5;
|
358
|
+
})
|
359
|
+
.attr('text-anchor', function (d) {
|
360
|
+
return 0 === d.depth ? 'end' : 'start';
|
361
|
+
})
|
362
|
+
.attr('data-href', function (d) {
|
363
|
+
return d.name;
|
364
|
+
})
|
365
|
+
.text(helper_node_text)
|
366
|
+
.on('click', function(d,i) {
|
367
|
+
location.href = d.name;
|
368
|
+
});
|
369
|
+
};
|
370
|
+
|
371
|
+
var radialGraph = function(element, graphData, leafCount) {
|
372
|
+
var max_val = Math.min(element.width(), $('body').height())
|
373
|
+
var r = max_val / 2;
|
374
|
+
|
375
|
+
var cluster = d3.layout.cluster()
|
376
|
+
.size([360, r - 160]);
|
377
|
+
|
378
|
+
var diagonal = d3.svg.diagonal.radial()
|
379
|
+
.projection(function (d) {
|
380
|
+
return [d.y, d.x / 180 * Math.PI];
|
381
|
+
});
|
382
|
+
|
383
|
+
d3.select('#canvas', element).html('');
|
384
|
+
var vis = d3.select('#canvas').append('svg')
|
385
|
+
.attr('width', r * 2)
|
386
|
+
.attr('height', r * 2)
|
387
|
+
.append('g')
|
388
|
+
.attr('transform', 'translate(' + r + ',' + r + ')');
|
389
|
+
|
390
|
+
var nodes = cluster.nodes(graphData);
|
391
|
+
|
392
|
+
var link = vis.selectAll('path.link')
|
393
|
+
.data(cluster.links(nodes))
|
394
|
+
.enter().append('path')
|
395
|
+
.attr('class', helper_path_class)
|
396
|
+
.attr('d', diagonal);
|
397
|
+
|
398
|
+
var node = vis.selectAll('g.node')
|
399
|
+
.data(nodes)
|
400
|
+
.enter().append('g')
|
401
|
+
.attr('class', helper_node_class)
|
402
|
+
.attr('transform', function (d) {
|
403
|
+
return 'rotate(' + (d.x - 90) + ')translate(' + d.y + ')';
|
404
|
+
})
|
405
|
+
|
406
|
+
node.append('circle')
|
407
|
+
.attr('r', 4.5);
|
408
|
+
|
409
|
+
node.append('text')
|
410
|
+
.attr('dx', function (d) {
|
411
|
+
return d.x < 180 ? 8 : -8;
|
412
|
+
})
|
413
|
+
.attr('dy', '.31em')
|
414
|
+
.attr('text-anchor', function (d) {
|
415
|
+
return d.x < 180 ? 'start' : 'end';
|
416
|
+
})
|
417
|
+
.attr('transform', function (d) {
|
418
|
+
return d.x < 180 ? null : 'rotate(180)';
|
419
|
+
})
|
420
|
+
.attr('data-href', function (d) {
|
421
|
+
return d.name;
|
422
|
+
})
|
423
|
+
.text(helper_node_text)
|
424
|
+
.on('click', function(d,i) {
|
425
|
+
location.href = d.name;
|
426
|
+
});
|
427
|
+
}
|
428
|
+
}
|
429
|
+
};
|
430
|
+
})
|
431
|
+
|
432
|
+
/*
|
433
|
+
|
434
|
+
========================
|
435
|
+
var init_debug = function( cloud_element )
|
436
|
+
{
|
437
|
+
var debug_element = $( '#debug', cloud_element );
|
438
|
+
var debug_button = $( '#menu #cloud .dump a' );
|
439
|
+
|
440
|
+
var clipboard_element = $( '.clipboard', debug_element );
|
441
|
+
var clipboard_button = $( 'a', clipboard_element );
|
442
|
+
|
443
|
+
$( '.clipboard', debug_element )
|
444
|
+
.die( 'click' )
|
445
|
+
.live
|
446
|
+
(
|
447
|
+
'click',
|
448
|
+
function( event )
|
449
|
+
{
|
450
|
+
return false;
|
451
|
+
}
|
452
|
+
);
|
453
|
+
|
454
|
+
url : app.config.solr_path + '/zookeeper?wt=json&dump=true',
|
455
|
+
ZeroClipboard.setMoviePath( 'img/ZeroClipboard.swf' );
|
456
|
+
|
457
|
+
clipboard_client = new ZeroClipboard.Client();
|
458
|
+
|
459
|
+
clipboard_client.addEventListener
|
460
|
+
(
|
461
|
+
'load',
|
462
|
+
function( client )
|
463
|
+
{
|
464
|
+
}
|
465
|
+
);
|
466
|
+
|
467
|
+
clipboard_client.addEventListener
|
468
|
+
(
|
469
|
+
'complete',
|
470
|
+
function( client, text )
|
471
|
+
{
|
472
|
+
clipboard_element
|
473
|
+
.addClass( 'copied' );
|
474
|
+
|
475
|
+
clipboard_button
|
476
|
+
.data( 'text', clipboard_button.text() )
|
477
|
+
.text( clipboard_button.data( 'copied' ) );
|
478
|
+
}
|
479
|
+
);
|
480
|
+
},
|
481
|
+
success : function( response, text_status, xhr )
|
482
|
+
{
|
483
|
+
clipboard_client.glue
|
484
|
+
(
|
485
|
+
clipboard_element.get(0),
|
486
|
+
clipboard_button.get(0)
|
487
|
+
);
|
488
|
+
|
489
|
+
clipboard_client.setText( response.replace( /\\/g, '\\\\' ) );
|
490
|
+
|
491
|
+
$( '.debug', debug_element )
|
492
|
+
.removeClass( 'loader' )
|
493
|
+
.text( response );
|
494
|
+
},
|
495
|
+
error : function( xhr, text_status, error_thrown )
|
496
|
+
{
|
497
|
+
},
|
498
|
+
complete : function( xhr, text_status )
|
499
|
+
{
|
500
|
+
}
|
501
|
+
}
|
502
|
+
);
|
503
|
+
}
|
504
|
+
)
|
505
|
+
.die( 'hide' )
|
506
|
+
.live
|
507
|
+
(
|
508
|
+
'hide',
|
509
|
+
function( event )
|
510
|
+
{
|
511
|
+
$( '.debug', debug_element )
|
512
|
+
.empty();
|
513
|
+
|
514
|
+
clipboard_element
|
515
|
+
.removeClass( 'copied' );
|
516
|
+
|
517
|
+
clipboard_button
|
518
|
+
.data( 'copied', clipboard_button.text() )
|
519
|
+
.text( clipboard_button.data( 'text' ) );
|
520
|
+
|
521
|
+
clipboard_client.destroy();
|
522
|
+
|
523
|
+
debug_element.hide();
|
524
|
+
}
|
525
|
+
);
|
526
|
+
};
|
527
|
+
|
528
|
+
*/
|