stoplight-admin 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +17 -14
- data/README.md +1 -1
- data/lib/sinatra/stoplight_admin.rb +8 -0
- metadata +55 -49
- data/.gitignore +0 -8
- data/.rubocop.yml +0 -9
- data/CONTRIBUTING.md +0 -7
- data/Gemfile +0 -4
- data/Rakefile +0 -1
- data/lib/sinatra/views/index.haml +0 -79
- data/lib/sinatra/views/layout.haml +0 -48
- data/stoplight-admin.gemspec +0 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f0e3d072fb5591e45d316a6495e32738a2745d8a
|
|
4
|
+
data.tar.gz: e2589c64e02747523b13f843769038a82a348c43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95ef7f59e1d034d5760ab56109ba077ec3a0033cf17fb817b43257e8699cb4d583c3a8975eaa94ee791b8152657201cc3734bf9c6b8e91ec7520f6e758851ad9
|
|
7
|
+
data.tar.gz: 410ac57ec77f92cdfa945d62c5250449a81dd743ef61880b67840cb6a4defd5efbdad521b5c79dd278edad747c286457e38330c354b10fe7a8f2a44db5c14917
|
data/LICENSE.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
-
the Software without restriction, including without limitation the rights to
|
|
6
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
7
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
8
|
-
subject to the following conditions:
|
|
3
|
+
Copyright (c) 2015 Cameron Desautels & Taylor Fausak
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
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.
|
|
12
14
|
|
|
13
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
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
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'haml'
|
|
4
4
|
require 'sinatra/base'
|
|
5
|
+
require 'sinatra/json'
|
|
5
6
|
require 'stoplight'
|
|
6
7
|
|
|
7
8
|
module Sinatra
|
|
@@ -120,6 +121,13 @@ module Sinatra
|
|
|
120
121
|
haml :index, locals: stats.merge(lights: ls)
|
|
121
122
|
end
|
|
122
123
|
|
|
124
|
+
app.get '/stats' do
|
|
125
|
+
ls = lights
|
|
126
|
+
stats = stat_params(ls)
|
|
127
|
+
|
|
128
|
+
json({stats: stats, lights: ls})
|
|
129
|
+
end
|
|
130
|
+
|
|
123
131
|
app.post '/lock' do
|
|
124
132
|
with_lights { |l| lock(l) }
|
|
125
133
|
redirect to('/')
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stoplight-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cameron Desautels
|
|
@@ -9,93 +9,107 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
name:
|
|
15
|
+
name: haml
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
|
-
- - ~>
|
|
18
|
+
- - "~>"
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: '
|
|
21
|
-
type: :
|
|
20
|
+
version: '4.0'
|
|
21
|
+
type: :runtime
|
|
22
22
|
prerelease: false
|
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
24
|
requirements:
|
|
25
|
-
- - ~>
|
|
25
|
+
- - "~>"
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: '
|
|
27
|
+
version: '4.0'
|
|
28
28
|
- !ruby/object:Gem::Dependency
|
|
29
|
-
name:
|
|
29
|
+
name: redis
|
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
|
32
|
-
- -
|
|
32
|
+
- - "~>"
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '
|
|
35
|
-
type: :
|
|
34
|
+
version: '3.2'
|
|
35
|
+
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
38
|
requirements:
|
|
39
|
-
- -
|
|
39
|
+
- - "~>"
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: '
|
|
41
|
+
version: '3.2'
|
|
42
42
|
- !ruby/object:Gem::Dependency
|
|
43
|
-
name:
|
|
43
|
+
name: sinatra
|
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
|
45
45
|
requirements:
|
|
46
|
-
- - ~>
|
|
46
|
+
- - "~>"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: 4
|
|
48
|
+
version: '1.4'
|
|
49
49
|
type: :runtime
|
|
50
50
|
prerelease: false
|
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
|
53
|
-
- - ~>
|
|
53
|
+
- - "~>"
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 4
|
|
55
|
+
version: '1.4'
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
|
-
name:
|
|
57
|
+
name: sinatra-contrib
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
|
60
|
-
- - ~>
|
|
60
|
+
- - "~>"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version:
|
|
62
|
+
version: '1.4'
|
|
63
63
|
type: :runtime
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
|
-
- - ~>
|
|
67
|
+
- - "~>"
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version:
|
|
69
|
+
version: '1.4'
|
|
70
70
|
- !ruby/object:Gem::Dependency
|
|
71
|
-
name:
|
|
71
|
+
name: stoplight
|
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements:
|
|
74
|
-
- - ~>
|
|
74
|
+
- - "~>"
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: 1.
|
|
76
|
+
version: '1.0'
|
|
77
77
|
type: :runtime
|
|
78
78
|
prerelease: false
|
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
|
81
|
-
- - ~>
|
|
81
|
+
- - "~>"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
|
-
version: 1.
|
|
83
|
+
version: '1.0'
|
|
84
84
|
- !ruby/object:Gem::Dependency
|
|
85
|
-
name:
|
|
85
|
+
name: bundler
|
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
|
87
87
|
requirements:
|
|
88
|
-
- - ~>
|
|
88
|
+
- - "~>"
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
|
-
version:
|
|
91
|
-
type: :
|
|
90
|
+
version: '1.10'
|
|
91
|
+
type: :development
|
|
92
|
+
prerelease: false
|
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - "~>"
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '1.10'
|
|
98
|
+
- !ruby/object:Gem::Dependency
|
|
99
|
+
name: rake
|
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
|
101
|
+
requirements:
|
|
102
|
+
- - "~>"
|
|
103
|
+
- !ruby/object:Gem::Version
|
|
104
|
+
version: '10.4'
|
|
105
|
+
type: :development
|
|
92
106
|
prerelease: false
|
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
|
94
108
|
requirements:
|
|
95
|
-
- - ~>
|
|
109
|
+
- - "~>"
|
|
96
110
|
- !ruby/object:Gem::Version
|
|
97
|
-
version:
|
|
98
|
-
description: A simple administration interface for
|
|
111
|
+
version: '10.4'
|
|
112
|
+
description: A simple administration interface for Stoplight.
|
|
99
113
|
email:
|
|
100
114
|
- camdez@gmail.com
|
|
101
115
|
- taylor@fausak.me
|
|
@@ -103,17 +117,9 @@ executables: []
|
|
|
103
117
|
extensions: []
|
|
104
118
|
extra_rdoc_files: []
|
|
105
119
|
files:
|
|
106
|
-
- .gitignore
|
|
107
|
-
- .rubocop.yml
|
|
108
|
-
- CONTRIBUTING.md
|
|
109
|
-
- Gemfile
|
|
110
120
|
- LICENSE.md
|
|
111
121
|
- README.md
|
|
112
|
-
- Rakefile
|
|
113
122
|
- lib/sinatra/stoplight_admin.rb
|
|
114
|
-
- lib/sinatra/views/index.haml
|
|
115
|
-
- lib/sinatra/views/layout.haml
|
|
116
|
-
- stoplight-admin.gemspec
|
|
117
123
|
homepage: https://github.com/orgsync/stoplight-admin
|
|
118
124
|
licenses:
|
|
119
125
|
- MIT
|
|
@@ -124,18 +130,18 @@ require_paths:
|
|
|
124
130
|
- lib
|
|
125
131
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
132
|
requirements:
|
|
127
|
-
- -
|
|
133
|
+
- - ">="
|
|
128
134
|
- !ruby/object:Gem::Version
|
|
129
|
-
version:
|
|
135
|
+
version: 1.9.3
|
|
130
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
137
|
requirements:
|
|
132
|
-
- -
|
|
138
|
+
- - ">="
|
|
133
139
|
- !ruby/object:Gem::Version
|
|
134
140
|
version: '0'
|
|
135
141
|
requirements: []
|
|
136
142
|
rubyforge_project:
|
|
137
|
-
rubygems_version: 2.4.
|
|
143
|
+
rubygems_version: 2.4.5
|
|
138
144
|
signing_key:
|
|
139
145
|
specification_version: 4
|
|
140
|
-
summary: A simple administration interface for
|
|
146
|
+
summary: A simple administration interface for Stoplight.
|
|
141
147
|
test_files: []
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
data/CONTRIBUTING.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
1. **Fork** the repository.
|
|
4
|
-
2. Create a **branch** for your feature (`git checkout -b feature`).
|
|
5
|
-
3. **Commit** your changes (`git commit -a -m 'Feature'`).
|
|
6
|
-
4. **Push** to your branch (`git push origin feature`).
|
|
7
|
-
5. Create a **pull request**.
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
.jumbotron.hidden-xs.hidden-sm
|
|
2
|
-
%h1 🚦 All of the Lights
|
|
3
|
-
%p Cop lights, flashlights, spotlights, strobe lights…
|
|
4
|
-
|
|
5
|
-
.main
|
|
6
|
-
- if lights.empty?
|
|
7
|
-
.alert.alert-warning{role: 'alert'}
|
|
8
|
-
%strong No lights found.
|
|
9
|
-
Ensure that your Stoplight data store is properly configured and that your Stoplight blocks have been run.
|
|
10
|
-
- else
|
|
11
|
-
.well
|
|
12
|
-
%form{method: 'post', action: url('/green_all')}
|
|
13
|
-
%button.btn-lg.btn.btn-success{type: 'submit', disabled: count_red + count_yellow > 0 ? nil : 'disabled'} Greenify All
|
|
14
|
-
|
|
15
|
-
.progress
|
|
16
|
-
.progress-bar.progress-bar-danger{style: "width: #{percent_red}%"}
|
|
17
|
-
.span= count_red
|
|
18
|
-
.progress-bar.progress-bar-warning{style: "width: #{percent_yellow}%"}
|
|
19
|
-
.span= count_yellow
|
|
20
|
-
.progress-bar.progress-bar-success{style: "width: #{percent_green}%"}
|
|
21
|
-
.span= count_green
|
|
22
|
-
|
|
23
|
-
.lights
|
|
24
|
-
%table.table.table-hover
|
|
25
|
-
%thead.hidden-xs
|
|
26
|
-
%tr
|
|
27
|
-
%th Status
|
|
28
|
-
%th
|
|
29
|
-
%abbr{title: 'Locked lights will not change color automatically.'} Locked?
|
|
30
|
-
%th Name
|
|
31
|
-
%th
|
|
32
|
-
%abbr{title: 'Exceptions which caused the light to turn red.'} Failures
|
|
33
|
-
%tbody
|
|
34
|
-
- lights.each do |l|
|
|
35
|
-
%tr
|
|
36
|
-
%td.indicator
|
|
37
|
-
- if l[:color] == GREEN
|
|
38
|
-
%form{method: 'post', action: url('/red')}
|
|
39
|
-
%input{type: 'hidden', name: 'names', value: URI.escape(l[:name])}
|
|
40
|
-
%button{type: 'submit', class: 'btn btn-success'}
|
|
41
|
-
G
|
|
42
|
-
%span.hidden-xs> REEN
|
|
43
|
-
- elsif l[:color] == YELLOW
|
|
44
|
-
%form{method: 'post', action: url('/green')}
|
|
45
|
-
%input{type: 'hidden', name: 'names', value: URI.escape(l[:name])}
|
|
46
|
-
%button{type: 'submit', class: 'btn btn-warning'}
|
|
47
|
-
Y
|
|
48
|
-
%span.hidden-xs> ELLOW
|
|
49
|
-
- else
|
|
50
|
-
%form{method: 'post', action: url('/green')}
|
|
51
|
-
%input{type: 'hidden', name: 'names', value: URI.escape(l[:name])}
|
|
52
|
-
%button{type: 'submit', class: 'btn btn-danger'}
|
|
53
|
-
R
|
|
54
|
-
%span.hidden-xs> ED
|
|
55
|
-
%td.locked
|
|
56
|
-
- if l[:locked]
|
|
57
|
-
%form{method: 'post', action: url('/unlock')}
|
|
58
|
-
%input{type: 'hidden', name: 'names', value: URI.escape(l[:name])}
|
|
59
|
-
%button{type: 'submit', class: 'btn btn-link'}
|
|
60
|
-
%span{class: 'glyphicon glyphicon-lock'}
|
|
61
|
-
- else
|
|
62
|
-
%form{method: 'post', action: url('/lock')}
|
|
63
|
-
%input{type: 'hidden', name: 'names', value: URI.escape(l[:name])}
|
|
64
|
-
%button{type: 'submit', class: 'btn btn-link'}
|
|
65
|
-
%span{class: 'glyphicon glyphicon-minus'}
|
|
66
|
-
%td.name
|
|
67
|
-
= l[:name]
|
|
68
|
-
%td.failures
|
|
69
|
-
- if l[:failures]
|
|
70
|
-
%ul
|
|
71
|
-
- l[:failures].each do |failure|
|
|
72
|
-
%li
|
|
73
|
-
%span.error
|
|
74
|
-
&= failure.error_class
|
|
75
|
-
\:
|
|
76
|
-
&= failure.error_message
|
|
77
|
-
@
|
|
78
|
-
%span.timestamp
|
|
79
|
-
&= failure.time
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
!!! 5
|
|
2
|
-
%html{lang: 'en'}
|
|
3
|
-
%head
|
|
4
|
-
%meta{charset: 'utf-8'}
|
|
5
|
-
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1'}
|
|
6
|
-
|
|
7
|
-
%title Stoplight Admin
|
|
8
|
-
|
|
9
|
-
%link{rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css'}
|
|
10
|
-
%link{rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css'}
|
|
11
|
-
%link{rel: 'shortcut icon', href: '//i.imgur.com/qvfoNuh.png'}
|
|
12
|
-
|
|
13
|
-
:css
|
|
14
|
-
td.indicator {
|
|
15
|
-
font-size: 200%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
td.name {
|
|
19
|
-
font-weight: bold;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
td.locked button {
|
|
23
|
-
font-size: 200%;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
td.failures span.error {
|
|
27
|
-
font-weight: bold;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
td.failures ul {
|
|
31
|
-
padding: 0;
|
|
32
|
-
list-style-type: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.btn-group form {
|
|
36
|
-
display: inline-block;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
%body
|
|
40
|
-
.navbar.navbar-inverse.navbar-static-top{role: 'navigation'}
|
|
41
|
-
.container
|
|
42
|
-
.navbar-header
|
|
43
|
-
%a{class: 'navbar-brand', href: url('/')} Stoplight Admin
|
|
44
|
-
|
|
45
|
-
.container{role: 'main'}
|
|
46
|
-
= yield
|
|
47
|
-
|
|
48
|
-
%script{src: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js'}
|
data/stoplight-admin.gemspec
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |spec|
|
|
4
|
-
spec.name = 'stoplight-admin'
|
|
5
|
-
spec.version = '0.2.9'
|
|
6
|
-
spec.authors = ['Cameron Desautels', 'Taylor Fausak']
|
|
7
|
-
spec.email = %w(camdez@gmail.com taylor@fausak.me)
|
|
8
|
-
spec.summary = %q{A simple administration interface for the stoplight gem.}
|
|
9
|
-
spec.description = spec.summary
|
|
10
|
-
spec.homepage = 'https://github.com/orgsync/stoplight-admin'
|
|
11
|
-
spec.license = 'MIT'
|
|
12
|
-
|
|
13
|
-
spec.files = `git ls-files`.split($/)
|
|
14
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
15
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
16
|
-
spec.require_paths = ['lib']
|
|
17
|
-
|
|
18
|
-
spec.add_development_dependency 'bundler', '~> 1.3'
|
|
19
|
-
spec.add_development_dependency 'rake'
|
|
20
|
-
|
|
21
|
-
spec.add_dependency 'haml', '~> 4.0.5'
|
|
22
|
-
spec.add_dependency 'redis', '~> 3.1.0'
|
|
23
|
-
spec.add_dependency 'sinatra', '~> 1.4.5'
|
|
24
|
-
spec.add_dependency 'stoplight', '~> 0.5.0'
|
|
25
|
-
end
|