You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2019/06/03 14:19:10 UTC
[whimsy] 02/02: Prototype debugging page for testing
This is an automated email from the ASF dual-hosted git repository.
curcuru pushed a commit to branch mail_ldap_notification
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit 62022142d267588392b7358eec56ff047535af45
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Mon Jun 3 10:18:57 2019 -0400
Prototype debugging page for testing
---
www/roster/main.rb | 10 ++++++++++
www/roster/models.rb | 2 ++
www/roster/views/app.js.rb | 2 +-
www/roster/views/debugger.html.rb | 24 ++++++++++++++++++++++++
www/roster/views/debugger.js.rb | 17 +++++++++++++++++
5 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 09ad883..b2f593c 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -330,3 +330,13 @@ end
get '/orgchart.cgi' do
redirect to('/orgchart/')
end
+
+# Debugging tool for testing
+get '/debugger' do
+ @auth = Auth.info(env)
+ @committer = ASF::Person.find(env.user)
+ unless @committer.asf_member?
+ halt 401, "Not authorized\n"
+ end
+ _html :debugger
+end
diff --git a/www/roster/models.rb b/www/roster/models.rb
index 0239483..cfc6e9d 100644
--- a/www/roster/models.rb
+++ b/www/roster/models.rb
@@ -9,3 +9,5 @@ require_relative 'models/ppmc'
require_relative 'models/ldap'
require_relative 'models/svn'
+
+require_relative 'models/mailer'
diff --git a/www/roster/views/app.js.rb b/www/roster/views/app.js.rb
index 796aa9b..850f26b 100644
--- a/www/roster/views/app.js.rb
+++ b/www/roster/views/app.js.rb
@@ -46,4 +46,4 @@ require_relative 'confirm'
require_relative 'group'
require_relative 'utils'
-
+require_relative 'debugger'
diff --git a/www/roster/views/debugger.html.rb b/www/roster/views/debugger.html.rb
new file mode 100644
index 0000000..947263a
--- /dev/null
+++ b/www/roster/views/debugger.html.rb
@@ -0,0 +1,24 @@
+#
+# Debugging tool shell
+#
+_html do
+ _base href: '..'
+ _link rel: 'stylesheet', href: "stylesheets/app.css?#{cssmtime}"
+ _body? do
+ _whimsy_body(
+ title: "Whimsy Roster Debugger",
+ breadcrumbs: {
+ roster: '.',
+ test: '/test.cgi'
+ }
+ ) do
+ _div_.main!
+ end
+
+ _script src: "app.js?#{appmtime}"
+ _.render '#main' do
+ _h3 "Debugger below:"
+ _Debugger committer: @committer, auth: @auth
+ end
+ end
+end
diff --git a/www/roster/views/debugger.js.rb b/www/roster/views/debugger.js.rb
new file mode 100644
index 0000000..f100fea
--- /dev/null
+++ b/www/roster/views/debugger.js.rb
@@ -0,0 +1,17 @@
+#
+# Debugging tool shell
+#
+class Debugger < Vue
+ def render
+ # Display auth status
+ if @auth
+ _div.alert.alert_success do
+ _ 'Whimsy Debugging: you are authd'
+ _ "#{@auth}"
+ end
+ end
+
+ _h2 "Welcome #{@committer.id}@apache.org"
+ _p 'TODO: add actions to allow debugging utility methods'
+ end
+end