[plugins] move apps into plugins
This commit is contained in:
parent
3e1ed4e004
commit
edc9fdc629
|
@ -1,15 +0,0 @@
|
|||
define(function (require) {
|
||||
return function VisTypeService(Private) {
|
||||
var _ = require('lodash');
|
||||
var Registry = require('utils/registry/registry');
|
||||
|
||||
return new Registry({
|
||||
index: ['name'],
|
||||
initialSet: [
|
||||
Private(require('components/vis_types/histogram')),
|
||||
Private(require('components/vis_types/line')),
|
||||
Private(require('components/vis_types/pie'))
|
||||
]
|
||||
});
|
||||
};
|
||||
});
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
@ -62,6 +62,9 @@ host = (options[:host] || config['host'])
|
|||
# Set the override for Elasticsaerch
|
||||
elasticsearch = (options[:elasticsearch] || config['elasticsearch'])
|
||||
|
||||
# absolute path to this directory
|
||||
dir = File.dirname(__FILE__)
|
||||
|
||||
# If the env isn't set we need to set it to development
|
||||
ENV["RACK_ENV"] = "development" if ENV["RACK_ENV"].nil?
|
||||
|
||||
|
@ -70,14 +73,16 @@ Kibana.global_settings[:port] = port || 5601
|
|||
Kibana.global_settings[:host] = host || '0.0.0.0'
|
||||
Kibana.global_settings[:config] = config
|
||||
Kibana.global_settings[:elasticsearch] = elasticsearch
|
||||
Kibana.global_settings[:root] = File.expand_path("#{File.dirname(__FILE__)}/../")
|
||||
Kibana.global_settings[:root] = File.expand_path("#{dir}/../")
|
||||
Kibana.global_settings[:quiet] = options[:quiet]
|
||||
|
||||
# Set the public folder based on whether we are running in production or not.
|
||||
if ENV['RACK_ENV'] == ('production')
|
||||
Kibana.global_settings[:public_folder] = File.expand_path("#{File.dirname(__FILE__)}/../public/")
|
||||
Kibana.global_settings[:public_folder] = File.expand_path("#{dir}/../public/")
|
||||
Kibana.global_settings[:plugin_folder] = File.expand_path("#{dir}/../../plugins/")
|
||||
else
|
||||
Kibana.global_settings[:public_folder] = File.expand_path("#{File.dirname(__FILE__)}/../../kibana/")
|
||||
Kibana.global_settings[:public_folder] = File.expand_path("#{dir}/../../kibana/")
|
||||
Kibana.global_settings[:plugin_folder] = File.expand_path("#{dir}/../../../plugins/")
|
||||
end
|
||||
|
||||
# Add the root of the project to the load path
|
||||
|
|
|
@ -8,13 +8,5 @@ elasticsearch: "http://localhost:9200"
|
|||
# and dashboards. It will create an new index if it doesn't already exist.
|
||||
kibanaIndex: "kibana-int"
|
||||
|
||||
# Applications loaded and included into Kibana. Use the settings below to
|
||||
# customize the applications and thier names.
|
||||
apps:
|
||||
- { id: "discover", name: "Discover" }
|
||||
- { id: "visualize", name: "Visualize" }
|
||||
- { id: "dashboard", name: "Dashboard" }
|
||||
- { id: "settings", name: "Settings" }
|
||||
|
||||
# The default application to laad.
|
||||
defaultAppId: "discover"
|
||||
|
|
|
@ -13,6 +13,7 @@ module Kibana
|
|||
|
||||
set :root, Kibana.global_settings[:root]
|
||||
set :public_folder, Kibana.global_settings[:public_folder]
|
||||
set :plugin_folder, Kibana.global_settings[:plugin_folder]
|
||||
set :httponly, true
|
||||
set :config, config
|
||||
end
|
||||
|
|
|
@ -13,6 +13,12 @@ module Kibana
|
|||
# to the proxy for elasticsearch
|
||||
data = settings.config.clone()
|
||||
data['elasticsearch'] = "#{request.scheme}://#{request.host}:#{request.port}/elasticsearch"
|
||||
|
||||
plugin_pattern = File.join(settings.plugin_folder, '*', 'index.js')
|
||||
data['plugins'] = Dir.glob(plugin_pattern).map { |path|
|
||||
path.sub(settings.plugin_folder, 'plugins').sub(/\.js$/, '')
|
||||
}
|
||||
|
||||
json data
|
||||
end
|
||||
|
||||
|
|
|
@ -61,10 +61,11 @@ module.exports = function (grunt) {
|
|||
|
||||
// include each app
|
||||
var main = config.build.options.modules[0];
|
||||
var configFile = grunt.file.readYAML(grunt.config.get('configFile'));
|
||||
configFile.apps.forEach(function (app) {
|
||||
main.include.push('apps/' + app.id + '/index');
|
||||
});
|
||||
// TODO: load files as plugins
|
||||
// var configFile = grunt.file.readYAML(grunt.config.get('configFile'));
|
||||
// configFile.apps.forEach(function (app) {
|
||||
// main.include.push('apps/' + app.id + '/index');
|
||||
// });
|
||||
|
||||
return config;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue