Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update webapp for solr4.2

  • Loading branch information...
commit 8bb5d9fc2d5a35add488f7d69bb63149ff0696ba 1 parent 5eb3e48
Riccardo Cambiassi authored March 28, 2013

Showing 27 changed files with 618 additions and 339 deletions. Show diff stats Hide diff stats

  1. 6  sunspot_solr/solr/solr-webapp/webapp/META-INF/MANIFEST.MF
  2. 12  sunspot_solr/solr/solr-webapp/webapp/META-INF/NOTICE.txt
  3. 14  sunspot_solr/solr/solr-webapp/webapp/WEB-INF/web.xml
  4. 8  sunspot_solr/solr/solr-webapp/webapp/admin.html
  5. 5  sunspot_solr/solr/solr-webapp/webapp/css/styles/analysis.css
  6. 52  sunspot_solr/solr/solr-webapp/webapp/css/styles/cloud.css
  7. 8  sunspot_solr/solr/solr-webapp/webapp/css/styles/common.css
  8. 5  sunspot_solr/solr/solr-webapp/webapp/css/styles/index.css
  9. 73  sunspot_solr/solr/solr-webapp/webapp/css/styles/menu.css
  10. 127  sunspot_solr/solr/solr-webapp/webapp/css/styles/schema-browser.css
  11. BIN  sunspot_solr/solr/solr-webapp/webapp/img/ico/home.png
  12. 1  sunspot_solr/solr/solr-webapp/webapp/js/main.js
  13. 6  sunspot_solr/solr/solr-webapp/webapp/js/scripts/analysis.js
  14. 189  sunspot_solr/solr/solr-webapp/webapp/js/scripts/app.js
  15. 8  sunspot_solr/solr/solr-webapp/webapp/js/scripts/cores.js
  16. 11  sunspot_solr/solr/solr-webapp/webapp/js/scripts/dataimport.js
  17. 71  sunspot_solr/solr/solr-webapp/webapp/js/scripts/index.js
  18. 2  sunspot_solr/solr/solr-webapp/webapp/js/scripts/java-properties.js
  19. 4  sunspot_solr/solr/solr-webapp/webapp/js/scripts/logging.js
  20. 2  sunspot_solr/solr/solr-webapp/webapp/js/scripts/ping.js
  21. 8  sunspot_solr/solr/solr-webapp/webapp/js/scripts/plugins.js
  22. 4  sunspot_solr/solr/solr-webapp/webapp/js/scripts/query.js
  23. 296  sunspot_solr/solr/solr-webapp/webapp/js/scripts/schema-browser.js
  24. 2  sunspot_solr/solr/solr-webapp/webapp/js/scripts/threads.js
  25. 2  sunspot_solr/solr/solr-webapp/webapp/tpl/analysis.html
  26. 11  sunspot_solr/solr/solr-webapp/webapp/tpl/cloud.html
  27. 30  sunspot_solr/solr/solr-webapp/webapp/tpl/schema-browser.html
6  sunspot_solr/solr/solr-webapp/webapp/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
2 2
 Implementation-Vendor: The Apache Software Foundation
3 3
 Ant-Version: Apache Ant 1.8.2
4 4
 Implementation-Title: org.apache.solr
5  
-Implementation-Version: 4.1.0 1434440 - sarowe - 2013-01-16 17:21:33
  5
+Implementation-Version: 4.2.0 1453694 - rmuir - 2013-03-06 22:32:08
6 6
 Specification-Vendor: The Apache Software Foundation
7 7
 Specification-Title: Apache Solr Search Server
8  
-Created-By: 1.6.0_37-b06-434-11M3909 (Apple Inc.)
9  
-Specification-Version: 4.1.0.2013.01.16.17.21.33
  8
+Created-By: 1.7.0_09-b05 (Oracle Corporation)
  9
+Specification-Version: 4.2.0.2013.03.06.22.32.08
10 10
 Extension-Name: org.apache.solr
11 11
 X-Compile-Source-JDK: 1.6
12 12
 X-Compile-Target-JDK: 1.6
12  sunspot_solr/solr/solr-webapp/webapp/META-INF/NOTICE.txt
@@ -503,3 +503,15 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
503 503
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
504 504
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
505 505
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  506
+
  507
+=========================================================================
  508
+==     Restlet Notice                                                  ==
  509
+=========================================================================
  510
+
  511
+Copyright (C) 2005-2013 Restlet S.A.S.
  512
+
  513
+Restlet is a registered trademark of Restlet S.A.S.
  514
+
  515
+This product contains software developed by the Restlet project.
  516
+
  517
+See http://www.restlet.org/
14  sunspot_solr/solr/solr-webapp/webapp/WEB-INF/web.xml
@@ -125,6 +125,15 @@
125 125
       <param-value>${context}/#/~logging</param-value>
126 126
     </init-param>
127 127
   </servlet>
  128
+
  129
+  <servlet>
  130
+    <servlet-name>SchemaRestApi</servlet-name>
  131
+    <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
  132
+    <init-param>
  133
+      <param-name>org.restlet.application</param-name>
  134
+      <param-value>org.apache.solr.rest.SchemaRestApi</param-value>
  135
