forked from xeust/telemage
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
90 lines (86 loc) · 3.57 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TeleGPT</title>
<link href="./public/styles.css" rel="stylesheet">
<link rel="icon" href="./public/favicon.svg">
{% if status == "SETUP_WEBHOOK" %}
<script defer src="./public/index.js"></script>
{% elif status == "AUTH" %}
<script defer src="./public/auth.js"></script>
{% endif %}
</head>
<body>
<header><a href="/">home</a><a href="/setup">setup</a><a href="/authorize">authorize</a></header>
<div class="app">
{% if status == "SETUP_ENVS" %}
<p>hey!</p>
<br />
<p>one or both of your configuration variables are not set, please do the following from the TeleGPT
app's card on your deta space canvas:</p>
<br />
<ul>
<li>
click on "...", select "settings", and then "configuration".
</li>
<li>
set both the configuration variables: "OPEN_AI" and "TELEGRAM". then click "save changes".
</li>
<li>
refresh this page or <a href="/setup">click here</a>.
</li>
</ul>
</p>
{% elif status == "SETUP_WEBHOOK" %}
<p>you can use the button below to set your webhook with telegram.</p>
<button class="btn add-id-btn set-webhook-btn">set webhook</button>
<p>once you've set the webhook, head over to <a href="./authorize"
rel="noopener noreferrer">authorize</a>.</p>
{% elif status == "READY" %}
<p>👅 configuration seems to be setup correctly.</p>
<br />
<p>
you can authorize individual users via <a href="./authorize"
rel="noopener noreferrer">authorize</a>.
then just slide into your TeleGPT bot's dms with cheeky prompts.
you should get generated images in response.
</p>
<br />
<p>your images are all stored in a <a href="https://deta.space/docs/en/reference/drive/about"
rel="noopener noreferrer">deta drive</a>. from your deta space canvas, simply click "...", then "view
data", then "drive" to preview and download. grab a <a
href="https://deta.space/changelog/post-6" rel="noopener noreferrer">data key</a> if you want to hack
around with your images elsewhere. </p>
{% elif status == "AUTH" %}
<div class="temp-container">
<p>
to get a chat id to authorize, just send your bot the message "/chat-id" & add it to this list.
</p>
<p style="text-decoration: underline;">authorized chat ids:</p>
<ul class="id-list">
{% if chat_ids != None %}
{% for i in chat_ids %}
<li>{{i}}</li>
{% endfor %}
{% endif %}
<li><button class="btn add-id-btn">add new chat id</button></li>
<li><button class="btn submit-btn hidden">submit</button></li>
</ul>
</div>
{% elif status == "ERROR" %}
<p>uh-oh, we've hit an unknown error. please double check your configuration variables.</p>
{% endif %}
</div>
</body>
<script>
const currentURL = window.location.pathname
const navLinks = document.querySelectorAll('header a').forEach(link => {
if (link.getAttribute('href') === currentURL) {
link.classList.add('active')
}
})
</script>
</html>