debugbar 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.prettierrc +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +5 -0
- data/Rakefile +4 -0
- data/app/channels/debugbar/debugbar_channel.rb +26 -0
- data/app/controllers/debugbar/application_controller.rb +4 -0
- data/app/controllers/debugbar/assets_controller.rb +15 -0
- data/app/helpers/debugbar/tag_helpers.rb +19 -0
- data/app/models/debugbar/application_record.rb +5 -0
- data/client/.gitignore +25 -0
- data/client/README.md +0 -0
- data/client/dist/.vite/manifest.json +14 -0
- data/client/dist/assets/debugbar-u5mP-5-z.js +34 -0
- data/client/dist/assets/ruby-logo-kn_8RniZ.svg +946 -0
- data/client/index.html +78 -0
- data/client/package-lock.json +2393 -0
- data/client/package.json +32 -0
- data/client/postcss.config.js +6 -0
- data/client/src/App.vue +17 -0
- data/client/src/AppDemo.vue +29 -0
- data/client/src/AppDev.vue +20 -0
- data/client/src/Debugbar.vue +276 -0
- data/client/src/assets/rails-logo.svg +1 -0
- data/client/src/assets/ruby-logo.svg +946 -0
- data/client/src/components/TabButton.vue +32 -0
- data/client/src/components/panels/CachePanel.vue +41 -0
- data/client/src/components/panels/JobsPanel.vue +52 -0
- data/client/src/components/panels/JsonPanel.vue +15 -0
- data/client/src/components/panels/LogsPanel.vue +43 -0
- data/client/src/components/panels/MessagesPanel.vue +25 -0
- data/client/src/components/panels/ModelsPanel.vue +37 -0
- data/client/src/components/panels/Panel.vue +7 -0
- data/client/src/components/panels/RequestPanel.vue +98 -0
- data/client/src/components/queries/QueriesPanel.vue +17 -0
- data/client/src/components/queries/QueryItem.vue +65 -0
- data/client/src/components/ui/Foldable.vue +39 -0
- data/client/src/components/ui/KeyValueTable.vue +16 -0
- data/client/src/components/ui/Row.vue +14 -0
- data/client/src/components/ui/logo-ruby.vue +547 -0
- data/client/src/demo.ts +17 -0
- data/client/src/dev.ts +20 -0
- data/client/src/main.ts +17 -0
- data/client/src/models/Config.ts +27 -0
- data/client/src/models/Request.ts +183 -0
- data/client/src/stores/RequestsStore.ts +36 -0
- data/client/src/stores/configStore.ts +8 -0
- data/client/src/style.css +23 -0
- data/client/src/types.d.ts +9 -0
- data/client/src/vite-env.d.ts +1 -0
- data/client/tailwind.config.js +16 -0
- data/client/tsconfig.json +29 -0
- data/client/tsconfig.node.json +10 -0
- data/client/vite.config.ts +44 -0
- data/config/routes.rb +7 -0
- data/debugbar.gemspec +38 -0
- data/fixtures/requests/1706607114--demo_post_list.json +499 -0
- data/fixtures/requests/1706607120--api_jobs.json +176 -0
- data/fixtures/requests/1706607123--api_jobs.json +119 -0
- data/fixtures/requests/1706607133--demo_slow_page.json +130 -0
- data/fixtures/requests/1706607136--demo_post.json +164 -0
- data/fixtures/requests/1706607136--demo_random_post.json +106 -0
- data/fixtures/requests/1706607141--api_errors.json +73 -0
- data/lib/debugbar/buffers/memory_buffer.rb +34 -0
- data/lib/debugbar/buffers/null_buffer.rb +18 -0
- data/lib/debugbar/buffers/request_buffer.rb +31 -0
- data/lib/debugbar/config.rb +50 -0
- data/lib/debugbar/current.rb +18 -0
- data/lib/debugbar/engine.rb +96 -5
- data/lib/debugbar/loggers/simple_logger.rb +34 -0
- data/lib/debugbar/middlewares/track_current_request.rb +35 -0
- data/lib/debugbar/request.rb +98 -0
- data/lib/debugbar/subscribers/action_controller.rb +33 -0
- data/lib/debugbar/subscribers/active_job.rb +158 -0
- data/lib/debugbar/subscribers/active_record.rb +65 -0
- data/lib/debugbar/subscribers/active_support.rb +30 -0
- data/lib/debugbar/version.rb +5 -0
- data/lib/debugbar.rb +86 -5
- data/package-lock.json +50 -0
- data/package.json +5 -0
- data/sig/debugbar.rbs +4 -0
- metadata +143 -47
- data/README.textile +0 -18
- data/lib/debugbar/railties/tasks.rake +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ce9e037dfdc60939b85dc13fa9f4361cbbb8de8c7269461fecc722eb9e84ac12
|
4
|
+
data.tar.gz: e7c609a43130829a4cbdc35b9b2735c3ed4da5430085036b96892860a7647641
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7c523067bb97bef7778d79b1f2aa31fc5ef3cbed4f632f21113fdb18edfe27b156633d9ca25943d5d387814c442e7c1c38b963fb85428fd852b57bb6f5a139e3
|
7
|
+
data.tar.gz: ffed0ea44e41025455732edde026d1319fe30b0c4b5603dc4c019171105f53419ca623f0629d0f08ee3125cf14256ef7a9ff77147b35dff00dc51bba3a4f4819
|
data/.prettierrc
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 Julien Bourdeau
|
4
|
+
|
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.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
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
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Debugbar
|
2
|
+
class DebugbarChannel < ActionCable::Channel::Base
|
3
|
+
def subscribed
|
4
|
+
stream_from "debugbar_channel"
|
5
|
+
end
|
6
|
+
|
7
|
+
def receive(data)
|
8
|
+
if data["clear"]
|
9
|
+
RequestBuffer.clear!
|
10
|
+
end
|
11
|
+
|
12
|
+
if data["ids"].present?
|
13
|
+
RequestBuffer.remove(data["ids"])
|
14
|
+
end
|
15
|
+
|
16
|
+
Debugbar.connect!
|
17
|
+
|
18
|
+
data = RequestBuffer.all.map(&:to_h)
|
19
|
+
ActionCable.server.broadcast("debugbar_channel", data)
|
20
|
+
end
|
21
|
+
|
22
|
+
def unsubscribed
|
23
|
+
Debugbar.disconnect!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Debugbar::TagHelpers
|
2
|
+
def debugbar_javascript(opt = {})
|
3
|
+
html = <<-HTML
|
4
|
+
<div id="__debugbar"></div>
|
5
|
+
HTML
|
6
|
+
|
7
|
+
html += <<-HTML
|
8
|
+
<script type="text/javascript">
|
9
|
+
window._debugbarConfigOptions = #{opt.to_json}
|
10
|
+
</script>
|
11
|
+
HTML
|
12
|
+
|
13
|
+
html += <<-HTML
|
14
|
+
<script defer src="#{Debugbar.config.prefix}/assets/script"></script>
|
15
|
+
HTML
|
16
|
+
|
17
|
+
raw html
|
18
|
+
end
|
19
|
+
end
|
data/client/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Logs
|
2
|
+
logs
|
3
|
+
*.log
|
4
|
+
npm-debug.log*
|
5
|
+
yarn-debug.log*
|
6
|
+
yarn-error.log*
|
7
|
+
pnpm-debug.log*
|
8
|
+
lerna-debug.log*
|
9
|
+
|
10
|
+
node_modules
|
11
|
+
#dist
|
12
|
+
dist-demo
|
13
|
+
dist-ssr
|
14
|
+
*.local
|
15
|
+
|
16
|
+
# Editor directories and files
|
17
|
+
.vscode/*
|
18
|
+
!.vscode/extensions.json
|
19
|
+
.idea
|
20
|
+
.DS_Store
|
21
|
+
*.suo
|
22
|
+
*.ntvs*
|
23
|
+
*.njsproj
|
24
|
+
*.sln
|
25
|
+
*.sw?
|
data/client/README.md
ADDED
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"src/assets/ruby-logo.svg": {
|
3
|
+
"file": "assets/ruby-logo-kn_8RniZ.svg",
|
4
|
+
"src": "src/assets/ruby-logo.svg"
|
5
|
+
},
|
6
|
+
"src/main.ts": {
|
7
|
+
"assets": [
|
8
|
+
"assets/ruby-logo-kn_8RniZ.svg"
|
9
|
+
],
|
10
|
+
"file": "assets/debugbar-u5mP-5-z.js",
|
11
|
+
"isEntry": true,
|
12
|
+
"src": "src/main.ts"
|
13
|
+
}
|
14
|
+
}
|