+    </init-param>
  136
+  </servlet>
128 137
   
129 138
   <servlet-mapping>
130 139
     <servlet-name>RedirectOldAdminUI</servlet-name>
@@ -153,6 +162,11 @@
153 162
     <servlet-name>LoadAdminUI</servlet-name>
154 163
     <url-pattern>/admin.html</url-pattern>
155 164
   </servlet-mapping>
  165
+
  166
+  <servlet-mapping>
  167
+    <servlet-name>SchemaRestApi</servlet-name>
  168
+    <url-pattern>/schema/*</url-pattern>
  169
+  </servlet-mapping>
156 170
   
157 171
   <mime-mapping>
158 172
     <extension>.xsl</extension>
8  sunspot_solr/solr/solr-webapp/webapp/admin.html
@@ -111,8 +111,12 @@
111 111
             
112 112
           </ul>
113 113
 
114  
-          <ul id="menu-selector">
115  
-          </ul>
  114
+          <div id="core-selector">
  115
+            <select data-placeholder="Core Selector"></select>
  116
+          </div>
  117
+          <div id="core-menu">
  118
+            <ul></ul>
  119
+          </div>
116 120
                   
117 121
         </div>
118 122
       </div>
5  sunspot_solr/solr/solr-webapp/webapp/css/styles/analysis.css
@@ -82,10 +82,9 @@
82 82
   float: right;
83 83
 }
84 84
 
85  
-#content #analysis .settings button.loader
  85
+#content #analysis .settings button span
86 86
 {
87  
-  background-position: 2px 50%;
88  
-  padding-left: 21px;
  87
+  background-image: url( ../../img/ico/funnel.png );
89 88
 }
90 89
 
91 90
 #content #analysis .settings .verbose_output
52  sunspot_solr/solr/solr-webapp/webapp/css/styles/cloud.css
@@ -231,11 +231,39 @@
231 231
   color: #00f;
232 232
 }
233 233
 
  234
+#content #cloud #legend
  235
+{
  236
+  border: 1px solid #f0f0f0;
  237
+  padding: 10px;
  238
+  position: absolute;
  239
+  right: 0;
  240
+  bottom: 0;
  241
+}
  242
+
  243
+#content #cloud #legend li
  244
+{
  245
+  padding-left: 15px;
  246
+  position: relative;
  247
+}
  248
+
  249
+#content #cloud #legend li svg
  250
+{
  251
+  position: absolute;
  252
+  left: 0;
  253
+  top: 2px;
  254
+}
  255
+
  256
+#content #graph-content
  257
+{
  258
+  min-height: 400px;
  259
+}
  260
+
234 261
 #content #graph-content .node
235 262
 {
236 263
   fill: #333;
237 264
 }
238 265
 
  266
+#content #cloud #legend circle,
239 267
 #content #graph-content .node circle
240 268
 {
241 269
   fill: #fff;
@@ -265,6 +293,7 @@
265 293
   stroke-width: 1.5px;
266 294
 }
267 295
 
  296
+#content #cloud #legend .gone circle,
268 297
 #content #graph-content .node.gone circle,
269 298
 #content #graph-content .link.gone
270 299
 {
@@ -276,8 +305,16 @@
276 305
   fill: #f0f0f0;
277 306
 }
278 307
 
  308
+#content #cloud #legend ul .gone
  309
+{
  310
+  color: #e0e0e0;
  311
+}
  312
+
  313
+#content #cloud #legend .recovery_failed,
  314
+#content #cloud #legend .recovery_failed circle,
279 315
 #content #graph-content .node.recovery_failed circle
280 316
 {
  317
+  color: #C43C35;
281 318
   stroke: #C43C35;
282 319
 }
283 320
 
@@ -286,8 +323,11 @@
286 323
   fill: #C43C35;
287 324
 }
288 325
 
  326
+#content #cloud #legend .down,
  327
+#content #cloud #legend .down circle,
289 328
 #content #graph-content .node.down circle
290 329
 {
  330
+  color: #c48f00;
291 331
   stroke: #c48f00;
292 332
 }
293 333
 
@@ -296,8 +336,11 @@
296 336
   fill: #c48f00;
297 337
 }
298 338
 
  339
+#content #cloud #legend .recovering,
  340
+#content #cloud #legend .recovering circle,
299 341
 #content #graph-content .node.recovering circle
300 342
 {
  343
+  color: #d5dd00;
301 344
   stroke: #d5dd00;
302 345
 }
303 346
 
@@ -306,8 +349,11 @@
306 349
   fill: #d5dd00;
307 350
 }
308 351
 
  352
+#content #cloud #legend .active,
  353
+#content #cloud #legend .active circle,
309 354
 #content #graph-content .node.active circle
310 355
 {
  356
+  color: #57A957;
311 357
   stroke: #57A957;
312 358
 }
313 359
 
@@ -316,11 +362,17 @@
316 362
   fill: #57A957;
317 363
 }
318 364
 
  365
+#content #cloud #legend .leader circle,
319 366
 #content #graph-content .node.leader circle
320 367
 {
321 368
   fill: #000;
322 369
 }
323 370
 
  371
+#content #cloud #legend .leader circle
  372
+{
  373
+  stroke: #fff;
  374
+}
  375
+
324 376
 #content #graph-content .link.lvl-2,
325 377
 #content #graph-content .link.leader
326 378
 {
8  sunspot_solr/solr/solr-webapp/webapp/css/styles/common.css
@@ -172,7 +172,7 @@ ul
172 172
 #header
173 173
 {
174 174
   padding-bottom: 10px;
175  
-  position: absolute;
  175
+  position: fixed;
176 176
   z-index: 42;
177 177
 }
178 178
 
@@ -340,12 +340,6 @@ ul
340 340
   width: 100%;
341 341
 }
342 342
 
343  
-#content > pre
344  
-{
345  
-  max-height: 600px;
346  
-  overflow: auto;
347  
-}
348  
-
349 343
 #content .block
350 344
 {
351 345
   margin-bottom: 10px;
5  sunspot_solr/solr/solr-webapp/webapp/css/styles/index.css
@@ -98,11 +98,6 @@
98 98
   padding-bottom: 3px;
99 99
 }
100 100
 
101  
-#content #index .data li.odd
102  
-{
103  
-  color: #c0c0c0;
104  
-}
105  
-
106 101
 #content #index .data li dt
107 102
 {
108 103
   float: left;
73  sunspot_solr/solr/solr-webapp/webapp/css/styles/menu.css
... ...
@@ -1,13 +1,13 @@
1 1
 #menu-wrapper
2 2
 {
3  
-  position: absolute;
4  
-  top: 90px;
  3
+  position: fixed;
  4
+  top: 120px;
5 5
   width: 150px;
6 6
 }
7 7
 
8 8
 .has-environment #menu-wrapper
9 9
 {
10  
-  top: 130px;
  10
+  top: 160px;
11 11
 }
12 12
 
13 13
 #menu-wrapper a
@@ -18,6 +18,23 @@
18 18
   text-overflow: ellipsis;
19 19
 }
20 20
 
  21
+#core-selector
  22
+{
  23
+  margin-top: 20px;
  24
+  padding-right: 10px;
  25
+}
  26
+
  27
+#core-selector a
  28
+{
  29
+  padding: 0;
  30
+  padding-left: 8px;
  31
+}
  32
+
  33
+#core-selector select
  34
+{
  35
+  width: 100%;
  36
+}
  37
+
21 38
 #menu-wrapper .active p
22 39
 {
23 40
   background-color: #fafafa;
@@ -121,32 +138,27 @@
121 138
   display: none;
122 139
 }
123 140
 
124  
-#menu-selector
125  
-{
126  
-  margin-top: 20px;
127  
-}
128  
-
129  
-#menu-selector p
  141
+#core-menu p
130 142
 {
131 143
   border-top: 1px solid #f0f0f0;
132 144
 }
133 145
 
134  
-#menu-selector li:first-child p
  146
+#core-menu li:first-child p
135 147
 {
136 148
   border-top: 0;
137 149
 }
138 150
 
139  
-#menu-selector p a
  151
+#core-menu p a
140 152
 {
141 153
   background-image: url( ../../img/ico/status-offline.png );
142 154
 }
143 155
 
144  
-#menu-selector .active p a
  156
+#core-menu .active p a
145 157
 {
146 158
   background-image: url( ../../img/ico/box.png );
147 159
 }
148 160
 
149  
-#menu-selector ul,
  161
+#core-menu ul,
150 162
 #menu ul
151 163
 {
152 164
   display: none;
@@ -154,7 +166,7 @@
154 166
   padding-bottom: 10px;
155 167
 }
156 168
 
157  
-#menu-selector .active ul,
  169
+#core-menu .active ul,
158 170
 #menu .active ul
159 171
 {
160 172
   display: block;
@@ -165,7 +177,7 @@
165 177
   border-bottom: 0;
166 178
 }
167 179
 
168  
-#menu-selector ul li a,
  180
+#core-menu ul li a,
169 181
 #menu ul li a
170 182
 {
171 183
   background-position: 7px 50%;
@@ -175,20 +187,20 @@
175 187
   padding-left: 26px;
176 188
 }
177 189
 
178  
-#menu-selector ul li:last-child a,
  190
+#core-menu ul li:last-child a,
179 191
 #menu ul li:last-child a
180 192
 {
181 193
   border-bottom: 0;
182 194
 }
183 195
 
184  
-#menu-selector ul li a:hover,
  196
+#core-menu ul li a:hover,
185 197
 #menu ul li a:hover
186 198
 {
187 199
   background-color: #f0f0f0;
188 200
   color: #333;
189 201
 }
190 202
 
191  
-#menu-selector ul li.active a,
  203
+#core-menu ul li.active a,
192 204
 #menu ul li.active a
193 205
 {
194 206
   background-color: #d0d0d0;
@@ -213,7 +225,7 @@
213 225
 #menu #cloud.global .rgraph a { background-image: url( ../../img/ico/asterisk.png ); }
214 226
 #menu #cloud.global .dump a { background-image: url( ../../img/ico/download-cloud.png ); }
215 227
 
216  
-#menu-selector .ping.error a
  228
+#core-menu .ping.error a
217 229
 {
218 230
   
219 231
   background-color: #ffcccc;
@@ -222,17 +234,18 @@
222 234
   cursor: help;
223 235
 }
224 236
 
225  
-#menu-selector .query a { background-image: url( ../../img/ico/magnifier.png ); }
226  
-#menu-selector .schema a { background-image: url( ../../img/ico/table.png ); }
227  
-#menu-selector .config a { background-image: url( ../../img/ico/gear.png ); }
228  
-#menu-selector .analysis a { background-image: url( ../../img/ico/funnel.png ); }
229  
-#menu-selector .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); }
230  
-#menu-selector .replication a { background-image: url( ../../img/ico/node.png ); }
231  
-#menu-selector .distribution a { background-image: url( ../../img/ico/node-select.png ); }
232  
-#menu-selector .ping a { background-image: url( ../../img/ico/system-monitor.png ); }
233  
-#menu-selector .logging a { background-image: url( ../../img/ico/inbox-document-text.png ); }
234  
-#menu-selector .plugins a { background-image: url( ../../img/ico/block.png ); }
235  
-#menu-selector .dataimport a { background-image: url( ../../img/ico/document-import.png ); }
  237
+#core-menu .overview a { background-image: url( ../../img/ico/home.png ); }
  238
+#core-menu .query a { background-image: url( ../../img/ico/magnifier.png ); }
  239
+#core-menu .schema a { background-image: url( ../../img/ico/table.png ); }
  240
+#core-menu .config a { background-image: url( ../../img/ico/gear.png ); }
  241
+#core-menu .analysis a { background-image: url( ../../img/ico/funnel.png ); }
  242
+#core-menu .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); }
  243
+#core-menu .replication a { background-image: url( ../../img/ico/node.png ); }
  244
+#core-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); }
  245
+#core-menu .ping a { background-image: url( ../../img/ico/system-monitor.png ); }
  246
+#core-menu .logging a { background-image: url( ../../img/ico/inbox-document-text.png ); }
  247
+#core-menu .plugins a { background-image: url( ../../img/ico/block.png ); }
  248
+#core-menu .dataimport a { background-image: url( ../../img/ico/document-import.png ); }
236 249
 
237 250
 
238 251
 #content #navigation
127  sunspot_solr/solr/solr-webapp/webapp/css/styles/schema-browser.css
@@ -45,6 +45,11 @@
45 45
   padding-bottom: 15px;
46 46
 }
47 47
 
  48
+#content #schema-browser #related .ukf-dsf dt
  49
+{
  50
+  display: none;
  51
+}
  52
+
48 53
 #content #schema-browser #related dl
49 54
 {
50 55
   margin-top: 15px;
@@ -140,11 +145,60 @@
140 145
   width: 100px;
141 146
 }
142 147
 
143  
-#content #schema-browser #data #field .field-options .options dd
  148
+#content #schema-browser #data #field .field-options .flags
144 149
 {
145  
-  margin-right: 5px;
  150
+  margin-top: 10px;
  151
+  margin-bottom: 20px;
  152
+}
  153
+
  154
+#content #schema-browser #data #field .field-options .flags thead td
  155
+{
  156
+  color: #c0c0c0;
  157
+  padding-right: 5px;
  158
+  width: 100px;
  159
+}
  160
+
  161
+#content #schema-browser #data #field .field-options .flags tbody td,
  162
+#content #schema-browser #data #field .field-options .flags th
  163
+{
  164
+  padding: 2px 5px;
  165
+}
  166
+
  167
+#content #schema-browser #data #field .field-options .flags thead td,
  168
+#content #schema-browser #data #field .field-options .flags tbody th
  169
+{
  170
+  padding-left: 0;
  171
+}
  172
+
  173
+#content #schema-browser #data #field .field-options .flags thead th,
  174
+#content #schema-browser #data #field .field-options .flags tbody td
  175
+{
  176
+  border-left: 1px solid #f0f0f0;
  177
+}
  178
+
  179
+#content #schema-browser #data #field .field-options .flags tbody th,
  180
+#content #schema-browser #data #field .field-options .flags tbody td
  181
+{
  182
+  border-top: 1px solid #f0f0f0;
  183
+}
  184
+
  185
+#content #schema-browser #data #field .field-options .flags tbody .check
  186
+{
  187
+  background-color: #fafdfa;
  188
+  background-image: url( ../../img/ico/tick.png );
  189
+  background-position: 50% 50%;
  190
+  text-align: center;
146 191
 }
147 192
 
  193
+#content #schema-browser #data #field .field-options .flags tbody .check span
  194
+{
  195
+  display: none;
  196
+}
  197
+
  198
+#content #schema-browser #data #field .field-options .flags tbody .text
  199
+{
  200
+  color: #c0c0c0;
  201
+}
148 202
 
149 203
 #content #schema-browser #data #field .field-options .analyzer,
150 204
 #content #schema-browser #data #field .field-options .analyzer li,
@@ -336,7 +390,8 @@
336 390
   color: #333;
337 391
 }
338 392
 
339  
-#content #schema-browser #data #field .topterms-holder
  393
+#content #schema-browser #data #field .topterms-holder,
  394
+#content #schema-browser #data #field .histogram-holder
340 395
 {
341 396
   border-left: 1px solid #f0f0f0;
342 397
   display: none;
@@ -394,12 +449,12 @@
394 449
   margin-bottom: 5px;
395 450
 }
396 451
 
  452
+/* possible overwrite with inline style */
397 453
 #content #schema-browser .topterms-holder li p
