Git Product home page Git Product logo

staff_bar's Introduction

Staff bar

Preview

Staff bar is a tiny utility for Ruby on Rails projects. It shows a bar with some basic project information: commit hash, branch, Ruby & Rails versions, environment and caching status. You can also make a list of links that you want to show on a bar for a quick access to your internal tools.

Usage

# Add this to Gemfile
gem 'staff_bar'

# Install dependencies
bundle

Add this to app/views/layouts/application.html.erb:

...
</head>

<body>
  <%= staff_bar if current_user.staff? %>

  <%= yield %>
</body>
...

(you can change current_user.staff? to whatever your administrators logic is of course.)

Add this to your application.css to use default styles:

*= require staff_bar

To show current branch, add staff_bar capistrano tasks in Capfile:

require "staff_bar/capistrano"

This will create BRANCH file when deploying, which will staff bar use to show the branch.

Configuration

# app/config/initializers/staff_bar.rb
StaffBar.configure do |config|
  config.links = [
    { url: '/jobs', title: 'Jobs queue' },
    { url: '/logs', title: 'Open logs' }
  ];

  config.theme = :dark # or :light
  config.position = :bottom # or :top
  config.highlight_envs = [:production]
end

License

The gem is available as open source under the terms of the MIT License.

staff_bar's People

Contributors

rolandasb avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.