Loading app/controllers/CommonsController.scala 0 → 100644 +15 −0 Original line number Diff line number Diff line package controllers import models.ElasticServer import models.commons.Indices import scala.concurrent.ExecutionContext.Implicits.global class CommonsController extends BaseController { def indices = process { (request, client) => client.getIndices(ElasticServer(request.host, request.authentication)).map { response => Status(response.status)(Indices(response.body)) } } } app/models/createindex/Indices.scala→app/models/commons/Indices.scala +1 −1 Original line number Diff line number Diff line package models.createindex package models.commons import play.api.libs.json.{JsArray, JsString, JsValue} Loading conf/routes +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ POST /analysis/analyze/analyzer @controllers.AnalysisController.ana POST /analysis/analyze/field @controllers.AnalysisController.analyzeByField # Create index module POST /create_index/create @controllers.CreateIndexController.execute POST /create_index/indices @controllers.CreateIndexController.indices # Commons POST /commons/indices @controllers.CommonsController.indices GET /apis/hosts @controllers.HostsController.index Loading public/aliases.html +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ <span class="info-text">assigned to index </span> <div class="form-group"> <select class="form-control" ng-model="new_alias.index" ng-options="i.name as i.name for i in indices | orderBy:'name'"> ng-options="i for i in indices | orderBy:'i'"> <option value="">select index</option> </select> </div> Loading public/js/app.js +4 −3 Original line number Diff line number Diff line Loading @@ -1440,13 +1440,14 @@ angular.module('cerebro').factory('DataService', ['$rootScope', '$timeout', request('/overview', {}, success, error); }; // Create index this.getIndices = function(success, error) { request('/create_index/indices', {}, success, error); }; this.createIndex = function(index, metadata, success, error) { var data = {index: index, metadata: metadata}; request('/create_index/create', data, success, error); }; // Commons this.getIndices = function(success, error) { request('/commons/indices', {}, success, error); }; this.closeIndex = function(index, success, error) { request('/apis/close_indices', {indices: index}, success, error); Loading Loading
app/controllers/CommonsController.scala 0 → 100644 +15 −0 Original line number Diff line number Diff line package controllers import models.ElasticServer import models.commons.Indices import scala.concurrent.ExecutionContext.Implicits.global class CommonsController extends BaseController { def indices = process { (request, client) => client.getIndices(ElasticServer(request.host, request.authentication)).map { response => Status(response.status)(Indices(response.body)) } } }
app/models/createindex/Indices.scala→app/models/commons/Indices.scala +1 −1 Original line number Diff line number Diff line package models.createindex package models.commons import play.api.libs.json.{JsArray, JsString, JsValue} Loading
conf/routes +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ POST /analysis/analyze/analyzer @controllers.AnalysisController.ana POST /analysis/analyze/field @controllers.AnalysisController.analyzeByField # Create index module POST /create_index/create @controllers.CreateIndexController.execute POST /create_index/indices @controllers.CreateIndexController.indices # Commons POST /commons/indices @controllers.CommonsController.indices GET /apis/hosts @controllers.HostsController.index Loading
public/aliases.html +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ <span class="info-text">assigned to index </span> <div class="form-group"> <select class="form-control" ng-model="new_alias.index" ng-options="i.name as i.name for i in indices | orderBy:'name'"> ng-options="i for i in indices | orderBy:'i'"> <option value="">select index</option> </select> </div> Loading
public/js/app.js +4 −3 Original line number Diff line number Diff line Loading @@ -1440,13 +1440,14 @@ angular.module('cerebro').factory('DataService', ['$rootScope', '$timeout', request('/overview', {}, success, error); }; // Create index this.getIndices = function(success, error) { request('/create_index/indices', {}, success, error); }; this.createIndex = function(index, metadata, success, error) { var data = {index: index, metadata: metadata}; request('/create_index/create', data, success, error); }; // Commons this.getIndices = function(success, error) { request('/commons/indices', {}, success, error); }; this.closeIndex = function(index, success, error) { request('/apis/close_indices', {indices: index}, success, error); Loading