398 454
 {
399 455
   background-color:  #999;
400 456
   color: #fff;
401 457
   float: left;
402  
-  width: 25px;
403 458
 }
404 459
 
405 460
 #content #schema-browser .topterms-holder li p span
@@ -409,6 +464,7 @@
409 464
   text-align: right;
410 465
 }
411 466
 
  467
+/* possible overwrite with inline style */
412 468
 #content #schema-browser .topterms-holder li ul
413 469
 {
414 470
   margin-left: 30px;
@@ -438,51 +494,66 @@
438 494
   background-color: #c0c0c0;
439 495
 }
440 496
 
441  
-#content #schema-browser #data #field .histogram-holder
  497
+#content #schema-browser #data #field .histogram-holder ul
442 498
 {
443  
-  border-left: 1px solid #f0f0f0;
444  
-  display: none;
445  
-  float: left;
446  
-  padding-left: 20px;
447  
-  padding-right: 20px;
  499
+  margin-left: 25px;
448 500
 }
449 501
 
450  
-#content #schema-browser #data #field .histogram-holder .histogram
  502
+#content #schema-browser #data #field .histogram-holder li
451 503
 {
452  
-  height: 150px;
  504
+  margin-bottom: 2px;
  505
+  position: relative;
  506
+  width: 150px;
453 507
 }
