From 6d9c2c46b1bd9ec5f2aad7928da17439af433cae Mon Sep 17 00:00:00 2001 From: Upayavira Date: Wed, 4 Nov 2015 11:16:45 +0000 Subject: [PATCH] SOLR-8139 Rename schema-browser to schema and add managed schema support git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1712532 13f79535-47bb-0310-9956-ffa450edef68 --- solr/webapp/web/css/angular/menu.css | 2 +- .../webapp/web/css/angular/schema-browser.css | 567 -------------- solr/webapp/web/css/angular/schema.css | 704 ++++++++++++++++++ solr/webapp/web/index.html | 8 +- solr/webapp/web/js/angular/app.js | 30 +- .../{schema-browser.js => schema.js} | 193 ++++- solr/webapp/web/js/angular/services.js | 20 +- solr/webapp/web/partials/analysis.html | 2 +- solr/webapp/web/partials/schema-browser.html | 207 ----- solr/webapp/web/partials/schema.html | 448 +++++++++++ 10 files changed, 1383 insertions(+), 798 deletions(-) delete mode 100644 solr/webapp/web/css/angular/schema-browser.css create mode 100644 solr/webapp/web/css/angular/schema.css rename solr/webapp/web/js/angular/controllers/{schema-browser.js => schema.js} (69%) delete mode 100644 solr/webapp/web/partials/schema-browser.html create mode 100644 solr/webapp/web/partials/schema.html diff --git a/solr/webapp/web/css/angular/menu.css b/solr/webapp/web/css/angular/menu.css index f00aa824f66..aba701bf6dd 100644 --- a/solr/webapp/web/css/angular/menu.css +++ b/solr/webapp/web/css/angular/menu.css @@ -278,7 +278,7 @@ limitations under the License. .sub-menu .analysis a { background-image: url( ../../img/ico/funnel.png ); } .sub-menu .documents a { background-image: url( ../../img/ico/documents-stack.png ); } .sub-menu .files a { background-image: url( ../../img/ico/folder.png ); } -.sub-menu .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); } +.sub-menu .schema a { background-image: url( ../../img/ico/book-open-text.png ); } .sub-menu .replication a { background-image: url( ../../img/ico/node.png ); } .sub-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); } .sub-menu .ping a { background-image: url( ../../img/ico/system-monitor.png ); } diff --git a/solr/webapp/web/css/angular/schema-browser.css b/solr/webapp/web/css/angular/schema-browser.css deleted file mode 100644 index 5dd8dad34bb..00000000000 --- a/solr/webapp/web/css/angular/schema-browser.css +++ /dev/null @@ -1,567 +0,0 @@ -/* - -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -*/ - -#content #schema-browser .loader -{ - background-position: 0 50%; - padding-left: 21px; -} - -#content #schema-browser.loaded -{ - background-image: url( ../../img/div.gif ); - background-position: 21% 0; - background-repeat: repeat-y; -} - -#content #schema-browser #data -{ - float: right; - width: 78%; -} - -#content #schema-browser #related -{ - float: left; - width: 20%; -} - -#content #schema-browser #related select -{ - width: 100%; -} - -#content #schema-browser #related select optgroup -{ - font-style: normal; - padding: 5px; -} - -#content #schema-browser #related select option -{ - padding-left: 10px; -} - -#content #schema-browser #related #f-df-t -{ - border-bottom: 1px solid #f0f0f0; - padding-bottom: 15px; -} - -#content #schema-browser #related .ukf-dsf dt -{ -} - -#content #schema-browser #related dl -{ - margin-top: 15px; -} - -#content #schema-browser #related dl dt, -#content #schema-browser #related dl dd a -{ - color: #c0c0c0; -} - -#content #schema-browser #related dl dt -{ - font-weight: bold; - margin-top: 5px; -} - -#content #schema-browser #related dl dd a -{ - display: block; - padding-left: 10px; -} - -#content #schema-browser #related dl dd a:hover -{ - background-color: #f8f8f8; -} - -#content #schema-browser #related .field .field, -#content #schema-browser #related .field .field a, -#content #schema-browser #related .dynamic-field .dynamic-field, -#content #schema-browser #related .dynamic-field .dynamic-field a, -#content #schema-browser #related .type .type, -#content #schema-browser #related .type .type a, -#content #schema-browser #related .active, -#content #schema-browser #related .active a -{ - color: #333; -} - -#content #schema-browser #related .copyfield, -#content #schema-browser #related .copyfield a -{ - color: #666; -} - -#content #schema-browser #data -{ -} - -#content #schema-browser #data #index dt -{ - float: left; - margin-right: 5px; - width: 150px; -} - -#content #schema-browser #data #field .field-options -{ - margin-bottom: 10px; -} - -#content #schema-browser #data #field .field-options .head h2 -{ - padding-left: 5px; -} - -#content #schema-browser #data #field .partial -{ -} - -#content #schema-browser #data #field .partial p -{ - background-image: url( ../../img/ico/exclamation-button.png ); - background-position: 0 50%; - padding-left: 21px; -} - -#content #schema-browser #data #field .field-options .options dt, -#content #schema-browser #data #field .field-options .options dd -{ - float: left; -} - -#content #schema-browser #data #field .field-options .options dt -{ - clear: left; - margin-right: 5px; - width: 100px; -} - -#content #schema-browser #data #field .field-options .flags -{ - margin-top: 10px; - margin-bottom: 20px; -} - -#content #schema-browser #data #field .field-options .flags thead td -{ - color: #c0c0c0; - padding-right: 5px; - width: 100px; -} - -#content #schema-browser #data #field .field-options .flags tbody td, -#content #schema-browser #data #field .field-options .flags th -{ - padding: 2px 5px; -} - -#content #schema-browser #data #field .field-options .flags thead td, -#content #schema-browser #data #field .field-options .flags tbody th -{ - padding-left: 0; -} - -#content #schema-browser #data #field .field-options .flags thead th, -#content #schema-browser #data #field .field-options .flags tbody td -{ - border-left: 1px solid #f0f0f0; -} - -#content #schema-browser #data #field .field-options .flags tbody th, -#content #schema-browser #data #field .field-options .flags tbody td -{ - border-top: 1px solid #f0f0f0; -} - -#content #schema-browser #data #field .field-options .flags tbody .check -{ - background-color: #fafdfa; - background-image: url( ../../img/ico/tick.png ); - background-position: 50% 50%; - text-align: center; -} - -#content #schema-browser #data #field .field-options .flags tbody .check span -{ -} - -#content #schema-browser #data #field .field-options .flags tbody .text -{ - color: #c0c0c0; -} - -#content #schema-browser #data #field .field-options .analyzer, -#content #schema-browser #data #field .field-options .analyzer li, -#content #schema-browser #data #field .field-options .analyzer ul, -#content #schema-browser #data #field .field-options .analyzer ul li -{ -} - -#content #schema-browser #data #field .field-options .analyzer p, -#content #schema-browser #data #field .field-options .analyzer dl -{ - float: left; -} - -#content #schema-browser #data #field .field-options .analyzer p -{ - margin-right: 5px; - text-align: right; - width: 125px; - white-space: pre; -} - -#content #schema-browser #data #field .field-options .analyzer p a -{ - cursor: auto; -} - -#content #schema-browser #data #field .field-options .analyzer p a.analysis -{ - cursor: pointer; - display: block; -} - -#content #schema-browser #data #field .field-options .analyzer p a.analysis span -{ - background-image: url( ../../img/ico/question-white.png ); - background-position: 0 50%; - padding-left: 21px; -} - -#content #schema-browser #data #field .field-options .analyzer p a.analysis:hover span -{ - background-image: url( ../../img/ico/question.png ); - color: #008; -} - -#content #schema-browser #data #field .field-options .analyzer a -{ - cursor: auto; -} - -#content #schema-browser #data #field .field-options .analyzer .toggle -{ - background-image: url( ../../img/ico/chevron-small-expand.png ); - background-position: 100% 50%; - cursor: pointer; - display: block; - padding-right: 21px; -} - -#content #schema-browser #data #field .field-options .analyzer .open .toggle -{ - background-image: url( ../../img/ico/chevron-small.png ); -} - -#content #schema-browser #data #field .field-options .analyzer li -{ - border-top: 1px solid #f0f0f0; - margin-top: 10px; - padding-top: 10px; -} - -#content #schema-browser #data #field .field-options .analyzer ul -{ - clear: left; - margin-left: 55px; - padding-top: 5px; -} - -#content #schema-browser #data #field .field-options .analyzer .open ul -{ - display: block; -} - -#content #schema-browser #data #field .field-options .analyzer ul li -{ - border-top: 1px solid #f8f8f8; - margin-top: 5px; - padding-top: 5px; -} - -#content #schema-browser #data #field .field-options .analyzer ul p -{ - color: #999; - margin-right: 5px; - text-align: right; - width: 70px; -} - -#content #schema-browser #data #field .field-options .analyzer ul dd -{ - margin-left: 20px; -} - -#content #schema-browser #data #field .field-options .analyzer ul dd -{ - background-image: url( ../../img/ico/document-list.png ); - background-position: 0 50%; - color: #c0c0c0; - padding-left: 21px; -} - -#content #schema-browser #data #field .field-options .analyzer ul dd.ico-0 -{ - background-image: url( ../../img/ico/slash.png ); -} - -#content #schema-browser #data #field .field-options .analyzer ul dd.ico-1 -{ - background-image: url( ../../img/ico/tick.png ); -} - -#content #schema-browser #data #field .head -{ - margin-bottom: 5px; -} - -#content #schema-browser #data #field .terminfo-holder -{ - border-top: 1px solid #c0c0c0; - padding-top: 10px; -} - -#content #schema-browser #data #field .terminfo-holder .trigger -{ - float: left; - width: 140px; -} - -#content #schema-browser #data #field .terminfo-holder .trigger button span -{ - background-image: url( ../../img/ico/information.png ); -} - -#content #schema-browser #data #field .terminfo-holder .status -{ - border-left: 1px solid #f0f0f0; - float: left; - padding-left: 20px; - padding-right: 20px; -} - -#content #schema-browser #data #field .terminfo-holder.disabled .trigger button span -{ - background-image: url( ../../img/ico/prohibition.png ); -} - -#content #schema-browser #data #field .terminfo-holder.disabled .status -{ - display: block; -} - -#content #schema-browser #data #field .terminfo-holder .trigger .autoload -{ -} - -#content #schema-browser #data #field .terminfo-holder.loaded .trigger .autoload -{ - background-image: url( ../../img/ico/ui-check-box-uncheck.png ); - background-position: 0 50%; - color: #c0c0c0; - display: block; - margin-top: 10px; - padding-left: 21px; -} - -#content #schema-browser #data #field .terminfo-holder .trigger .autoload:hover -{ - color: #008; -} - -#content #schema-browser #data #field .terminfo-holder .trigger .autoload.on -{ - background-image: url( ../../img/ico/ui-check-box.png ); - color: #333; -} - -#content #schema-browser #data #field .topterms-holder, -#content #schema-browser #data #field .histogram-holder -{ - border-left: 1px solid #f0f0f0; - float: left; - padding-left: 20px; - padding-right: 20px; -} - -#content #schema-browser #data #field .topterms-holder .head input -{ - height: 18px; - line-height: 16px; - text-align: right; - width: 30px; -} - -#content #schema-browser #data #field .topterms-holder .head .max-holder -{ - color: #c0c0c0; -} - -#content #schema-browser #data #field .topterms-holder .head .max-holder:hover .max -{ - color: #008; -} - -#content #schema-browser #data #field .topterms-holder .head #query_link -{ - background-image: url( ../../img/ico/question-white.png ); - background-position: 0 50%; - color: #c0c0c0; - padding-left: 21px; - margin-left: 5px; -} - -#content #schema-browser #data #field .topterms-holder .head #query_link:hover -{ - background-image: url( ../../img/ico/question.png ); -} - - -#content #schema-browser #data #field .topterms-holder .head #query_link span -{ - visibility: hidden; -} - -#content #schema-browser #data #field .topterms-holder .head #query_link:hover span -{ - visibility: visible; -} - -#content #schema-browser .topterms-holder li -{ - border-top: 1px solid #999; - margin-bottom: 5px; -} - -/* possible overwrite with inline style */ -#content #schema-browser .topterms-holder li p -{ - background-color: #999; - color: #fff; - float: left; -} - -#content #schema-browser .topterms-holder li p span -{ - display: block; - padding-right: 2px; - text-align: right; -} - -/* possible overwrite with inline style */ -#content #schema-browser .topterms-holder li ul -{ - margin-left: 30px; -} - -#content #schema-browser .topterms-holder li li -{ - border-top: 0; - margin-bottom: 0; - white-space: nowrap; -} - -#content #schema-browser .topterms-holder li li.odd -{ - background-color: #f0f0f0; -} - -#content #schema-browser .topterms-holder li li a -{ - display: block; - padding-left: 2px; - padding-right: 2px; -} - -#content #schema-browser .topterms-holder li li a:hover -{ - background-color: #c0c0c0; -} - -#content #schema-browser #data #field .histogram-holder ul -{ - margin-left: 25px; -} - -#content #schema-browser #data #field .histogram-holder li -{ - margin-bottom: 2px; - position: relative; - width: 150px; -} - -#content #schema-browser #data #field .histogram-holder li.odd -{ - background-color: #f0f0f0; -} - -#content #schema-browser #data #field .histogram-holder li dl, -#content #schema-browser #data #field .histogram-holder li dt -{ - padding-top: 1px; - padding-bottom: 1px; -} - -#content #schema-browser #data #field .histogram-holder li dl -{ - background-color: #c0c0c0; - min-width: 1px; -} - -#content #schema-browser #data #field .histogram-holder li dt -{ - color: #a0a0a0; - position: absolute; - overflow: hidden; - left: -25px; - top: 0px; -} - -#content #schema-browser #data #field .histogram-holder li dt span -{ - display: block; - padding-right: 4px; - text-align: right; -} - -#content #schema-browser #data #field .histogram-holder li dd -{ - clear: left; - float: left; - margin-left: 2px; - white-space: nowrap; -} - -#content #schema-browser #data #field .histogram-holder li:hover dl -{ - background-color: #b0b0b0; -} - -#content #schema-browser #data #field .histogram-holder li:hover dt -{ - color: #333; -} diff --git a/solr/webapp/web/css/angular/schema.css b/solr/webapp/web/css/angular/schema.css new file mode 100644 index 00000000000..626cdc2bb75 --- /dev/null +++ b/solr/webapp/web/css/angular/schema.css @@ -0,0 +1,704 @@ +/* + +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +*/ + +#content #schema .loader +{ + background-position: 0 50%; + padding-left: 21px; +} + +#content #schema.loaded +{ + background-image: url( ../../img/div.gif ); + background-position: 21% 0; + background-repeat: repeat-y; +} + +#content #schema #data +{ + float: right; + width: 78%; +} + +#content #schema #related +{ + float: left; + width: 20%; +} + +#content #schema #related select +{ + width: 100%; +} + +#content #schema #related select optgroup +{ + font-style: normal; + padding: 5px; +} + +#content #schema #related select option +{ + padding-left: 10px; +} + +#content #schema #related #f-df-t +{ + border-bottom: 1px solid #f0f0f0; + padding-bottom: 15px; +} + +#content #schema #related .ukf-dsf dt +{ +} + +#content #schema #related dl +{ + margin-top: 15px; +} + +#content #schema #related dl dt, +#content #schema #related dl dd a +{ + color: #c0c0c0; +} + +#content #schema #related dl dt +{ + font-weight: bold; + margin-top: 5px; +} + +#content #schema #related dl dd a +{ + display: block; + padding-left: 10px; +} + +#content #schema #related dl dd a:hover +{ + background-color: #f8f8f8; +} + +#content #schema #related .field .field, +#content #schema #related .field .field a, +#content #schema #related .dynamic-field .dynamic-field, +#content #schema #related .dynamic-field .dynamic-field a, +#content #schema #related .type .type, +#content #schema #related .type .type a, +#content #schema #related .active, +#content #schema #related .active a +{ + color: #333; +} + +#content #schema #related .copyfield, +#content #schema #related .copyfield a +{ + color: #666; +} + +#content #schema #data +{ +} + +#content #schema #data #index dt +{ + float: left; + margin-right: 5px; + width: 150px; +} + +#content #schema #data #field .field-options +{ + margin-bottom: 10px; +} + +#content #schema #data #field .field-options .head h2 +{ + padding-left: 5px; +} + +#content #schema #data #field .partial +{ +} + +#content #schema #data #field .partial p +{ + background-image: url( ../../img/ico/exclamation-button.png ); + background-position: 0 50%; + padding-left: 21px; +} + +#content #schema #data #field .field-options .options dt, +#content #schema #data #field .field-options .options dd +{ + float: left; +} + +#content #schema #data #field .field-options .options dt +{ + clear: left; + margin-right: 5px; + width: 100px; +} + +#content #schema #data #field .field-options .flags +{ + margin-top: 10px; + margin-bottom: 20px; +} + +#content #schema #data #field .field-options .flags thead td +{ + color: #c0c0c0; + padding-right: 5px; + width: 100px; +} + +#content #schema #data #field .field-options .flags tbody td, +#content #schema #data #field .field-options .flags th +{ + padding: 2px 5px; +} + +#content #schema #data #field .field-options .flags thead td, +#content #schema #data #field .field-options .flags tbody th +{ + padding-left: 0; +} + +#content #schema #data #field .field-options .flags thead th, +#content #schema #data #field .field-options .flags tbody td +{ + border-left: 1px solid #f0f0f0; +} + +#content #schema #data #field .field-options .flags tbody th, +#content #schema #data #field .field-options .flags tbody td +{ + border-top: 1px solid #f0f0f0; +} + +#content #schema #data #field .field-options .flags tbody .check +{ + background-color: #fafdfa; + background-image: url( ../../img/ico/tick.png ); + background-position: 50% 50%; + text-align: center; +} + +#content #schema #data #field .field-options .flags tbody .check span +{ +} + +#content #schema #data #field .field-options .flags tbody .text +{ + color: #c0c0c0; +} + +#content #schema #data #field .field-options .analyzer, +#content #schema #data #field .field-options .analyzer li, +#content #schema #data #field .field-options .analyzer ul, +#content #schema #data #field .field-options .analyzer ul li +{ +} + +#content #schema #data #field .field-options .analyzer p, +#content #schema #data #field .field-options .analyzer dl +{ + float: left; +} + +#content #schema #data #field .field-options .analyzer p +{ + margin-right: 5px; + text-align: right; + width: 125px; + white-space: pre; +} + +#content #schema #data #field .field-options .analyzer p a +{ + cursor: auto; +} + +#content #schema #data #field .field-options .analyzer p a.analysis +{ + cursor: pointer; + display: block; +} + +#content #schema #data #field .field-options .analyzer p a.analysis span +{ + background-image: url( ../../img/ico/question-white.png ); + background-position: 0 50%; + padding-left: 21px; +} + +#content #schema #data #field .field-options .analyzer p a.analysis:hover span +{ + background-image: url( ../../img/ico/question.png ); + color: #008; +} + +#content #schema #data #field .field-options .analyzer a +{ + cursor: auto; +} + +#content #schema #data #field .field-options .analyzer .toggle +{ + background-image: url( ../../img/ico/chevron-small-expand.png ); + background-position: 100% 50%; + cursor: pointer; + display: block; + padding-right: 21px; +} + +#content #schema #data #field .field-options .analyzer .open .toggle +{ + background-image: url( ../../img/ico/chevron-small.png ); +} + +#content #schema #data #field .field-options .analyzer li +{ + border-top: 1px solid #f0f0f0; + margin-top: 10px; + padding-top: 10px; +} + +#content #schema #data #field .field-options .analyzer ul +{ + clear: left; + margin-left: 55px; + padding-top: 5px; +} + +#content #schema #data #field .field-options .analyzer .open ul +{ + display: block; +} + +#content #schema #data #field .field-options .analyzer ul li +{ + border-top: 1px solid #f8f8f8; + margin-top: 5px; + padding-top: 5px; +} + +#content #schema #data #field .field-options .analyzer ul p +{ + color: #999; + margin-right: 5px; + text-align: right; + width: 70px; +} + +#content #schema #data #field .field-options .analyzer ul dd +{ + margin-left: 20px; +} + +#content #schema #data #field .field-options .analyzer ul dd +{ + background-image: url( ../../img/ico/document-list.png ); + background-position: 0 50%; + color: #c0c0c0; + padding-left: 21px; +} + +#content #schema #data #field .field-options .analyzer ul dd.ico-0 +{ + background-image: url( ../../img/ico/slash.png ); +} + +#content #schema #data #field .field-options .analyzer ul dd.ico-1 +{ + background-image: url( ../../img/ico/tick.png ); +} + +#content #schema #data #field .head +{ + margin-bottom: 5px; +} + +#content #schema #data #field .terminfo-holder +{ + border-top: 1px solid #c0c0c0; + padding-top: 10px; +} + +#content #schema #data #field .terminfo-holder .trigger +{ + float: left; + width: 140px; +} + +#content #schema #data #field .terminfo-holder .trigger button span +{ + background-image: url( ../../img/ico/information.png ); +} + +#content #schema #data #field .terminfo-holder .status +{ + border-left: 1px solid #f0f0f0; + float: left; + padding-left: 20px; + padding-right: 20px; +} + +#content #schema #data #field .terminfo-holder.disabled .trigger button span +{ + background-image: url( ../../img/ico/prohibition.png ); +} + +#content #schema #data #field .terminfo-holder.disabled .status +{ + display: block; +} + +#content #schema #data #field .terminfo-holder .trigger .autoload +{ +} + +#content #schema #data #field .terminfo-holder.loaded .trigger .autoload +{ + background-image: url( ../../img/ico/ui-check-box-uncheck.png ); + background-position: 0 50%; + color: #c0c0c0; + display: block; + margin-top: 10px; + padding-left: 21px; +} + +#content #schema #data #field .terminfo-holder .trigger .autoload:hover +{ + color: #008; +} + +#content #schema #data #field .terminfo-holder .trigger .autoload.on +{ + background-image: url( ../../img/ico/ui-check-box.png ); + color: #333; +} + +#content #schema #data #field .topterms-holder, +#content #schema #data #field .histogram-holder +{ + border-left: 1px solid #f0f0f0; + float: left; + padding-left: 20px; + padding-right: 20px; +} + +#content #schema #data #field .topterms-holder .head input +{ + height: 18px; + line-height: 16px; + text-align: right; + width: 30px; +} + +#content #schema #data #field .topterms-holder .head .max-holder +{ + color: #c0c0c0; +} + +#content #schema #data #field .topterms-holder .head .max-holder:hover .max +{ + color: #008; +} + +#content #schema #data #field .topterms-holder .head #query_link +{ + background-image: url( ../../img/ico/question-white.png ); + background-position: 0 50%; + color: #c0c0c0; + padding-left: 21px; + margin-left: 5px; +} + +#content #schema #data #field .topterms-holder .head #query_link:hover +{ + background-image: url( ../../img/ico/question.png ); +} + + +#content #schema #data #field .topterms-holder .head #query_link span +{ + visibility: hidden; +} + +#content #schema #data #field .topterms-holder .head #query_link:hover span +{ + visibility: visible; +} + +#content #schema .topterms-holder li +{ + border-top: 1px solid #999; + margin-bottom: 5px; +} + +/* possible overwrite with inline style */ +#content #schema .topterms-holder li p +{ + background-color: #999; + color: #fff; + float: left; +} + +#content #schema .topterms-holder li p span +{ + display: block; + padding-right: 2px; + text-align: right; +} + +/* possible overwrite with inline style */ +#content #schema .topterms-holder li ul +{ + margin-left: 30px; +} + +#content #schema .topterms-holder li li +{ + border-top: 0; + margin-bottom: 0; + white-space: nowrap; +} + +#content #schema .topterms-holder li li.odd +{ + background-color: #f0f0f0; +} + +#content #schema .topterms-holder li li a +{ + display: block; + padding-left: 2px; + padding-right: 2px; +} + +#content #schema .topterms-holder li li a:hover +{ + background-color: #c0c0c0; +} + +#content #schema #data #field .histogram-holder ul +{ + margin-left: 25px; +} + +#content #schema #data #field .histogram-holder li +{ + margin-bottom: 2px; + position: relative; + width: 150px; +} + +#content #schema #data #field .histogram-holder li.odd +{ + background-color: #f0f0f0; +} + +#content #schema #data #field .histogram-holder li dl, +#content #schema #data #field .histogram-holder li dt +{ + padding-top: 1px; + padding-bottom: 1px; +} + +#content #schema #data #field .histogram-holder li dl +{ + background-color: #c0c0c0; + min-width: 1px; +} + +#content #schema #data #field .histogram-holder li dt +{ + color: #a0a0a0; + position: absolute; + overflow: hidden; + left: -25px; + top: 0px; +} + +#content #schema #data #field .histogram-holder li dt span +{ + display: block; + padding-right: 4px; + text-align: right; +} + +#content #schema #data #field .histogram-holder li dd +{ + clear: left; + float: left; + margin-left: 2px; + white-space: nowrap; +} + +#content #schema #data #field .histogram-holder li:hover dl +{ + background-color: #b0b0b0; +} + +#content #schema #data #field .histogram-holder li:hover dt +{ + color: #333; +} + +#content #schema #actions { + margin-bottom: 20px; + min-height: 30px; +} + +#content #schema .actions #addField span { background-image: url( ../../img/ico/document-list.png ); } +#content #schema .actions #addDynamicField span { background-image: url( ../../img/ico/documents-stack.png ); } +#content #schema .actions #addCopyField span { background-image: url( ../../img/ico/document-import.png ); } + +#content #schema .actions div.action +{ + width: 320px; + background-color: #fff; + border: 1px solid #f0f0f0; + box-shadow: 5px 5px 10px #c0c0c0; + -moz-box-shadow: 5px 5px 10px #c0c0c0; + -webkit-box-shadow: 5px 5px 10px #c0c0c0; + position: absolute; + left: 160px; + top: 50px; + padding: 10px; + z-index: 2; +} + +#content #schema .actions p +{ + padding-bottom: 8px; +} + +#content #schema .actions label +{ + float: left; + padding-top: 3px; + padding-bottom: 3px; + text-align: right; + width: 25%; +} + +#content #schema .actions input, +#content #schema .actions select, +#content #schema .actions .buttons, +#content #schema .actions .note span +{ + float: right; + width: 71%; +} + +#content #schema .actions label.checkbox { + margin-left: 27%; + text-align: left; + width: 73%; + padding: 0px; + margin-top: 0px; +} +#content #schema .actions .checkbox input { + float: none; + width: auto; +} + +#content #schema .add_showhide { + background-image: url( ../../img/ico/chevron-small-expand.png ); + background-position: 100% 50%; + cursor: pointer; + padding-right: 21px; +} + +#content #schema .add_showhide.open { + background-image: url( ../../img/ico/chevron-small.png ); +} + +#content #schema label +{ + cursor: pointer; + display: block; + margin-top: 5px; + width: 100%; +} + +#content #schema .checkbox +{ + margin-bottom: 0; + width: auto; +} + +#content #schema .chosen-container { + margin-left: 6px; + width: 100%; +} +#content #schema .chosen-drop input, +#content #schema .chosen-results { + width: 100% !important; +} + +#content #schema button span +{ + background-image: url( ../../img/ico/cross.png ); +} +#content #schema button.submit span +{ + background-image: url( ../../img/ico/tick.png ); +} + +#content #schema .error +{ + background-image: url( ../../img/ico/cross-button.png ); + background-position: 22% 1px; + color: #c00; + font-weight: bold; + margin-bottom: 10px; +} + +#content #schema #actions .error span +{ + float: right; + width: 71%; + padding-left: 3px; + padding-right: 3px; +} + +#content #schema .delete-field button span { + background-image: url( ../../img/ico/cross.png ); +} + +#content #schema span.rem { + background-image: url( ../../img/ico/cross.png ); + background-position: 100% 50%; + cursor: pointer; + padding-right: 21px; + right:10px; + float:right; +} + +#content #schema .copyfield .updatable a { + float:left; + width:80%; +} \ No newline at end of file diff --git a/solr/webapp/web/index.html b/solr/webapp/web/index.html index 3378929c397..5a87a1e2acc 100644 --- a/solr/webapp/web/index.html +++ b/solr/webapp/web/index.html @@ -39,7 +39,7 @@ limitations under the License. - + @@ -74,7 +74,7 @@ limitations under the License. - + @@ -185,7 +185,7 @@ limitations under the License.
  • Documents
  • Files
  • Query
  • -
  • Schema Browser
  • +
  • Schema
  • @@ -212,7 +212,7 @@ limitations under the License.
  • Plugins / Stats
  • Query
  • Replication
  • -
  • Schema Browser
  • +
  • Schema
  • Segments info
  • diff --git a/solr/webapp/web/js/angular/app.js b/solr/webapp/web/js/angular/app.js index d888cc9e14c..6b55d8cbde8 100644 --- a/solr/webapp/web/js/angular/app.js +++ b/solr/webapp/web/js/angular/app.js @@ -121,9 +121,9 @@ solrAdminApp.config([ templateUrl: 'partials/dataimport.html', controller: 'DataImportController' }). - when('/:core/schema-browser', { - templateUrl: 'partials/schema-browser.html', - controller: 'SchemaBrowserController' + when('/:core/schema', { + templateUrl: 'partials/schema.html', + controller: 'SchemaController' }). when('/:core/segments', { templateUrl: 'partials/segments.html', @@ -156,6 +156,30 @@ solrAdminApp.config([ } }; }) +.directive('escapePressed', function () { + return function (scope, element, attrs) { + element.bind("keydown keypress", function (event) { + if(event.which === 27) { + scope.$apply(function (){ + scope.$eval(attrs.escapePressed); + }); + event.preventDefault(); + } + }); + }; +}) +.directive('focusWhen', function($timeout) { + return { + link: function(scope, element, attrs) { + scope.$watch(attrs.focusWhen, function(value) { + if(value === true) { + $timeout(function() { + element[0].focus(); + }, 100); + } + }); + } + }; .directive('scrollableWhenSmall', function($window) { return { link: function(scope, element, attrs) { diff --git a/solr/webapp/web/js/angular/controllers/schema-browser.js b/solr/webapp/web/js/angular/controllers/schema.js similarity index 69% rename from solr/webapp/web/js/angular/controllers/schema-browser.js rename to solr/webapp/web/js/angular/controllers/schema.js index a02dd54d275..3f61ebeab05 100644 --- a/solr/webapp/web/js/angular/controllers/schema-browser.js +++ b/solr/webapp/web/js/angular/controllers/schema.js @@ -17,14 +17,13 @@ var cookie_schema_browser_autoload = 'schema-browser_autoload'; -solrAdminApp.controller('SchemaBrowserController', - function($scope, $routeParams, $location, $cookies, Luke, Constants) { - $scope.resetMenu("schema-browser", Constants.IS_COLLECTION_PAGE); +solrAdminApp.controller('SchemaController', + function($scope, $routeParams, $location, $cookies, $timeout, Luke, Constants, Schema, Config) { + $scope.resetMenu("schema", Constants.IS_COLLECTION_PAGE); $scope.refresh = function () { Luke.schema({core: $routeParams.core}, function (schema) { - Luke.index({core: $routeParams.core}, function (index) { - + Luke.raw({core: $routeParams.core}, function (index) { var data = mergeIndexAndSchemaData(index, schema.schema); $scope.fieldsAndTypes = getFieldsAndTypes(data); @@ -42,8 +41,12 @@ solrAdminApp.controller('SchemaBrowserController', var field = data.fields[$scope.name]; leftbar.types = [field.type]; if (field.dynamicBase) leftbar.dynamicFields = [field.dynamicBase]; - if (field.copySources && field.copySources.length>0) leftbar.copyFieldSources = field.copySources.sort(); - if (field.copyDests && field.copyDests.length>0) leftbar.copyFieldDests = field.copyDests.sort(); + if (field.copySources && field.copySources.length>0) { + leftbar.copyFieldSources = sortedObjectArray(field.copySources.sort()); + } + if (field.copyDests && field.copyDests.length>0) { + leftbar.copyFieldDests = sortedObjectArray(field.copyDests.sort()); + } $scope.fieldOrType = "field=" + $scope.name; } else if (search["dynamic-field"]) { $scope.selectedType = "Dynamic Field"; @@ -70,15 +73,20 @@ solrAdminApp.controller('SchemaBrowserController', $scope.isDefaultSearchField = ($scope.selectedType == "Field" && $scope.name == $scope.defaultSearchField); $scope.isUniqueKeyField = ($scope.selectedType == "Field" && $scope.name == $scope.uniqueKeyField); - $scope.display = getFieldProperties(index, $routeParams.core, $scope.is, $scope.name); + $scope.display = getFieldProperties(data, $routeParams.core, $scope.is, $scope.name); $scope.analysis = getAnalysisInfo(data, $scope.is, $scope.name); $scope.isAutoload = $cookies[cookie_schema_browser_autoload] == "true"; if ($scope.isAutoload) { $scope.toggleTerms(); } + + $scope.types = Object.keys(schema.schema.types); }); }); + Config.get({core: $routeParams.core}, function(data) { + $scope.isSchemaUpdatable = data.config.schemaFactory.class == "ManagedIndexSchemaFactory"; + }); }; $scope.refresh(); @@ -123,6 +131,161 @@ solrAdminApp.controller('SchemaBrowserController', $cookies[cookie_schema_browser_autoload] = $scope.isAutoload; console.log("cookie: " + $cookies[cookie_schema_browser_autoload]); } + + $scope.hideAll = function() { + $scope.showAddField = false; + $scope.showAddDynamicField = false; + $scope.showAddCopyField = false; + } + + $scope.toggleAddField = function() { + if ($scope.showAddField && $scope.adding == "field") { + $scope.hideAll(); + } else { + $scope.hideAll(); + $scope.showAddField = true; + $scope.adding = "field"; + + $scope.newField = { + stored: "true", + indexed: "true" + } + delete $scope.addErrors; + } + } + + $scope.addField = function() { + delete $scope.addErrors; + var data = {"add-field": $scope.newField}; + Schema.post({core: $routeParams.core}, data, function(data) { + if (data.errors) { + $scope.addErrors = data.errors[0].errorMessages; + if (typeof $scope.addErrors === "string") { + $scope.addErrors = [$scope.addErrors]; + } + } else { + $scope.added = true; + $timeout(function() { + $scope.showAddField = false; + $scope.added = false; + $scope.refresh(); + }, 1500); + } + }); + } + + $scope.toggleAddDynamicField = function() { + if ($scope.showAddField && $scope.adding == "dynamicField") { + $scope.hideAll(); + } else { + $scope.hideAll(); + $scope.showAddField = true; + $scope.adding = "dynamicField"; + + $scope.newField = { + stored: "true", + indexed: "true" + } + delete $scope.addErrors; + } + } + + $scope.addDynamicField = function() { + delete $scope.addErrors; + var data = {"add-dynamic-field": $scope.newField}; + Schema.post({core: $routeParams.core}, data, function(data) { + if (data.errors) { + $scope.addErrors = data.errors[0].errorMessages; + if (typeof $scope.addErrors === "string") { + $scope.addErrors = [$scope.addErrors]; + } + } else { + $scope.added = true; + $timeout(function() { + $scope.showAddField = false; + $scope.added = false; + $scope.refresh(); + }, 1500); + } + }); + } + + $scope.toggleAddCopyField = function() { + if ($scope.showAddCopyField) { + $scope.hideAll(); + } else { + $scope.hideAll(); + $scope.showAddCopyField = true; + + $scope.copyField = {}; + delete $scope.addCopyFieldErrors; + } + } + $scope.addCopyField = function() { + delete $scope.addCopyFieldErrors; + var data = {"add-copy-field": $scope.copyField}; + Schema.post({core: $routeParams.core}, data, function(data) { + if (data.errors) { + $scope.addCopyFieldErrors = data.errors[0].errorMessages; + if (typeof $scope.addCopyFieldErrors === "string") { + $scope.addCopyFieldErrors = [$scope.addCopyFieldErrors]; + } + } else { + $scope.showAddCopyField = false; + $timeout($scope.refresh, 1500); + } + }); + } + + $scope.toggleDelete = function() { + if ($scope.showDelete) { + $scope.showDelete = false; + } else { + if ($scope.is.field) { + $scope.deleteData = {'delete-field': {name: $scope.name}}; + } else if ($scope.is.dynamicField) { + $scope.deleteData = {'delete-dynamic-field': {name: $scope.name}}; + } else { + alert("TYPE NOT KNOWN"); + } + $scope.showDelete = true; + } + } + + $scope.delete = function() { + Schema.post({core: $routeParams.core}, $scope.deleteData, function(data) { + if (data.errors) { + $scope.deleteErrors = data.errors[0].errorMessages; + if (typeof $scope.deleteErrors === "string") { + $scope.deleteErrors = [$scope.deleteErrors]; + } + } else { + $scope.deleted = true; + $timeout(function() { + $location.search(""); + }, 1500 + ); + } + }); + } + $scope.toggleDeleteCopyField = function(field) { + field.show = !field.show; + delete field.errors; + } + $scope.deleteCopyField = function(field, source, dest) { + data = {'delete-copy-field': {source: source, dest: dest}}; + Schema.post({core: $routeParams.core}, data, function(data) { + if (data.errors) { + field.errors = data.errors[0].errorMessages; + if (typeof $scope.deleteErrors === "string") { + field.errors = [field.errors]; + } + } else { + field.deleted = true; + $timeout($scope.refresh, 1500); + } + }); + } } ); @@ -303,9 +466,9 @@ var getFieldProperties = function(data, core, is, field) { } // identify columns in field property table: - for (var key in data.info.key) { + for (var key in data.key) { if (allFlags.indexOf(key)>=0) { - display.columns.push({key: key, name: data.info.key[key]}); + display.columns.push({key: key, name: data.key[key]}); } } @@ -343,9 +506,7 @@ var getAnalysisInfo = function(data, is, name) { var processComponentType = function (label, key, componentTypeData) { if (componentTypeData) { var components = []; - console.dir(componentTypeData); for (var componentName in componentTypeData) { - console.log(componentName); var componentData = componentTypeData[componentName]; var component = {className: componentData.className, args:[]}; if (componentData.args) { @@ -420,6 +581,14 @@ var getTermInfo = function(data) { return termInfo; }; +var sortedObjectArray = function(list) { + var objarr = []; + for (var i in list) { + objarr.push({"name": list[i]}); + } + return objarr; +} + /* var get_width = function get_width() { diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js index 3d20dad8b9a..13d01f7204c 100644 --- a/solr/webapp/web/js/angular/services.js +++ b/solr/webapp/web/js/angular/services.js @@ -136,7 +136,8 @@ solrAdminServices.factory('System', .factory('Luke', ['$resource', function($resource) { return $resource('/solr/:core/admin/luke', {core: '@core', wt:'json', _:Date.now()}, { - "index": {params: {numTerms: 0}}, + "index": {params: {numTerms: 0, show: 'index'}}, + "raw": {params: {numTerms: 0}}, "schema": {params: {show:'schema'}}, "field": {}, "fields": {params: {show:'schema'}, interceptor: { @@ -238,5 +239,18 @@ solrAdminServices.factory('System', return $resource('/solr/:core/admin/segments', {'wt':'json', core: '@core', _:Date.now()}, { get: {} }); - } -]); +}]) +.factory('Schema', + ['$resource', function($resource) { + return $resource('/solr/:core/schema', {wt: 'json', core: '@core', _:Date.now()}, { + get: {method: "GET"}, + check: {method: "GET", headers: {doNotIntercept: "true"}}, + post: {method: "POST"} + }); +}]) +.factory('Config', + ['$resource', function($resource) { + return $resource('/solr/:core/config', {wt: 'json', core: '@core', _:Date.now()}, { + get: {method: "GET"} + }) +}]); diff --git a/solr/webapp/web/partials/analysis.html b/solr/webapp/web/partials/analysis.html index 282373b5b0f..3c1b4565dc5 100644 --- a/solr/webapp/web/partials/analysis.html +++ b/solr/webapp/web/partials/analysis.html @@ -51,7 +51,7 @@ limitations under the License. - Schema Browser  + Schema Browser 
    diff --git a/solr/webapp/web/partials/schema-browser.html b/solr/webapp/web/partials/schema-browser.html deleted file mode 100644 index f4084196f5e..00000000000 --- a/solr/webapp/web/partials/schema-browser.html +++ /dev/null @@ -1,207 +0,0 @@ - -
    - -
    - -
    - -
    - -
    - -
    -

    - {{selectedType}}: - {{name}} -

    -
    - -
    - -

    Because your Index is empty, we do not have enough Information about this Field

    - -
    - -
    - -
    Field-Type:
    -
    {{analysis.data.className}}
    - -
    Similarity:
    -
    {{ display.similarity.details }} ({{ similarity.className }})
    - -
    PI Gap:
    -
    {{ display.positionIncrementGap }}
    - -
    Docs:
    -
    {{display.docs | number}}
    - -
    Distinct:
    -
    {{display.distinct}}
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    Flags:{{key.name}}
    {{row.name}}{{row.comment}} - -   -
    - - - -
    - -
    - -
    - - -
    - N.B. Loaded from a single core - not from the whole collection. - - Autoload - -
    - -

    Sorry, no Term Info available :(

    - -
    - -
    -

    - - /{{termInfo.maxTerms | number}} Top-Terms: - Query  -

    -
    - -
      -
    • -

      {{countGroup.count}}

      - -
    • - -
    - -
    - -
    - -

    Histogram:

    -
      -
    • -
      -
      {{ row.key | number}}
      -
      {{ row.value | number }}
      -
      -
    • - -
    - -
    - -
    - -
    - -
    - - - -
    - -
    diff --git a/solr/webapp/web/partials/schema.html b/solr/webapp/web/partials/schema.html new file mode 100644 index 00000000000..b91a92c1def --- /dev/null +++ b/solr/webapp/web/partials/schema.html @@ -0,0 +1,448 @@ + +
    + +
    + +
    +
    + + + + +
    + +

    +

    + +

    + +

    + +

    +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + + Show omit options + Hide omit options + +

    + +
    + +

    + +

    + +

    + +

    + +

    + +

    +
    + +

    + + Show term vector options + Hide term vector options + +

    +
    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +
    + +

    + + Show sort options + Show sort options + +

    +
    +

    + +

    + +

    + +

    + +
    + +
    + {{error}}
    + +

    + + + +

    + + + +
    + +
    + +
    + +

    +

    + +

    +

    + +
    + {{error}}
    + +

    + + +

    + +
    + +
    +
    + +
    + +
    + +
    + +
    +

    + {{selectedType}}: + {{name}} +

    +
    + +
    + +

    Because your Index is empty, we do not have enough Information about this Field

    + +
    + +
    + +
    Field-Type:
    +
    {{analysis.data.className}}
    + +
    Similarity:
    +
    {{ display.similarity.details }} ({{ similarity.className }})
    + +
    PI Gap:
    +
    {{ display.positionIncrementGap }}
    + +
    Docs:
    +
    {{display.docs | number}}
    + +
    Distinct:
    +
    {{display.distinct}}
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    Flags:{{key.name}}
    {{row.name}}{{row.comment}} + +   +
    + + + +
    + +
    + +
    + + +
    + N.B. Loaded from a single core - not from the whole collection. + + Autoload + +
    + +

    Sorry, no Term Info available :(

    + +
    + +
    +

    + + /{{termInfo.maxTerms | number}} Top-Terms: + Query  +

    +
    + +
      +
    • +

      {{countGroup.count}}

      + +
    • + +
    + +
    + +
    + +

    Histogram:

    +
      +
    • +
      +
      {{ row.key | number}}
      +
      {{ row.value | number }}
      +
      +
    • + +
    + +
    + +
    + +
    + +
    + + +
    + +
    + +