0
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
|
3 local Io = require "luan:Io.luan"
|
|
4 local Http = require "luan:http/Http.luan"
|
|
5 local Shared = require "site:/lib/Shared.luan"
|
|
6 local head = Shared.head or error()
|
|
7 local header = Shared.header or error()
|
|
8
|
|
9
|
|
10 return function()
|
1
|
11 local ai_key = "whatever"
|
0
|
12 Io.stdout = Http.response.text_writer()
|
|
13 %>
|
|
14 <!doctype html>
|
|
15 <html lang="en">
|
|
16 <head>
|
|
17 <% head() %>
|
|
18 <title>Lang</title>
|
|
19 <style>
|
|
20 </style>
|
|
21 </head>
|
|
22 <body>
|
|
23 <% header() %>
|
|
24 <div content>
|
|
25 <h1>Lang</h1>
|
1
|
26 <div ai_container="<%=ai_key%>" >
|
|
27 <div flex>
|
|
28 <div scroll>
|
|
29 <h2>Let's chat</h2>
|
|
30 <div messages></div>
|
|
31 </div>
|
|
32 <div ask>
|
|
33 <textarea autofocus oninput="fixTextarea(event)" onkeydown="textareaKey('<%=ai_key%>',event)"></textarea>
|
|
34 <button onclick="askAi('<%=ai_key%>')" title="Send"><img src="/images/send.svg"></button>
|
|
35 </div>
|
|
36 </div>
|
|
37 <img waiting-ai-icon src="/images/spinner_green.gif">
|
|
38 </div>
|
0
|
39 </div>
|
|
40 </body>
|
|
41 </html>
|
|
42 <%
|
|
43 end
|