454 508
 
455  
-#content #schema-browser #data #field .histogram-holder .histogram.single canvas
  509
+#content #schema-browser #data #field .histogram-holder li.odd
  510
+{
  511
+  background-color: #f0f0f0;
  512
+}
  513
+
  514
+#content #schema-browser #data #field .histogram-holder li dl,
  515
+#content #schema-browser #data #field .histogram-holder li dt
  516
+{
  517
+  padding-top: 1px;
  518
+  padding-bottom: 1px;
  519
+}
  520
+
  521
+#content #schema-browser #data #field .histogram-holder li dl
456 522
 {
457 523
   background-color: #c0c0c0;
  524
+  min-width: 1px;
458 525
 }
459 526
 
460  
-#content #schema-browser #data #field .histogram-holder dt,
461  
-#content #schema-browser #data #field .histogram-holder dd
  527
+#content #schema-browser #data #field .histogram-holder li dt
462 528
 {
463  
-  float: left;
464  
-  font-size: 10px;
465  
-  text-align: center;
  529
+  color: #a0a0a0;
  530
+  position: absolute;
  531
+  overflow: hidden;
  532
+  left: -25px;
  533
+  top: 0px;
466 534
 }
467 535
 
468  
-#content #schema-browser #data #field .histogram-holder span
  536
