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,719 +1,719 @@
|
|
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
|
-
sammy.bind
|
19
|
-
(
|
20
|
-
'cores_load_data',
|
21
|
-
function( event, params )
|
22
|
-
{
|
23
|
-
$.ajax
|
24
|
-
(
|
25
|
-
{
|
26
|
-
url : app.config.solr_path + app.config.core_admin_path + '?wt=json',
|
27
|
-
dataType : 'json',
|
28
|
-
beforeSend : function( xhr, settings )
|
29
|
-
{
|
30
|
-
},
|
31
|
-
success : function( response, text_status, xhr )
|
32
|
-
{
|
33
|
-
if( params.only_failures )
|
34
|
-
{
|
35
|
-
app.check_for_init_failures( response );
|
36
|
-
return true;
|
37
|
-
}
|
38
|
-
|
39
|
-
var has_cores = false;
|
40
|
-
for( core in response.status )
|
41
|
-
{
|
42
|
-
has_cores = true; break;
|
43
|
-
}
|
44
|
-
|
45
|
-
app.set_cores_data( response );
|
46
|
-
|
47
|
-
if( has_cores )
|
48
|
-
{
|
49
|
-
params.success( app.cores_data );
|
50
|
-
}
|
51
|
-
else
|
52
|
-
{
|
53
|
-
params.error();
|
54
|
-
}
|
55
|
-
},
|
56
|
-
error : function( xhr, text_status, error_thrown)
|
57
|
-
{
|
58
|
-
},
|
59
|
-
complete : function( xhr, text_status )
|
60
|
-
{
|
61
|
-
}
|
62
|
-
}
|
63
|
-
);
|
64
|
-
}
|
65
|
-
);
|
66
|
-
|
67
|
-
sammy.bind
|
68
|
-
(
|
69
|
-
'cores_build_navigation',
|
70
|
-
function( event, params )
|
71
|
-
{
|
72
|
-
var navigation_content = ['<ul>'];
|
73
|
-
|
74
|
-
for( var core in params.cores )
|
75
|
-
{
|
76
|
-
var core_name = core;
|
77
|
-
if( !core_name )
|
78
|
-
{
|
79
|
-
core_name = '<em>(empty)</em>';
|
80
|
-
}
|
81
|
-
navigation_content.push( '<li><a href="' + params.basepath + core + '">' + core_name + '</a></li>' );
|
82
|
-
}
|
83
|
-
|
84
|
-
params.navigation_element
|
85
|
-
.html( navigation_content.join( "\n" ) );
|
86
|
-
|
87
|
-
$( 'a[href="' + params.basepath + params.current_core + '"]', params.navigation_element ).parent()
|
88
|
-
.addClass( 'current' );
|
89
|
-
}
|
90
|
-
);
|
91
|
-
|
92
|
-
sammy.bind
|
93
|
-
(
|
94
|
-
'cores_load_template',
|
95
|
-
function( event, params )
|
96
|
-
{
|
97
|
-
if( app.cores_template )
|
98
|
-
{
|
99
|
-
params.callback();
|
100
|
-
return true;
|
101
|
-
}
|
102
|
-
|
103
|
-
$.get
|
104
|
-
(
|
105
|
-
'tpl/cores.html',
|
106
|
-
function( template )
|
107
|
-
{
|
108
|
-
params.content_element
|
109
|
-
.html( template );
|
110
|
-
|
111
|
-
app.cores_template = template;
|
112
|
-
params.callback();
|
113
|
-
}
|
114
|
-
);
|
115
|
-
}
|
116
|
-
);
|
117
|
-
|
118
|
-
// #/~cores
|
119
|
-
sammy.get
|
120
|
-
(
|
121
|
-
/^#\/(~cores)$/,
|
122
|
-
function( context )
|
123
|
-
{
|
124
|
-
delete app.cores_template;
|
125
|
-
var content_element = $( '#content' );
|
126
|
-
|
127
|
-
sammy.trigger
|
128
|
-
(
|
129
|
-
'cores_load_data',
|
130
|
-
{
|
131
|
-
success : function( cores )
|
132
|
-
{
|
133
|
-
var first_core = null;
|
134
|
-
for( var key in cores )
|
135
|
-
{
|
136
|
-
if( !first_core )
|
137
|
-
{
|
138
|
-
first_core = key;
|
139
|
-
}
|
140
|
-
continue;
|
141
|
-
}
|
142
|
-
context.redirect( context.path + '/' + first_core );
|
143
|
-
},
|
144
|
-
error : function()
|
145
|
-
{
|
146
|
-
sammy.trigger
|
147
|
-
(
|
148
|
-
'cores_load_template',
|
149
|
-
{
|
150
|
-
content_element : content_element,
|
151
|
-
callback : function()
|
152
|
-
{
|
153
|
-
var cores_element = $( '#cores', content_element );
|
154
|
-
var navigation_element = $( '#navigation', cores_element );
|
155
|
-
var data_element = $( '#data', cores_element );
|
156
|
-
var core_data_element = $( '#core-data', data_element );
|
157
|
-
var index_data_element = $( '#index-data', data_element );
|
158
|
-
|
159
|
-
// layout
|
160
|
-
|
161
|
-
var ui_block = $( '#ui-block' );
|
162
|
-
var actions_element = $( '.actions', cores_element );
|
163
|
-
var div_action = $( 'div.action', actions_element );
|
164
|
-
|
165
|
-
ui_block
|
166
|
-
.css( 'opacity', 0.7 )
|
167
|
-
.width( cores_element.width() + 10 )
|
168
|
-
.height( cores_element.height() );
|
169
|
-
|
170
|
-
if( $( '#cloud.global' ).is( ':visible' ) )
|
171
|
-
{
|
172
|
-
$( '.cloud', div_action )
|
173
|
-
.show();
|
174
|
-
}
|
175
|
-
|
176
|
-
$( 'button.action', actions_element )
|
177
|
-
.die( 'click' )
|
178
|
-
.live
|
179
|
-
(
|
180
|
-
'click',
|
181
|
-
function( event )
|
182
|
-
{
|
183
|
-
var self = $( this );
|
184
|
-
|
185
|
-
self
|
186
|
-
.toggleClass( 'open' );
|
187
|
-
|
188
|
-
$( '.action.' + self.attr( 'id' ), actions_element )
|
189
|
-
.trigger( 'open' );
|
190
|
-
|
191
|
-
return false;
|
192
|
-
}
|
193
|
-
);
|
194
|
-
|
195
|
-
div_action
|
196
|
-
.die( 'close' )
|
197
|
-
.live
|
198
|
-
(
|
199
|
-
'close',
|
200
|
-
function( event )
|
201
|
-
{
|
202
|
-
div_action.hide();
|
203
|
-
ui_block.hide();
|
204
|
-
}
|
205
|
-
)
|
206
|
-
.die( 'open' )
|
207
|
-
.live
|
208
|
-
(
|
209
|
-
'open',
|
210
|
-
function( event )
|
211
|
-
{
|
212
|
-
var self = $( this );
|
213
|
-
var rel = $( '#' + self.data( 'rel' ) );
|
214
|
-
|
215
|
-
self
|
216
|
-
.trigger( 'close' )
|
217
|
-
.show()
|
218
|
-
.css( 'left', rel.position().left );
|
219
|
-
|
220
|
-
ui_block
|
221
|
-
.show();
|
222
|
-
}
|
223
|
-
);
|
224
|
-
|
225
|
-
$( 'form button.reset', actions_element )
|
226
|
-
.die( 'click' )
|
227
|
-
.live
|
228
|
-
(
|
229
|
-
'click',
|
230
|
-
function( event )
|
231
|
-
{
|
232
|
-
$( this ).closest( 'div.action' )
|
233
|
-
.trigger( 'close' );
|
234
|
-
}
|
235
|
-
);
|
236
|
-
|
237
|
-
$( 'form', div_action )
|
238
|
-
.ajaxForm
|
239
|
-
(
|
240
|
-
{
|
241
|
-
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
|
242
|
-
dataType : 'json',
|
243
|
-
beforeSubmit : function( array, form, options )
|
244
|
-
{
|
245
|
-
$( 'button[type="submit"] span', form )
|
246
|
-
.addClass( 'loader' );
|
247
|
-
},
|
248
|
-
success : function( response, status_text, xhr, form )
|
249
|
-
{
|
250
|
-
delete app.cores_data;
|
251
|
-
sammy.refresh();
|
252
|
-
|
253
|
-
$( 'button.reset', form )
|
254
|
-
.trigger( 'click' );
|
255
|
-
},
|
256
|
-
error : function( xhr, text_status, error_thrown )
|
257
|
-
{
|
258
|
-
var response = null;
|
259
|
-
eval( 'response = ' + xhr.responseText + ';' );
|
260
|
-
|
261
|
-
var error_elem = $( '.error', div_action.filter( ':visible' ) );
|
262
|
-
error_elem.show();
|
263
|
-
$( 'span', error_elem ).text( response.error.msg );
|
264
|
-
},
|
265
|
-
complete : function()
|
266
|
-
{
|
267
|
-
$( 'button span.loader', actions_element )
|
268
|
-
.removeClass( 'loader' );
|
269
|
-
}
|
270
|
-
}
|
271
|
-
);
|
272
|
-
|
273
|
-
// --
|
274
|
-
|
275
|
-
$( '#add', content_element )
|
276
|
-
.trigger( 'click' );
|
277
|
-
|
278
|
-
$( '[data-rel="add"] input[type="text"]:first', content_element )
|
279
|
-
.focus();
|
280
|
-
}
|
281
|
-
}
|
282
|
-
);
|
283
|
-
}
|
284
|
-
}
|
285
|
-
);
|
286
|
-
}
|
287
|
-
);
|
288
|
-
|
289
|
-
// #/~cores
|
290
|
-
sammy.get
|
291
|
-
(
|
292
|
-
/^#\/(~cores)\//,
|
293
|
-
function( context )
|
294
|
-
{
|
295
|
-
var content_element = $( '#content' );
|
296
|
-
|
297
|
-
var path_parts = this.path.match( /^(.+\/~cores\/)(.*)$/ );
|
298
|
-
var current_core = path_parts[2];
|
299
|
-
|
300
|
-
sammy.trigger
|
301
|
-
(
|
302
|
-
'cores_load_data',
|
303
|
-
{
|
304
|
-
error : function()
|
305
|
-
{
|
306
|
-
context.redirect( '#/' + context.params.splat[0] );
|
307
|
-
},
|
308
|
-
success : function( cores )
|
309
|
-
{
|
310
|
-
sammy.trigger
|
311
|
-
(
|
312
|
-
'cores_load_template',
|
313
|
-
{
|
314
|
-
content_element : content_element,
|
315
|
-
callback : function()
|
316
|
-
{
|
317
|
-
var cores_element = $( '#cores', content_element );
|
318
|
-
var navigation_element = $( '#navigation', cores_element );
|
319
|
-
var data_element = $( '#data', cores_element );
|
320
|
-
var core_data_element = $( '#core-data', data_element );
|
321
|
-
var index_data_element = $( '#index-data', data_element );
|
322
|
-
|
323
|
-
cores_element
|
324
|
-
.removeClass( 'empty' );
|
325
|
-
|
326
|
-
sammy.trigger
|
327
|
-
(
|
328
|
-
'cores_build_navigation',
|
329
|
-
{
|
330
|
-
cores : cores,
|
331
|
-
basepath : path_parts[1],
|
332
|
-
current_core : current_core,
|
333
|
-
navigation_element : navigation_element
|
334
|
-
}
|
335
|
-
);
|
336
|
-
|
337
|
-
var core_data = cores[current_core];
|
338
|
-
var core_basepath = $( '#' + current_core, app.menu_element ).attr( 'data-basepath' );
|
339
|
-
|
340
|
-
// core-data
|
341
|
-
|
342
|
-
$( '.startTime dd', core_data_element )
|
343
|
-
.html( core_data.startTime );
|
344
|
-
|
345
|
-
$( '.instanceDir dd', core_data_element )
|
346
|
-
.html( core_data.instanceDir );
|
347
|
-
|
348
|
-
$( '.dataDir dd', core_data_element )
|
349
|
-
.html( core_data.dataDir );
|
350
|
-
|
351
|
-
// index-data
|
352
|
-
|
353
|
-
$( '.lastModified dd', index_data_element )
|
354
|
-
.html( core_data.index.lastModified || '-' );
|
355
|
-
|
356
|
-
$( '.version dd', index_data_element )
|
357
|
-
.html( core_data.index.version );
|
358
|
-
|
359
|
-
$( '.numDocs dd', index_data_element )
|
360
|
-
.html( core_data.index.numDocs );
|
361
|
-
|
362
|
-
$( '.maxDoc dd', index_data_element )
|
363
|
-
.html( core_data.index.maxDoc );
|
364
|
-
|
365
|
-
$( '.deletedDocs dd', index_data_element )
|
366
|
-
.html( core_data.index.deletedDocs || '-' );
|
367
|
-
|
368
|
-
$( '.optimized dd', index_data_element )
|
369
|
-
.addClass( !core_data.index.hasDeletions ? 'ico-1' : 'ico-0' );
|
370
|
-
|
371
|
-
$( '#actions #optimize', cores_element )
|
372
|
-
.show();
|
373
|
-
|
374
|
-
$( '.optimized dd span', index_data_element )
|
375
|
-
.html( !core_data.index.hasDeletions ? 'yes' : 'no' );
|
376
|
-
|
377
|
-
$( '.current dd', index_data_element )
|
378
|
-
.addClass( core_data.index.current ? 'ico-1' : 'ico-0' );
|
379
|
-
|
380
|
-
$( '.current dd span', index_data_element )
|
381
|
-
.html( core_data.index.current ? 'yes' : 'no' );
|
382
|
-
|
383
|
-
$( '.directory dd', index_data_element )
|
384
|
-
.html
|
385
|
-
(
|
386
|
-
core_data.index.directory
|
387
|
-
.replace( /:/g, ':​' )
|
388
|
-
.replace( /@/g, '@​' )
|
389
|
-
);
|
390
|
-
|
391
|
-
var core_names = [];
|
392
|
-
var core_selects = $( '#actions select', cores_element );
|
393
|
-
|
394
|
-
for( var key in cores )
|
395
|
-
{
|
396
|
-
core_names.push( '<option value="' + key + '">' + key + '</option>' )
|
397
|
-
}
|
398
|
-
|
399
|
-
core_selects
|
400
|
-
.html( core_names.join( "\n") );
|
401
|
-
|
402
|
-
$( 'option[value="' + current_core + '"]', core_selects.filter( '.other' ) )
|
403
|
-
.remove();
|
404
|
-
|
405
|
-
$( 'input[data-core="current"]', cores_element )
|
406
|
-
.val( current_core );
|
407
|
-
|
408
|
-
// layout
|
409
|
-
|
410
|
-
var ui_block = $( '#ui-block' );
|
411
|
-
var actions_element = $( '.actions', cores_element );
|
412
|
-
var div_action = $( 'div.action', actions_element );
|
413
|
-
|
414
|
-
ui_block
|
415
|
-
.css( 'opacity', 0.7 )
|
416
|
-
.width( cores_element.width() + 10 )
|
417
|
-
.height( cores_element.height() );
|
418
|
-
|
419
|
-
if( $( '#cloud.global' ).is( ':visible' ) )
|
420
|
-
{
|
421
|
-
$( '.cloud', div_action )
|
422
|
-
.show();
|
423
|
-
}
|
424
|
-
|
425
|
-
$( 'button.action', actions_element )
|
426
|
-
.die( 'click' )
|
427
|
-
.live
|
428
|
-
(
|
429
|
-
'click',
|
430
|
-
function( event )
|
431
|
-
{
|
432
|
-
var self = $( this );
|
433
|
-
|
434
|
-
self
|
435
|
-
.toggleClass( 'open' );
|
436
|
-
|
437
|
-
$( '.action.' + self.attr( 'id' ), actions_element )
|
438
|
-
.trigger( 'open' );
|
439
|
-
|
440
|
-
return false;
|
441
|
-
}
|
442
|
-
);
|
443
|
-
|
444
|
-
div_action
|
445
|
-
.die( 'close' )
|
446
|
-
.live
|
447
|
-
(
|
448
|
-
'close',
|
449
|
-
function( event )
|
450
|
-
{
|
451
|
-
div_action.hide();
|
452
|
-
ui_block.hide();
|
453
|
-
}
|
454
|
-
)
|
455
|
-
.die( 'open' )
|
456
|
-
.live
|
457
|
-
(
|
458
|
-
'open',
|
459
|
-
function( event )
|
460
|
-
{
|
461
|
-
var self = $( this );
|
462
|
-
var rel = $( '#' + self.data( 'rel' ) );
|
463
|
-
|
464
|
-
self
|
465
|
-
.trigger( 'close' )
|
466
|
-
.show()
|
467
|
-
.css( 'left', rel.position().left );
|
468
|
-
|
469
|
-
ui_block
|
470
|
-
.show();
|
471
|
-
}
|
472
|
-
);
|
473
|
-
|
474
|
-
$( 'form button.reset', actions_element )
|
475
|
-
.die( 'click' )
|
476
|
-
.live
|
477
|
-
(
|
478
|
-
'click',
|
479
|
-
function( event )
|
480
|
-
{
|
481
|
-
$( this ).closest( 'div.action' )
|
482
|
-
.trigger( 'close' );
|
483
|
-
}
|
484
|
-
);
|
485
|
-
|
486
|
-
var form_callback = {
|
487
|
-
|
488
|
-
rename : function( form, response )
|
489
|
-
{
|
490
|
-
var url = path_parts[1] + $( 'input[name="other"]', form ).val();
|
491
|
-
context.redirect( url );
|
492
|
-
}
|
493
|
-
|
494
|
-
};
|
495
|
-
|
496
|
-
$( 'form', div_action )
|
497
|
-
.ajaxForm
|
498
|
-
(
|
499
|
-
{
|
500
|
-
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
|
501
|
-
dataType : 'json',
|
502
|
-
beforeSubmit : function( array, form, options )
|
503
|
-
{
|
504
|
-
$( 'button[type="submit"] span', form )
|
505
|
-
.addClass( 'loader' );
|
506
|
-
},
|
507
|
-
success : function( response, status_text, xhr, form )
|
508
|
-
{
|
509
|
-
var action = $( 'input[name="action"]', form ).val().toLowerCase();
|
510
|
-
|
511
|
-
delete app.cores_data;
|
512
|
-
|
513
|
-
if( form_callback[action] )
|
514
|
-
{
|
515
|
-
form_callback[action]( form, response );
|
516
|
-
}
|
517
|
-
else
|
518
|
-
{
|
519
|
-
sammy.refresh();
|
520
|
-
}
|
521
|
-
|
522
|
-
$( 'button.reset', form )
|
523
|
-
.trigger( 'click' );
|
524
|
-
},
|
525
|
-
error : function( xhr, text_status, error_thrown )
|
526
|
-
{
|
527
|
-
var response = null;
|
528
|
-
eval( 'response = ' + xhr.responseText + ';' );
|
529
|
-
|
530
|
-
var error_elem = $( '.error', div_action.filter( ':visible' ) );
|
531
|
-
error_elem.show();
|
532
|
-
$( 'span', error_elem ).text( response.error.msg );
|
533
|
-
},
|
534
|
-
complete : function()
|
535
|
-
{
|
536
|
-
$( 'button span.loader', actions_element )
|
537
|
-
.removeClass( 'loader' );
|
538
|
-
}
|
539
|
-
}
|
540
|
-
);
|
541
|
-
|
542
|
-
var reload_button = $( '#actions #reload', cores_element );
|
543
|
-
reload_button
|
544
|
-
.die( 'click' )
|
545
|
-
.live
|
546
|
-
(
|
547
|
-
'click',
|
548
|
-
function( event )
|
549
|
-
{
|
550
|
-
$.ajax
|
551
|
-
(
|
552
|
-
{
|
553
|
-
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=RELOAD&core=' + current_core,
|
554
|
-
dataType : 'json',
|
555
|
-
context : $( this ),
|
556
|
-
beforeSend : function( xhr, settings )
|
557
|
-
{
|
558
|
-
$( 'span', this )
|
559
|
-
.addClass( 'loader' );
|
560
|
-
},
|
561
|
-
success : function( response, text_status, xhr )
|
562
|
-
{
|
563
|
-
this
|
564
|
-
.addClass( 'success' );
|
565
|
-
|
566
|
-
delete app.cores_data;
|
567
|
-
sammy.refresh();
|
568
|
-
|
569
|
-
window.setTimeout
|
570
|
-
(
|
571
|
-
function()
|
572
|
-
{
|
573
|
-
reload_button
|
574
|
-
.removeClass( 'success' );
|
575
|
-
},
|
576
|
-
1000
|
577
|
-
);
|
578
|
-
},
|
579
|
-
error : function( xhr, text_status, error_thrown )
|
580
|
-
{
|
581
|
-
this
|
582
|
-
.addClass( 'warn' );
|
583
|
-
|
584
|
-
sammy.trigger( 'cores_load_data', { only_failures : true } );
|
585
|
-
|
586
|
-
window.setTimeout
|
587
|
-
(
|
588
|
-
function()
|
589
|
-
{
|
590
|
-
reload_button
|
591
|
-
.removeClass( 'warn' );
|
592
|
-
},
|
593
|
-
1000
|
594
|
-
);
|
595
|
-
},
|
596
|
-
complete : function( xhr, text_status )
|
597
|
-
{
|
598
|
-
$( 'span', this )
|
599
|
-
.removeClass( 'loader' );
|
600
|
-
}
|
601
|
-
}
|
602
|
-
);
|
603
|
-
}
|
604
|
-
);
|
605
|
-
|
606
|
-
$( '#actions #unload', cores_element )
|
607
|
-
.die( 'click' )
|
608
|
-
.live
|
609
|
-
(
|
610
|
-
'click',
|
611
|
-
function( event )
|
612
|
-
{
|
613
|
-
var ret = confirm( 'Do you really want to unload Core "' + current_core + '"?' );
|
614
|
-
if( !ret )
|
615
|
-
{
|
616
|
-
return false;
|
617
|
-
}
|
618
|
-
|
619
|
-
$.ajax
|
620
|
-
(
|
621
|
-
{
|
622
|
-
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=UNLOAD&core=' + current_core,
|
623
|
-
dataType : 'json',
|
624
|
-
context : $( this ),
|
625
|
-
beforeSend : function( xhr, settings )
|
626
|
-
{
|
627
|
-
$( 'span', this )
|
628
|
-
.addClass( 'loader' );
|
629
|
-
},
|
630
|
-
success : function( response, text_status, xhr )
|
631
|
-
{
|
632
|
-
delete app.cores_data;
|
633
|
-
context.redirect( path_parts[1].substr( 0, path_parts[1].length - 1 ) );
|
634
|
-
},
|
635
|
-
error : function( xhr, text_status, error_thrown )
|
636
|
-
{
|
637
|
-
},
|
638
|
-
complete : function( xhr, text_status )
|
639
|
-
{
|
640
|
-
$( 'span', this )
|
641
|
-
.removeClass( 'loader' );
|
642
|
-
}
|
643
|
-
}
|
644
|
-
);
|
645
|
-
}
|
646
|
-
);
|
647
|
-
|
648
|
-
var optimize_button = $( '#actions #optimize', cores_element );
|
649
|
-
optimize_button
|
650
|
-
.die( 'click' )
|
651
|
-
.live
|
652
|
-
(
|
653
|
-
'click',
|
654
|
-
function( event )
|
655
|
-
{
|
656
|
-
$.ajax
|
657
|
-
(
|
658
|
-
{
|
659
|
-
url : core_basepath + '/update?optimize=true&waitFlush=true&wt=json',
|
660
|
-
dataType : 'json',
|
661
|
-
context : $( this ),
|
662
|
-
beforeSend : function( xhr, settings )
|
663
|
-
{
|
664
|
-
$( 'span', this )
|
665
|
-
.addClass( 'loader' );
|
666
|
-
},
|
667
|
-
success : function( response, text_status, xhr )
|
668
|
-
{
|
669
|
-
this
|
670
|
-
.addClass( 'success' );
|
671
|
-
|
672
|
-
window.setTimeout
|
673
|
-
(
|
674
|
-
function()
|
675
|
-
{
|
676
|
-
optimize_button
|
677
|
-
.removeClass( 'success' );
|
678
|
-
},
|
679
|
-
1000
|
680
|
-
);
|
681
|
-
|
682
|
-
$( '.optimized dd.ico-0', index_data_element )
|
683
|
-
.removeClass( 'ico-0' )
|
684
|
-
.addClass( 'ico-1' );
|
685
|
-
},
|
686
|
-
error : function( xhr, text_status, error_thrown)
|
687
|
-
{
|
688
|
-
console.warn( 'd0h, optimize broken!' );
|
689
|
-
},
|
690
|
-
complete : function( xhr, text_status )
|
691
|
-
{
|
692
|
-
$( 'span', this )
|
693
|
-
.removeClass( 'loader' );
|
694
|
-
}
|
695
|
-
}
|
696
|
-
);
|
697
|
-
}
|
698
|
-
);
|
699
|
-
|
700
|
-
$( '.timeago', data_element )
|
701
|
-
.timeago();
|
702
|
-
|
703
|
-
$( 'ul', data_element )
|
704
|
-
.each
|
705
|
-
(
|
706
|
-
function( i, element )
|
707
|
-
{
|
708
|
-
$( 'li:odd', element )
|
709
|
-
.addClass( 'odd' );
|
710
|
-
}
|
711
|
-
)
|
712
|
-
}
|
713
|
-
}
|
714
|
-
);
|
715
|
-
}
|
716
|
-
}
|
717
|
-
);
|
718
|
-
}
|
719
|
-
);
|
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
|
+
sammy.bind
|
19
|
+
(
|
20
|
+
'cores_load_data',
|
21
|
+
function( event, params )
|
22
|
+
{
|
23
|
+
$.ajax
|
24
|
+
(
|
25
|
+
{
|
26
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json',
|
27
|
+
dataType : 'json',
|
28
|
+
beforeSend : function( xhr, settings )
|
29
|
+
{
|
30
|
+
},
|
31
|
+
success : function( response, text_status, xhr )
|
32
|
+
{
|
33
|
+
if( params.only_failures )
|
34
|
+
{
|
35
|
+
app.check_for_init_failures( response );
|
36
|
+
return true;
|
37
|
+
}
|
38
|
+
|
39
|
+
var has_cores = false;
|
40
|
+
for( core in response.status )
|
41
|
+
{
|
42
|
+
has_cores = true; break;
|
43
|
+
}
|
44
|
+
|
45
|
+
app.set_cores_data( response );
|
46
|
+
|
47
|
+
if( has_cores )
|
48
|
+
{
|
49
|
+
params.success( app.cores_data );
|
50
|
+
}
|
51
|
+
else
|
52
|
+
{
|
53
|
+
params.error();
|
54
|
+
}
|
55
|
+
},
|
56
|
+
error : function( xhr, text_status, error_thrown)
|
57
|
+
{
|
58
|
+
},
|
59
|
+
complete : function( xhr, text_status )
|
60
|
+
{
|
61
|
+
}
|
62
|
+
}
|
63
|
+
);
|
64
|
+
}
|
65
|
+
);
|
66
|
+
|
67
|
+
sammy.bind
|
68
|
+
(
|
69
|
+
'cores_build_navigation',
|
70
|
+
function( event, params )
|
71
|
+
{
|
72
|
+
var navigation_content = ['<ul>'];
|
73
|
+
|
74
|
+
for( var core in params.cores )
|
75
|
+
{
|
76
|
+
var core_name = core;
|
77
|
+
if( !core_name )
|
78
|
+
{
|
79
|
+
core_name = '<em>(empty)</em>';
|
80
|
+
}
|
81
|
+
navigation_content.push( '<li><a href="' + params.basepath + core + '">' + core_name + '</a></li>' );
|
82
|
+
}
|
83
|
+
|
84
|
+
params.navigation_element
|
85
|
+
.html( navigation_content.join( "\n" ) );
|
86
|
+
|
87
|
+
$( 'a[href="' + params.basepath + params.current_core + '"]', params.navigation_element ).parent()
|
88
|
+
.addClass( 'current' );
|
89
|
+
}
|
90
|
+
);
|
91
|
+
|
92
|
+
sammy.bind
|
93
|
+
(
|
94
|
+
'cores_load_template',
|
95
|
+
function( event, params )
|
96
|
+
{
|
97
|
+
if( app.cores_template )
|
98
|
+
{
|
99
|
+
params.callback();
|
100
|
+
return true;
|
101
|
+
}
|
102
|
+
|
103
|
+
$.get
|
104
|
+
(
|
105
|
+
'tpl/cores.html',
|
106
|
+
function( template )
|
107
|
+
{
|
108
|
+
params.content_element
|
109
|
+
.html( template );
|
110
|
+
|
111
|
+
app.cores_template = template;
|
112
|
+
params.callback();
|
113
|
+
}
|
114
|
+
);
|
115
|
+
}
|
116
|
+
);
|
117
|
+
|
118
|
+
// #/~cores
|
119
|
+
sammy.get
|
120
|
+
(
|
121
|
+
/^#\/(~cores)$/,
|
122
|
+
function( context )
|
123
|
+
{
|
124
|
+
delete app.cores_template;
|
125
|
+
var content_element = $( '#content' );
|
126
|
+
|
127
|
+
sammy.trigger
|
128
|
+
(
|
129
|
+
'cores_load_data',
|
130
|
+
{
|
131
|
+
success : function( cores )
|
132
|
+
{
|
133
|
+
var first_core = null;
|
134
|
+
for( var key in cores )
|
135
|
+
{
|
136
|
+
if( !first_core )
|
137
|
+
{
|
138
|
+
first_core = key;
|
139
|
+
}
|
140
|
+
continue;
|
141
|
+
}
|
142
|
+
context.redirect( context.path + '/' + first_core );
|
143
|
+
},
|
144
|
+
error : function()
|
145
|
+
{
|
146
|
+
sammy.trigger
|
147
|
+
(
|
148
|
+
'cores_load_template',
|
149
|
+
{
|
150
|
+
content_element : content_element,
|
151
|
+
callback : function()
|
152
|
+
{
|
153
|
+
var cores_element = $( '#cores', content_element );
|
154
|
+
var navigation_element = $( '#navigation', cores_element );
|
155
|
+
var data_element = $( '#data', cores_element );
|
156
|
+
var core_data_element = $( '#core-data', data_element );
|
157
|
+
var index_data_element = $( '#index-data', data_element );
|
158
|
+
|
159
|
+
// layout
|
160
|
+
|
161
|
+
var ui_block = $( '#ui-block' );
|
162
|
+
var actions_element = $( '.actions', cores_element );
|
163
|
+
var div_action = $( 'div.action', actions_element );
|
164
|
+
|
165
|
+
ui_block
|
166
|
+
.css( 'opacity', 0.7 )
|
167
|
+
.width( cores_element.width() + 10 )
|
168
|
+
.height( cores_element.height() );
|
169
|
+
|
170
|
+
if( $( '#cloud.global' ).is( ':visible' ) )
|
171
|
+
{
|
172
|
+
$( '.cloud', div_action )
|
173
|
+
.show();
|
174
|
+
}
|
175
|
+
|
176
|
+
$( 'button.action', actions_element )
|
177
|
+
.die( 'click' )
|
178
|
+
.live
|
179
|
+
(
|
180
|
+
'click',
|
181
|
+
function( event )
|
182
|
+
{
|
183
|
+
var self = $( this );
|
184
|
+
|
185
|
+
self
|
186
|
+
.toggleClass( 'open' );
|
187
|
+
|
188
|
+
$( '.action.' + self.attr( 'id' ), actions_element )
|
189
|
+
.trigger( 'open' );
|
190
|
+
|
191
|
+
return false;
|
192
|
+
}
|
193
|
+
);
|
194
|
+
|
195
|
+
div_action
|
196
|
+
.die( 'close' )
|
197
|
+
.live
|
198
|
+
(
|
199
|
+
'close',
|
200
|
+
function( event )
|
201
|
+
{
|
202
|
+
div_action.hide();
|
203
|
+
ui_block.hide();
|
204
|
+
}
|
205
|
+
)
|
206
|
+
.die( 'open' )
|
207
|
+
.live
|
208
|
+
(
|
209
|
+
'open',
|
210
|
+
function( event )
|
211
|
+
{
|
212
|
+
var self = $( this );
|
213
|
+
var rel = $( '#' + self.data( 'rel' ) );
|
214
|
+
|
215
|
+
self
|
216
|
+
.trigger( 'close' )
|
217
|
+
.show()
|
218
|
+
.css( 'left', rel.position().left );
|
219
|
+
|
220
|
+
ui_block
|
221
|
+
.show();
|
222
|
+
}
|
223
|
+
);
|
224
|
+
|
225
|
+
$( 'form button.reset', actions_element )
|
226
|
+
.die( 'click' )
|
227
|
+
.live
|
228
|
+
(
|
229
|
+
'click',
|
230
|
+
function( event )
|
231
|
+
{
|
232
|
+
$( this ).closest( 'div.action' )
|
233
|
+
.trigger( 'close' );
|
234
|
+
}
|
235
|
+
);
|
236
|
+
|
237
|
+
$( 'form', div_action )
|
238
|
+
.ajaxForm
|
239
|
+
(
|
240
|
+
{
|
241
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
|
242
|
+
dataType : 'json',
|
243
|
+
beforeSubmit : function( array, form, options )
|
244
|
+
{
|
245
|
+
$( 'button[type="submit"] span', form )
|
246
|
+
.addClass( 'loader' );
|
247
|
+
},
|
248
|
+
success : function( response, status_text, xhr, form )
|
249
|
+
{
|
250
|
+
delete app.cores_data;
|
251
|
+
sammy.refresh();
|
252
|
+
|
253
|
+
$( 'button.reset', form )
|
254
|
+
.trigger( 'click' );
|
255
|
+
},
|
256
|
+
error : function( xhr, text_status, error_thrown )
|
257
|
+
{
|
258
|
+
var response = null;
|
259
|
+
eval( 'response = ' + xhr.responseText + ';' );
|
260
|
+
|
261
|
+
var error_elem = $( '.error', div_action.filter( ':visible' ) );
|
262
|
+
error_elem.show();
|
263
|
+
$( 'span', error_elem ).text( response.error.msg );
|
264
|
+
},
|
265
|
+
complete : function()
|
266
|
+
{
|
267
|
+
$( 'button span.loader', actions_element )
|
268
|
+
.removeClass( 'loader' );
|
269
|
+
}
|
270
|
+
}
|
271
|
+
);
|
272
|
+
|
273
|
+
// --
|
274
|
+
|
275
|
+
$( '#add', content_element )
|
276
|
+
.trigger( 'click' );
|
277
|
+
|
278
|
+
$( '[data-rel="add"] input[type="text"]:first', content_element )
|
279
|
+
.focus();
|
280
|
+
}
|
281
|
+
}
|
282
|
+
);
|
283
|
+
}
|
284
|
+
}
|
285
|
+
);
|
286
|
+
}
|
287
|
+
);
|
288
|
+
|
289
|
+
// #/~cores
|
290
|
+
sammy.get
|
291
|
+
(
|
292
|
+
/^#\/(~cores)\//,
|
293
|
+
function( context )
|
294
|
+
{
|
295
|
+
var content_element = $( '#content' );
|
296
|
+
|
297
|
+
var path_parts = this.path.match( /^(.+\/~cores\/)(.*)$/ );
|
298
|
+
var current_core = path_parts[2];
|
299
|
+
|
300
|
+
sammy.trigger
|
301
|
+
(
|
302
|
+
'cores_load_data',
|
303
|
+
{
|
304
|
+
error : function()
|
305
|
+
{
|
306
|
+
context.redirect( '#/' + context.params.splat[0] );
|
307
|
+
},
|
308
|
+
success : function( cores )
|
309
|
+
{
|
310
|
+
sammy.trigger
|
311
|
+
(
|
312
|
+
'cores_load_template',
|
313
|
+
{
|
314
|
+
content_element : content_element,
|
315
|
+
callback : function()
|
316
|
+
{
|
317
|
+
var cores_element = $( '#cores', content_element );
|
318
|
+
var navigation_element = $( '#navigation', cores_element );
|
319
|
+
var data_element = $( '#data', cores_element );
|
320
|
+
var core_data_element = $( '#core-data', data_element );
|
321
|
+
var index_data_element = $( '#index-data', data_element );
|
322
|
+
|
323
|
+
cores_element
|
324
|
+
.removeClass( 'empty' );
|
325
|
+
|
326
|
+
sammy.trigger
|
327
|
+
(
|
328
|
+
'cores_build_navigation',
|
329
|
+
{
|
330
|
+
cores : cores,
|
331
|
+
basepath : path_parts[1],
|
332
|
+
current_core : current_core,
|
333
|
+
navigation_element : navigation_element
|
334
|
+
}
|
335
|
+
);
|
336
|
+
|
337
|
+
var core_data = cores[current_core];
|
338
|
+
var core_basepath = $( '#' + current_core, app.menu_element ).attr( 'data-basepath' );
|
339
|
+
|
340
|
+
// core-data
|
341
|
+
|
342
|
+
$( '.startTime dd', core_data_element )
|
343
|
+
.html( core_data.startTime );
|
344
|
+
|
345
|
+
$( '.instanceDir dd', core_data_element )
|
346
|
+
.html( core_data.instanceDir );
|
347
|
+
|
348
|
+
$( '.dataDir dd', core_data_element )
|
349
|
+
.html( core_data.dataDir );
|
350
|
+
|
351
|
+
// index-data
|
352
|
+
|
353
|
+
$( '.lastModified dd', index_data_element )
|
354
|
+
.html( core_data.index.lastModified || '-' );
|
355
|
+
|
356
|
+
$( '.version dd', index_data_element )
|
357
|
+
.html( core_data.index.version );
|
358
|
+
|
359
|
+
$( '.numDocs dd', index_data_element )
|
360
|
+
.html( core_data.index.numDocs );
|
361
|
+
|
362
|
+
$( '.maxDoc dd', index_data_element )
|
363
|
+
.html( core_data.index.maxDoc );
|
364
|
+
|
365
|
+
$( '.deletedDocs dd', index_data_element )
|
366
|
+
.html( core_data.index.deletedDocs || '-' );
|
367
|
+
|
368
|
+
$( '.optimized dd', index_data_element )
|
369
|
+
.addClass( !core_data.index.hasDeletions ? 'ico-1' : 'ico-0' );
|
370
|
+
|
371
|
+
$( '#actions #optimize', cores_element )
|
372
|
+
.show();
|
373
|
+
|
374
|
+
$( '.optimized dd span', index_data_element )
|
375
|
+
.html( !core_data.index.hasDeletions ? 'yes' : 'no' );
|
376
|
+
|
377
|
+
$( '.current dd', index_data_element )
|
378
|
+
.addClass( core_data.index.current ? 'ico-1' : 'ico-0' );
|
379
|
+
|
380
|
+
$( '.current dd span', index_data_element )
|
381
|
+
.html( core_data.index.current ? 'yes' : 'no' );
|
382
|
+
|
383
|
+
$( '.directory dd', index_data_element )
|
384
|
+
.html
|
385
|
+
(
|
386
|
+
core_data.index.directory
|
387
|
+
.replace( /:/g, ':​' )
|
388
|
+
.replace( /@/g, '@​' )
|
389
|
+
);
|
390
|
+
|
391
|
+
var core_names = [];
|
392
|
+
var core_selects = $( '#actions select', cores_element );
|
393
|
+
|
394
|
+
for( var key in cores )
|
395
|
+
{
|
396
|
+
core_names.push( '<option value="' + key + '">' + key + '</option>' )
|
397
|
+
}
|
398
|
+
|
399
|
+
core_selects
|
400
|
+
.html( core_names.join( "\n") );
|
401
|
+
|
402
|
+
$( 'option[value="' + current_core + '"]', core_selects.filter( '.other' ) )
|
403
|
+
.remove();
|
404
|
+
|
405
|
+
$( 'input[data-core="current"]', cores_element )
|
406
|
+
.val( current_core );
|
407
|
+
|
408
|
+
// layout
|
409
|
+
|
410
|
+
var ui_block = $( '#ui-block' );
|
411
|
+
var actions_element = $( '.actions', cores_element );
|
412
|
+
var div_action = $( 'div.action', actions_element );
|
413
|
+
|
414
|
+
ui_block
|
415
|
+
.css( 'opacity', 0.7 )
|
416
|
+
.width( cores_element.width() + 10 )
|
417
|
+
.height( cores_element.height() );
|
418
|
+
|
419
|
+
if( $( '#cloud.global' ).is( ':visible' ) )
|
420
|
+
{
|
421
|
+
$( '.cloud', div_action )
|
422
|
+
.show();
|
423
|
+
}
|
424
|
+
|
425
|
+
$( 'button.action', actions_element )
|
426
|
+
.die( 'click' )
|
427
|
+
.live
|
428
|
+
(
|
429
|
+
'click',
|
430
|
+
function( event )
|
431
|
+
{
|
432
|
+
var self = $( this );
|
433
|
+
|
434
|
+
self
|
435
|
+
.toggleClass( 'open' );
|
436
|
+
|
437
|
+
$( '.action.' + self.attr( 'id' ), actions_element )
|
438
|
+
.trigger( 'open' );
|
439
|
+
|
440
|
+
return false;
|
441
|
+
}
|
442
|
+
);
|
443
|
+
|
444
|
+
div_action
|
445
|
+
.die( 'close' )
|
446
|
+
.live
|
447
|
+
(
|
448
|
+
'close',
|
449
|
+
function( event )
|
450
|
+
{
|
451
|
+
div_action.hide();
|
452
|
+
ui_block.hide();
|
453
|
+
}
|
454
|
+
)
|
455
|
+
.die( 'open' )
|
456
|
+
.live
|
457
|
+
(
|
458
|
+
'open',
|
459
|
+
function( event )
|
460
|
+
{
|
461
|
+
var self = $( this );
|
462
|
+
var rel = $( '#' + self.data( 'rel' ) );
|
463
|
+
|
464
|
+
self
|
465
|
+
.trigger( 'close' )
|
466
|
+
.show()
|
467
|
+
.css( 'left', rel.position().left );
|
468
|
+
|
469
|
+
ui_block
|
470
|
+
.show();
|
471
|
+
}
|
472
|
+
);
|
473
|
+
|
474
|
+
$( 'form button.reset', actions_element )
|
475
|
+
.die( 'click' )
|
476
|
+
.live
|
477
|
+
(
|
478
|
+
'click',
|
479
|
+
function( event )
|
480
|
+
{
|
481
|
+
$( this ).closest( 'div.action' )
|
482
|
+
.trigger( 'close' );
|
483
|
+
}
|
484
|
+
);
|
485
|
+
|
486
|
+
var form_callback = {
|
487
|
+
|
488
|
+
rename : function( form, response )
|
489
|
+
{
|
490
|
+
var url = path_parts[1] + $( 'input[name="other"]', form ).val();
|
491
|
+
context.redirect( url );
|
492
|
+
}
|
493
|
+
|
494
|
+
};
|
495
|
+
|
496
|
+
$( 'form', div_action )
|
497
|
+
.ajaxForm
|
498
|
+
(
|
499
|
+
{
|
500
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
|
501
|
+
dataType : 'json',
|
502
|
+
beforeSubmit : function( array, form, options )
|
503
|
+
{
|
504
|
+
$( 'button[type="submit"] span', form )
|
505
|
+
.addClass( 'loader' );
|
506
|
+
},
|
507
|
+
success : function( response, status_text, xhr, form )
|
508
|
+
{
|
509
|
+
var action = $( 'input[name="action"]', form ).val().toLowerCase();
|
510
|
+
|
511
|
+
delete app.cores_data;
|
512
|
+
|
513
|
+
if( form_callback[action] )
|
514
|
+
{
|
515
|
+
form_callback[action]( form, response );
|
516
|
+
}
|
517
|
+
else
|
518
|
+
{
|
519
|
+
sammy.refresh();
|
520
|
+
}
|
521
|
+
|
522
|
+
$( 'button.reset', form )
|
523
|
+
.trigger( 'click' );
|
524
|
+
},
|
525
|
+
error : function( xhr, text_status, error_thrown )
|
526
|
+
{
|
527
|
+
var response = null;
|
528
|
+
eval( 'response = ' + xhr.responseText + ';' );
|
529
|
+
|
530
|
+
var error_elem = $( '.error', div_action.filter( ':visible' ) );
|
531
|
+
error_elem.show();
|
532
|
+
$( 'span', error_elem ).text( response.error.msg );
|
533
|
+
},
|
534
|
+
complete : function()
|
535
|
+
{
|
536
|
+
$( 'button span.loader', actions_element )
|
537
|
+
.removeClass( 'loader' );
|
538
|
+
}
|
539
|
+
}
|
540
|
+
);
|
541
|
+
|
542
|
+
var reload_button = $( '#actions #reload', cores_element );
|
543
|
+
reload_button
|
544
|
+
.die( 'click' )
|
545
|
+
.live
|
546
|
+
(
|
547
|
+
'click',
|
548
|
+
function( event )
|
549
|
+
{
|
550
|
+
$.ajax
|
551
|
+
(
|
552
|
+
{
|
553
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=RELOAD&core=' + current_core,
|
554
|
+
dataType : 'json',
|
555
|
+
context : $( this ),
|
556
|
+
beforeSend : function( xhr, settings )
|
557
|
+
{
|
558
|
+
$( 'span', this )
|
559
|
+
.addClass( 'loader' );
|
560
|
+
},
|
561
|
+
success : function( response, text_status, xhr )
|
562
|
+
{
|
563
|
+
this
|
564
|
+
.addClass( 'success' );
|
565
|
+
|
566
|
+
delete app.cores_data;
|
567
|
+
sammy.refresh();
|
568
|
+
|
569
|
+
window.setTimeout
|
570
|
+
(
|
571
|
+
function()
|
572
|
+
{
|
573
|
+
reload_button
|
574
|
+
.removeClass( 'success' );
|
575
|
+
},
|
576
|
+
1000
|
577
|
+
);
|
578
|
+
},
|
579
|
+
error : function( xhr, text_status, error_thrown )
|
580
|
+
{
|
581
|
+
this
|
582
|
+
.addClass( 'warn' );
|
583
|
+
|
584
|
+
sammy.trigger( 'cores_load_data', { only_failures : true } );
|
585
|
+
|
586
|
+
window.setTimeout
|
587
|
+
(
|
588
|
+
function()
|
589
|
+
{
|
590
|
+
reload_button
|
591
|
+
.removeClass( 'warn' );
|
592
|
+
},
|
593
|
+
1000
|
594
|
+
);
|
595
|
+
},
|
596
|
+
complete : function( xhr, text_status )
|
597
|
+
{
|
598
|
+
$( 'span', this )
|
599
|
+
.removeClass( 'loader' );
|
600
|
+
}
|
601
|
+
}
|
602
|
+
);
|
603
|
+
}
|
604
|
+
);
|
605
|
+
|
606
|
+
$( '#actions #unload', cores_element )
|
607
|
+
.die( 'click' )
|
608
|
+
.live
|
609
|
+
(
|
610
|
+
'click',
|
611
|
+
function( event )
|
612
|
+
{
|
613
|
+
var ret = confirm( 'Do you really want to unload Core "' + current_core + '"?' );
|
614
|
+
if( !ret )
|
615
|
+
{
|
616
|
+
return false;
|
617
|
+
}
|
618
|
+
|
619
|
+
$.ajax
|
620
|
+
(
|
621
|
+
{
|
622
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=UNLOAD&core=' + current_core,
|
623
|
+
dataType : 'json',
|
624
|
+
context : $( this ),
|
625
|
+
beforeSend : function( xhr, settings )
|
626
|
+
{
|
627
|
+
$( 'span', this )
|
628
|
+
.addClass( 'loader' );
|
629
|
+
},
|
630
|
+
success : function( response, text_status, xhr )
|
631
|
+
{
|
632
|
+
delete app.cores_data;
|
633
|
+
context.redirect( path_parts[1].substr( 0, path_parts[1].length - 1 ) );
|
634
|
+
},
|
635
|
+
error : function( xhr, text_status, error_thrown )
|
636
|
+
{
|
637
|
+
},
|
638
|
+
complete : function( xhr, text_status )
|
639
|
+
{
|
640
|
+
$( 'span', this )
|
641
|
+
.removeClass( 'loader' );
|
642
|
+
}
|
643
|
+
}
|
644
|
+
);
|
645
|
+
}
|
646
|
+
);
|
647
|
+
|
648
|
+
var optimize_button = $( '#actions #optimize', cores_element );
|
649
|
+
optimize_button
|
650
|
+
.die( 'click' )
|
651
|
+
.live
|
652
|
+
(
|
653
|
+
'click',
|
654
|
+
function( event )
|
655
|
+
{
|
656
|
+
$.ajax
|
657
|
+
(
|
658
|
+
{
|
659
|
+
url : core_basepath + '/update?optimize=true&waitFlush=true&wt=json',
|
660
|
+
dataType : 'json',
|
661
|
+
context : $( this ),
|
662
|
+
beforeSend : function( xhr, settings )
|
663
|
+
{
|
664
|
+
$( 'span', this )
|
665
|
+
.addClass( 'loader' );
|
666
|
+
},
|
667
|
+
success : function( response, text_status, xhr )
|
668
|
+
{
|
669
|
+
this
|
670
|
+
.addClass( 'success' );
|
671
|
+
|
672
|
+
window.setTimeout
|
673
|
+
(
|
674
|
+
function()
|
675
|
+
{
|
676
|
+
optimize_button
|
677
|
+
.removeClass( 'success' );
|
678
|
+
},
|
679
|
+
1000
|
680
|
+
);
|
681
|
+
|
682
|
+
$( '.optimized dd.ico-0', index_data_element )
|
683
|
+
.removeClass( 'ico-0' )
|
684
|
+
.addClass( 'ico-1' );
|
685
|
+
},
|
686
|
+
error : function( xhr, text_status, error_thrown)
|
687
|
+
{
|
688
|
+
console.warn( 'd0h, optimize broken!' );
|
689
|
+
},
|
690
|
+
complete : function( xhr, text_status )
|
691
|
+
{
|
692
|
+
$( 'span', this )
|
693
|
+
.removeClass( 'loader' );
|
694
|
+
}
|
695
|
+
}
|
696
|
+
);
|
697
|
+
}
|
698
|
+
);
|
699
|
+
|
700
|
+
$( '.timeago', data_element )
|
701
|
+
.timeago();
|
702
|
+
|
703
|
+
$( 'ul', data_element )
|
704
|
+
.each
|
705
|
+
(
|
706
|
+
function( i, element )
|
707
|
+
{
|
708
|
+
$( 'li:odd', element )
|
709
|
+
.addClass( 'odd' );
|
710
|
+
}
|
711
|
+
)
|
712
|
+
}
|
713
|
+
}
|
714
|
+
);
|
715
|
+
}
|
716
|
+
}
|
717
|
+
);
|
718
|
+
}
|
719
|
+
);
|