web-console 3.6.2 → 4.0.3
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/CHANGELOG.markdown +35 -0
- data/README.markdown +32 -25
- data/lib/web_console.rb +3 -1
- data/lib/web_console/evaluator.rb +5 -3
- data/lib/web_console/exception_mapper.rb +23 -2
- data/lib/web_console/extensions.rb +10 -23
- data/lib/web_console/injector.rb +5 -3
- data/lib/web_console/interceptor.rb +18 -0
- data/lib/web_console/middleware.rb +6 -9
- data/lib/web_console/{whitelist.rb → permissions.rb} +5 -9
- data/lib/web_console/railtie.rb +19 -4
- data/lib/web_console/request.rb +4 -20
- data/lib/web_console/session.rb +11 -9
- data/lib/web_console/source_location.rb +15 -0
- data/lib/web_console/template.rb +2 -3
- data/lib/web_console/templates/console.js.erb +116 -28
- data/lib/web_console/templates/error_page.js.erb +7 -8
- data/lib/web_console/templates/index.html.erb +4 -0
- data/lib/web_console/templates/regular_page.js.erb +24 -0
- data/lib/web_console/templates/style.css.erb +182 -33
- data/lib/web_console/testing/fake_middleware.rb +0 -1
- data/lib/web_console/version.rb +1 -1
- data/lib/web_console/view.rb +5 -0
- data/lib/web_console/whiny_request.rb +4 -4
- metadata +14 -12
|
@@ -1,33 +1,182 @@
|
|
|
1
|
-
.console .pos-absolute {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.console .
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.console .
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.console .
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.console .
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.console .console-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.console .
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.console
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
.console .pos-absolute {
|
|
2
|
+
position: absolute;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.console .pos-fixed {
|
|
6
|
+
position: fixed;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.console .pos-right {
|
|
10
|
+
right: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.console .border-box {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.console .layer {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.console .layer.console-outer {
|
|
23
|
+
z-index: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.console .layer.resizer {
|
|
27
|
+
z-index: 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.console {
|
|
31
|
+
position: fixed;
|
|
32
|
+
left: 0;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 148px;
|
|
36
|
+
padding: 0;
|
|
37
|
+
margin: 0;
|
|
38
|
+
background: none repeat scroll 0% 0% #333;
|
|
39
|
+
z-index: 9999;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.console .console-outer {
|
|
43
|
+
overflow: auto;
|
|
44
|
+
padding-top: 4px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.console .console-inner {
|
|
48
|
+
font-family: monospace;
|
|
49
|
+
font-size: 11px;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
overflow: none;
|
|
53
|
+
background: #333;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.console .console-prompt-box {
|
|
57
|
+
color: #fff;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.console .console-message {
|
|
61
|
+
color: #1ad027;
|
|
62
|
+
margin: 0;
|
|
63
|
+
border: 0;
|
|
64
|
+
white-space: pre-wrap;
|
|
65
|
+
background-color: #333;
|
|
66
|
+
padding: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.console .console-message.error-message {
|
|
70
|
+
color: #fc9;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.console .console-message.notification-message {
|
|
74
|
+
color: #99f;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.console .console-message.auto-complete {
|
|
78
|
+
word-break: break-all;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.console .console-message.auto-complete .keyword {
|
|
82
|
+
margin-right: 11px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.console .console-message.auto-complete .keyword.selected {
|
|
86
|
+
background: #fff;
|
|
87
|
+
color: #000;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.console .console-message.auto-complete .hidden {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.console .console-message.auto-complete .trimmed {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.console .console-hint {
|
|
99
|
+
color: #096;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.console .console-focus .console-cursor {
|
|
103
|
+
background: #fefefe;
|
|
104
|
+
color: #333;
|
|
105
|
+
font-weight: bold;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.console .resizer {
|
|
109
|
+
background: #333;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 4px;
|
|
112
|
+
cursor: ns-resize;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.console .console-actions {
|
|
116
|
+
padding-right: 3px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.console .console-actions .button {
|
|
120
|
+
float: left;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.console .button {
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
border-radius: 1px;
|
|
126
|
+
font-family: monospace;
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
width: 14px;
|
|
129
|
+
height: 14px;
|
|
130
|
+
line-height: 14px;
|
|
131
|
+
text-align: center;
|
|
132
|
+
color: #ccc;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.console .button:hover {
|
|
136
|
+
background: #666;
|
|
137
|
+
color: #fff;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.console .button.close-button:hover {
|
|
141
|
+
background: #966;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.console .clipboard {
|
|
145
|
+
height: 0px;
|
|
146
|
+
padding: 0px;
|
|
147
|
+
margin: 0px;
|
|
148
|
+
width: 0px;
|
|
149
|
+
margin-left: -1000px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.console .console-prompt-label {
|
|
153
|
+
display: inline;
|
|
154
|
+
color: #fff;
|
|
155
|
+
background: none repeat scroll 0% 0% #333;
|
|
156
|
+
border: 0;
|
|
157
|
+
padding: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.console .console-prompt-display {
|
|
161
|
+
display: inline;
|
|
162
|
+
color: #fff;
|
|
163
|
+
background: none repeat scroll 0% 0% #333;
|
|
164
|
+
border: 0;
|
|
165
|
+
padding: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.console.full-screen {
|
|
169
|
+
height: 100%;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.console.full-screen .console-outer {
|
|
173
|
+
padding-top: 3px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.console.full-screen .resizer {
|
|
177
|
+
display: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.console.full-screen .close-button {
|
|
181
|
+
display: none;
|
|
182
|
+
}
|
data/lib/web_console/version.rb
CHANGED
data/lib/web_console/view.rb
CHANGED
|
@@ -10,6 +10,11 @@ module WebConsole
|
|
|
10
10
|
yield if Thread.current[:__web_console_exception].present?
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
# Execute a block only on regular, non-error, pages.
|
|
14
|
+
def only_on_regular_page(*args)
|
|
15
|
+
yield if Thread.current[:__web_console_binding].present?
|
|
16
|
+
end
|
|
17
|
+
|
|
13
18
|
# Render JavaScript inside a script tag and a closure.
|
|
14
19
|
#
|
|
15
20
|
# This one lets write JavaScript that will automatically get wrapped in a
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
module WebConsole
|
|
4
4
|
# Noisy wrapper around +Request+.
|
|
5
5
|
#
|
|
6
|
-
# If any calls to +
|
|
6
|
+
# If any calls to +permitted?+ and +acceptable_content_type?+
|
|
7
7
|
# return false, an info log message will be displayed in users' logs.
|
|
8
8
|
class WhinyRequest < SimpleDelegator
|
|
9
|
-
def
|
|
10
|
-
whine_unless request.
|
|
9
|
+
def permitted?
|
|
10
|
+
whine_unless request.permitted? do
|
|
11
11
|
"Cannot render console from #{request.strict_remote_ip}! " \
|
|
12
|
-
"Allowed networks: #{request.
|
|
12
|
+
"Allowed networks: #{request.permissions}"
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: web-console
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Charlie Somerville
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date:
|
|
14
|
+
date: 2020-06-17 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: railties
|
|
@@ -19,42 +19,42 @@ dependencies:
|
|
|
19
19
|
requirements:
|
|
20
20
|
- - ">="
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
22
|
+
version: 6.0.0
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version:
|
|
29
|
+
version: 6.0.0
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: activemodel
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
33
|
requirements:
|
|
34
34
|
- - ">="
|
|
35
35
|
- !ruby/object:Gem::Version
|
|
36
|
-
version:
|
|
36
|
+
version: 6.0.0
|
|
37
37
|
type: :runtime
|
|
38
38
|
prerelease: false
|
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
40
|
requirements:
|
|
41
41
|
- - ">="
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
|
-
version:
|
|
43
|
+
version: 6.0.0
|
|
44
44
|
- !ruby/object:Gem::Dependency
|
|
45
45
|
name: actionview
|
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
|
47
47
|
requirements:
|
|
48
48
|
- - ">="
|
|
49
49
|
- !ruby/object:Gem::Version
|
|
50
|
-
version:
|
|
50
|
+
version: 6.0.0
|
|
51
51
|
type: :runtime
|
|
52
52
|
prerelease: false
|
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements:
|
|
55
55
|
- - ">="
|
|
56
56
|
- !ruby/object:Gem::Version
|
|
57
|
-
version:
|
|
57
|
+
version: 6.0.0
|
|
58
58
|
- !ruby/object:Gem::Dependency
|
|
59
59
|
name: bindex
|
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -91,11 +91,14 @@ files:
|
|
|
91
91
|
- lib/web_console/exception_mapper.rb
|
|
92
92
|
- lib/web_console/extensions.rb
|
|
93
93
|
- lib/web_console/injector.rb
|
|
94
|
+
- lib/web_console/interceptor.rb
|
|
94
95
|
- lib/web_console/locales/en.yml
|
|
95
96
|
- lib/web_console/middleware.rb
|
|
97
|
+
- lib/web_console/permissions.rb
|
|
96
98
|
- lib/web_console/railtie.rb
|
|
97
99
|
- lib/web_console/request.rb
|
|
98
100
|
- lib/web_console/session.rb
|
|
101
|
+
- lib/web_console/source_location.rb
|
|
99
102
|
- lib/web_console/tasks/extensions.rake
|
|
100
103
|
- lib/web_console/tasks/templates.rake
|
|
101
104
|
- lib/web_console/template.rb
|
|
@@ -108,6 +111,7 @@ files:
|
|
|
108
111
|
- lib/web_console/templates/layouts/inlined_string.erb
|
|
109
112
|
- lib/web_console/templates/layouts/javascript.erb
|
|
110
113
|
- lib/web_console/templates/main.js.erb
|
|
114
|
+
- lib/web_console/templates/regular_page.js.erb
|
|
111
115
|
- lib/web_console/templates/style.css.erb
|
|
112
116
|
- lib/web_console/testing/erb_precompiler.rb
|
|
113
117
|
- lib/web_console/testing/fake_middleware.rb
|
|
@@ -115,7 +119,6 @@ files:
|
|
|
115
119
|
- lib/web_console/version.rb
|
|
116
120
|
- lib/web_console/view.rb
|
|
117
121
|
- lib/web_console/whiny_request.rb
|
|
118
|
-
- lib/web_console/whitelist.rb
|
|
119
122
|
homepage: https://github.com/rails/web-console
|
|
120
123
|
licenses:
|
|
121
124
|
- MIT
|
|
@@ -128,15 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
128
131
|
requirements:
|
|
129
132
|
- - ">="
|
|
130
133
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 2.
|
|
134
|
+
version: '2.5'
|
|
132
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
136
|
requirements:
|
|
134
137
|
- - ">="
|
|
135
138
|
- !ruby/object:Gem::Version
|
|
136
139
|
version: '0'
|
|
137
140
|
requirements: []
|
|
138
|
-
|
|
139
|
-
rubygems_version: 2.7.3
|
|
141
|
+
rubygems_version: 3.0.3
|
|
140
142
|
signing_key:
|
|
141
143
|
specification_version: 4
|
|
142
144
|
summary: A debugging tool for your Ruby on Rails applications.
|