+#content #schema-browser #data #field .histogram-holder li dt span
469 537
 {
470  
-  background-color: #f0f0f0;
471 538
   display: block;
472  
-  width: 20px;
  539
+  padding-right: 4px;
  540
+  text-align: right;
473 541
 }
474 542
 
475  
-#content #schema-browser #data #field .histogram-holder dt
  543
+#content #schema-browser #data #field .histogram-holder li dd
476 544
 {
477  
-  padding-right: 1px;
  545
+  clear: left;
  546
+  float: left;
  547
+  margin-left: 2px;
  548
+  white-space: nowrap;
478 549
 }
479 550
 
480  
-#content #schema-browser #data #field .histogram-holder dd
  551
+#content #schema-browser #data #field .histogram-holder li:hover dl
481 552
 {
482  
-  padding-right: 3px;
  553
+  background-color: #b0b0b0;
483 554
 }
484 555
 
485  
-#content #schema-browser #data #field .histogram-holder dd span
  556
+#content #schema-browser #data #field .histogram-holder li:hover dt
486 557
 {
487  
-  width: 25px;
488  
-}
  558
+  color: #333;
  559
+}
BIN  sunspot_solr/solr/solr-webapp/webapp/img/ico/home.png
1  sunspot_solr/solr/solr-webapp/webapp/js/main.js
@@ -25,7 +25,6 @@ require
25 25
     'lib/order!lib/jquery.form',
26 26
     'lib/order!lib/jquery.jstree',
27 27
     'lib/order!lib/jquery.sammy',
28  
-    'lib/order!lib/jquery.sparkline',
29 28
     'lib/order!lib/jquery.timeago',
30 29
     'lib/order!lib/jquery.blockUI',
31 30
     'lib/order!lib/highlight',
6  sunspot_solr/solr/solr-webapp/webapp/js/scripts/analysis.js
@@ -42,7 +42,7 @@ sammy.get
42 42
 
43 43
         var type_or_name = $( '#type_or_name', analysis_form );
44 44
         var schema_browser_element = $( '#tor_schema' );
45  
-        var schema_browser_path = $( 'p > a', active_core ).attr( 'href' ) + '/schema-browser'
  45
