bnb_blazer 0.2.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/bnb_blazer/base_controller.rb +6 -0
- data/app/views/{blazer → bnb_blazer}/_variables.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/checks/_form.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/checks/edit.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/checks/index.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/checks/new.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/dashboards/_form.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/dashboards/edit.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/dashboards/new.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/dashboards/show.html.haml +2 -2
- data/app/views/{blazer → bnb_blazer}/queries/_form.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/queries/edit.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/queries/home.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/queries/new.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/queries/run.html.haml +0 -0
- data/app/views/{blazer → bnb_blazer}/queries/show.html.haml +2 -2
- data/app/views/layouts/{blazer → bnb_blazer}/_footer.html.haml +0 -0
- data/app/views/layouts/{blazer → bnb_blazer}/_navbar.html.haml +0 -0
- data/app/views/layouts/{blazer → bnb_blazer}/application.html.haml +0 -0
- data/lib/{bnb_blazer/bnb_blazer.rb → bnb_blazer.rb} +5 -0
- data/lib/bnb_blazer/engine.rb +5 -0
- data/lib/bnb_blazer/version.rb +1 -1
- metadata +23 -96
- data/.docker-development-vars +0 -1
- data/.gitignore +0 -31
- data/.rspec +0 -3
- data/.ruby-version +0 -1
- data/.travis.yml +0 -6
- data/Gemfile +0 -54
- data/Gemfile.lock +0 -233
- data/LICENSE.txt +0 -21
- data/README.md +0 -35
- data/app/assets/config/manifest.js +0 -3
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/bnb_intel_logo.png +0 -0
- data/app/assets/stylesheets/application.css +0 -83
- data/app/channels/application_cable/channel.rb +0 -4
- data/app/channels/application_cable/connection.rb +0 -4
- data/app/controllers/application_controller.rb +0 -2
- data/app/controllers/concerns/.keep +0 -0
- data/app/helpers/application_helper.rb +0 -2
- data/app/jobs/application_job.rb +0 -2
- data/app/mailers/application_mailer.rb +0 -4
- data/app/models/application_record.rb +0 -3
- data/app/models/concerns/.keep +0 -0
- data/app/models/user.rb +0 -2
- data/bin/bundle +0 -3
- data/bin/console +0 -14
- data/bin/rails +0 -9
- data/bin/rake +0 -9
- data/bin/setup +0 -36
- data/bin/spring +0 -17
- data/bin/update +0 -31
- data/bin/yarn +0 -11
- data/bnb_blazer.gemspec +0 -28
- data/config.ru +0 -5
- data/config/application.rb +0 -19
- data/config/blazer.yml +0 -79
- data/config/boot.rb +0 -4
- data/config/cable.yml +0 -10
- data/config/credentials.yml.enc +0 -1
- data/config/database.yml +0 -19
- data/config/environment.rb +0 -5
- data/config/environments/development.rb +0 -61
- data/config/environments/production.rb +0 -94
- data/config/environments/test.rb +0 -46
- data/config/initializers/application_controller_renderer.rb +0 -8
- data/config/initializers/assets.rb +0 -14
- data/config/initializers/backtrace_silencers.rb +0 -7
- data/config/initializers/content_security_policy.rb +0 -25
- data/config/initializers/cookies_serializer.rb +0 -5
- data/config/initializers/filter_parameter_logging.rb +0 -4
- data/config/initializers/inflections.rb +0 -16
- data/config/initializers/mime_types.rb +0 -4
- data/config/initializers/wrap_parameters.rb +0 -14
- data/config/locales/en.yml +0 -33
- data/config/puma.rb +0 -37
- data/config/routes.rb +0 -3
- data/config/spring.rb +0 -6
- data/config/storage.yml +0 -34
- data/db/migrate/20210309231658_install_blazer.rb +0 -47
- data/db/migrate/20210309231908_create_users.rb +0 -13
- data/db/schema.rb +0 -85
- data/db/seeds.rb +0 -45
- data/docker-compose.yml +0 -22
- data/lib/assets/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/log/.keep +0 -0
- data/package.json +0 -5
- data/public/404.html +0 -67
- data/public/422.html +0 -67
- data/public/500.html +0 -66
- data/public/apple-touch-icon-precomposed.png +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +0 -1
- data/tmp/.keep +0 -0
- data/vendor/.keep +0 -0
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2021 Joe
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# BnbBlazer
|
2
|
-
|
3
|
-
Welcome to BNB Blazer! This is a gem wrapper for the [Blazer](https://github.com/ankane/blazer) query tool designed specifically for BNB projects. In this directory, you'll find the files you need to edit the behavior/appearance of this gem. Additionally, you can spin up the test app to experiment with the appearance of the tool. Put your Ruby code in the file `lib/bnb_blazer`.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
To use this wrapper in conjunction with Blazer, add this block to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem "blazer"
|
11
|
-
gem "bnb_blazer"
|
12
|
-
```
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
|
16
|
-
$ bundle install
|
17
|
-
|
18
|
-
## Development
|
19
|
-
|
20
|
-
This gem comes bundled with a test app to help you test out new display designs with pre-populated blazer queries. To get the environment up and running:
|
21
|
-
|
22
|
-
1. Clone this repo down to your machine
|
23
|
-
2. Make sure you have [Dip](https://github.com/brandnewbox/bnb-dip-defaults) installed and configured
|
24
|
-
3. In your new `bnb_blazer` directory, run `docker-compose up`
|
25
|
-
4. Once all your containers have spun up, run `dip setup`
|
26
|
-
5. Navigate to http://localhost:300/blazer in your browser, and away you go!
|
27
|
-
|
28
|
-
## Contributing
|
29
|
-
|
30
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/brandnewbox/bnb_blazer.
|
31
|
-
|
32
|
-
|
33
|
-
## License
|
34
|
-
|
35
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/app/assets/images/.keep
DELETED
File without changes
|
Binary file
|
@@ -1,83 +0,0 @@
|
|
1
|
-
|
2
|
-
body {
|
3
|
-
background-color: #D3D3D3;
|
4
|
-
}
|
5
|
-
|
6
|
-
table{
|
7
|
-
table-layout: fixed;
|
8
|
-
}
|
9
|
-
|
10
|
-
.blazer-content {
|
11
|
-
padding-bottom: 2.5rem;
|
12
|
-
}
|
13
|
-
|
14
|
-
#footer {
|
15
|
-
position: relative;
|
16
|
-
bottom: 0;
|
17
|
-
width: 100%;
|
18
|
-
}
|
19
|
-
|
20
|
-
#results * {
|
21
|
-
background-color: #f5f5f5;
|
22
|
-
padding-left: 10px;
|
23
|
-
padding-right: 10px;
|
24
|
-
}
|
25
|
-
|
26
|
-
.results-container {
|
27
|
-
margin-top: 20px;
|
28
|
-
}
|
29
|
-
|
30
|
-
#branded-table {
|
31
|
-
background-color: #f5f5f5;
|
32
|
-
}
|
33
|
-
|
34
|
-
.chart-container {
|
35
|
-
background-color: #f5f5f5;
|
36
|
-
padding-top: 10px;
|
37
|
-
padding-bottom: 10px;
|
38
|
-
}
|
39
|
-
|
40
|
-
.navbar-default .navbar-nav > li > a {
|
41
|
-
color: #373737;
|
42
|
-
font-size: 18px;
|
43
|
-
}
|
44
|
-
|
45
|
-
.navbar-default .navbar-toggle .icon-bar {
|
46
|
-
background-color: #2EB1E6;
|
47
|
-
}
|
48
|
-
|
49
|
-
.dropdown {
|
50
|
-
background-color: #606060;
|
51
|
-
}
|
52
|
-
|
53
|
-
.btn-default {
|
54
|
-
background-color: #f8f8f8;
|
55
|
-
border-color: #f8f8f8;
|
56
|
-
color: #373737;
|
57
|
-
font-size: 18px;
|
58
|
-
}
|
59
|
-
|
60
|
-
.btn-default:hover {
|
61
|
-
color: #2EB1E6;
|
62
|
-
background-color: #f8f8f8;
|
63
|
-
border-color:#2EB1E6;
|
64
|
-
}
|
65
|
-
|
66
|
-
.btn-group > .btn + .dropdown-toggle:hover {
|
67
|
-
background-color: #f8f8f8;
|
68
|
-
border-color:#2EB1E6;
|
69
|
-
}
|
70
|
-
|
71
|
-
.btn-group.open .dropdown-toggle {
|
72
|
-
background-color: #f8f8f8;
|
73
|
-
border-color:#2EB1E6;
|
74
|
-
}
|
75
|
-
|
76
|
-
.navbar-default .navbar-nav > .open > a {
|
77
|
-
background-color: #f8f8f8;
|
78
|
-
border-color:#2EB1E6;
|
79
|
-
}
|
80
|
-
|
81
|
-
.navbar-nav .btn-group {
|
82
|
-
margin-top: 8px;
|
83
|
-
}
|
File without changes
|
data/app/jobs/application_job.rb
DELETED
data/app/models/concerns/.keep
DELETED
File without changes
|
data/app/models/user.rb
DELETED
data/bin/bundle
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "bnb_blazer"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/rails
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
begin
|
3
|
-
load File.expand_path('../spring', __FILE__)
|
4
|
-
rescue LoadError => e
|
5
|
-
raise unless e.message.include?('spring')
|
6
|
-
end
|
7
|
-
APP_PATH = File.expand_path('../config/application', __dir__)
|
8
|
-
require_relative '../config/boot'
|
9
|
-
require 'rails/commands'
|
data/bin/rake
DELETED
data/bin/setup
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'fileutils'
|
3
|
-
include FileUtils
|
4
|
-
|
5
|
-
# path to your application root.
|
6
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
-
|
8
|
-
def system!(*args)
|
9
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
-
end
|
11
|
-
|
12
|
-
chdir APP_ROOT do
|
13
|
-
# This script is a starting point to setup your application.
|
14
|
-
# Add necessary setup steps to this file.
|
15
|
-
|
16
|
-
puts '== Installing dependencies =='
|
17
|
-
system! 'gem install bundler --conservative'
|
18
|
-
system('bundle check') || system!('bundle install')
|
19
|
-
|
20
|
-
# Install JavaScript dependencies if using Yarn
|
21
|
-
# system('bin/yarn')
|
22
|
-
|
23
|
-
# puts "\n== Copying sample files =="
|
24
|
-
# unless File.exist?('config/database.yml')
|
25
|
-
# cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
-
# end
|
27
|
-
|
28
|
-
puts "\n== Preparing database =="
|
29
|
-
system! 'bin/rails db:setup'
|
30
|
-
|
31
|
-
puts "\n== Removing old logs and tempfiles =="
|
32
|
-
system! 'bin/rails log:clear tmp:clear'
|
33
|
-
|
34
|
-
puts "\n== Restarting application server =="
|
35
|
-
system! 'bin/rails restart'
|
36
|
-
end
|
data/bin/spring
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# This file loads Spring without using Bundler, in order to be fast.
|
4
|
-
# It gets overwritten when you run the `spring binstub` command.
|
5
|
-
|
6
|
-
unless defined?(Spring)
|
7
|
-
require 'rubygems'
|
8
|
-
require 'bundler'
|
9
|
-
|
10
|
-
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
-
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
|
12
|
-
if spring
|
13
|
-
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
14
|
-
gem 'spring', spring.version
|
15
|
-
require 'spring/binstub'
|
16
|
-
end
|
17
|
-
end
|
data/bin/update
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'fileutils'
|
3
|
-
include FileUtils
|
4
|
-
|
5
|
-
# path to your application root.
|
6
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
-
|
8
|
-
def system!(*args)
|
9
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
-
end
|
11
|
-
|
12
|
-
chdir APP_ROOT do
|
13
|
-
# This script is a way to update your development environment automatically.
|
14
|
-
# Add necessary update steps to this file.
|
15
|
-
|
16
|
-
puts '== Installing dependencies =='
|
17
|
-
system! 'gem install bundler --conservative'
|
18
|
-
system('bundle check') || system!('bundle install')
|
19
|
-
|
20
|
-
# Install JavaScript dependencies if using Yarn
|
21
|
-
# system('bin/yarn')
|
22
|
-
|
23
|
-
puts "\n== Updating database =="
|
24
|
-
system! 'bin/rails db:migrate'
|
25
|
-
|
26
|
-
puts "\n== Removing old logs and tempfiles =="
|
27
|
-
system! 'bin/rails log:clear tmp:clear'
|
28
|
-
|
29
|
-
puts "\n== Restarting application server =="
|
30
|
-
system! 'bin/rails restart'
|
31
|
-
end
|
data/bin/yarn
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
-
Dir.chdir(APP_ROOT) do
|
4
|
-
begin
|
5
|
-
exec "yarnpkg", *ARGV
|
6
|
-
rescue Errno::ENOENT
|
7
|
-
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
-
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
-
exit 1
|
10
|
-
end
|
11
|
-
end
|
data/bnb_blazer.gemspec
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require_relative 'lib/bnb_blazer/version'
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = "bnb_blazer"
|
5
|
-
spec.version = BnbBlazer::VERSION
|
6
|
-
spec.authors = ["Joe"]
|
7
|
-
spec.email = ["pickertjoe@gmail.com"]
|
8
|
-
|
9
|
-
spec.summary = "Customized branding of the Blazer gem for BNB projects"
|
10
|
-
spec.description = "Customized branding of the Blazer gem for BNB projects"
|
11
|
-
spec.homepage = "https://github.com/brandnewbox/bnb_blazer"
|
12
|
-
spec.license = "MIT"
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
|
-
|
15
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
-
spec.metadata["source_code_uri"] = "https://github.com/brandnewbox/bnb_blazer"
|
17
|
-
|
18
|
-
spec.add_dependency "blazer", "~> 2.4"
|
19
|
-
|
20
|
-
# Specify which files should be added to the gem when it is released.
|
21
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
-
end
|
25
|
-
spec.bindir = "exe"
|
26
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
-
spec.require_paths = ["lib"]
|
28
|
-
end
|
data/config.ru
DELETED
data/config/application.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require_relative 'boot'
|
2
|
-
|
3
|
-
require 'rails/all'
|
4
|
-
|
5
|
-
# Require the gems listed in Gemfile, including any gems
|
6
|
-
# you've limited to :test, :development, or :production.
|
7
|
-
Bundler.require(*Rails.groups)
|
8
|
-
|
9
|
-
module BnbBlazer
|
10
|
-
class Application < Rails::Application
|
11
|
-
# Initialize configuration defaults for originally generated Rails version.
|
12
|
-
config.load_defaults 5.2
|
13
|
-
|
14
|
-
# Settings in config/environments/* take precedence over those specified here.
|
15
|
-
# Application configuration can go into files in config/initializers
|
16
|
-
# -- all .rb files in that directory are automatically loaded after loading
|
17
|
-
# the framework and any gems in your application.
|
18
|
-
end
|
19
|
-
end
|
data/config/blazer.yml
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
# see https://github.com/ankane/blazer for more info
|
2
|
-
|
3
|
-
data_sources:
|
4
|
-
main:
|
5
|
-
url: <%= ENV["BLAZER_DATABASE_URL"] %>
|
6
|
-
|
7
|
-
# statement timeout, in seconds
|
8
|
-
# none by default
|
9
|
-
# timeout: 15
|
10
|
-
|
11
|
-
# caching settings
|
12
|
-
# can greatly improve speed
|
13
|
-
# off by default
|
14
|
-
# cache:
|
15
|
-
# mode: slow # or all
|
16
|
-
# expires_in: 60 # min
|
17
|
-
# slow_threshold: 15 # sec, only used in slow mode
|
18
|
-
|
19
|
-
# wrap queries in a transaction for safety
|
20
|
-
# not necessary if you use a read-only user
|
21
|
-
# true by default
|
22
|
-
# use_transaction: false
|
23
|
-
|
24
|
-
smart_variables:
|
25
|
-
# zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
|
26
|
-
# period: ["day", "week", "month"]
|
27
|
-
# status: {0: "Active", 1: "Archived"}
|
28
|
-
|
29
|
-
linked_columns:
|
30
|
-
# user_id: "/admin/users/{value}"
|
31
|
-
|
32
|
-
smart_columns:
|
33
|
-
# user_id: "SELECT id, name FROM users WHERE id IN {value}"
|
34
|
-
|
35
|
-
# create audits
|
36
|
-
audit: true
|
37
|
-
|
38
|
-
# change the time zone
|
39
|
-
# time_zone: "Pacific Time (US & Canada)"
|
40
|
-
|
41
|
-
# class name of the user model
|
42
|
-
# user_class: User
|
43
|
-
|
44
|
-
# method name for the current user
|
45
|
-
# user_method: current_user
|
46
|
-
|
47
|
-
# method name for the display name
|
48
|
-
# user_name: name
|
49
|
-
|
50
|
-
# custom before_action to use for auth
|
51
|
-
# before_action_method: require_admin
|
52
|
-
|
53
|
-
# email to send checks from
|
54
|
-
# from_email: blazer@example.org
|
55
|
-
|
56
|
-
# webhook for Slack
|
57
|
-
# slack_webhook_url: <%= ENV["BLAZER_SLACK_WEBHOOK_URL"] %>
|
58
|
-
|
59
|
-
check_schedules:
|
60
|
-
- "1 day"
|
61
|
-
- "1 hour"
|
62
|
-
- "5 minutes"
|
63
|
-
|
64
|
-
# enable anomaly detection
|
65
|
-
# note: with trend, time series are sent to https://trendapi.org
|
66
|
-
# anomaly_checks: trend / r
|
67
|
-
|
68
|
-
# enable forecasting
|
69
|
-
# note: with trend, time series are sent to https://trendapi.org
|
70
|
-
# forecasting: trend / prophet
|
71
|
-
|
72
|
-
# enable map
|
73
|
-
# mapbox_access_token: <%= ENV["MAPBOX_ACCESS_TOKEN"] %>
|
74
|
-
|
75
|
-
# enable uploads
|
76
|
-
# uploads:
|
77
|
-
# url: <%= ENV["BLAZER_UPLOADS_URL"] %>
|
78
|
-
# schema: uploads
|
79
|
-
# data_source: main
|