diff --git a/hc/front/management/commands/pygmentize.py b/hc/front/management/commands/pygmentize.py
index 29835a45..0972692e 100644
--- a/hc/front/management/commands/pygmentize.py
+++ b/hc/front/management/commands/pygmentize.py
@@ -27,10 +27,12 @@ class Command(BaseCommand):
return
# Invocation examples
- _process("bash", lexers.BashLexer())
+ _process("bash_curl", lexers.BashLexer())
+ _process("bash_wget", lexers.BashLexer())
_process("browser", lexers.JavascriptLexer())
_process("crontab", lexers.BashLexer())
- _process("python", lexers.PythonLexer())
+ _process("python_urllib2", lexers.PythonLexer())
+ _process("python_requests", lexers.PythonLexer())
_process("php", lexers.PhpLexer())
_process("powershell", lexers.shell.PowerShellLexer())
_process("node", lexers.JavascriptLexer())
@@ -38,7 +40,8 @@ class Command(BaseCommand):
# API examples
_process("list_checks_request", lexers.BashLexer())
_process("list_checks_response", lexers.JsonLexer())
- _process("create_check_request", lexers.BashLexer())
+ _process("create_check_request_a", lexers.BashLexer())
+ _process("create_check_request_b", lexers.BashLexer())
_process("create_check_response", lexers.JsonLexer())
_process("pause_check_request", lexers.BashLexer())
_process("pause_check_response", lexers.JsonLexer())
diff --git a/static/css/base.css b/static/css/base.css
index 825e77f5..2fa9f07e 100644
--- a/static/css/base.css
+++ b/static/css/base.css
@@ -74,4 +74,8 @@ body {
.dialog-body {
margin: 24px 0;
+}
+
+pre {
+ border: 0;
}
\ No newline at end of file
diff --git a/static/css/docs.css b/static/css/docs.css
index 4455b211..ff2188e0 100644
--- a/static/css/docs.css
+++ b/static/css/docs.css
@@ -55,7 +55,8 @@ a.section:hover {
.page-docs code {
padding: 2px 4px;
font-size: 90%;
- color: #427d5e;
- background-color: #f2f9f6;
+ color: #333;
+ background-color: #f5f5f5;
border-radius: 4px;
-}
\ No newline at end of file
+}
+
diff --git a/static/css/icomoon.css b/static/css/icomoon.css
index a62470b5..287b9c92 100644
--- a/static/css/icomoon.css
+++ b/static/css/icomoon.css
@@ -1,10 +1,10 @@
@font-face {
font-family: 'icomoon';
- src: url('../fonts/icomoon.eot?j2asdo');
- src: url('../fonts/icomoon.eot?j2asdo#iefix') format('embedded-opentype'),
- url('../fonts/icomoon.ttf?j2asdo') format('truetype'),
- url('../fonts/icomoon.woff?j2asdo') format('woff'),
- url('../fonts/icomoon.svg?j2asdo#icomoon') format('svg');
+ src: url('../fonts/icomoon.eot?cxijqz');
+ src: url('../fonts/icomoon.eot?cxijqz#iefix') format('embedded-opentype'),
+ url('../fonts/icomoon.ttf?cxijqz') format('truetype'),
+ url('../fonts/icomoon.woff?cxijqz') format('woff'),
+ url('../fonts/icomoon.svg?cxijqz#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
@@ -24,6 +24,9 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-clippy:before {
+ content: "\e900";
+}
.icon-cancel:before {
content: "\e5c9";
}
diff --git a/static/css/my_checks.css b/static/css/my_checks.css
index 6a1a9254..89344664 100644
--- a/static/css/my_checks.css
+++ b/static/css/my_checks.css
@@ -63,11 +63,20 @@
font-style: normal;
}
-
#show-usage-modal .modal-dialog {
width: 1100px;
- }
+}
+
+#show-usage-modal .modal-body {
+ padding: 0;
+}
+
+#show-usage-modal pre {
+ margin: 0;
+ padding: 15px;
+}
+
+#show-usage-modal .highlight:nth-child(n+2) {
+ border-top: 1px solid #ddd;
+}
- #show-usage-modal .tab-content {
- margin-top: 15px;
- }
diff --git a/static/css/snippet-copy.css b/static/css/snippet-copy.css
new file mode 100644
index 00000000..315aa3fb
--- /dev/null
+++ b/static/css/snippet-copy.css
@@ -0,0 +1,15 @@
+.highlight {
+ position: relative;
+}
+
+.highlight button {
+ position: absolute;
+ top: 4px;
+ right: 4px;
+ opacity: 0;
+ transition: opacity 0.1s linear;
+}
+
+.highlight:hover button {
+ opacity: 1
+}
diff --git a/static/css/welcome.css b/static/css/welcome.css
index 9aca0590..625483e3 100644
--- a/static/css/welcome.css
+++ b/static/css/welcome.css
@@ -50,26 +50,6 @@
margin-bottom: 0;
}
-.page-welcome .highlight pre {
- background: #FFF;
- border-top: 0;
- border-radius: 0;
- border-color: #dddddd;
-}
-
-#email .instructions {
- background: #FFF;
- border: 1px solid #dddddd;
- border-top: 0;
- padding: 10px;
-}
-
-#email .email-address {
- font-size: 18px;
- padding-top: 10px;
-}
-
-
#get-started {
margin-top: 4em;
}
@@ -86,4 +66,28 @@
.welcome-integrations img {
width: 22px;
height: 22px;
-}
\ No newline at end of file
+}
+
+.page-welcome .tab-content {
+ border: 1px solid #ddd;
+ border-top: 0;
+}
+
+.tab-pane p {
+ padding: 15px;
+ margin: 0;
+}
+
+.page-welcome .highlight:nth-child(n+2) {
+ border-top: 1px solid #ddd;
+}
+
+.page-welcome .tab-pane pre {
+ margin-bottom: 0;
+ background: transparent;
+ padding: 15px;
+}
+
+.tab-pane.tab-pane-email {
+ border: none;
+}
diff --git a/static/fonts/icomoon.eot b/static/fonts/icomoon.eot
index 2d318da4..87082976 100644
Binary files a/static/fonts/icomoon.eot and b/static/fonts/icomoon.eot differ
diff --git a/static/fonts/icomoon.svg b/static/fonts/icomoon.svg
index 2aa4f133..7b548958 100644
--- a/static/fonts/icomoon.svg
+++ b/static/fonts/icomoon.svg
@@ -19,4 +19,5 @@
-powershell.exe -ExecutionPolicy bypass -File C:\Scripts\healthchecks.ps1 -+
powershell.exe -ExecutionPolicy bypass -File C:\Scripts\healthchecks.ps1
+Or, alternatively:
+{% include "front/snippets/create_check_request_b.html" %} +
-
+ As an alternative to HTTP/HTTPS requests,
+ you can "ping" this check by sending an
+ email message to
+
# using curl:
# (make sure it is installed on your system!)
curl --retry 3 {{ ping_url }}
-
-# using wget:
-wget {{ ping_url }} -O /dev/null
# using wget:
+wget {{ ping_url }} -O /dev/null
+
var xhr = new XMLHttpRequest();
+// the server returns appropriate CORS headers so cross-domain AJAX requests should work:
+var xhr = new XMLHttpRequest();
xhr.open('GET', '{{ ping_url }}', true);
xhr.send(null);
diff --git a/templates/front/snippets/browser.txt b/templates/front/snippets/browser.txt
index 93e083c0..1805a685 100644
--- a/templates/front/snippets/browser.txt
+++ b/templates/front/snippets/browser.txt
@@ -1,3 +1,4 @@
+// the server returns appropriate CORS headers so cross-domain AJAX requests should work:
var xhr = new XMLHttpRequest();
xhr.open('GET', 'PING_URL', true);
xhr.send(null);
\ No newline at end of file
diff --git a/templates/front/snippets/create_check_request.txt b/templates/front/snippets/create_check_request.txt
deleted file mode 100644
index 86d59fd3..00000000
--- a/templates/front/snippets/create_check_request.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-curl SITE_ROOT/api/v1/checks/ \
- --header "X-Api-Key: your-api-key" \
- --data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
-
-# Or, alternatively:
-curl SITE_ROOT/api/v1/checks/ \
- --data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
diff --git a/templates/front/snippets/create_check_request.html b/templates/front/snippets/create_check_request_a.html
similarity index 54%
rename from templates/front/snippets/create_check_request.html
rename to templates/front/snippets/create_check_request_a.html
index 8e497dfa..e6cc06ff 100644
--- a/templates/front/snippets/create_check_request.html
+++ b/templates/front/snippets/create_check_request_a.html
@@ -1,8 +1,4 @@
curl {{ SITE_ROOT }}/api/v1/checks/ \
--header "X-Api-Key: your-api-key" \
--data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
-
-# Or, alternatively:
-curl {{ SITE_ROOT }}/api/v1/checks/ \
- --data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
diff --git a/templates/front/snippets/create_check_request_a.txt b/templates/front/snippets/create_check_request_a.txt
new file mode 100644
index 00000000..e7e4d5db
--- /dev/null
+++ b/templates/front/snippets/create_check_request_a.txt
@@ -0,0 +1,3 @@
+curl SITE_ROOT/api/v1/checks/ \
+ --header "X-Api-Key: your-api-key" \
+ --data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
diff --git a/templates/front/snippets/create_check_request_b.html b/templates/front/snippets/create_check_request_b.html
new file mode 100644
index 00000000..a824f47f
--- /dev/null
+++ b/templates/front/snippets/create_check_request_b.html
@@ -0,0 +1,3 @@
+curl {{ SITE_ROOT }}/api/v1/checks/ \
+ --data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
+
diff --git a/templates/front/snippets/create_check_request_b.txt b/templates/front/snippets/create_check_request_b.txt
new file mode 100644
index 00000000..40838f18
--- /dev/null
+++ b/templates/front/snippets/create_check_request_b.txt
@@ -0,0 +1,2 @@
+curl SITE_ROOT/api/v1/checks/ \
+ --data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
diff --git a/templates/front/snippets/python.html b/templates/front/snippets/python.html
deleted file mode 100644
index f75fd980..00000000
--- a/templates/front/snippets/python.html
+++ /dev/null
@@ -1,8 +0,0 @@
->>> # using urllib2:
->>> import urllib2
->>> urllib2.urlopen("{{ ping_url }}")
-
->>> # using requests:
->>> import requests
->>> requests.get("{{ ping_url }}")
-
diff --git a/templates/front/snippets/python.txt b/templates/front/snippets/python.txt
deleted file mode 100644
index b37e2a01..00000000
--- a/templates/front/snippets/python.txt
+++ /dev/null
@@ -1,7 +0,0 @@
->>> # using urllib2:
->>> import urllib2
->>> urllib2.urlopen("PING_URL")
-
->>> # using requests:
->>> import requests
->>> requests.get("PING_URL")
\ No newline at end of file
diff --git a/templates/front/snippets/python_requests.html b/templates/front/snippets/python_requests.html
new file mode 100644
index 00000000..a97a4ff2
--- /dev/null
+++ b/templates/front/snippets/python_requests.html
@@ -0,0 +1,4 @@
+# using requests:
+import requests
+requests.get("{{ ping_url }}")
+
diff --git a/templates/front/snippets/python_requests.txt b/templates/front/snippets/python_requests.txt
new file mode 100644
index 00000000..72a8fb89
--- /dev/null
+++ b/templates/front/snippets/python_requests.txt
@@ -0,0 +1,3 @@
+# using requests:
+import requests
+requests.get("PING_URL")
diff --git a/templates/front/snippets/python_urllib2.html b/templates/front/snippets/python_urllib2.html
new file mode 100644
index 00000000..7fd2b041
--- /dev/null
+++ b/templates/front/snippets/python_urllib2.html
@@ -0,0 +1,4 @@
+# using urllib2:
+import urllib2
+urllib2.urlopen("{{ ping_url }}")
+
diff --git a/templates/front/snippets/python_urllib2.txt b/templates/front/snippets/python_urllib2.txt
new file mode 100644
index 00000000..44c514c8
--- /dev/null
+++ b/templates/front/snippets/python_urllib2.txt
@@ -0,0 +1,3 @@
+# using urllib2:
+import urllib2
+urllib2.urlopen("PING_URL")
diff --git a/templates/front/welcome.html b/templates/front/welcome.html
index f1cf0dea..00f46c98 100644
--- a/templates/front/welcome.html
+++ b/templates/front/welcome.html
@@ -62,10 +62,12 @@
{% include "front/snippets/crontab.html" %}
As an alternative to HTTP/HTTPS requests, you can "ping" this check by sending an email message to -
{{ check.email }}
-