+        var schema_browser_path = app.core_menu.find( '.schema-browser a' ).attr( 'href' );
46 46
         var schema_browser_map = { 'fieldname' : 'field', 'fieldtype' : 'type' };
47 47
 
48 48
         type_or_name
@@ -269,7 +269,7 @@ sammy.get
269 269
                   dataType : 'json',
270 270
                   beforeSend : function( xhr, settings )
271 271
                   {
272  
-                    loader.show( button );
  272
+                    loader.show( $( 'span', button ) );
273 273
                     button.attr( 'disabled', true );
274 274
                   },
275 275
                   success : function( response, status_text, xhr, form )
@@ -325,7 +325,7 @@ sammy.get
325 325
                   },
326 326
                   complete : function()
327 327
                   {
328  
-                    loader.hide( $( 'button', analysis_form ) );
  328
+                    loader.hide( $( 'span', button ) );
329 329
                     button.removeAttr( 'disabled' );
330 330
                   }
331 331
                 }
189  sunspot_solr/solr/solr-webapp/webapp/js/scripts/app.js
@@ -92,20 +92,26 @@ var sammy = $.sammy
92 92
         $( 'li.active', menu_wrapper )
93 93
           .removeClass( 'active' );
94 94
 
95  
-        if( this.params.splat )
  95
+        // global dashboard doesn't have params.splat
  96
+        if( !this.params.splat )
96 97
         {
97  
-          var selector = '~' === this.params.splat[0][0]
98  
-                       ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
99  
-                       : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' );
  98
+          this.params.splat = [ '~index' ];
  99
+        }
100 100
 
101  
-          var active_element = $( selector, menu_wrapper );
102  
-                    
103  
-          if( 0 === active_element.size() )
104  
-          {
105  
-            this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
106  
-            return false;
107  
-          }
  101
+        var selector = '~' === this.params.splat[0][0]
  102
+                     ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
  103
+                     : '#core-selector #' + this.params.splat[0].replace( /\./g, '__' );
  104
+
  105
+        var active_element = $( selector, menu_wrapper );
  106
+                  
  107
+        if( 0 === active_element.size() )
  108
+        {
  109
+          this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
  110
+          return false;
  111
+        }
108 112
 
  113
+        if( active_element.hasClass( 'global' ) )
  114
+        {
109 115
           active_element
110 116
             .addClass( 'active' );
111 117
 
@@ -115,10 +121,28 @@ var sammy = $.sammy
115 121
               .addClass( 'active' );
116 122
           }
117 123
 
118  
-          if( !active_element.hasClass( 'global' ) )
  124
+          $( '#core-selector option[selected]' )
  125
+            .removeAttr( 'selected' )
  126
+            .trigger( 'liszt:updated' );
  127
+
  128
+          $( '#core-selector .chzn-container > a' )
  129
+            .addClass( 'chzn-default' );
  130
+        }
  131
+        else
  132
+        {
  133
+          active_element
  134
+            .attr( 'selected', 'selected' )
  135
+            .trigger( 'liszt:updated' );
  136
+
  137
+          if( !this.params.splat[1] )
119 138
           {
120  
-            this.active_core = active_element;
  139
+            this.params.splat[1] = 'overview';
121 140
           }
  141
+
  142
+          $( '#core-menu .' + this.params.splat[1] )
  143
+            .addClass( 'active' );
  144
+
  145
+          this.active_core = active_element;
122 146
         }
123 147
       }
124 148
     );
@@ -143,13 +167,20 @@ var solr_admin = function( app_config )
143 167
 
144 168
   plugin_data = null,
145 169
     
146  
-  this.menu_element = $( '#menu-selector' );
147  
-  this.config = config;
  170
+  this.menu_element = $( '#core-selector select' );
  171
+  this.core_menu = $( '#core-menu ul' );
148 172
 
  173
+  this.config = config;
149 174
   this.timeout = null;
150 175
 
151 176
   this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
152 177
 
  178
+  browser = {
  179
+    locale : null,
  180
+    language : null,
  181
+    country : null
  182
+  };
  183
+
153 184
   show_global_error = function( error )
