Mercurial Hosting > luan
comparison src/luan/modules/http/tools/Shell.luan @ 1245:2de84f128be3
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 16 Jul 2018 17:26:45 -0600 |
parents | a50803fde972 |
children | 5ba660381bd5 |
comparison
equal
deleted
inserted
replaced
1244:d1911842c2be | 1245:2de84f128be3 |
---|---|
69 local function remove_session(session_id) | 69 local function remove_session(session_id) |
70 return Thread.remove_global_callable("shell.session"..session_id) | 70 return Thread.remove_global_callable("shell.session"..session_id) |
71 end | 71 end |
72 | 72 |
73 function Shell.respond() | 73 function Shell.respond() |
74 local session_id = Http.request.cookies.session | 74 local session_id = Http.request.cookies["session"] |
75 if session_id == nil then | 75 if session_id == nil then |
76 session_id = new_session() | 76 session_id = new_session() |
77 Http.response.set_cookie("session",session_id) | 77 Http.response.set_cookie("session",session_id) |
78 end | 78 end |
79 local session = get_session(session_id) | 79 local session = get_session(session_id) |
128 </head> | 128 </head> |
129 <body> | 129 <body> |
130 <h2>Luan Shell</h2> | 130 <h2>Luan Shell</h2> |
131 <p>This is a command shell. Enter commands below.</p> | 131 <p>This is a command shell. Enter commands below.</p> |
132 <pre><%= session.history() %></pre> | 132 <pre><%= session.history() %></pre> |
133 <form name='form0' method='post'> | 133 <form method='post'> |
134 % <input type="text" name='cmd' size="80" autofocus> | 134 % <input type="text" name='cmd' size="80" autofocus> |
135 <input type="submit" value="run"> | 135 <input type="submit" value="run"> |
136 <input type="submit" name="clear" value="clear"> | 136 <input type="submit" name="clear" value="clear"> |
137 </form> | 137 </form> |
138 </body> | 138 </body> |