diff --git a/web/Gemfile b/web/Gemfile index 23b5783..4218ee1 100644 --- a/web/Gemfile +++ b/web/Gemfile @@ -25,6 +25,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc gem 'active_scaffold' gem 'bootstrap', '~> 4.0.0.alpha3' gem 'ace-rails-ap' +gem 'puma' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' diff --git a/web/Gemfile.lock b/web/Gemfile.lock index 9c00e91..ffa7970 100644 --- a/web/Gemfile.lock +++ b/web/Gemfile.lock @@ -86,6 +86,7 @@ GEM parser (2.3.0.6) ast (~> 2.2) powerpack (0.1.1) + puma (2.16.0) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -171,6 +172,7 @@ DEPENDENCIES coffee-rails (~> 4.1.0) jbuilder (~> 2.0) jquery-rails + puma rails (= 4.2.5.1) rubocop sass-rails (~> 5.0) diff --git a/web/app/assets/images/chub.png b/web/app/assets/images/chub.png new file mode 100644 index 0000000..de339c3 Binary files /dev/null and b/web/app/assets/images/chub.png differ diff --git a/web/app/assets/images/ubuntu.png b/web/app/assets/images/ubuntu.png new file mode 100644 index 0000000..f0a4088 Binary files /dev/null and b/web/app/assets/images/ubuntu.png differ diff --git a/web/app/assets/javascripts/application.js b/web/app/assets/javascripts/application.js index e07c5a8..a245878 100644 --- a/web/app/assets/javascripts/application.js +++ b/web/app/assets/javascripts/application.js @@ -14,3 +14,5 @@ //= require jquery_ujs //= require turbolinks //= require_tree . +//= require active_scaffold +//= require bootstrap-sprockets diff --git a/web/app/assets/stylesheets/application.css b/web/app/assets/stylesheets/application.css.scss similarity index 83% rename from web/app/assets/stylesheets/application.css rename to web/app/assets/stylesheets/application.css.scss index f9cd5b3..78857fd 100644 --- a/web/app/assets/stylesheets/application.css +++ b/web/app/assets/stylesheets/application.css.scss @@ -1,3 +1,4 @@ + /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. @@ -10,6 +11,15 @@ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new * file per style scope. * - *= require_tree . - *= require_self + *= require active_scaffold */ + @import "bootstrap"; + +#logo { + margin: 20px; + color: green; +} + +.server-thumbnail { + margin: 15px; +} diff --git a/web/app/controllers/operating_systems_controller.rb b/web/app/controllers/operating_systems_controller.rb new file mode 100644 index 0000000..1c39f29 --- /dev/null +++ b/web/app/controllers/operating_systems_controller.rb @@ -0,0 +1,4 @@ +class OperatingSystemsController < ApplicationController + active_scaffold :operating_system do |conf| + end +end diff --git a/web/app/controllers/servers_controller.rb b/web/app/controllers/servers_controller.rb new file mode 100644 index 0000000..3d96d9a --- /dev/null +++ b/web/app/controllers/servers_controller.rb @@ -0,0 +1,6 @@ +class ServersController < ApplicationController + active_scaffold :server do |conf| + conf.columns = [:name, :operating_system] + conf.columns[:operating_system].form_ui = :select + end +end diff --git a/web/app/helpers/operating_systems_helper.rb b/web/app/helpers/operating_systems_helper.rb new file mode 100644 index 0000000..b4c2770 --- /dev/null +++ b/web/app/helpers/operating_systems_helper.rb @@ -0,0 +1,2 @@ +module OperatingSystemsHelper +end diff --git a/web/app/helpers/servers_helper.rb b/web/app/helpers/servers_helper.rb new file mode 100644 index 0000000..a36fb17 --- /dev/null +++ b/web/app/helpers/servers_helper.rb @@ -0,0 +1,2 @@ +module ServersHelper +end diff --git a/web/app/models/operating_system.rb b/web/app/models/operating_system.rb new file mode 100644 index 0000000..f034e25 --- /dev/null +++ b/web/app/models/operating_system.rb @@ -0,0 +1,3 @@ +class OperatingSystem < ActiveRecord::Base + has_many :servers +end diff --git a/web/app/models/server.rb b/web/app/models/server.rb new file mode 100644 index 0000000..6733cad --- /dev/null +++ b/web/app/models/server.rb @@ -0,0 +1,8 @@ +class Server < ActiveRecord::Base + belongs_to :operating_system + before_create :generate_hash + + def generate_hash + self.namehash = SecureRandom.hex + end +end diff --git a/web/app/views/layouts/application.html.erb b/web/app/views/layouts/application.html.erb index d67f770..aca93f4 100644 --- a/web/app/views/layouts/application.html.erb +++ b/web/app/views/layouts/application.html.erb @@ -7,8 +7,11 @@ <%= csrf_meta_tags %>
- +