154 185
   {
155 186
     var main = $( '#main' );
@@ -197,6 +228,9 @@ var solr_admin = function( app_config )
197 228
     that.menu_element
198 229
       .empty();
199 230
 
  231
+    var core_list = [];
  232
+    core_list.push( '<option></option>' );
  233
+
200 234
     var core_count = 0;
201 235
     for( var core_name in that.cores_data )
202 236
     {
@@ -214,32 +248,24 @@ var solr_admin = function( app_config )
214 248
         classes.push( 'default' );
215 249
       }
216 250
 
217  
-      var core_tpl = '<li id="' + core_name.replace( /\./g, '__' ) + '" '
  251
+      var core_tpl = '<option '
  252
+                   + '    id="' + core_name.replace( /\./g, '__' ) + '" '
218 253
                    + '    class="' + classes.join( ' ' ) + '"'
219 254
                    + '    data-basepath="' + core_path + '"'
220 255
                    + '    schema="' + cores.status[core_name]['schema'] + '"'
221 256
                    + '    config="' + cores.status[core_name]['config'] + '"'
222  
-                   + '>' + "\n"
223  
-                   + '  <p><a href="#/' + core_name + '" title="' + core_name + '">' + core_name + '</a></p>' + "\n"
224  
-                   + '  <ul>' + "\n"
225  
-
226  
-                   + '    <li class="ping"><a rel="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"
227  
-                   + '    <li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"
228  
-                   + '    <li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"
229  
-                   + '    <li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"
230  
-                   + '    <li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"
231  
-                   + '    <li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"
232  
-                   + '    <li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"
233  
-                   + '    <li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n"
234  
-                   + '    <li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
235  
-
236  
-                   + '    </ul>' + "\n"
237  
-                   + '</li>';
238  
-
239  
-      that.menu_element
240  
-        .append( core_tpl );
  257
+                   + '    value="#/' + core_name + '"'
  258
+                   + '    title="' + core_name + '"'
  259
+                   + '>' 
  260
+                   + core_name 
  261
+                   + '</option>';
  262
+
  263
+      core_list.push( core_tpl );
241 264
     }
242 265
 
  266
+    that.menu_element
  267
+      .append( core_list.join( "\n" ) );
  268
+
243 269
     if( cores.initFailures )
