fuik 0.8.0 → 0.9.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/README.md +9 -4
- data/app/assets/images/fuik/icons/adyen.jpg +0 -0
- data/app/assets/images/fuik/icons/anthropic.jpg +0 -0
- data/app/assets/images/fuik/icons/apple.jpg +0 -0
- data/app/assets/images/fuik/icons/basecamp.jpg +0 -0
- data/app/assets/images/fuik/icons/chirpform.jpg +0 -0
- data/app/assets/images/fuik/icons/dropbox.jpg +0 -0
- data/app/assets/images/fuik/icons/facebook.jpg +0 -0
- data/app/assets/images/fuik/icons/fizzy.jpg +0 -0
- data/app/assets/images/fuik/icons/github.jpg +0 -0
- data/app/assets/images/fuik/icons/gitlab.jpg +0 -0
- data/app/assets/images/fuik/icons/google.jpg +0 -0
- data/app/assets/images/fuik/icons/gumroad.jpg +0 -0
- data/app/assets/images/fuik/icons/linkedin.jpg +0 -0
- data/app/assets/images/fuik/icons/loops.jpg +0 -0
- data/app/assets/images/fuik/icons/mailgun.jpg +0 -0
- data/app/assets/images/fuik/icons/mailpace.jpg +0 -0
- data/app/assets/images/fuik/icons/mollie.jpg +0 -0
- data/app/assets/images/fuik/icons/moneybird.jpg +0 -0
- data/app/assets/images/fuik/icons/openai.jpg +0 -0
- data/app/assets/images/fuik/icons/postmark.jpg +0 -0
- data/app/assets/images/fuik/icons/resend.jpg +0 -0
- data/app/assets/images/fuik/icons/shopify.jpg +0 -0
- data/app/assets/images/fuik/icons/slack.jpg +0 -0
- data/app/assets/images/fuik/icons/stripe.jpg +0 -0
- data/app/assets/images/fuik/icons/telegram.jpg +0 -0
- data/app/assets/images/fuik/icons/twitter.jpg +0 -0
- data/app/assets/images/fuik/icons/userlist.jpg +0 -0
- data/app/assets/images/fuik/icons/webhook.svg +1 -0
- data/app/assets/images/fuik/icons/zoom.jpg +0 -0
- data/app/assets/stylesheets/fuik/application.css +95 -25
- data/app/controllers/concerns/fuik/event_type.rb +2 -0
- data/app/controllers/fuik/downloads_controller.rb +9 -0
- data/app/controllers/fuik/events_controller.rb +5 -0
- data/app/helpers/fuik/highlight_helper.rb +61 -0
- data/app/helpers/fuik/icon_helper.rb +28 -0
- data/app/views/fuik/events/_copy_button.html.erb +7 -3
- data/app/views/fuik/events/index.html.erb +16 -10
- data/app/views/fuik/events/show.html.erb +18 -3
- data/app/views/layouts/fuik/application.html.erb +2 -2
- data/config/routes.rb +1 -0
- data/lib/fuik/engine.rb +7 -0
- data/lib/fuik/version.rb +1 -1
- metadata +34 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88d837d843a47b5e38b77f2ee01839045c2cce4920fcf83c8be7739273132c0d
|
|
4
|
+
data.tar.gz: feb08cf1fa6f8a3328be3fed97af86997e1fac81ec79b78f71435e948289673a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d64260c13efb33cdb8e10ebd8b6e862e067bcf4421f63ce8b228f91d345ea271602db298162f6898660f16e925635aeba429ced6462d08ec1b18e62a21eecc66
|
|
7
|
+
data.tar.gz: c89181684f34de8dab62991240d15021901dd56c1686811ea1c89dafc49122d819cb1c47e7a366227622931a3d280d61f72b34f1e9e5f279ca82ae4e104440d1
|
data/README.md
CHANGED
|
@@ -54,7 +54,7 @@ The engine mounts at `/webhooks` automatically.
|
|
|
54
54
|
|
|
55
55
|
### View events
|
|
56
56
|
|
|
57
|
-
Visit `/webhooks` to see all received webhooks. Click any event to
|
|
57
|
+
Visit `/webhooks` to see all received webhooks. Click any event to view all the payload details and copy the payload or download as JSON.
|
|
58
58
|
|
|
59
59
|
<img alt="Fuik event detail interface" src="https://raw.githubusercontent.com/Rails-Designer/fuik/HEAD/.github/docs/event-detail.jpg" style="max-width: 100%;">
|
|
60
60
|
|
|
@@ -63,15 +63,14 @@ Visit `/webhooks` to see all received webhooks. Click any event to see the full
|
|
|
63
63
|
|
|
64
64
|
### Add business logic
|
|
65
65
|
|
|
66
|
-
Generate
|
|
66
|
+
Generate classes for events you want to process:
|
|
67
67
|
```bash
|
|
68
|
-
bin/rails generate fuik:provider stripe checkout_session_completed
|
|
68
|
+
bin/rails generate fuik:provider stripe checkout_session_completed
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
This creates:
|
|
72
72
|
- `app/webhooks/stripe/base.rb`
|
|
73
73
|
- `app/webhooks/stripe/checkout_session_completed.rb`
|
|
74
|
-
- `app/webhooks/stripe/customer_subscription_updated.rb`
|
|
75
74
|
|
|
76
75
|
Each class is a thin wrapper around your business logic:
|
|
77
76
|
```ruby
|
|
@@ -149,6 +148,12 @@ event_id:
|
|
|
149
148
|
key: custom_id
|
|
150
149
|
```
|
|
151
150
|
|
|
151
|
+
The options for `event_type`'s source are:
|
|
152
|
+
|
|
153
|
+
- header
|
|
154
|
+
- payload
|
|
155
|
+
- static; for cases when no event type is present in header or payload
|
|
156
|
+
|
|
152
157
|
|
|
153
158
|
## Add your custom provider
|
|
154
159
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="#64748b" viewBox="0 0 256 256"><path d="M178.16 176h-66.84a48 48 0 1 1-85.72-36.81 8 8 0 0 1 12.8 9.61A31.69 31.69 0 0 0 32 168a32 32 0 0 0 64 0 8 8 0 0 1 8-8h74.16a16 16 0 1 1 0 16ZM64 184a16 16 0 0 0 14.08-23.61l35.77-58.14a8 8 0 0 0-2.62-11 32 32 0 1 1 46.1-40.06 8 8 0 1 0 14.67-6.4 48 48 0 1 0-75.62 55.33L64.44 152H64a16 16 0 0 0 0 32Zm128-64a48.18 48.18 0 0 0-18 3.49L142.08 71.6A16 16 0 1 0 128 80h.44l35.78 58.15a8 8 0 0 0 11 2.61A32 32 0 1 1 192 200a8 8 0 0 0 0 16 48 48 0 0 0 0-96Z"/></svg>
|
|
Binary file
|
|
@@ -68,25 +68,77 @@
|
|
|
68
68
|
position: relative;
|
|
69
69
|
overflow-x: auto;
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
.actions {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: .5rem;
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: .5rem; right: .5rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
svg {
|
|
81
|
+
width: 1rem;
|
|
82
|
+
aspect-ratio: 1 / 1;
|
|
83
|
+
color: oklch(from var(--color-text) l c h / 80%);
|
|
84
|
+
background: var(--color-bg);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
dd .copy-button .success-icon {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
dd:has([data-copy-success="true"]) .copy-button .copy-icon {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
dd:has([data-copy-success="true"]) .copy-button .success-icon {
|
|
96
|
+
display: block;
|
|
97
|
+
}
|
|
71
98
|
}
|
|
72
99
|
}
|
|
73
100
|
|
|
74
101
|
@layer components {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
102
|
+
.events {
|
|
103
|
+
list-style: none;
|
|
104
|
+
|
|
105
|
+
li {
|
|
106
|
+
--icon-width: 1.125rem;
|
|
107
|
+
|
|
108
|
+
padding-block: .5rem;
|
|
109
|
+
padding-inline: .75rem;
|
|
110
|
+
|
|
111
|
+
&:hover { background: var(--color-bg-hover); }
|
|
112
|
+
|
|
113
|
+
a {
|
|
114
|
+
display: grid;
|
|
115
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
116
|
+
gap: 1rem;
|
|
117
|
+
|
|
118
|
+
&:hover { text-decoration: none; }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.name {
|
|
122
|
+
display: grid;
|
|
123
|
+
grid-template-columns: var(--icon-width) 1fr;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: .5rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.icon {
|
|
129
|
+
width: var(--icon-width);
|
|
130
|
+
aspect-ratio: 1/1;
|
|
131
|
+
border-radius: .125rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
code {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
88
139
|
|
|
89
|
-
|
|
140
|
+
li:not(:first-child) {
|
|
141
|
+
border-top: 1px solid var(--color-border);
|
|
90
142
|
}
|
|
91
143
|
}
|
|
92
144
|
|
|
@@ -95,18 +147,25 @@
|
|
|
95
147
|
align-items: center;
|
|
96
148
|
column-gap: .375rem;
|
|
97
149
|
|
|
98
|
-
&::before {
|
|
150
|
+
&::before {
|
|
151
|
+
content: "";
|
|
152
|
+
width: .5rem;
|
|
153
|
+
aspect-ratio: 1/1;
|
|
154
|
+
background-color: currentColor;
|
|
155
|
+
border: 2px solid oklch(from currentColor 1 c h / 85%);
|
|
156
|
+
border-radius: .5rem;
|
|
157
|
+
}
|
|
99
158
|
|
|
100
|
-
&[data-status="pending"]::before { color: oklch(65%
|
|
159
|
+
&[data-status="pending"]::before { color: oklch(65% .15 80); }
|
|
101
160
|
|
|
102
|
-
&[data-status="processed"]::before { color: oklch(65%
|
|
161
|
+
&[data-status="processed"]::before { color: oklch(65% .15 150); }
|
|
103
162
|
|
|
104
|
-
&[data-status="failed"]::before { color: oklch(60%
|
|
163
|
+
&[data-status="failed"]::before { color: oklch(60% .2 25); }
|
|
105
164
|
}
|
|
106
165
|
|
|
166
|
+
button,
|
|
107
167
|
.copy-button {
|
|
108
168
|
padding: .125rem;
|
|
109
|
-
color: oklch(from var(--color-text) l c h / 80%);
|
|
110
169
|
background: var(--color-bg);
|
|
111
170
|
border: 0;
|
|
112
171
|
border-radius: .25rem;
|
|
@@ -117,15 +176,26 @@
|
|
|
117
176
|
transition: transform ease-in-out 300ms;
|
|
118
177
|
transform: scale(1.10);
|
|
119
178
|
}
|
|
179
|
+
}
|
|
120
180
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
181
|
+
.json-highlight {
|
|
182
|
+
.json-key {
|
|
183
|
+
color: oklch(35% .15 250);
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
|
|
186
|
+
&:hover {
|
|
187
|
+
background: oklch(90% 0.02 250);
|
|
188
|
+
}
|
|
124
189
|
}
|
|
125
190
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
aspect-ratio: 1 / 1;
|
|
191
|
+
.json-key-selected {
|
|
192
|
+
background: oklch(85% 0.05 250);
|
|
129
193
|
}
|
|
194
|
+
|
|
195
|
+
.json-string { color: oklch(30% .18 160); }
|
|
196
|
+
.json-number { color: oklch(40% .15 130); }
|
|
197
|
+
.json-boolean { color: oklch(45% .18 260); }
|
|
198
|
+
.json-null { color: oklch(50% .05 250); }
|
|
199
|
+
.json-punctuation { color: oklch(20% .03 250); }
|
|
130
200
|
}
|
|
131
201
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Fuik::DownloadsController < ApplicationController
|
|
4
|
+
def create
|
|
5
|
+
webhook_event = Fuik::WebhookEvent.find(params[:event_id])
|
|
6
|
+
|
|
7
|
+
send_data webhook_event.body, filename: "webhook_#{webhook_event.provider}_#{webhook_event.event_id}.json", type: "application/json", disposition: "attachment"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Fuik
|
|
4
|
+
module HighlightHelper
|
|
5
|
+
def highlighted(json)
|
|
6
|
+
annotate(JSON.parse(json), [], 0).html_safe
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
def annotate(object, current_path, depth)
|
|
12
|
+
case object
|
|
13
|
+
when Hash
|
|
14
|
+
hashed(object, current_path:, depth:)
|
|
15
|
+
when Array
|
|
16
|
+
arrayed(object, current_path:, depth:)
|
|
17
|
+
when String
|
|
18
|
+
%(<span class="json-string">"#{object}"</span>)
|
|
19
|
+
when Numeric
|
|
20
|
+
%(<span class="json-number">#{object}</span>)
|
|
21
|
+
when TrueClass, FalseClass
|
|
22
|
+
%(<span class="json-boolean">#{object}</span>)
|
|
23
|
+
when NilClass
|
|
24
|
+
'<span class="json-null">null</span>'
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def hashed(object, current_path:, depth:)
|
|
29
|
+
indent = " " * depth
|
|
30
|
+
next_indent = " " * (depth + 1)
|
|
31
|
+
|
|
32
|
+
object.each_with_index.map do |(key, value), index|
|
|
33
|
+
key_path = current_path + [key]
|
|
34
|
+
path_string = key_path.map { "[\"#{it}\"]" }.join
|
|
35
|
+
|
|
36
|
+
comma = (index == object.size - 1) ? "" : '<span class="json-punctuation">,</span>'
|
|
37
|
+
|
|
38
|
+
"#{next_indent}#{%(<span class="json-key" data-path='#{path_string}'>"#{key}"</span>)}<span class=\"json-punctuation\">:</span> #{annotate(value, key_path, depth + 1)}#{comma}"
|
|
39
|
+
end.tap do |lines|
|
|
40
|
+
lines.unshift('<span class="json-punctuation">{</span>')
|
|
41
|
+
|
|
42
|
+
lines.push("#{indent}<span class=\"json-punctuation\">}</span>")
|
|
43
|
+
end.join("\n")
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def arrayed(object, current_path:, depth:)
|
|
47
|
+
indent = " " * depth
|
|
48
|
+
next_indent = " " * (depth + 1)
|
|
49
|
+
|
|
50
|
+
object.each_with_index.map do |value, index|
|
|
51
|
+
comma = (index == object.size - 1) ? "" : '<span class="json-punctuation">,</span>'
|
|
52
|
+
|
|
53
|
+
"#{next_indent}#{annotate(value, current_path + [index], depth + 1)}#{comma}"
|
|
54
|
+
end.tap do |lines|
|
|
55
|
+
lines.unshift('<span class="json-punctuation">[</span>')
|
|
56
|
+
|
|
57
|
+
lines.push("#{indent}<span class=\"json-punctuation\">]</span>")
|
|
58
|
+
end.join("\n")
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Fuik
|
|
4
|
+
module IconHelper
|
|
5
|
+
def icon(provider)
|
|
6
|
+
provider = provider.to_s.downcase
|
|
7
|
+
path = "fuik/icons/#{provider}.jpg"
|
|
8
|
+
|
|
9
|
+
if asset_exists?(path)
|
|
10
|
+
image_tag path, alt: provider.capitalize, class: "icon"
|
|
11
|
+
else
|
|
12
|
+
image_tag "fuik/icons/webhook.svg", alt: "Webhook", class: "icon"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def asset_exists?(path)
|
|
19
|
+
if defined?(Propshaft)
|
|
20
|
+
Rails.application.assets.load_path.find(path).present?
|
|
21
|
+
else
|
|
22
|
+
Rails.application.assets&.find_asset(path).present?
|
|
23
|
+
end
|
|
24
|
+
rescue
|
|
25
|
+
false
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
<%# locals: (target:, delay: 5000
|
|
2
|
-
<button data-action="copy" data-target="<%= target %>" data-copy-delay="<%= delay %>"
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"
|
|
1
|
+
<%# locals: (target:, delay: 5000) %>
|
|
2
|
+
<button data-action="copy" data-target="<%= target %>" data-copy-delay="<%= delay %>" class="copy-button">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon" class="copy-icon">
|
|
4
4
|
<path fill-rule="evenodd" d="M13.887 3.182c.396.037.79.08 1.183.128C16.194 3.45 17 4.414 17 5.517V16.75A2.25 2.25 0 0 1 14.75 19h-9.5A2.25 2.25 0 0 1 3 16.75V5.517c0-1.103.806-2.068 1.93-2.207.393-.048.787-.09 1.183-.128A3.001 3.001 0 0 1 9 1h2c1.373 0 2.531.923 2.887 2.182ZM7.5 4A1.5 1.5 0 0 1 9 2.5h2A1.5 1.5 0 0 1 12.5 4v.5h-5V4Z" clip-rule="evenodd" ></path>
|
|
5
5
|
</svg>
|
|
6
|
+
|
|
7
|
+
<svg class="success-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true" data-slot="icon" stroke-width="">
|
|
8
|
+
<path d="M200,32H163.74a47.92,47.92,0,0,0-71.48,0H56A16,16,0,0,0,40,48V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm-72,0a32,32,0,0,1,32,32H96A32,32,0,0,1,128,32Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"></path>
|
|
9
|
+
</svg>
|
|
6
10
|
</button>
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
<h1>Webhooks</h1>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
<ul class="events">
|
|
4
|
+
<% @webhook_events.each do |event| %>
|
|
5
|
+
<li>
|
|
6
|
+
<%= link_to event_path(event) do %>
|
|
7
|
+
<div class="name">
|
|
8
|
+
<%= icon event.provider %>
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
<span><%= event.provider %></span>
|
|
11
|
+
</div>
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
<code><%= event.event_type %></code>
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<% end %>
|
|
15
|
+
<span class="status" data-status="<%= event.status %>"><%= event.status %></span>
|
|
16
|
+
|
|
17
|
+
<time><%= event.created_at.strftime("%Y-%m-%d %H:%M:%S") %></time>
|
|
18
|
+
<% end %>
|
|
19
|
+
</li>
|
|
20
|
+
<% end %>
|
|
21
|
+
</ul>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<% content_for :title, "#{@webhook_event.provider} / #{@webhook_event.event_type} | Fuik Admin" %>
|
|
2
|
+
|
|
1
3
|
<h1>
|
|
2
4
|
<%= link_to "Webhooks", root_path %> / <%= @webhook_event.event_id %>
|
|
3
5
|
</h1>
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
<dd><%= @webhook_event.provider %></dd>
|
|
8
10
|
|
|
9
11
|
<dt>Event ID</dt>
|
|
10
|
-
<dd><%= tag.code @webhook_event.event_id, id: "event_id" %> <%= render "copy_button", target: "
|
|
12
|
+
<dd><%= tag.code @webhook_event.event_id, id: "event_id" %> <%= render "copy_button", target: "event_id" %></dd>
|
|
11
13
|
|
|
12
14
|
<dt>Type</dt>
|
|
13
15
|
<dd><%= @webhook_event.event_type %></dd>
|
|
@@ -19,13 +21,26 @@
|
|
|
19
21
|
<dd><%= @webhook_event.created_at.strftime("%Y-%m-%d %H:%M:%S") %></dd>
|
|
20
22
|
|
|
21
23
|
<dt>Payload</dt>
|
|
22
|
-
<dd><pre id="payload"><%= JSON.pretty_generate(@webhook_event.payload) %></pre> <%= render "copy_button", target: "
|
|
24
|
+
<dd><pre id="payload" data-root="payload" class="json-highlight"><%= highlighted(JSON.pretty_generate(@webhook_event.payload)) %></pre> <div class="actions"><%= button_to downloads_path, params: { event_id: @webhook_event.id }, method: :post, class: "" do %><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34Zm-56,83.32-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L120,164.69V120a8,8,0,0,1,16,0v44.69l10.34-10.35a8,8,0,0,1,11.32,11.32ZM152,88V44l44,44Z"/></svg><% end %> <%= render "copy_button", target: "payload" %></div></dd>
|
|
23
25
|
|
|
24
26
|
<dt>Headers</dt>
|
|
25
|
-
<dd><pre id="headers"><%= JSON.pretty_generate(@webhook_event.headers) %></pre>
|
|
27
|
+
<dd><pre id="headers" class="json-highlight"><%= highlighted JSON.pretty_generate(@webhook_event.headers) %></pre> <div class="actions"><%= render "copy_button", target: "headers" %></div></dd>
|
|
26
28
|
|
|
27
29
|
<% if @webhook_event.error.present? %>
|
|
28
30
|
<dt>Error</dt>
|
|
29
31
|
<dd><%= @webhook_event.error %></dd>
|
|
30
32
|
<% end %>
|
|
31
33
|
</dl>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
document.addEventListener("click", (event) => {
|
|
37
|
+
if (event.target.classList.contains("json-key")) {
|
|
38
|
+
const path = event.target.dataset.path;
|
|
39
|
+
const root = event.target.closest("[data-root]").dataset.root;
|
|
40
|
+
navigator.clipboard.writeText(root + path);
|
|
41
|
+
|
|
42
|
+
event.target.classList.add("json-key-selected");
|
|
43
|
+
setTimeout(() => event.target.classList.remove("json-key-selected"), 200);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
|
-
<title
|
|
4
|
+
<title><%= content_for?(:title) ? yield(:title) : "Fuik Admin" %></title>
|
|
5
5
|
<%= csrf_meta_tags %>
|
|
6
6
|
<%= csp_meta_tag %>
|
|
7
7
|
|
|
8
8
|
<%= yield :head %>
|
|
9
9
|
|
|
10
10
|
<%= stylesheet_link_tag "fuik/application", media: "all" %>
|
|
11
|
-
<script defer src="https://cdn.jsdelivr.net/npm/attractivejs@0.
|
|
11
|
+
<script defer src="https://cdn.jsdelivr.net/npm/attractivejs@0.12.0"></script>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<main>
|
data/config/routes.rb
CHANGED
data/lib/fuik/engine.rb
CHANGED
|
@@ -6,5 +6,12 @@ module Fuik
|
|
|
6
6
|
|
|
7
7
|
config.webhooks_controller_parent = "ActionController::Base"
|
|
8
8
|
config.events_controller_parent = "ActionController::Base"
|
|
9
|
+
|
|
10
|
+
config.to_prepare do
|
|
11
|
+
ActiveSupport.on_load(:action_view) do
|
|
12
|
+
include Fuik::IconHelper
|
|
13
|
+
include Fuik::HighlightHelper
|
|
14
|
+
end
|
|
15
|
+
end
|
|
9
16
|
end
|
|
10
17
|
end
|
data/lib/fuik/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fuik
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rails Designer
|
|
@@ -35,11 +35,43 @@ files:
|
|
|
35
35
|
- MIT-LICENSE
|
|
36
36
|
- README.md
|
|
37
37
|
- Rakefile
|
|
38
|
+
- app/assets/images/fuik/icons/adyen.jpg
|
|
39
|
+
- app/assets/images/fuik/icons/anthropic.jpg
|
|
40
|
+
- app/assets/images/fuik/icons/apple.jpg
|
|
41
|
+
- app/assets/images/fuik/icons/basecamp.jpg
|
|
42
|
+
- app/assets/images/fuik/icons/chirpform.jpg
|
|
43
|
+
- app/assets/images/fuik/icons/dropbox.jpg
|
|
44
|
+
- app/assets/images/fuik/icons/facebook.jpg
|
|
45
|
+
- app/assets/images/fuik/icons/fizzy.jpg
|
|
46
|
+
- app/assets/images/fuik/icons/github.jpg
|
|
47
|
+
- app/assets/images/fuik/icons/gitlab.jpg
|
|
48
|
+
- app/assets/images/fuik/icons/google.jpg
|
|
49
|
+
- app/assets/images/fuik/icons/gumroad.jpg
|
|
50
|
+
- app/assets/images/fuik/icons/linkedin.jpg
|
|
51
|
+
- app/assets/images/fuik/icons/loops.jpg
|
|
52
|
+
- app/assets/images/fuik/icons/mailgun.jpg
|
|
53
|
+
- app/assets/images/fuik/icons/mailpace.jpg
|
|
54
|
+
- app/assets/images/fuik/icons/mollie.jpg
|
|
55
|
+
- app/assets/images/fuik/icons/moneybird.jpg
|
|
56
|
+
- app/assets/images/fuik/icons/openai.jpg
|
|
57
|
+
- app/assets/images/fuik/icons/postmark.jpg
|
|
58
|
+
- app/assets/images/fuik/icons/resend.jpg
|
|
59
|
+
- app/assets/images/fuik/icons/shopify.jpg
|
|
60
|
+
- app/assets/images/fuik/icons/slack.jpg
|
|
61
|
+
- app/assets/images/fuik/icons/stripe.jpg
|
|
62
|
+
- app/assets/images/fuik/icons/telegram.jpg
|
|
63
|
+
- app/assets/images/fuik/icons/twitter.jpg
|
|
64
|
+
- app/assets/images/fuik/icons/userlist.jpg
|
|
65
|
+
- app/assets/images/fuik/icons/webhook.svg
|
|
66
|
+
- app/assets/images/fuik/icons/zoom.jpg
|
|
38
67
|
- app/assets/stylesheets/fuik/application.css
|
|
39
68
|
- app/controllers/concerns/fuik/event_type.rb
|
|
40
69
|
- app/controllers/fuik/application_controller.rb
|
|
70
|
+
- app/controllers/fuik/downloads_controller.rb
|
|
41
71
|
- app/controllers/fuik/events_controller.rb
|
|
42
72
|
- app/controllers/fuik/webhooks_controller.rb
|
|
73
|
+
- app/helpers/fuik/highlight_helper.rb
|
|
74
|
+
- app/helpers/fuik/icon_helper.rb
|
|
43
75
|
- app/jobs/fuik/application_job.rb
|
|
44
76
|
- app/models/fuik/application_record.rb
|
|
45
77
|
- app/models/fuik/event.rb
|
|
@@ -90,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
90
122
|
- !ruby/object:Gem::Version
|
|
91
123
|
version: '0'
|
|
92
124
|
requirements: []
|
|
93
|
-
rubygems_version: 4.0.
|
|
125
|
+
rubygems_version: 4.0.8
|
|
94
126
|
specification_version: 4
|
|
95
127
|
summary: A fish trap for webhooks
|
|
96
128
|
test_files: []
|