rjack-solr 3.6.2.0-java → 4.0.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +5 -0
- data/Manifest.txt +268 -33
- data/NOTICE.txt +1 -1
- data/README.rdoc +6 -6
- data/assembly.xml +2 -2
- data/bin/rjack-solr-fg +1 -1
- data/init/rjack-solr +2 -2
- data/lib/rjack-solr.rb +7 -2
- data/lib/rjack-solr/base.rb +2 -2
- data/lib/rjack-solr/commons-cli-1.2.jar +0 -0
- data/lib/rjack-solr/config.rb +1 -1
- data/lib/rjack-solr/server.rb +1 -1
- data/lib/rjack-solr/solr-core-4.0.0.jar +0 -0
- data/lib/rjack-solr/solr-solrj-4.0.0.jar +0 -0
- data/pom.xml +19 -6
- data/test/test_solr.rb +7 -5
- data/webapp/META-INF/LICENSE.txt +0 -940
- data/webapp/META-INF/MANIFEST.MF +5 -5
- data/webapp/META-INF/NOTICE.txt +160 -93
- data/webapp/WEB-INF/web.xml +57 -43
- data/webapp/admin.html +140 -0
- data/webapp/css/chosen.css +392 -0
- data/webapp/css/styles/analysis.css +293 -0
- data/webapp/css/styles/cloud.css +331 -0
- data/webapp/css/styles/common.css +593 -0
- data/webapp/css/styles/cores.css +203 -0
- data/webapp/css/styles/dashboard.css +127 -0
- data/webapp/css/styles/dataimport.css +222 -0
- data/webapp/css/styles/index.css +195 -0
- data/webapp/css/styles/java-properties.css +33 -0
- data/webapp/css/styles/logging.css +323 -0
- data/webapp/css/styles/menu.css +272 -0
- data/webapp/css/styles/plugins.css +175 -0
- data/webapp/css/styles/query.css +137 -0
- data/webapp/css/styles/replication.css +494 -0
- data/webapp/css/styles/schema-browser.css +476 -0
- data/webapp/css/styles/threads.css +153 -0
- data/webapp/img/ZeroClipboard.swf +0 -0
- data/webapp/img/chosen-sprite.png +0 -0
- data/webapp/img/div.gif +0 -0
- data/webapp/{admin → img}/favicon.ico +0 -0
- data/webapp/img/filetypes/7z.png +0 -0
- data/webapp/img/filetypes/README +27 -0
- data/webapp/img/filetypes/ai.png +0 -0
- data/webapp/img/filetypes/aiff.png +0 -0
- data/webapp/img/filetypes/asc.png +0 -0
- data/webapp/img/filetypes/audio.png +0 -0
- data/webapp/img/filetypes/bin.png +0 -0
- data/webapp/img/filetypes/bz2.png +0 -0
- data/webapp/img/filetypes/c.png +0 -0
- data/webapp/img/filetypes/cfc.png +0 -0
- data/webapp/img/filetypes/cfm.png +0 -0
- data/webapp/img/filetypes/chm.png +0 -0
- data/webapp/img/filetypes/class.png +0 -0
- data/webapp/img/filetypes/conf.png +0 -0
- data/webapp/img/filetypes/cpp.png +0 -0
- data/webapp/img/filetypes/cs.png +0 -0
- data/webapp/img/filetypes/css.png +0 -0
- data/webapp/img/filetypes/csv.png +0 -0
- data/webapp/img/filetypes/deb.png +0 -0
- data/webapp/img/filetypes/divx.png +0 -0
- data/webapp/img/filetypes/doc.png +0 -0
- data/webapp/img/filetypes/dot.png +0 -0
- data/webapp/img/filetypes/eml.png +0 -0
- data/webapp/img/filetypes/enc.png +0 -0
- data/webapp/img/filetypes/file.png +0 -0
- data/webapp/img/filetypes/gif.png +0 -0
- data/webapp/img/filetypes/gz.png +0 -0
- data/webapp/img/filetypes/hlp.png +0 -0
- data/webapp/img/filetypes/htm.png +0 -0
- data/webapp/img/filetypes/html.png +0 -0
- data/webapp/img/filetypes/image.png +0 -0
- data/webapp/img/filetypes/iso.png +0 -0
- data/webapp/img/filetypes/jar.png +0 -0
- data/webapp/img/filetypes/java.png +0 -0
- data/webapp/img/filetypes/jpeg.png +0 -0
- data/webapp/img/filetypes/jpg.png +0 -0
- data/webapp/img/filetypes/js.png +0 -0
- data/webapp/img/filetypes/lua.png +0 -0
- data/webapp/img/filetypes/m.png +0 -0
- data/webapp/img/filetypes/mm.png +0 -0
- data/webapp/img/filetypes/mov.png +0 -0
- data/webapp/img/filetypes/mp3.png +0 -0
- data/webapp/img/filetypes/mpg.png +0 -0
- data/webapp/img/filetypes/odc.png +0 -0
- data/webapp/img/filetypes/odf.png +0 -0
- data/webapp/img/filetypes/odg.png +0 -0
- data/webapp/img/filetypes/odi.png +0 -0
- data/webapp/img/filetypes/odp.png +0 -0
- data/webapp/img/filetypes/ods.png +0 -0
- data/webapp/img/filetypes/odt.png +0 -0
- data/webapp/img/filetypes/ogg.png +0 -0
- data/webapp/img/filetypes/pdf.png +0 -0
- data/webapp/img/filetypes/pgp.png +0 -0
- data/webapp/img/filetypes/php.png +0 -0
- data/webapp/img/filetypes/pl.png +0 -0
- data/webapp/img/filetypes/png.png +0 -0
- data/webapp/img/filetypes/ppt.png +0 -0
- data/webapp/img/filetypes/ps.png +0 -0
- data/webapp/img/filetypes/py.png +0 -0
- data/webapp/img/filetypes/ram.png +0 -0
- data/webapp/img/filetypes/rar.png +0 -0
- data/webapp/img/filetypes/rb.png +0 -0
- data/webapp/img/filetypes/rm.png +0 -0
- data/webapp/img/filetypes/rpm.png +0 -0
- data/webapp/img/filetypes/rtf.png +0 -0
- data/webapp/img/filetypes/sig.png +0 -0
- data/webapp/img/filetypes/sql.png +0 -0
- data/webapp/img/filetypes/swf.png +0 -0
- data/webapp/img/filetypes/sxc.png +0 -0
- data/webapp/img/filetypes/sxd.png +0 -0
- data/webapp/img/filetypes/sxi.png +0 -0
- data/webapp/img/filetypes/sxw.png +0 -0
- data/webapp/img/filetypes/tar.png +0 -0
- data/webapp/img/filetypes/tex.png +0 -0
- data/webapp/img/filetypes/tgz.png +0 -0
- data/webapp/img/filetypes/txt.png +0 -0
- data/webapp/img/filetypes/vcf.png +0 -0
- data/webapp/img/filetypes/video.png +0 -0
- data/webapp/img/filetypes/vsd.png +0 -0
- data/webapp/img/filetypes/wav.png +0 -0
- data/webapp/img/filetypes/wma.png +0 -0
- data/webapp/img/filetypes/wmv.png +0 -0
- data/webapp/img/filetypes/xls.png +0 -0
- data/webapp/img/filetypes/xml.png +0 -0
- data/webapp/img/filetypes/xpi.png +0 -0
- data/webapp/img/filetypes/xvid.png +0 -0
- data/webapp/img/filetypes/zip.png +0 -0
- data/webapp/img/ico/arrow-000-small.png +0 -0
- data/webapp/img/ico/arrow-circle.png +0 -0
- data/webapp/img/ico/arrow-switch.png +0 -0
- data/webapp/img/ico/asterisk.png +0 -0
- data/webapp/img/ico/battery.png +0 -0
- data/webapp/img/ico/block-small.png +0 -0
- data/webapp/img/ico/block.png +0 -0
- data/webapp/img/ico/book-open-text.png +0 -0
- data/webapp/img/ico/box.png +0 -0
- data/webapp/img/ico/bug.png +0 -0
- data/webapp/img/ico/chart.png +0 -0
- data/webapp/img/ico/chevron-small-expand.png +0 -0
- data/webapp/img/ico/chevron-small.png +0 -0
- data/webapp/img/ico/clipboard-list.png +0 -0
- data/webapp/img/ico/clipboard-paste-document-text.png +0 -0
- data/webapp/img/ico/clipboard-paste.png +0 -0
- data/webapp/img/ico/clock-select-remain.png +0 -0
- data/webapp/img/ico/clock-select.png +0 -0
- data/webapp/img/ico/construction.png +0 -0
- data/webapp/img/ico/cross-0.png +0 -0
- data/webapp/img/ico/cross-1.png +0 -0
- data/webapp/img/ico/cross.png +0 -0
- data/webapp/img/ico/dashboard.png +0 -0
- data/webapp/img/ico/database.png +0 -0
- data/webapp/img/ico/databases.png +0 -0
- data/webapp/img/ico/disk-black.png +0 -0
- data/webapp/img/ico/document-convert.png +0 -0
- data/webapp/img/ico/document-import.png +0 -0
- data/webapp/img/ico/document-list.png +0 -0
- data/webapp/img/ico/document-text.png +0 -0
- data/webapp/img/ico/download-cloud.png +0 -0
- data/webapp/img/ico/exclamation-button.png +0 -0
- data/webapp/img/ico/eye.png +0 -0
- data/webapp/img/ico/folder-export.png +0 -0
- data/webapp/img/ico/folder-tree.png +0 -0
- data/webapp/img/ico/folder.png +0 -0
- data/webapp/img/ico/funnel-small.png +0 -0
- data/webapp/img/ico/funnel.png +0 -0
- data/webapp/img/ico/gear.png +0 -0
- data/webapp/img/ico/globe-network.png +0 -0
- data/webapp/img/ico/globe.png +0 -0
- data/webapp/img/ico/hammer-screwdriver.png +0 -0
- data/webapp/img/ico/hand.png +0 -0
- data/webapp/img/ico/highlighter-text.png +0 -0
- data/webapp/img/ico/hourglass--exclamation.png +0 -0
- data/webapp/img/ico/hourglass.png +0 -0
- data/webapp/img/ico/inbox-document-text.png +0 -0
- data/webapp/img/ico/information-button.png +0 -0
- data/webapp/img/ico/information-small.png +0 -0
- data/webapp/img/ico/information-white.png +0 -0
- data/webapp/img/ico/information.png +0 -0
- data/webapp/img/ico/jar.png +0 -0
- data/webapp/img/ico/magnifier.png +0 -0
- data/webapp/img/ico/mail.png +0 -0
- data/webapp/img/ico/memory.png +0 -0
- data/webapp/img/ico/molecule.png +0 -0
- data/webapp/img/ico/network-cloud.png +0 -0
- data/webapp/img/ico/network-status-away.png +0 -0
- data/webapp/img/ico/network-status-busy.png +0 -0
- data/webapp/img/ico/network-status-offline.png +0 -0
- data/webapp/img/ico/network-status.png +0 -0
- data/webapp/img/ico/network.png +0 -0
- data/webapp/img/ico/node-design.png +0 -0
- data/webapp/img/ico/node-master.png +0 -0
- data/webapp/img/ico/node-select.png +0 -0
- data/webapp/img/ico/node-slave.png +0 -0
- data/webapp/img/ico/node.png +0 -0
- data/webapp/img/ico/pencil-small.png +0 -0
- data/webapp/img/ico/plus-button.png +0 -0
- data/webapp/img/ico/processor.png +0 -0
- data/webapp/img/ico/prohibition.png +0 -0
- data/webapp/img/ico/property.png +0 -0
- data/webapp/img/ico/question-small-white.png +0 -0
- data/webapp/img/ico/question-white.png +0 -0
- data/webapp/img/ico/question.png +0 -0
- data/webapp/img/ico/receipt-invoice.png +0 -0
- data/webapp/img/ico/receipt.png +0 -0
- data/webapp/img/ico/script-code.png +0 -0
- data/webapp/img/ico/server-cast.png +0 -0
- data/webapp/img/ico/server.png +0 -0
- data/webapp/img/ico/sitemap.png +0 -0
- data/webapp/img/ico/slash.png +0 -0
- data/webapp/img/ico/status-away.png +0 -0
- data/webapp/img/ico/status-busy.png +0 -0
- data/webapp/img/ico/status-offline.png +0 -0
- data/webapp/img/ico/status.png +0 -0
- data/webapp/img/ico/system-monitor--exclamation.png +0 -0
- data/webapp/img/ico/system-monitor.png +0 -0
- data/webapp/img/ico/table.png +0 -0
- data/webapp/img/ico/terminal.png +0 -0
- data/webapp/img/ico/tick-circle.png +0 -0
- data/webapp/img/ico/tick-red.png +0 -0
- data/webapp/img/ico/tick.png +0 -0
- data/webapp/img/ico/toggle-small-expand.png +0 -0
- data/webapp/img/ico/toggle-small.png +0 -0
- data/webapp/img/ico/toolbox.png +0 -0
- data/webapp/img/ico/ui-accordion.png +0 -0
- data/webapp/img/ico/ui-address-bar.png +0 -0
- data/webapp/img/ico/ui-check-box-uncheck.png +0 -0
- data/webapp/img/ico/ui-check-box.png +0 -0
- data/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
- data/webapp/img/ico/ui-radio-button.png +0 -0
- data/webapp/img/ico/ui-text-field-select.png +0 -0
- data/webapp/img/ico/users.png +0 -0
- data/webapp/img/ico/wooden-box.png +0 -0
- data/webapp/img/ico/zone.png +0 -0
- data/webapp/img/loader-light.gif +0 -0
- data/webapp/img/loader.gif +0 -0
- data/webapp/img/lucene-ico.png +0 -0
- data/webapp/img/solr-ico.png +0 -0
- data/webapp/{admin/solr_small.png → img/solr.png} +0 -0
- data/webapp/img/tree.png +0 -0
- data/webapp/js/lib/ZeroClipboard.js +317 -0
- data/webapp/js/lib/chosen.js +953 -0
- data/webapp/{admin/get-properties.jsp → js/lib/console.js} +13 -10
- data/webapp/js/lib/d3.js +9342 -0
- data/webapp/js/lib/highlight.js +1 -0
- data/webapp/{admin/jquery-1.4.3.min.js → js/lib/jquery-1.7.2.min.js} +0 -0
- data/webapp/js/lib/jquery.blockUI.js +499 -0
- data/webapp/js/lib/jquery.cookie.js +47 -0
- data/webapp/js/lib/jquery.form.js +782 -0
- data/webapp/js/lib/jquery.jstree.js +3510 -0
- data/webapp/js/lib/jquery.sammy.js +1856 -0
- data/webapp/js/lib/jquery.sparkline.js +1271 -0
- data/webapp/js/lib/jquery.timeago.js +165 -0
- data/webapp/js/lib/linker.js +48 -0
- data/webapp/js/lib/order.js +189 -0
- data/webapp/js/main.js +57 -0
- data/webapp/js/require.js +11319 -0
- data/webapp/js/scripts/analysis.js +549 -0
- data/webapp/js/scripts/app.js +368 -0
- data/webapp/js/scripts/cloud.js +719 -0
- data/webapp/js/scripts/cores.js +540 -0
- data/webapp/js/scripts/dashboard.js +540 -0
- data/webapp/js/scripts/dataimport.js +567 -0
- data/webapp/js/scripts/file.js +56 -0
- data/webapp/js/scripts/index.js +344 -0
- data/webapp/js/scripts/java-properties.js +107 -0
- data/webapp/js/scripts/logging.js +519 -0
- data/webapp/js/scripts/ping.js +72 -0
- data/webapp/js/scripts/plugins.js +426 -0
- data/webapp/js/scripts/query.js +170 -0
- data/webapp/js/scripts/replication.js +557 -0
- data/webapp/js/scripts/schema-browser.js +1206 -0
- data/webapp/js/scripts/threads.js +159 -0
- data/webapp/tpl/analysis.html +83 -0
- data/webapp/tpl/cloud.html +54 -0
- data/webapp/tpl/cores.html +215 -0
- data/webapp/tpl/dashboard.html +164 -0
- data/webapp/tpl/dataimport.html +123 -0
- data/webapp/tpl/index.html +250 -0
- data/webapp/tpl/logging.html +23 -0
- data/webapp/tpl/plugins.html +39 -0
- data/webapp/tpl/query.html +318 -0
- data/webapp/tpl/replication.html +207 -0
- data/webapp/tpl/schema-browser.html +178 -0
- data/webapp/tpl/threads.html +56 -0
- metadata +307 -40
- data/lib/rjack-solr/solr-core-3.6.2.jar +0 -0
- data/lib/rjack-solr/solr-solrj-3.6.2.jar +0 -0
- data/webapp/admin/_info.jsp +0 -120
- data/webapp/admin/action.jsp +0 -94
- data/webapp/admin/analysis.jsp +0 -496
- data/webapp/admin/analysis.xsl +0 -179
- data/webapp/admin/dataimport.jsp +0 -53
- data/webapp/admin/debug.jsp +0 -103
- data/webapp/admin/distributiondump.jsp +0 -160
- data/webapp/admin/form.jsp +0 -152
- data/webapp/admin/get-file.jsp +0 -72
- data/webapp/admin/header.jsp +0 -44
- data/webapp/admin/index.jsp +0 -162
- data/webapp/admin/meta.xsl +0 -34
- data/webapp/admin/ping.jsp +0 -52
- data/webapp/admin/ping.xsl +0 -71
- data/webapp/admin/raw-schema.jsp +0 -38
- data/webapp/admin/registry.jsp +0 -107
- data/webapp/admin/registry.xsl +0 -321
- data/webapp/admin/replication/header.jsp +0 -89
- data/webapp/admin/replication/index.jsp +0 -378
- data/webapp/admin/schema.jsp +0 -690
- data/webapp/admin/solr-admin.css +0 -215
- data/webapp/admin/stats.jsp +0 -92
- data/webapp/admin/stats.xsl +0 -220
- data/webapp/admin/tabular.xsl +0 -141
- data/webapp/admin/threaddump.jsp +0 -110
- data/webapp/admin/threaddump.xsl +0 -103
- data/webapp/index.jsp +0 -49
@@ -0,0 +1,540 @@
|
|
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
|
+
if( app.cores_data )
|
24
|
+
{
|
25
|
+
params.callback( app.cores_data );
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
|
29
|
+
$.ajax
|
30
|
+
(
|
31
|
+
{
|
32
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json',
|
33
|
+
dataType : 'json',
|
34
|
+
beforeSend : function( xhr, settings )
|
35
|
+
{
|
36
|
+
},
|
37
|
+
success : function( response, text_status, xhr )
|
38
|
+
{
|
39
|
+
app.cores_data = response.status;
|
40
|
+
params.callback( app.cores_data );
|
41
|
+
},
|
42
|
+
error : function( xhr, text_status, error_thrown)
|
43
|
+
{
|
44
|
+
},
|
45
|
+
complete : function( xhr, text_status )
|
46
|
+
{
|
47
|
+
}
|
48
|
+
}
|
49
|
+
);
|
50
|
+
}
|
51
|
+
);
|
52
|
+
|
53
|
+
sammy.bind
|
54
|
+
(
|
55
|
+
'cores_build_navigation',
|
56
|
+
function( event, params )
|
57
|
+
{
|
58
|
+
var navigation_content = ['<ul>'];
|
59
|
+
|
60
|
+
for( var core in params.cores )
|
61
|
+
{
|
62
|
+
var core_name = core;
|
63
|
+
if( !core_name )
|
64
|
+
{
|
65
|
+
core_name = '<em>(empty)</em>';
|
66
|
+
}
|
67
|
+
navigation_content.push( '<li><a href="' + params.basepath + core + '">' + core_name + '</a></li>' );
|
68
|
+
}
|
69
|
+
|
70
|
+
params.navigation_element
|
71
|
+
.html( navigation_content.join( "\n" ) );
|
72
|
+
|
73
|
+
$( 'a[href="' + params.basepath + params.current_core + '"]', params.navigation_element ).parent()
|
74
|
+
.addClass( 'current' );
|
75
|
+
}
|
76
|
+
);
|
77
|
+
|
78
|
+
sammy.bind
|
79
|
+
(
|
80
|
+
'cores_load_template',
|
81
|
+
function( event, params )
|
82
|
+
{
|
83
|
+
if( app.cores_template )
|
84
|
+
{
|
85
|
+
params.callback();
|
86
|
+
return true;
|
87
|
+
}
|
88
|
+
|
89
|
+
$.get
|
90
|
+
(
|
91
|
+
'tpl/cores.html',
|
92
|
+
function( template )
|
93
|
+
{
|
94
|
+
params.content_element
|
95
|
+
.html( template );
|
96
|
+
|
97
|
+
app.cores_template = template;
|
98
|
+
params.callback();
|
99
|
+
}
|
100
|
+
);
|
101
|
+
}
|
102
|
+
);
|
103
|
+
|
104
|
+
// #/~cores
|
105
|
+
sammy.get
|
106
|
+
(
|
107
|
+
/^#\/(~cores)$/,
|
108
|
+
function( context )
|
109
|
+
{
|
110
|
+
delete app.cores_template;
|
111
|
+
|
112
|
+
sammy.trigger
|
113
|
+
(
|
114
|
+
'cores_load_data',
|
115
|
+
{
|
116
|
+
callback : function( cores )
|
117
|
+
{
|
118
|
+
var first_core = null;
|
119
|
+
for( var key in cores )
|
120
|
+
{
|
121
|
+
if( !first_core )
|
122
|
+
{
|
123
|
+
first_core = key;
|
124
|
+
}
|
125
|
+
continue;
|
126
|
+
}
|
127
|
+
context.redirect( context.path + '/' + first_core );
|
128
|
+
}
|
129
|
+
}
|
130
|
+
);
|
131
|
+
}
|
132
|
+
);
|
133
|
+
|
134
|
+
// #/~cores
|
135
|
+
sammy.get
|
136
|
+
(
|
137
|
+
/^#\/(~cores)\//,
|
138
|
+
function( context )
|
139
|
+
{
|
140
|
+
var content_element = $( '#content' );
|
141
|
+
|
142
|
+
var path_parts = this.path.match( /^(.+\/~cores\/)(.*)$/ );
|
143
|
+
var current_core = path_parts[2];
|
144
|
+
|
145
|
+
sammy.trigger
|
146
|
+
(
|
147
|
+
'cores_load_data',
|
148
|
+
{
|
149
|
+
callback : function( cores )
|
150
|
+
{
|
151
|
+
sammy.trigger
|
152
|
+
(
|
153
|
+
'cores_load_template',
|
154
|
+
{
|
155
|
+
content_element : content_element,
|
156
|
+
callback : function()
|
157
|
+
{
|
158
|
+
var cores_element = $( '#cores', content_element );
|
159
|
+
var navigation_element = $( '#navigation', cores_element );
|
160
|
+
var data_element = $( '#data', cores_element );
|
161
|
+
var core_data_element = $( '#core-data', data_element );
|
162
|
+
var index_data_element = $( '#index-data', data_element );
|
163
|
+
|
164
|
+
sammy.trigger
|
165
|
+
(
|
166
|
+
'cores_build_navigation',
|
167
|
+
{
|
168
|
+
cores : cores,
|
169
|
+
basepath : path_parts[1],
|
170
|
+
current_core : current_core,
|
171
|
+
navigation_element : navigation_element
|
172
|
+
}
|
173
|
+
);
|
174
|
+
|
175
|
+
var core_data = cores[current_core];
|
176
|
+
var core_basepath = $( '#' + current_core, app.menu_element ).attr( 'data-basepath' );
|
177
|
+
|
178
|
+
// core-data
|
179
|
+
|
180
|
+
$( '.startTime dd', core_data_element )
|
181
|
+
.html( core_data.startTime );
|
182
|
+
|
183
|
+
$( '.instanceDir dd', core_data_element )
|
184
|
+
.html( core_data.instanceDir );
|
185
|
+
|
186
|
+
$( '.dataDir dd', core_data_element )
|
187
|
+
.html( core_data.dataDir );
|
188
|
+
|
189
|
+
// index-data
|
190
|
+
|
191
|
+
$( '.lastModified dd', index_data_element )
|
192
|
+
.html( core_data.index.lastModified );
|
193
|
+
|
194
|
+
$( '.version dd', index_data_element )
|
195
|
+
.html( core_data.index.version );
|
196
|
+
|
197
|
+
$( '.numDocs dd', index_data_element )
|
198
|
+
.html( core_data.index.numDocs );
|
199
|
+
|
200
|
+
$( '.maxDoc dd', index_data_element )
|
201
|
+
.html( core_data.index.maxDoc );
|
202
|
+
|
203
|
+
$( '.optimized dd', index_data_element )
|
204
|
+
.addClass( !core_data.index.hasDeletions ? 'ico-1' : 'ico-0' );
|
205
|
+
|
206
|
+
$( '#actions #optimize', cores_element )
|
207
|
+
.show();
|
208
|
+
|
209
|
+
$( '.optimized dd span', index_data_element )
|
210
|
+
.html( !core_data.index.hasDeletions ? 'yes' : 'no' );
|
211
|
+
|
212
|
+
$( '.current dd', index_data_element )
|
213
|
+
.addClass( core_data.index.current ? 'ico-1' : 'ico-0' );
|
214
|
+
|
215
|
+
$( '.current dd span', index_data_element )
|
216
|
+
.html( core_data.index.current ? 'yes' : 'no' );
|
217
|
+
|
218
|
+
$( '.directory dd', index_data_element )
|
219
|
+
.html
|
220
|
+
(
|
221
|
+
core_data.index.directory
|
222
|
+
.replace( /:/g, ':​' )
|
223
|
+
.replace( /@/g, '@​' )
|
224
|
+
);
|
225
|
+
|
226
|
+
var core_names = [];
|
227
|
+
var core_selects = $( '#actions select', cores_element );
|
228
|
+
|
229
|
+
for( var key in cores )
|
230
|
+
{
|
231
|
+
core_names.push( '<option value="' + key + '">' + key + '</option>' )
|
232
|
+
}
|
233
|
+
|
234
|
+
core_selects
|
235
|
+
.html( core_names.join( "\n") );
|
236
|
+
|
237
|
+
$( 'option[value="' + current_core + '"]', core_selects.filter( '.other' ) )
|
238
|
+
.remove();
|
239
|
+
|
240
|
+
$( 'input[data-core="current"]', cores_element )
|
241
|
+
.val( current_core );
|
242
|
+
|
243
|
+
// layout
|
244
|
+
|
245
|
+
var ui_block = $( '#ui-block' );
|
246
|
+
var actions_element = $( '.actions', cores_element );
|
247
|
+
var div_action = $( 'div.action', actions_element );
|
248
|
+
|
249
|
+
ui_block
|
250
|
+
.css( 'opacity', 0.7 )
|
251
|
+
.width( cores_element.width() + 10 )
|
252
|
+
.height( cores_element.height() );
|
253
|
+
|
254
|
+
if( $( '#cloud.global' ).is( ':visible' ) )
|
255
|
+
{
|
256
|
+
$( '.cloud', div_action )
|
257
|
+
.show();
|
258
|
+
}
|
259
|
+
|
260
|
+
$( 'button.action', actions_element )
|
261
|
+
.die( 'click' )
|
262
|
+
.live
|
263
|
+
(
|
264
|
+
'click',
|
265
|
+
function( event )
|
266
|
+
{
|
267
|
+
var self = $( this );
|
268
|
+
|
269
|
+
self
|
270
|
+
.toggleClass( 'open' );
|
271
|
+
|
272
|
+
$( '.action.' + self.attr( 'id' ), actions_element )
|
273
|
+
.trigger( 'open' );
|
274
|
+
|
275
|
+
return false;
|
276
|
+
}
|
277
|
+
);
|
278
|
+
|
279
|
+
div_action
|
280
|
+
.die( 'close' )
|
281
|
+
.live
|
282
|
+
(
|
283
|
+
'close',
|
284
|
+
function( event )
|
285
|
+
{
|
286
|
+
div_action.hide();
|
287
|
+
ui_block.hide();
|
288
|
+
}
|
289
|
+
)
|
290
|
+
.die( 'open' )
|
291
|
+
.live
|
292
|
+
(
|
293
|
+
'open',
|
294
|
+
function( event )
|
295
|
+
{
|
296
|
+
var self = $( this );
|
297
|
+
var rel = $( '#' + self.data( 'rel' ) );
|
298
|
+
|
299
|
+
self
|
300
|
+
.trigger( 'close' )
|
301
|
+
.show()
|
302
|
+
.css( 'left', rel.position().left );
|
303
|
+
|
304
|
+
ui_block
|
305
|
+
.show();
|
306
|
+
}
|
307
|
+
);
|
308
|
+
|
309
|
+
$( 'form button.reset', actions_element )
|
310
|
+
.die( 'click' )
|
311
|
+
.live
|
312
|
+
(
|
313
|
+
'click',
|
314
|
+
function( event )
|
315
|
+
{
|
316
|
+
$( this ).closest( 'div.action' )
|
317
|
+
.trigger( 'close' );
|
318
|
+
}
|
319
|
+
);
|
320
|
+
|
321
|
+
var form_callback = {
|
322
|
+
|
323
|
+
rename : function( form, response )
|
324
|
+
{
|
325
|
+
var url = path_parts[1] + $( 'input[name="other"]', form ).val();
|
326
|
+
context.redirect( url );
|
327
|
+
}
|
328
|
+
|
329
|
+
};
|
330
|
+
|
331
|
+
$( 'form', div_action )
|
332
|
+
.ajaxForm
|
333
|
+
(
|
334
|
+
{
|
335
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json',
|
336
|
+
dataType : 'json',
|
337
|
+
beforeSubmit : function( array, form, options )
|
338
|
+
{
|
339
|
+
$( 'button[type="submit"] span', form )
|
340
|
+
.addClass( 'loader' );
|
341
|
+
},
|
342
|
+
success : function( response, status_text, xhr, form )
|
343
|
+
{
|
344
|
+
var action = $( 'input[name="action"]', form ).val().toLowerCase();
|
345
|
+
|
346
|
+
delete app.cores_data;
|
347
|
+
|
348
|
+
if( form_callback[action] )
|
349
|
+
{
|
350
|
+
form_callback[action]( form, response );
|
351
|
+
}
|
352
|
+
else
|
353
|
+
{
|
354
|
+
sammy.refresh();
|
355
|
+
}
|
356
|
+
|
357
|
+
$( 'button.reset', form )
|
358
|
+
.trigger( 'click' );
|
359
|
+
},
|
360
|
+
error : function( xhr, text_status, error_thrown )
|
361
|
+
{
|
362
|
+
var response = null;
|
363
|
+
eval( 'response = ' + xhr.responseText + ';' );
|
364
|
+
|
365
|
+
var error_elem = $( '.error', div_action.filter( ':visible' ) );
|
366
|
+
error_elem.show();
|
367
|
+
$( 'span', error_elem ).text( response.error.msg );
|
368
|
+
},
|
369
|
+
complete : function()
|
370
|
+
{
|
371
|
+
$( 'button span.loader', actions_element )
|
372
|
+
.removeClass( 'loader' );
|
373
|
+
}
|
374
|
+
}
|
375
|
+
);
|
376
|
+
|
377
|
+
var reload_button = $( '#actions #reload', cores_element );
|
378
|
+
reload_button
|
379
|
+
.die( 'click' )
|
380
|
+
.live
|
381
|
+
(
|
382
|
+
'click',
|
383
|
+
function( event )
|
384
|
+
{
|
385
|
+
$.ajax
|
386
|
+
(
|
387
|
+
{
|
388
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=RELOAD&core=' + current_core,
|
389
|
+
dataType : 'json',
|
390
|
+
context : $( this ),
|
391
|
+
beforeSend : function( xhr, settings )
|
392
|
+
{
|
393
|
+
$( 'span', this )
|
394
|
+
.addClass( 'loader' );
|
395
|
+
},
|
396
|
+
success : function( response, text_status, xhr )
|
397
|
+
{
|
398
|
+
this
|
399
|
+
.addClass( 'success' );
|
400
|
+
|
401
|
+
delete app.cores_data;
|
402
|
+
sammy.refresh();
|
403
|
+
|
404
|
+
window.setTimeout
|
405
|
+
(
|
406
|
+
function()
|
407
|
+
{
|
408
|
+
reload_button
|
409
|
+
.removeClass( 'success' );
|
410
|
+
},
|
411
|
+
1000
|
412
|
+
);
|
413
|
+
},
|
414
|
+
error : function( xhr, text_status, error_thrown )
|
415
|
+
{
|
416
|
+
},
|
417
|
+
complete : function( xhr, text_status )
|
418
|
+
{
|
419
|
+
$( 'span', this )
|
420
|
+
.removeClass( 'loader' );
|
421
|
+
}
|
422
|
+
}
|
423
|
+
);
|
424
|
+
}
|
425
|
+
);
|
426
|
+
|
427
|
+
$( '#actions #unload', cores_element )
|
428
|
+
.die( 'click' )
|
429
|
+
.live
|
430
|
+
(
|
431
|
+
'click',
|
432
|
+
function( event )
|
433
|
+
{
|
434
|
+
var ret = confirm( 'Do you really want to unload Core "' + current_core + '"?' );
|
435
|
+
if( !ret )
|
436
|
+
{
|
437
|
+
return false;
|
438
|
+
}
|
439
|
+
|
440
|
+
$.ajax
|
441
|
+
(
|
442
|
+
{
|
443
|
+
url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=UNLOAD&core=' + current_core,
|
444
|
+
dataType : 'json',
|
445
|
+
context : $( this ),
|
446
|
+
beforeSend : function( xhr, settings )
|
447
|
+
{
|
448
|
+
$( 'span', this )
|
449
|
+
.addClass( 'loader' );
|
450
|
+
},
|
451
|
+
success : function( response, text_status, xhr )
|
452
|
+
{
|
453
|
+
delete app.cores_data;
|
454
|
+
context.redirect( path_parts[1].substr( 0, path_parts[1].length - 1 ) );
|
455
|
+
},
|
456
|
+
error : function( xhr, text_status, error_thrown )
|
457
|
+
{
|
458
|
+
},
|
459
|
+
complete : function( xhr, text_status )
|
460
|
+
{
|
461
|
+
$( 'span', this )
|
462
|
+
.removeClass( 'loader' );
|
463
|
+
}
|
464
|
+
}
|
465
|
+
);
|
466
|
+
}
|
467
|
+
);
|
468
|
+
|
469
|
+
var optimize_button = $( '#actions #optimize', cores_element );
|
470
|
+
optimize_button
|
471
|
+
.die( 'click' )
|
472
|
+
.live
|
473
|
+
(
|
474
|
+
'click',
|
475
|
+
function( event )
|
476
|
+
{
|
477
|
+
$.ajax
|
478
|
+
(
|
479
|
+
{
|
480
|
+
url : core_basepath + '/update?optimize=true&waitFlush=true&wt=json',
|
481
|
+
dataType : 'json',
|
482
|
+
context : $( this ),
|
483
|
+
beforeSend : function( xhr, settings )
|
484
|
+
{
|
485
|
+
$( 'span', this )
|
486
|
+
.addClass( 'loader' );
|
487
|
+
},
|
488
|
+
success : function( response, text_status, xhr )
|
489
|
+
{
|
490
|
+
this
|
491
|
+
.addClass( 'success' );
|
492
|
+
|
493
|
+
window.setTimeout
|
494
|
+
(
|
495
|
+
function()
|
496
|
+
{
|
497
|
+
optimize_button
|
498
|
+
.removeClass( 'success' );
|
499
|
+
},
|
500
|
+
1000
|
501
|
+
);
|
502
|
+
|
503
|
+
$( '.optimized dd.ico-0', index_data_element )
|
504
|
+
.removeClass( 'ico-0' )
|
505
|
+
.addClass( 'ico-1' );
|
506
|
+
},
|
507
|
+
error : function( xhr, text_status, error_thrown)
|
508
|
+
{
|
509
|
+
console.warn( 'd0h, optimize broken!' );
|
510
|
+
},
|
511
|
+
complete : function( xhr, text_status )
|
512
|
+
{
|
513
|
+
$( 'span', this )
|
514
|
+
.removeClass( 'loader' );
|
515
|
+
}
|
516
|
+
}
|
517
|
+
);
|
518
|
+
}
|
519
|
+
);
|
520
|
+
|
521
|
+
$( '.timeago', data_element )
|
522
|
+
.timeago();
|
523
|
+
|
524
|
+
$( 'ul', data_element )
|
525
|
+
.each
|
526
|
+
(
|
527
|
+
function( i, element )
|
528
|
+
{
|
529
|
+
$( 'li:odd', element )
|
530
|
+
.addClass( 'odd' );
|
531
|
+
}
|
532
|
+
)
|
533
|
+
}
|
534
|
+
}
|
535
|
+
);
|
536
|
+
}
|
537
|
+
}
|
538
|
+
);
|
539
|
+
}
|
540
|
+
);
|