244 270
     {
245 271
       var failures = [];
@@ -274,10 +300,28 @@ var solr_admin = function( app_config )
274 300
 
275 301
   this.run = function()
276 302
   {
  303
+    var navigator_language = navigator.userLanguage || navigator.language;
  304
+    var language_match = navigator_language.match( /^(\w{2})([-_](\w{2}))?$/ );
  305
+    if( language_match )
  306
+    {
  307
+      if( language_match[1] )
  308
+      {
  309
+        browser.language = language_match[1].toLowerCase();
  310
+      }
  311
+      if( language_match[3] )
  312
+      {
  313
+        browser.country = language_match[3].toUpperCase();
  314
+      }
  315
+      if( language_match[1] && language_match[3] )
  316
+      {
  317
+        browser.locale = browser.language + '_' + browser.country
  318
+      }
  319
+    }
  320
+
277 321
     $.ajax
278 322
     (
279 323
       {
280  
-        url : config.solr_path + config.core_admin_path + '?wt=json',
  324
+        url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
281 325
         dataType : 'json',
282 326
         beforeSend : function( arr, form, options )
283 327
         {               
@@ -288,6 +332,52 @@ var solr_admin = function( app_config )
288 332
         {
289 333
           that.set_cores_data( response );
290 334
 
  335
+          that.menu_element
  336
+            .chosen()
  337
+            .off( 'change' )
  338
+            .on
  339
+            (
  340
+              'change',
  341
+              function( event )
  342
+              {
  343
+                location.href = $( 'option:selected', this ).val();
  344
+                return false;
  345
+              }
  346
+            )
  347
+            .on
  348
+            (
  349
+              'liszt:updated',
  350
+              function( event )
  351
+              {
  352
+                var core_name = $( 'option:selected', this ).text();
  353
+
  354
+                if( core_name )
  355
+                {
  356
+                  that.core_menu
  357
+                    .html
  358
+                    (
  359
+                      '<li class="overview"><a href="#/' + core_name + '"><span>Overview</span></a></li>' + "\n" +
  360
+                      '<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
  361
+                      '<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
  362
+                      '<li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n" +
  363
+                      '<li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n" +
  364
+                      '<li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n" +
  365
+                      '<li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n" +
  366
+                      '<li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n" + 
  367
+                      '<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
  368
+                      '<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
  369
+                    )
  370
+                    .show();
  371
+                }
  372
+                else
  373
+                {
  374
+                  that.core_menu
  375
+                    .hide()
  376
+                    .empty();
  377
+                }
  378
+              }
  379
+            );
  380
+
291 381
           for( var core_name in response.status )
292 382
           {
293 383
             var core_path = config.solr_path + '/' + core_name;
@@ -318,9 +408,13 @@ var solr_admin = function( app_config )
318 408
                   var command_line_args = response.jvm.jmx.commandLineArgs.join( ' | ' );
319 409
 
320 410
                   environment_args = command_line_args.match( /-Dsolr.environment=((dev|test|prod)?[\w\d]*)/i );
321  
-                  cloud_args = command_line_args.match( /-Dzk/i );
322 411
                 }
323 412
 
  413
+                if( response.mode )
  414
+                {
  415
+                  cloud_args = response.mode.match( /solrcloud/i );
  416
+                }
  417
+                
324 418
                 // title
325 419
 
326 420
                 $( 'title', document )
@@ -468,6 +562,27 @@ var solr_admin = function( app_config )
468 562
     return json_str;
469 563
   };
470 564
 
  565
+  this.format_number = function format_number( number )
  566
+  {
  567
+    var sep = {
  568
+      'de_CH' : '\'',
  569
+      'de' : '.',
  570
+      'en' : ',',
  571
+      'es' : '.',
  572
+      'it' : '.',
  573
+      'ja' : ',',
  574
+      'sv' : ' ',
  575
+      'tr' : '.',
  576
+      '_' : '' // fallback
  577
+    };
  578
+
  579
+    return ( number || 0 ).toString().replace
  580
+    (
  581
+      /\B(?=(\d{3})+(?!\d))/g,
  582
+      sep[ browser.locale ] || sep[ browser.language ] || sep['_']
  583
+    );
  584
+  };
  585
+
471 586
 };
472 587
 
473 588
 var app = new solr_admin( app_config );
8  sunspot_solr/solr/solr-webapp/webapp/js/scripts/cores.js
@@ -20,12 +20,6 @@ sammy.bind
20 20
   'cores_load_data',
21 21
   function( event, params )
22 22
   {
23  
-    if( app.cores_data )
24  
-    {
25  
-      params.callback( app.cores_data );
26  
-      return true;
27  
-    }
28  
-
29 23
     $.ajax
30 24
     (
31 25
       {
@@ -335,7 +329,7 @@ sammy.get
335 329
                   .ajaxForm
336 330
                   (
337 331
                     {
338  
-                      url : app.config.solr_path + app.config.core_admin_path + '?wt=json',
  332
+                      url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
339 333
                       dataType : 'json',
340 334
                       beforeSubmit : function( array, form, options )
341 335
                       {
11  sunspot_solr/solr/solr-webapp/webapp/js/scripts/dataimport.js
@@ -440,11 +440,6 @@ sammy.get
440 440
                 var messages_count = 0;
441 441
                 for( var key in messages ) { messages_count++; }
442 442
 
443  
-                var format_number = function format_number( number )
444  
-                {
445  
-                  return ( number || 0 ).toString().replace( /\B(?=(\d{3})+(?!\d))/g, '\'' );
446  
-                };
447  
-
448 443
                 function dataimport_compute_details( response, details_element, elapsed_seconds )
449 444
                 {
450 445
                   details_element
@@ -464,10 +459,10 @@ sammy.get
464 459
                   {
465 460
                     var value = parseInt( response.statusMessages[document_config[key]], 10 );
466 461
 
467  
-                    var detail = '<abbr title="' + document_config[key].esc() + '">' + key.esc() + '</abbr>: ' +  format_number( value ).esc();
  462
+                    var detail = '<abbr title="' + document_config[key].esc() + '">' + key.esc() + '</abbr>: ' +  app.format_number( value ).esc();
468 463
                     if( elapsed_seconds && 'skipped' !== key.toLowerCase() )
469 464
                     {
470  
-                      detail += ' <span>(' + format_number( Math.round( value / elapsed_seconds ) ).esc() + '/s)</span>'
  465
+                      detail += ' <span>(' + app.format_number( Math.round( value / elapsed_seconds ) ).esc() + '/s)</span>'
471 466
                     }
472 467
 
473 468
                     document_details.push( detail );
@@ -523,7 +518,7 @@ sammy.get
523 518
                     /\d{4,}/g,
524 519
                     function( match, position, string )
525 520
                     {
526  
-                      return format_number( parseInt( match, 10 ) );
  521
+                      return app.format_number( parseInt( match, 10 ) );
527 522
                     }
528 523
                   );
529 524
 
71  sunspot_solr/solr/solr-webapp/webapp/js/scripts/index.js
@@ -97,8 +97,8 @@ var system_info = function( element, system_data )
97 97
 {
98 98
   // -- usage
99 99
 
100  
-  var load_average = ( system_data['system']['uptime'] || '' ).match( /load average: (.+)/ );
101  
-  if( load_average && load_average[1] )
  100
+  var load_average = ( system_data['system']['uptime'] || '' ).match( /load averages?: (\d+[.,]\d\d),? (\d+[.,]\d\d),? (\d+[.,]\d\d)/ );
  101
+  if( load_average )
102 102
   {
103 103
     var hl = $( '#system h2', element );
104 104
 
@@ -106,20 +106,20 @@ var system_info = function( element, system_data )
106 106
       .remove();
107 107
 
108 108
     hl
109  
-      .append( ' <small class="bar-desc">' + load_average[1].split( ', ' ).join( '  ' ).esc() + '</small>' );
  109
+      .append( ' <small class="bar-desc">' + load_average.slice( 1 ).join( '  ' ).replace( /,/g, '.' ).esc() + '</small>' );
110 110
   }
111 111
 
112 112
   // -- physical-memory-bar
113 113
     
114 114
   var bar_holder = $( '#physical-memory-bar', element );
115  
-  if( !system_data['system']['totalPhysicalMemorySize'] )
  115
+  if( system_data['system']['totalPhysicalMemorySize'] === undefined || system_data['system']['freePhysicalMemorySize'] === undefined )
116 116
   {
117 117
     bar_holder.hide();
118 118
   }
119 119
   else
120 120
   {
121 121
     bar_holder.show();
122  
-    
  122
+
123 123
     var bar_data = {
124 124
       'max' : parse_memory_value( system_data['system']['totalPhysicalMemorySize'] ),
125 125
       'total' : parse_memory_value( system_data['system']['totalPhysicalMemorySize'] - system_data['system']['freePhysicalMemorySize'] )
@@ -131,7 +131,7 @@ var system_info = function( element, system_data )