couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [5/19] git commit: A debugging page
Date Mon, 11 Feb 2013 13:51:16 GMT
A debugging page


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/374e536f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/374e536f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/374e536f

Branch: refs/heads/nodejs_couchdb
Commit: 374e536f1952f6a539133964a6e44582c39db540
Parents: 5ad2487
Author: Jason Smith (work) <jhs@iriscouch.com>
Authored: Thu Feb 7 07:34:39 2013 +0000
Committer: Jason Smith (work) <jhs@iriscouch.com>
Committed: Thu Feb 7 07:34:39 2013 +0000

----------------------------------------------------------------------
 share/www/_sidebar.html |    1 +
 share/www/debug.html    |   71 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/374e536f/share/www/_sidebar.html
----------------------------------------------------------------------
diff --git a/share/www/_sidebar.html b/share/www/_sidebar.html
index 271e906..52d34f6 100644
--- a/share/www/_sidebar.html
+++ b/share/www/_sidebar.html
@@ -30,6 +30,7 @@ specific language governing permissions and limitations under the License.
     <li><span>Diagnostics</span><ul>
       <li><a href="verify_install.html">Verify Installation</a></li>
       <li><a href="couch_tests.html?script/couch_tests.js">Test Suite</a></li>
+      <li><a href="debug.html">Debugger</a></li>
     </ul></li>
     <li><span>Recent Databases</span>
       <ul id="dbs"></ul>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/374e536f/share/www/debug.html
----------------------------------------------------------------------
diff --git a/share/www/debug.html b/share/www/debug.html
new file mode 100644
index 0000000..6c90417
--- /dev/null
+++ b/share/www/debug.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<html lang="en">
+  <head>
+    <title>Test Suite</title>
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
+    <script src="script/json2.js"></script>
+    <script src="script/sha1.js"></script>
+    <script src="script/jquery.js"></script>
+    <script src="script/jquery.couch.js"></script>
+    <script src="script/futon.js"></script>
+    <script src="script/request-min.js"></script>
+    <style>
+      .is_not_admin, .is_admin {
+        display: none;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="wrap">
+      <h1>
+        <a href="index.html">Overview</a>
+        <strong>Verify Install</strong>
+      </h1>
+      <div id="content">
+        <p class="is_not_admin">
+          Sorry, only the site admin may use the debugger.
+        </p>
+        <p class="is_admin">
+          These JavaScript processes are debuggable:
+        </p>
+        <ul id="query_servers">
+          <!--
+          <li><button class="run" id="run">Verify Your Installation.</button><span
id="result"></span></li>
+          -->
+        </ul>
+      </div>
+    </div>
+    <script>
+    jQuery(function($) {
+
+request.couch('/_session', function(er, res) {
+  if(er)
+    throw er
+
+  var session = res.body
+  if(!~ session.userCtx.roles.indexOf('_admin'))
+    return $('.is_not_admin').show()
+
+  console.log('Confirmed admin')
+  $('.is_admin').show()
+})
+
+    })
+    </script>
+  </body>
+</html>


Mime
View raw message