-
Notifications
You must be signed in to change notification settings - Fork 10
/
home.qtpl
103 lines (83 loc) · 3.82 KB
/
home.qtpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{% func HomePage(data HomeData) %}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chathooks</title>
</head>
<style>
h1, h2, p, select {font-family: Arial, Helvetica, sans-serif;}
.code {font-family: monospace;background-color:#efefef;border:1px solid #aaa;width:90%;height:5em;padding:0.3em;}
.fixed {font-family: monospace;background-color:#efefef;border:1px solid #aaa;width:90%;height:1em;padding:0.3em;color:#800000;border-radius:3px;}
</style>
<script type="text/javascript">
// https://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-and-not-a-new-window-using-javascript
function buildWebhookUrl() {
var proxyUrl = '{%s data.WebhookURL %}';
var webhookUrl = encodeURIComponent(document.getElementById('webhookUrlOrGuid').value);
var input = encodeURIComponent(document.getElementById('input').value);
var token = encodeURIComponent(document.getElementById('token').value);
var queryString = '?outputType=glip&url=' + webhookUrl + '&inputType=' + input + '&token=' + token;
return proxyUrl + queryString
}
function buildAndShowRedirectUrl() {
var webhookUrl = buildWebhookUrl();
var span = document.getElementById('proxyUrl');
while( span.firstChild ) {
span.removeChild( span.firstChild );
}
span.appendChild( document.createTextNode(webhookUrl) );
}
</script>
<body>
<img src="https://raw.githubusercontent.com/grokify/chathooks/master/docs/logos/logo_chathooks_long_600x150.png" />
<p><a href="{%s data.HomeURL %}">{%s data.HomeURL %}</a></p>
<p>Easily connect your webhooks to <a href="https://glip.com">Glip</a>!</p>
<p>View the code on GitHub: <a href="https://github.com/grokify/chathooks">Chathooks</a>.</p>
<h2>Step 1) Create a Glip Webhook URL</h2>
<h2>Step 2) Create your Chathooks webhook proxy URL</h2>
<form action="/button" method="post">
<p><select id="input" name="source" onchange="buildAndShowWebhookUrl()">
<option value="slack">slack (inbound)</option>
<option>aha</option>
<option>appsignal</option>
<option>apteligent</option>
<option>circleci</option>
<option>codeship</option>
<option>confluence</option>
<option>datadog</option>
<option>deskdotcom</option>
<option>enchant</option>
<option>gosquared</option>
<option>gosquared2</option>
<option>heroku</option>
<option>librato</option>
<option>magnumci</option>
<option>marketo</option>
<option>opsgenie</option>
<option>papertrail</option>
<option>pingdom</option>
<option>raygun</option>
<option>runscope</option>
<option>semaphore</option>
<option>statuspage</option>
<option>travisci</option>
<option>userlike</option>
<option>victorops</option>
</select></p>
<p><input type="text" id="webhookUrlOrGuid" name="webhookUrlOrGuid" value="" placeholder="Your Glip Webhook URL" style="width:400px" onchange="buildAndShowRedirectUrl()" /> Required</p>
<p><input type="text" id="token" name="token" value="demo account - do not use for production" placeholder="Your Glip Webhook URL" style="width:400px" onchange="buildAndShowRedirectUrl()" /> Required</p>
<p>Your Chathooks Webhook Proxy URL (be sure to verify):</p>
<textarea id="proxyUrl" class="code"></textarea>
</form>
<h2>Step 3) Add Your Chathooks URL to your webapp</h2>
<h2>Next Steps</h2>
<p>Please reach out to us on <a href="https://glipped.herokuapp.com">Glip chat</a> if you have any questions.</p>
<hr/>
<p><a href="https://github.com/grokify/chathooks">https://github.com/grokify/chathooks</a></p>
<script>
buildAndShowRedirectUrl();
</script>
</body>
</html>
{% endfunc %}