|
@@ -41,11 +41,11 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
</%def>
|
|
</%def>
|
|
|
|
|
|
|
|
<%def name="creation()">
|
|
<%def name="creation()">
|
|
|
- <a href="javascript:void(0)" class="btn" data-bind="click: function() { collection.showCreateModal(true) }">
|
|
|
|
|
- <i class="fa fa-plus-circle"></i> ${ _('Create collection') }
|
|
|
|
|
|
|
+ <a href="javascript:void(0)" class="btn" data-bind="click: function() { index.showCreateModal(true) }">
|
|
|
|
|
+ <i class="fa fa-plus-circle"></i> ${ _('Create index') }
|
|
|
</a>
|
|
</a>
|
|
|
<a href="javascript:void(0)" class="btn" data-bind="click: function() { createWizard.show(true) }">
|
|
<a href="javascript:void(0)" class="btn" data-bind="click: function() { createWizard.show(true) }">
|
|
|
- <i class="fa fa-plus-circle"></i> ${ _('Create collection from a file') }
|
|
|
|
|
|
|
+ <i class="fa fa-plus-circle"></i> ${ _('Create index from a file') }
|
|
|
</a>
|
|
</a>
|
|
|
<a href="javascript:void(0)" class="btn" data-bind="click: function() { alias.showCreateModal(true) }">
|
|
<a href="javascript:void(0)" class="btn" data-bind="click: function() { alias.showCreateModal(true) }">
|
|
|
<i class="fa fa-plus-circle"></i> ${ _('Create alias') }
|
|
<i class="fa fa-plus-circle"></i> ${ _('Create alias') }
|
|
@@ -61,13 +61,14 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
<th>${ _('Name') }</th>
|
|
<th>${ _('Name') }</th>
|
|
|
<th>${ _('Type') }</th>
|
|
<th>${ _('Type') }</th>
|
|
|
<th>${ _('Collections') }</th>
|
|
<th>${ _('Collections') }</th>
|
|
|
|
|
+ <th>${ _('Schema') }</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody data-bind="foreach: { data: indexes }">
|
|
<tbody data-bind="foreach: { data: indexes }">
|
|
|
<tr>
|
|
<tr>
|
|
|
<td data-bind="click: $root.handleSelect" class="center" style="cursor: default" data-row-selector-exclude="true">
|
|
<td data-bind="click: $root.handleSelect" class="center" style="cursor: default" data-row-selector-exclude="true">
|
|
|
<div data-bind="css: { 'hueCheckbox': true, 'fa': true, 'fa-check': isSelected }" data-row-selector-exclude="true"></div>
|
|
<div data-bind="css: { 'hueCheckbox': true, 'fa': true, 'fa-check': isSelected }" data-row-selector-exclude="true"></div>
|
|
|
- ## <a data-bind="attr: { 'href': '${ url('spark:index') }?index=' + id() }" data-row-selector="true"></a>
|
|
|
|
|
|
|
+ ## <a data-bind="attr: { 'href': '${ url('search:index') }?index=' + id() }" data-row-selector="true"></a>
|
|
|
</td>
|
|
</td>
|
|
|
<td data-bind="text: name"></td>
|
|
<td data-bind="text: name"></td>
|
|
|
<td data-bind="text: type"></td>
|
|
<td data-bind="text: type"></td>
|
|
@@ -77,6 +78,11 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
<i class="fa fa-pencil"></i> ${ _('Edit') }
|
|
<i class="fa fa-pencil"></i> ${ _('Edit') }
|
|
|
</a>
|
|
</a>
|
|
|
</td>
|
|
</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <a data-bind="attr: { 'href': '/indexer/api/indexes/' + name() + '/schema/' }, visible: type() == 'collection'">
|
|
|
|
|
+ <i class="fa fa-pencil"></i> ${ _('Edit') }
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
@@ -84,17 +90,17 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
-<!-- ko template: 'create-collection' --><!-- /ko -->
|
|
|
|
|
|
|
+<!-- ko template: 'create-index' --><!-- /ko -->
|
|
|
|
|
|
|
|
-<script type="text/html" id="create-collection">
|
|
|
|
|
- <div class="snippet-settings" data-bind="visible: collection.showCreateModal">
|
|
|
|
|
|
|
+<script type="text/html" id="create-index">
|
|
|
|
|
+ <div class="snippet-settings" data-bind="visible: index.showCreateModal">
|
|
|
|
|
|
|
|
- <input data-bind="value: collection.name"></input>
|
|
|
|
|
|
|
+ <input data-bind="value: index.name"></input>
|
|
|
|
|
|
|
|
- <a href="javascript:void(0)" class="btn" data-bind="click: collection.create">
|
|
|
|
|
- <i class="fa fa-plus-circle"></i> ${ _('Create collection') }
|
|
|
|
|
|
|
+ <a href="javascript:void(0)" class="btn" data-bind="click: index.create">
|
|
|
|
|
+ <i class="fa fa-plus-circle"></i> ${ _('Create index') }
|
|
|
</a>
|
|
</a>
|
|
|
- <a href="javascript:void(0)" class="btn" data-bind="click: function() { collection.showCreateModal(false) }">
|
|
|
|
|
|
|
+ <a href="javascript:void(0)" class="btn" data-bind="click: function() { index.showCreateModal(false) }">
|
|
|
<i class="fa fa-plus-circle"></i> ${ _('Cancel') }
|
|
<i class="fa fa-plus-circle"></i> ${ _('Cancel') }
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
@@ -119,9 +125,9 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
-<!-- ko template: 'create-collection-wizard' --><!-- /ko -->
|
|
|
|
|
|
|
+<!-- ko template: 'create-index-wizard' --><!-- /ko -->
|
|
|
|
|
|
|
|
-<script type="text/html" id="create-collection-wizard">
|
|
|
|
|
|
|
+<script type="text/html" id="create-index-wizard">
|
|
|
<div class="snippet-settings" data-bind="visible: createWizard.show">
|
|
<div class="snippet-settings" data-bind="visible: createWizard.show">
|
|
|
|
|
|
|
|
${ _('Name') } <input data-bind="value: createWizard.name"></input>
|
|
${ _('Name') } <input data-bind="value: createWizard.name"></input>
|
|
@@ -129,8 +135,8 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
<!-- ko if: createWizard.name() -->
|
|
<!-- ko if: createWizard.name() -->
|
|
|
<select data-bind="options: createWizard.availableWizards, value: createWizard.wizard, optionsText: 'name'" size="5"></select>
|
|
<select data-bind="options: createWizard.availableWizards, value: createWizard.wizard, optionsText: 'name'" size="5"></select>
|
|
|
|
|
|
|
|
- <span data-bind="template: { name: 'create-collection-from-file', data: createWizard.wizard }"></span>
|
|
|
|
|
- <span data-bind="template: { name: 'create-collection-from-hive', data: createWizard.wizard }"></span>
|
|
|
|
|
|
|
+ <span data-bind="template: { name: 'create-index-from-file', data: createWizard.wizard }"></span>
|
|
|
|
|
+ <span data-bind="template: { name: 'create-index-from-hive', data: createWizard.wizard }"></span>
|
|
|
|
|
|
|
|
<ul data-bind="foreach: createWizard.wizard().sample">
|
|
<ul data-bind="foreach: createWizard.wizard().sample">
|
|
|
<li>
|
|
<li>
|
|
@@ -161,7 +167,7 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
-<script type="text/html" id="create-collection-from-file">
|
|
|
|
|
|
|
+<script type="text/html" id="create-index-from-file">
|
|
|
<!-- ko if: name() == 'file' -->
|
|
<!-- ko if: name() == 'file' -->
|
|
|
<div class="snippet-settings" data-bind="visible: show">
|
|
<div class="snippet-settings" data-bind="visible: show">
|
|
|
|
|
|
|
@@ -173,7 +179,7 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
-<script type="text/html" id="create-collection-from-hive">
|
|
|
|
|
|
|
+<script type="text/html" id="create-index-from-hive">
|
|
|
<!-- ko if: name() == 'hive' -->
|
|
<!-- ko if: name() == 'hive' -->
|
|
|
<div class="snippet-settings" data-bind="visible: show">
|
|
<div class="snippet-settings" data-bind="visible: show">
|
|
|
|
|
|
|
@@ -216,7 +222,7 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
- var Collection = function () {
|
|
|
|
|
|
|
+ var Index = function () {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
|
|
|
|
|
self.showCreateModal = ko.observable(false);
|
|
self.showCreateModal = ko.observable(false);
|
|
@@ -224,7 +230,7 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
self.name = ko.observable('');
|
|
self.name = ko.observable('');
|
|
|
|
|
|
|
|
self.create = function() {
|
|
self.create = function() {
|
|
|
- $.post("${ url('indexer:create_collection') }", {
|
|
|
|
|
|
|
+ $.post("${ url('indexer:create_index') }", {
|
|
|
"name": self.name
|
|
"name": self.name
|
|
|
}, function() {
|
|
}, function() {
|
|
|
window.location.reload();
|
|
window.location.reload();
|
|
@@ -335,20 +341,20 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
|
|
|
|
|
self.indexes = ko.mapping.fromJS(${ indexes_json | n });
|
|
self.indexes = ko.mapping.fromJS(${ indexes_json | n });
|
|
|
|
|
|
|
|
- self.collection = new Collection(self);
|
|
|
|
|
|
|
+ self.index = new Index(self);
|
|
|
self.alias = new Alias(self);
|
|
self.alias = new Alias(self);
|
|
|
self.createWizard = new CreateWizard(self);
|
|
self.createWizard = new CreateWizard(self);
|
|
|
|
|
|
|
|
- self.selectedJobs = ko.computed(function() {
|
|
|
|
|
|
|
+ self.selectedIndexes = ko.computed(function() {
|
|
|
return $.grep(self.indexes(), function(index) { return index.isSelected(); });
|
|
return $.grep(self.indexes(), function(index) { return index.isSelected(); });
|
|
|
});
|
|
});
|
|
|
self.isLoading = ko.observable(false);
|
|
self.isLoading = ko.observable(false);
|
|
|
|
|
|
|
|
self.oneSelected = ko.computed(function() {
|
|
self.oneSelected = ko.computed(function() {
|
|
|
- return self.selectedJobs().length == 1;
|
|
|
|
|
|
|
+ return self.selectedIndexes().length == 1;
|
|
|
});
|
|
});
|
|
|
self.atLeastOneSelected = ko.computed(function() {
|
|
self.atLeastOneSelected = ko.computed(function() {
|
|
|
- return self.selectedJobs().length >= 1;
|
|
|
|
|
|
|
+ return self.selectedIndexes().length >= 1;
|
|
|
});
|
|
});
|
|
|
self.allSelected = ko.observable(false);
|
|
self.allSelected = ko.observable(false);
|
|
|
|
|
|
|
@@ -393,6 +399,7 @@ ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
|
|
|
null,
|
|
null,
|
|
|
null,
|
|
null,
|
|
|
null,
|
|
null,
|
|
|
|
|
+ { "bSortable":false },
|
|
|
],
|
|
],
|
|
|
"aaSorting":[
|
|
"aaSorting":[
|
|
|
[1, 'asc' ]
|
|
[1, 'asc' ]
|