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,527 +1,527 @@
|
|
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 timer_element = null;
|
19
|
-
var timer_timeout = null;
|
20
|
-
|
21
|
-
var core_basepath = null;
|
22
|
-
var navigation_element = null;
|
23
|
-
var replication_element = null;
|
24
|
-
|
25
|
-
var init_timer = function( next_tick )
|
26
|
-
{
|
27
|
-
if( timer_timeout )
|
28
|
-
{
|
29
|
-
window.clearTimeout( timer_timeout );
|
30
|
-
}
|
31
|
-
update_timer( next_tick );
|
32
|
-
}
|
33
|
-
|
34
|
-
var update_timer = function( next_tick )
|
35
|
-
{
|
36
|
-
if( 0 === next_tick )
|
37
|
-
{
|
38
|
-
replication_fetch_status();
|
39
|
-
return false;
|
40
|
-
}
|
41
|
-
|
42
|
-
$( 'p .tick', timer_element )
|
43
|
-
.text( app.convert_seconds_to_readable_time( next_tick ) );
|
44
|
-
|
45
|
-
timer_timeout = window.setTimeout
|
46
|
-
(
|
47
|
-
'update_timer( ' + --next_tick + ' )',
|
48
|
-
1000
|
49
|
-
);
|
50
|
-
}
|
51
|
-
|
52
|
-
var clear_timer = function()
|
53
|
-
{
|
54
|
-
if( timer_timeout )
|
55
|
-
{
|
56
|
-
window.clearTimeout( timer_timeout );
|
57
|
-
timer_element.hide();
|
58
|
-
}
|
59
|
-
}
|
60
|
-
|
61
|
-
var replication_fetch_status = function()
|
62
|
-
{
|
63
|
-
$.ajax
|
64
|
-
(
|
65
|
-
{
|
66
|
-
url : core_basepath + '/replication?command=details&wt=json',
|
67
|
-
dataType : 'json',
|
68
|
-
beforeSend : function( xhr, settings )
|
69
|
-
{
|
70
|
-
$( '.refresh-status span', navigation_element )
|
71
|
-
.addClass( 'loader' );
|
72
|
-
|
73
|
-
clear_timer();
|
74
|
-
},
|
75
|
-
success : function( response, text_status, xhr )
|
76
|
-
{
|
77
|
-
$( '.refresh-status span', navigation_element )
|
78
|
-
.removeClass( 'loader' );
|
79
|
-
|
80
|
-
var data = response.details;
|
81
|
-
var is_slave = 'true' === data.isSlave;
|
82
|
-
|
83
|
-
replication_element
|
84
|
-
.addClass( is_slave ? 'slave' : 'master' );
|
85
|
-
|
86
|
-
if( is_slave )
|
87
|
-
{
|
88
|
-
var error_element = $( '#error', replication_element );
|
89
|
-
|
90
|
-
if( data.slave.ERROR )
|
91
|
-
{
|
92
|
-
error_element
|
93
|
-
.html( data.slave.ERROR )
|
94
|
-
.show();
|
95
|
-
}
|
96
|
-
else
|
97
|
-
{
|
98
|
-
error_element
|
99
|
-
.hide()
|
100
|
-
.empty();
|
101
|
-
}
|
102
|
-
|
103
|
-
var progress_element = $( '#progress', replication_element );
|
104
|
-
|
105
|
-
var start_element = $( '#start', progress_element );
|
106
|
-
$( 'span', start_element )
|
107
|
-
.text( data.slave.replicationStartTime );
|
108
|
-
|
109
|
-
var eta_element = $( '#eta', progress_element );
|
110
|
-
$( 'span', eta_element )
|
111
|
-
.text( app.convert_seconds_to_readable_time( data.slave.timeRemaining ) );
|
112
|
-
|
113
|
-
var bar_element = $( '#bar', progress_element );
|
114
|
-
$( '.files span', bar_element )
|
115
|
-
.text( data.slave.numFilesToDownload );
|
116
|
-
$( '.size span', bar_element )
|
117
|
-
.text( data.slave.bytesToDownload );
|
118
|
-
|
119
|
-
var speed_element = $( '#speed', progress_element );
|
120
|
-
$( 'span', speed_element )
|
121
|
-
.text( data.slave.downloadSpeed );
|
122
|
-
|
123
|
-
var done_element = $( '#done', progress_element );
|
124
|
-
$( '.files span', done_element )
|
125
|
-
.text( data.slave.numFilesDownloaded );
|
126
|
-
$( '.size span', done_element )
|
127
|
-
.text( data.slave.bytesDownloaded );
|
128
|
-
$( '.percent span', done_element )
|
129
|
-
.text( parseInt(data.slave.totalPercent ) );
|
130
|
-
|
131
|
-
var percent = parseInt( data.slave.totalPercent );
|
132
|
-
if( 0 === percent )
|
133
|
-
{
|
134
|
-
done_element
|
135
|
-
.css( 'width', '1px' );
|
136
|
-
}
|
137
|
-
else
|
138
|
-
{
|
139
|
-
done_element
|
140
|
-
.css( 'width', percent + '%' );
|
141
|
-
}
|
142
|
-
|
143
|
-
var current_file_element = $( '#current-file', replication_element );
|
144
|
-
$( '.file', current_file_element )
|
145
|
-
.text( data.slave.currentFile );
|
146
|
-
$( '.done', current_file_element )
|
147
|
-
.text( data.slave.currentFileSizeDownloaded );
|
148
|
-
$( '.total', current_file_element )
|
149
|
-
.text( data.slave.currentFileSize );
|
150
|
-
$( '.percent', current_file_element )
|
151
|
-
.text( parseInt( data.slave.currentFileSizePercent ) );
|
152
|
-
|
153
|
-
if( !data.slave.indexReplicatedAtList )
|
154
|
-
{
|
155
|
-
data.slave.indexReplicatedAtList = [];
|
156
|
-
}
|
157
|
-
|
158
|
-
if( !data.slave.replicationFailedAtList )
|
159
|
-
{
|
160
|
-
data.slave.replicationFailedAtList = [];
|
161
|
-
}
|
162
|
-
|
163
|
-
var iterations_element = $( '#iterations', replication_element );
|
164
|
-
var iterations_list = $( '.iterations ul', iterations_element );
|
165
|
-
|
166
|
-
var iterations_data = [];
|
167
|
-
var iterations_obj = {};
|
168
|
-
|
169
|
-
for( var i in data.slave.indexReplicatedAtList )
|
170
|
-
{
|
171
|
-
var date = data.slave.indexReplicatedAtList[i];
|
172
|
-
if( !iterations_obj[date] )
|
173
|
-
{
|
174
|
-
iterations_obj[date] = true;
|
175
|
-
iterations_data.push( date );
|
176
|
-
}
|
177
|
-
}
|
178
|
-
|
179
|
-
for( var i in data.slave.replicationFailedAtList )
|
180
|
-
{
|
181
|
-
var date = data.slave.replicationFailedAtList[i];
|
182
|
-
if( !iterations_obj[date] )
|
183
|
-
{
|
184
|
-
iterations_obj[date] = true;
|
185
|
-
iterations_data.push( date );
|
186
|
-
}
|
187
|
-
}
|
188
|
-
|
189
|
-
iterations_data.sort().reverse();
|
190
|
-
|
191
|
-
if( 0 !== iterations_data.length )
|
192
|
-
{
|
193
|
-
var iterations = [];
|
194
|
-
for( var i = 0; i < iterations_data.length; i++ )
|
195
|
-
{
|
196
|
-
iterations.push( '<li data-date="' + iterations_data[i] + '">' + iterations_data[i] + '</li>' );
|
197
|
-
}
|
198
|
-
|
199
|
-
iterations_list
|
200
|
-
.html( iterations.join( "\n" ) )
|
201
|
-
.show();
|
202
|
-
|
203
|
-
$( data.slave.indexReplicatedAtList )
|
204
|
-
.each
|
205
|
-
(
|
206
|
-
function( key, value )
|
207
|
-
{
|
208
|
-
$( 'li[data-date="' + value + '"]', iterations_list )
|
209
|
-
.addClass( 'replicated' );
|
210
|
-
}
|
211
|
-
);
|
212
|
-
|
213
|
-
if( data.slave.indexReplicatedAt )
|
214
|
-
{
|
215
|
-
$( 'li[data-date="' + data.slave.indexReplicatedAt + '"]', iterations_list )
|
216
|
-
.addClass( 'latest' );
|
217
|
-
}
|
218
|
-
|
219
|
-
$( data.slave.replicationFailedAtList )
|
220
|
-
.each
|
221
|
-
(
|
222
|
-
function( key, value )
|
223
|
-
{
|
224
|
-
$( 'li[data-date="' + value + '"]', iterations_list )
|
225
|
-
.addClass( 'failed' );
|
226
|
-
}
|
227
|
-
);
|
228
|
-
|
229
|
-
if( data.slave.replicationFailedAt )
|
230
|
-
{
|
231
|
-
$( 'li[data-date="' + data.slave.replicationFailedAt + '"]', iterations_list )
|
232
|
-
.addClass( 'latest' );
|
233
|
-
}
|
234
|
-
|
235
|
-
if( 0 !== $( 'li:hidden', iterations_list ).size() )
|
236
|
-
{
|
237
|
-
$( 'a', iterations_element )
|
238
|
-
.show();
|
239
|
-
}
|
240
|
-
else
|
241
|
-
{
|
242
|
-
$( 'a', iterations_element )
|
243
|
-
.hide();
|
244
|
-
}
|
245
|
-
}
|
246
|
-
}
|
247
|
-
|
248
|
-
var details_element = $( '#details', replication_element );
|
249
|
-
var current_type_element = $( ( is_slave ? '.slave' : '.masterSearch' ), details_element );
|
250
|
-
var master_data = is_slave ? data.slave.masterDetails : data;
|
251
|
-
|
252
|
-
// the currently searchable commit regardless of type
|
253
|
-
$( '.version div', current_type_element )
|
254
|
-
.html( data.indexVersion );
|
255
|
-
$( '.generation div', current_type_element )
|
256
|
-
.html( data.generation );
|
257
|
-
$( '.size div', current_type_element )
|
258
|
-
.html( data.indexSize );
|
259
|
-
|
260
|
-
// what's replicable on the master
|
261
|
-
var master_element = $( '.master', details_element );
|
262
|
-
$( '.version div', master_element )
|
263
|
-
.html( master_data.master.replicableVersion || '-' );
|
264
|
-
$( '.generation div', master_element )
|
265
|
-
.html( master_data.master.replicableGeneration || '-' );
|
266
|
-
$( '.size div', master_element )
|
267
|
-
.html( "-" );
|
268
|
-
|
269
|
-
if( is_slave )
|
270
|
-
{
|
271
|
-
// what's searchable on the master
|
272
|
-
var master_searchable = $( '.masterSearch', details_element );
|
273
|
-
$( '.version div', master_searchable )
|
274
|
-
.html( master_data.indexVersion );
|
275
|
-
$( '.generation div', master_searchable )
|
276
|
-
.html( master_data.generation );
|
277
|
-
$( '.size div', master_searchable )
|
278
|
-
.html( master_data.indexSize );
|
279
|
-
|
280
|
-
// warnings if slave version|gen doesn't match what's replicable
|
281
|
-
if( data.indexVersion !== master_data.master.replicableVersion )
|
282
|
-
{
|
283
|
-
$( '.version', details_element )
|
284
|
-
.addClass( 'diff' );
|
285
|
-
}
|
286
|
-
else
|
287
|
-
{
|
288
|
-
$( '.version', details_element )
|
289
|
-
.removeClass( 'diff' );
|
290
|
-
}
|
291
|
-
|
292
|
-
if( data.generation !== master_data.master.replicableGeneration )
|
293
|
-
{
|
294
|
-
$( '.generation', details_element )
|
295
|
-
.addClass( 'diff' );
|
296
|
-
}
|
297
|
-
else
|
298
|
-
{
|
299
|
-
$( '.generation', details_element )
|
300
|
-
.removeClass( 'diff' );
|
301
|
-
}
|
302
|
-
}
|
303
|
-
|
304
|
-
if( is_slave )
|
305
|
-
{
|
306
|
-
var settings_element = $( '#settings', replication_element );
|
307
|
-
|
308
|
-
if( data.slave.masterUrl )
|
309
|
-
{
|
310
|
-
$( '.masterUrl dd', settings_element )
|
311
|
-
.html( response.details.slave.masterUrl )
|
312
|
-
.parents( 'li' ).show();
|
313
|
-
}
|
314
|
-
|
315
|
-
var polling_content = ' ';
|
316
|
-
var polling_ico = 'ico-1';
|
317
|
-
|
318
|
-
if( 'true' === data.slave.isPollingDisabled )
|
319
|
-
{
|
320
|
-
polling_ico = 'ico-0';
|
321
|
-
|
322
|
-
$( '.disable-polling', navigation_element ).hide();
|
323
|
-
$( '.enable-polling', navigation_element ).show();
|
324
|
-
}
|
325
|
-
else
|
326
|
-
{
|
327
|
-
$( '.disable-polling', navigation_element ).show();
|
328
|
-
$( '.enable-polling', navigation_element ).hide();
|
329
|
-
|
330
|
-
if( data.slave.pollInterval )
|
331
|
-
{
|
332
|
-
polling_content = '(interval: ' + data.slave.pollInterval + ')';
|
333
|
-
}
|
334
|
-
}
|
335
|
-
|
336
|
-
$( '.isPollingDisabled dd', settings_element )
|
337
|
-
.removeClass( 'ico-0' )
|
338
|
-
.removeClass( 'ico-1' )
|
339
|
-
.addClass( polling_ico )
|
340
|
-
.html( polling_content )
|
341
|
-
.parents( 'li' ).show();
|
342
|
-
|
343
|
-
if( 'true' === data.slave.isReplicating )
|
344
|
-
{
|
345
|
-
replication_element
|
346
|
-
.addClass( 'replicating' );
|
347
|
-
|
348
|
-
$( '.replicate-now', navigation_element ).hide();
|
349
|
-
$( '.abort-replication', navigation_element ).show();
|
350
|
-
|
351
|
-
window.setTimeout( replication_fetch_status, 1000 );
|
352
|
-
}
|
353
|
-
else
|
354
|
-
{
|
355
|
-
replication_element
|
356
|
-
.removeClass( 'replicating' );
|
357
|
-
|
358
|
-
$( '.replicate-now', navigation_element ).show();
|
359
|
-
$( '.abort-replication', navigation_element ).hide();
|
360
|
-
|
361
|
-
|
362
|
-
if( 'false' === data.slave.isPollingDisabled && data.slave.pollInterval )
|
363
|
-
{
|
364
|
-
timer_element = $( '.timer', navigation_element );
|
365
|
-
approx_element = $( '.approx', timer_element );
|
366
|
-
|
367
|
-
var next_tick = app.convert_duration_to_seconds( data.slave.pollInterval );
|
368
|
-
approx_element.show();
|
369
|
-
|
370
|
-
if( data.slave.nextExecutionAt )
|
371
|
-
{
|
372
|
-
var nextExecutionAt = new SolrDate( data.slave.nextExecutionAt );
|
373
|
-
var currentDate = new SolrDate( data.slave.currentDate );
|
374
|
-
|
375
|
-
if( nextExecutionAt.getTime() > currentDate.getTime() )
|
376
|
-
{
|
377
|
-
next_tick = ( nextExecutionAt.getTime() - currentDate.getTime() ) / 1000;
|
378
|
-
approx_element.hide();
|
379
|
-
|
380
|
-
$( 'small', timer_element )
|
381
|
-
.text( data.slave.nextExecutionAt )
|
382
|
-
.show();
|
383
|
-
}
|
384
|
-
}
|
385
|
-
|
386
|
-
init_timer( next_tick );
|
387
|
-
|
388
|
-
timer_element
|
389
|
-
.show();
|
390
|
-
}
|
391
|
-
}
|
392
|
-
}
|
393
|
-
|
394
|
-
var master_settings_element = $( '#master-settings', replication_element );
|
395
|
-
var master_data = is_slave ? data.slave.masterDetails.master : data.master;
|
396
|
-
|
397
|
-
var replication_icon = 'ico-0';
|
398
|
-
if( 'true' === master_data.replicationEnabled )
|
399
|
-
{
|
400
|
-
replication_icon = 'ico-1';
|
401
|
-
|
402
|
-
$( '.disable-replication', navigation_element ).show();
|
403
|
-
$( '.enable-replication', navigation_element ).hide();
|
404
|
-
}
|
405
|
-
else
|
406
|
-
{
|
407
|
-
$( '.disable-replication', navigation_element ).hide();
|
408
|
-
$( '.enable-replication', navigation_element ).show();
|
409
|
-
}
|
410
|
-
|
411
|
-
$( '.replicationEnabled dd', master_settings_element )
|
412
|
-
.removeClass( 'ico-0' )
|
413
|
-
.removeClass( 'ico-1' )
|
414
|
-
.addClass( replication_icon )
|
415
|
-
.parents( 'li' ).show();
|
416
|
-
|
417
|
-
$( '.replicateAfter dd', master_settings_element )
|
418
|
-
.html( master_data.replicateAfter.join( ', ' ) )
|
419
|
-
.parents( 'li' ).show();
|
420
|
-
|
421
|
-
if( master_data.confFiles )
|
422
|
-
{
|
423
|
-
var conf_files = [];
|
424
|
-
var conf_data = master_data.confFiles.split( ',' );
|
425
|
-
|
426
|
-
for( var i = 0; i < conf_data.length; i++ )
|
427
|
-
{
|
428
|
-
var item = conf_data[i];
|
429
|
-
|
430
|
-
if( - 1 !== item.indexOf( ':' ) )
|
431
|
-
{
|
432
|
-
info = item.split( ':' );
|
433
|
-
item = '<abbr title="' + info[0] + ' » ' + info[1] + '">' + ( is_slave ? info[1] : info[0] ) + '</abbr>';
|
434
|
-
}
|
435
|
-
|
436
|
-
conf_files.push( item );
|
437
|
-
}
|
438
|
-
|
439
|
-
$( '.confFiles dd', master_settings_element )
|
440
|
-
.html( conf_files.join( ', ' ) )
|
441
|
-
.parents( 'li' ).show();
|
442
|
-
}
|
443
|
-
|
444
|
-
|
445
|
-
$( '.block', replication_element ).last()
|
446
|
-
.addClass( 'last' );
|
447
|
-
},
|
448
|
-
error : function( xhr, text_status, error_thrown )
|
449
|
-
{
|
450
|
-
$( '#content' )
|
451
|
-
.html( 'sorry, no replication-handler defined!' );
|
452
|
-
},
|
453
|
-
complete : function( xhr, text_status )
|
454
|
-
{
|
455
|
-
}
|
456
|
-
}
|
457
|
-
);
|
458
|
-
}
|
459
|
-
|
460
|
-
// #/:core/replication
|
461
|
-
sammy.get
|
462
|
-
(
|
463
|
-
new RegExp( app.core_regex_base + '\\/(replication)$' ),
|
464
|
-
function( context )
|
465
|
-
{
|
466
|
-
core_basepath = this.active_core.attr( 'data-basepath' );
|
467
|
-
var content_element = $( '#content' );
|
468
|
-
|
469
|
-
$.get
|
470
|
-
(
|
471
|
-
'tpl/replication.html',
|
472
|
-
function( template )
|
473
|
-
{
|
474
|
-
content_element
|
475
|
-
.html( template );
|
476
|
-
|
477
|
-
replication_element = $( '#replication', content_element );
|
478
|
-
navigation_element = $( '#navigation', replication_element );
|
479
|
-
|
480
|
-
replication_fetch_status();
|
481
|
-
|
482
|
-
$( '#iterations a', content_element )
|
483
|
-
.die( 'click' )
|
484
|
-
.live
|
485
|
-
(
|
486
|
-
'click',
|
487
|
-
function( event )
|
488
|
-
{
|
489
|
-
$( this ).parents( '.iterations' )
|
490
|
-
.toggleClass( 'expanded' );
|
491
|
-
|
492
|
-
return false;
|
493
|
-
}
|
494
|
-
);
|
495
|
-
|
496
|
-
$( 'button', navigation_element )
|
497
|
-
.die( 'click' )
|
498
|
-
.live
|
499
|
-
(
|
500
|
-
'click',
|
501
|
-
function( event )
|
502
|
-
{
|
503
|
-
var button = $( this );
|
504
|
-
var command = button.data( 'command' );
|
505
|
-
|
506
|
-
if( button.hasClass( 'refresh-status' ) && !button.hasClass( 'loader' ) )
|
507
|
-
{
|
508
|
-
replication_fetch_status();
|
509
|
-
}
|
510
|
-
else if( command )
|
511
|
-
{
|
512
|
-
$.get
|
513
|
-
(
|
514
|
-
core_basepath + '/replication?command=' + command + '&wt=json',
|
515
|
-
function()
|
516
|
-
{
|
517
|
-
replication_fetch_status();
|
518
|
-
}
|
519
|
-
);
|
520
|
-
}
|
521
|
-
return false;
|
522
|
-
}
|
523
|
-
);
|
524
|
-
}
|
525
|
-
);
|
526
|
-
}
|
527
|
-
);
|
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 timer_element = null;
|
19
|
+
var timer_timeout = null;
|
20
|
+
|
21
|
+
var core_basepath = null;
|
22
|
+
var navigation_element = null;
|
23
|
+
var replication_element = null;
|
24
|
+
|
25
|
+
var init_timer = function( next_tick )
|
26
|
+
{
|
27
|
+
if( timer_timeout )
|
28
|
+
{
|
29
|
+
window.clearTimeout( timer_timeout );
|
30
|
+
}
|
31
|
+
update_timer( next_tick );
|
32
|
+
}
|
33
|
+
|
34
|
+
var update_timer = function( next_tick )
|
35
|
+
{
|
36
|
+
if( 0 === next_tick )
|
37
|
+
{
|
38
|
+
replication_fetch_status();
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
|
42
|
+
$( 'p .tick', timer_element )
|
43
|
+
.text( app.convert_seconds_to_readable_time( next_tick ) );
|
44
|
+
|
45
|
+
timer_timeout = window.setTimeout
|
46
|
+
(
|
47
|
+
'update_timer( ' + --next_tick + ' )',
|
48
|
+
1000
|
49
|
+
);
|
50
|
+
}
|
51
|
+
|
52
|
+
var clear_timer = function()
|
53
|
+
{
|
54
|
+
if( timer_timeout )
|
55
|
+
{
|
56
|
+
window.clearTimeout( timer_timeout );
|
57
|
+
timer_element.hide();
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
var replication_fetch_status = function()
|
62
|
+
{
|
63
|
+
$.ajax
|
64
|
+
(
|
65
|
+
{
|
66
|
+
url : core_basepath + '/replication?command=details&wt=json',
|
67
|
+
dataType : 'json',
|
68
|
+
beforeSend : function( xhr, settings )
|
69
|
+
{
|
70
|
+
$( '.refresh-status span', navigation_element )
|
71
|
+
.addClass( 'loader' );
|
72
|
+
|
73
|
+
clear_timer();
|
74
|
+
},
|
75
|
+
success : function( response, text_status, xhr )
|
76
|
+
{
|
77
|
+
$( '.refresh-status span', navigation_element )
|
78
|
+
.removeClass( 'loader' );
|
79
|
+
|
80
|
+
var data = response.details;
|
81
|
+
var is_slave = 'true' === data.isSlave;
|
82
|
+
|
83
|
+
replication_element
|
84
|
+
.addClass( is_slave ? 'slave' : 'master' );
|
85
|
+
|
86
|
+
if( is_slave )
|
87
|
+
{
|
88
|
+
var error_element = $( '#error', replication_element );
|
89
|
+
|
90
|
+
if( data.slave.ERROR )
|
91
|
+
{
|
92
|
+
error_element
|
93
|
+
.html( data.slave.ERROR )
|
94
|
+
.show();
|
95
|
+
}
|
96
|
+
else
|
97
|
+
{
|
98
|
+
error_element
|
99
|
+
.hide()
|
100
|
+
.empty();
|
101
|
+
}
|
102
|
+
|
103
|
+
var progress_element = $( '#progress', replication_element );
|
104
|
+
|
105
|
+
var start_element = $( '#start', progress_element );
|
106
|
+
$( 'span', start_element )
|
107
|
+
.text( data.slave.replicationStartTime );
|
108
|
+
|
109
|
+
var eta_element = $( '#eta', progress_element );
|
110
|
+
$( 'span', eta_element )
|
111
|
+
.text( app.convert_seconds_to_readable_time( data.slave.timeRemaining ) );
|
112
|
+
|
113
|
+
var bar_element = $( '#bar', progress_element );
|
114
|
+
$( '.files span', bar_element )
|
115
|
+
.text( data.slave.numFilesToDownload );
|
116
|
+
$( '.size span', bar_element )
|
117
|
+
.text( data.slave.bytesToDownload );
|
118
|
+
|
119
|
+
var speed_element = $( '#speed', progress_element );
|
120
|
+
$( 'span', speed_element )
|
121
|
+
.text( data.slave.downloadSpeed );
|
122
|
+
|
123
|
+
var done_element = $( '#done', progress_element );
|
124
|
+
$( '.files span', done_element )
|
125
|
+
.text( data.slave.numFilesDownloaded );
|
126
|
+
$( '.size span', done_element )
|
127
|
+
.text( data.slave.bytesDownloaded );
|
128
|
+
$( '.percent span', done_element )
|
129
|
+
.text( parseInt(data.slave.totalPercent ) );
|
130
|
+
|
131
|
+
var percent = parseInt( data.slave.totalPercent );
|
132
|
+
if( 0 === percent )
|
133
|
+
{
|
134
|
+
done_element
|
135
|
+
.css( 'width', '1px' );
|
136
|
+
}
|
137
|
+
else
|
138
|
+
{
|
139
|
+
done_element
|
140
|
+
.css( 'width', percent + '%' );
|
141
|
+
}
|
142
|
+
|
143
|
+
var current_file_element = $( '#current-file', replication_element );
|
144
|
+
$( '.file', current_file_element )
|
145
|
+
.text( data.slave.currentFile );
|
146
|
+
$( '.done', current_file_element )
|
147
|
+
.text( data.slave.currentFileSizeDownloaded );
|
148
|
+
$( '.total', current_file_element )
|
149
|
+
.text( data.slave.currentFileSize );
|
150
|
+
$( '.percent', current_file_element )
|
151
|
+
.text( parseInt( data.slave.currentFileSizePercent ) );
|
152
|
+
|
153
|
+
if( !data.slave.indexReplicatedAtList )
|
154
|
+
{
|
155
|
+
data.slave.indexReplicatedAtList = [];
|
156
|
+
}
|
157
|
+
|
158
|
+
if( !data.slave.replicationFailedAtList )
|
159
|
+
{
|
160
|
+
data.slave.replicationFailedAtList = [];
|
161
|
+
}
|
162
|
+
|
163
|
+
var iterations_element = $( '#iterations', replication_element );
|
164
|
+
var iterations_list = $( '.iterations ul', iterations_element );
|
165
|
+
|
166
|
+
var iterations_data = [];
|
167
|
+
var iterations_obj = {};
|
168
|
+
|
169
|
+
for( var i in data.slave.indexReplicatedAtList )
|
170
|
+
{
|
171
|
+
var date = data.slave.indexReplicatedAtList[i];
|
172
|
+
if( !iterations_obj[date] )
|
173
|
+
{
|
174
|
+
iterations_obj[date] = true;
|
175
|
+
iterations_data.push( date );
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
for( var i in data.slave.replicationFailedAtList )
|
180
|
+
{
|
181
|
+
var date = data.slave.replicationFailedAtList[i];
|
182
|
+
if( !iterations_obj[date] )
|
183
|
+
{
|
184
|
+
iterations_obj[date] = true;
|
185
|
+
iterations_data.push( date );
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
iterations_data.sort().reverse();
|
190
|
+
|
191
|
+
if( 0 !== iterations_data.length )
|
192
|
+
{
|
193
|
+
var iterations = [];
|
194
|
+
for( var i = 0; i < iterations_data.length; i++ )
|
195
|
+
{
|
196
|
+
iterations.push( '<li data-date="' + iterations_data[i] + '">' + iterations_data[i] + '</li>' );
|
197
|
+
}
|
198
|
+
|
199
|
+
iterations_list
|
200
|
+
.html( iterations.join( "\n" ) )
|
201
|
+
.show();
|
202
|
+
|
203
|
+
$( data.slave.indexReplicatedAtList )
|
204
|
+
.each
|
205
|
+
(
|
206
|
+
function( key, value )
|
207
|
+
{
|
208
|
+
$( 'li[data-date="' + value + '"]', iterations_list )
|
209
|
+
.addClass( 'replicated' );
|
210
|
+
}
|
211
|
+
);
|
212
|
+
|
213
|
+
if( data.slave.indexReplicatedAt )
|
214
|
+
{
|
215
|
+
$( 'li[data-date="' + data.slave.indexReplicatedAt + '"]', iterations_list )
|
216
|
+
.addClass( 'latest' );
|
217
|
+
}
|
218
|
+
|
219
|
+
$( data.slave.replicationFailedAtList )
|
220
|
+
.each
|
221
|
+
(
|
222
|
+
function( key, value )
|
223
|
+
{
|
224
|
+
$( 'li[data-date="' + value + '"]', iterations_list )
|
225
|
+
.addClass( 'failed' );
|
226
|
+
}
|
227
|
+
);
|
228
|
+
|
229
|
+
if( data.slave.replicationFailedAt )
|
230
|
+
{
|
231
|
+
$( 'li[data-date="' + data.slave.replicationFailedAt + '"]', iterations_list )
|
232
|
+
.addClass( 'latest' );
|
233
|
+
}
|
234
|
+
|
235
|
+
if( 0 !== $( 'li:hidden', iterations_list ).size() )
|
236
|
+
{
|
237
|
+
$( 'a', iterations_element )
|
238
|
+
.show();
|
239
|
+
}
|
240
|
+
else
|
241
|
+
{
|
242
|
+
$( 'a', iterations_element )
|
243
|
+
.hide();
|
244
|
+
}
|
245
|
+
}
|
246
|
+
}
|
247
|
+
|
248
|
+
var details_element = $( '#details', replication_element );
|
249
|
+
var current_type_element = $( ( is_slave ? '.slave' : '.masterSearch' ), details_element );
|
250
|
+
var master_data = is_slave ? data.slave.masterDetails : data;
|
251
|
+
|
252
|
+
// the currently searchable commit regardless of type
|
253
|
+
$( '.version div', current_type_element )
|
254
|
+
.html( data.indexVersion );
|
255
|
+
$( '.generation div', current_type_element )
|
256
|
+
.html( data.generation );
|
257
|
+
$( '.size div', current_type_element )
|
258
|
+
.html( data.indexSize );
|
259
|
+
|
260
|
+
// what's replicable on the master
|
261
|
+
var master_element = $( '.master', details_element );
|
262
|
+
$( '.version div', master_element )
|
263
|
+
.html( master_data.master.replicableVersion || '-' );
|
264
|
+
$( '.generation div', master_element )
|
265
|
+
.html( master_data.master.replicableGeneration || '-' );
|
266
|
+
$( '.size div', master_element )
|
267
|
+
.html( "-" );
|
268
|
+
|
269
|
+
if( is_slave )
|
270
|
+
{
|
271
|
+
// what's searchable on the master
|
272
|
+
var master_searchable = $( '.masterSearch', details_element );
|
273
|
+
$( '.version div', master_searchable )
|
274
|
+
.html( master_data.indexVersion );
|
275
|
+
$( '.generation div', master_searchable )
|
276
|
+
.html( master_data.generation );
|
277
|
+
$( '.size div', master_searchable )
|
278
|
+
.html( master_data.indexSize );
|
279
|
+
|
280
|
+
// warnings if slave version|gen doesn't match what's replicable
|
281
|
+
if( data.indexVersion !== master_data.master.replicableVersion )
|
282
|
+
{
|
283
|
+
$( '.version', details_element )
|
284
|
+
.addClass( 'diff' );
|
285
|
+
}
|
286
|
+
else
|
287
|
+
{
|
288
|
+
$( '.version', details_element )
|
289
|
+
.removeClass( 'diff' );
|
290
|
+
}
|
291
|
+
|
292
|
+
if( data.generation !== master_data.master.replicableGeneration )
|
293
|
+
{
|
294
|
+
$( '.generation', details_element )
|
295
|
+
.addClass( 'diff' );
|
296
|
+
}
|
297
|
+
else
|
298
|
+
{
|
299
|
+
$( '.generation', details_element )
|
300
|
+
.removeClass( 'diff' );
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
if( is_slave )
|
305
|
+
{
|
306
|
+
var settings_element = $( '#settings', replication_element );
|
307
|
+
|
308
|
+
if( data.slave.masterUrl )
|
309
|
+
{
|
310
|
+
$( '.masterUrl dd', settings_element )
|
311
|
+
.html( response.details.slave.masterUrl )
|
312
|
+
.parents( 'li' ).show();
|
313
|
+
}
|
314
|
+
|
315
|
+
var polling_content = ' ';
|
316
|
+
var polling_ico = 'ico-1';
|
317
|
+
|
318
|
+
if( 'true' === data.slave.isPollingDisabled )
|
319
|
+
{
|
320
|
+
polling_ico = 'ico-0';
|
321
|
+
|
322
|
+
$( '.disable-polling', navigation_element ).hide();
|
323
|
+
$( '.enable-polling', navigation_element ).show();
|
324
|
+
}
|
325
|
+
else
|
326
|
+
{
|
327
|
+
$( '.disable-polling', navigation_element ).show();
|
328
|
+
$( '.enable-polling', navigation_element ).hide();
|
329
|
+
|
330
|
+
if( data.slave.pollInterval )
|
331
|
+
{
|
332
|
+
polling_content = '(interval: ' + data.slave.pollInterval + ')';
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
$( '.isPollingDisabled dd', settings_element )
|
337
|
+
.removeClass( 'ico-0' )
|
338
|
+
.removeClass( 'ico-1' )
|
339
|
+
.addClass( polling_ico )
|
340
|
+
.html( polling_content )
|
341
|
+
.parents( 'li' ).show();
|
342
|
+
|
343
|
+
if( 'true' === data.slave.isReplicating )
|
344
|
+
{
|
345
|
+
replication_element
|
346
|
+
.addClass( 'replicating' );
|
347
|
+
|
348
|
+
$( '.replicate-now', navigation_element ).hide();
|
349
|
+
$( '.abort-replication', navigation_element ).show();
|
350
|
+
|
351
|
+
window.setTimeout( replication_fetch_status, 1000 );
|
352
|
+
}
|
353
|
+
else
|
354
|
+
{
|
355
|
+
replication_element
|
356
|
+
.removeClass( 'replicating' );
|
357
|
+
|
358
|
+
$( '.replicate-now', navigation_element ).show();
|
359
|
+
$( '.abort-replication', navigation_element ).hide();
|
360
|
+
|
361
|
+
|
362
|
+
if( 'false' === data.slave.isPollingDisabled && data.slave.pollInterval )
|
363
|
+
{
|
364
|
+
timer_element = $( '.timer', navigation_element );
|
365
|
+
approx_element = $( '.approx', timer_element );
|
366
|
+
|
367
|
+
var next_tick = app.convert_duration_to_seconds( data.slave.pollInterval );
|
368
|
+
approx_element.show();
|
369
|
+
|
370
|
+
if( data.slave.nextExecutionAt )
|
371
|
+
{
|
372
|
+
var nextExecutionAt = new SolrDate( data.slave.nextExecutionAt );
|
373
|
+
var currentDate = new SolrDate( data.slave.currentDate );
|
374
|
+
|
375
|
+
if( nextExecutionAt.getTime() > currentDate.getTime() )
|
376
|
+
{
|
377
|
+
next_tick = ( nextExecutionAt.getTime() - currentDate.getTime() ) / 1000;
|
378
|
+
approx_element.hide();
|
379
|
+
|
380
|
+
$( 'small', timer_element )
|
381
|
+
.text( data.slave.nextExecutionAt )
|
382
|
+
.show();
|
383
|
+
}
|
384
|
+
}
|
385
|
+
|
386
|
+
init_timer( next_tick );
|
387
|
+
|
388
|
+
timer_element
|
389
|
+
.show();
|
390
|
+
}
|
391
|
+
}
|
392
|
+
}
|
393
|
+
|
394
|
+
var master_settings_element = $( '#master-settings', replication_element );
|
395
|
+
var master_data = is_slave ? data.slave.masterDetails.master : data.master;
|
396
|
+
|
397
|
+
var replication_icon = 'ico-0';
|
398
|
+
if( 'true' === master_data.replicationEnabled )
|
399
|
+
{
|
400
|
+
replication_icon = 'ico-1';
|
401
|
+
|
402
|
+
$( '.disable-replication', navigation_element ).show();
|
403
|
+
$( '.enable-replication', navigation_element ).hide();
|
404
|
+
}
|
405
|
+
else
|
406
|
+
{
|
407
|
+
$( '.disable-replication', navigation_element ).hide();
|
408
|
+
$( '.enable-replication', navigation_element ).show();
|
409
|
+
}
|
410
|
+
|
411
|
+
$( '.replicationEnabled dd', master_settings_element )
|
412
|
+
.removeClass( 'ico-0' )
|
413
|
+
.removeClass( 'ico-1' )
|
414
|
+
.addClass( replication_icon )
|
415
|
+
.parents( 'li' ).show();
|
416
|
+
|
417
|
+
$( '.replicateAfter dd', master_settings_element )
|
418
|
+
.html( master_data.replicateAfter.join( ', ' ) )
|
419
|
+
.parents( 'li' ).show();
|
420
|
+
|
421
|
+
if( master_data.confFiles )
|
422
|
+
{
|
423
|
+
var conf_files = [];
|
424
|
+
var conf_data = master_data.confFiles.split( ',' );
|
425
|
+
|
426
|
+
for( var i = 0; i < conf_data.length; i++ )
|
427
|
+
{
|
428
|
+
var item = conf_data[i];
|
429
|
+
|
430
|
+
if( - 1 !== item.indexOf( ':' ) )
|
431
|
+
{
|
432
|
+
info = item.split( ':' );
|
433
|
+
item = '<abbr title="' + info[0] + ' » ' + info[1] + '">' + ( is_slave ? info[1] : info[0] ) + '</abbr>';
|
434
|
+
}
|
435
|
+
|
436
|
+
conf_files.push( item );
|
437
|
+
}
|
438
|
+
|
439
|
+
$( '.confFiles dd', master_settings_element )
|
440
|
+
.html( conf_files.join( ', ' ) )
|
441
|
+
.parents( 'li' ).show();
|
442
|
+
}
|
443
|
+
|
444
|
+
|
445
|
+
$( '.block', replication_element ).last()
|
446
|
+
.addClass( 'last' );
|
447
|
+
},
|
448
|
+
error : function( xhr, text_status, error_thrown )
|
449
|
+
{
|
450
|
+
$( '#content' )
|
451
|
+
.html( 'sorry, no replication-handler defined!' );
|
452
|
+
},
|
453
|
+
complete : function( xhr, text_status )
|
454
|
+
{
|
455
|
+
}
|
456
|
+
}
|
457
|
+
);
|
458
|
+
}
|
459
|
+
|
460
|
+
// #/:core/replication
|
461
|
+
sammy.get
|
462
|
+
(
|
463
|
+
new RegExp( app.core_regex_base + '\\/(replication)$' ),
|
464
|
+
function( context )
|
465
|
+
{
|
466
|
+
core_basepath = this.active_core.attr( 'data-basepath' );
|
467
|
+
var content_element = $( '#content' );
|
468
|
+
|
469
|
+
$.get
|
470
|
+
(
|
471
|
+
'tpl/replication.html',
|
472
|
+
function( template )
|
473
|
+
{
|
474
|
+
content_element
|
475
|
+
.html( template );
|
476
|
+
|
477
|
+
replication_element = $( '#replication', content_element );
|
478
|
+
navigation_element = $( '#navigation', replication_element );
|
479
|
+
|
480
|
+
replication_fetch_status();
|
481
|
+
|
482
|
+
$( '#iterations a', content_element )
|
483
|
+
.die( 'click' )
|
484
|
+
.live
|
485
|
+
(
|
486
|
+
'click',
|
487
|
+
function( event )
|
488
|
+
{
|
489
|
+
$( this ).parents( '.iterations' )
|
490
|
+
.toggleClass( 'expanded' );
|
491
|
+
|
492
|
+
return false;
|
493
|
+
}
|
494
|
+
);
|
495
|
+
|
496
|
+
$( 'button', navigation_element )
|
497
|
+
.die( 'click' )
|
498
|
+
.live
|
499
|
+
(
|
500
|
+
'click',
|
501
|
+
function( event )
|
502
|
+
{
|
503
|
+
var button = $( this );
|
504
|
+
var command = button.data( 'command' );
|
505
|
+
|
506
|
+
if( button.hasClass( 'refresh-status' ) && !button.hasClass( 'loader' ) )
|
507
|
+
{
|
508
|
+
replication_fetch_status();
|
509
|
+
}
|
510
|
+
else if( command )
|
511
|
+
{
|
512
|
+
$.get
|
513
|
+
(
|
514
|
+
core_basepath + '/replication?command=' + command + '&wt=json',
|
515
|
+
function()
|
516
|
+
{
|
517
|
+
replication_fetch_status();
|
518
|
+
}
|
519
|
+
);
|
520
|
+
}
|
521
|
+
return false;
|
522
|
+
}
|
523
|
+
);
|
524
|
+
}
|
525
|
+
);
|
526
|
+
}
|
527
|
+
);
|