Added traceback
This commit is contained in:
parent
03e9003969
commit
b06a10f6ec
13
compose.yml
13
compose.yml
@ -10,4 +10,17 @@ services:
|
|||||||
- PYTHONDONTWRITEBYTECODE="1"
|
- PYTHONDONTWRITEBYTECODE="1"
|
||||||
entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
|
entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
|
||||||
#["python","-m","snek.app"]
|
#["python","-m","snek.app"]
|
||||||
|
snecssh:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: DockerfileDrive
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "2225:2225"
|
||||||
|
volumes:
|
||||||
|
- ./:/code
|
||||||
|
environment:
|
||||||
|
- PYTHONDONTWRITEBYTECODE="1"
|
||||||
|
entrypoint: ["python","-m","snekssh.app2"]
|
||||||
|
#["python","-m","snek.app"]
|
||||||
|
|
@ -24,6 +24,7 @@ dependencies = [
|
|||||||
"mistune",
|
"mistune",
|
||||||
"aiohttp-session",
|
"aiohttp-session",
|
||||||
"cryptography",
|
"cryptography",
|
||||||
"requests"
|
"requests",
|
||||||
|
"asyncssh"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -4,6 +4,29 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gallery {
|
||||||
|
padding: 50px;
|
||||||
|
height: auto;
|
||||||
|
overflow: auto;
|
||||||
|
flex: 1;
|
||||||
|
&.tile {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
object-fit: cover;
|
||||||
|
margin-right: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tile {
|
||||||
|
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
object-fit: cover;
|
||||||
|
margin-right: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
|
@ -25,6 +25,7 @@ class ChatWindowElement extends HTMLElement {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const chatTitle = document.createElement('h2')
|
const chatTitle = document.createElement('h2')
|
||||||
chatTitle.classList.add("chat-title")
|
chatTitle.classList.add("chat-title")
|
||||||
chatTitle.innerText = "Loading..."
|
chatTitle.innerText = "Loading..."
|
||||||
@ -37,7 +38,13 @@ class ChatWindowElement extends HTMLElement {
|
|||||||
channelElement.setAttribute("channel", channel.uid)
|
channelElement.setAttribute("channel", channel.uid)
|
||||||
//channelElement.classList.add("chat-messages")
|
//channelElement.classList.add("chat-messages")
|
||||||
this.container.appendChild(channelElement)
|
this.container.appendChild(channelElement)
|
||||||
|
//const tileElement = document.createElement('tile-grid')
|
||||||
|
//tileElement.classList.add("message-list")
|
||||||
|
//this.container.appendChild(tileElement)
|
||||||
|
//const uploadButton = document.createElement('upload-button')
|
||||||
|
//uploadButton.grid = tileElement
|
||||||
|
//uploadButton.setAttribute('grid', "#grid")
|
||||||
|
//this.container.appendChild(uploadButton)
|
||||||
const chatInput = document.createElement('chat-input')
|
const chatInput = document.createElement('chat-input')
|
||||||
|
|
||||||
chatInput.addEventListener("submit",(e)=>{
|
chatInput.addEventListener("submit",(e)=>{
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Snek</title>
|
<title>Snek</title>
|
||||||
|
<script src="/media-upload.js"></script>
|
||||||
<script src="/html-frame.js"></script>
|
<script src="/html-frame.js"></script>
|
||||||
<script src="/schedule.js"></script>
|
<script src="/schedule.js"></script>
|
||||||
<script src="/app.js"></script>
|
<script src="/app.js"></script>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from snek.system.view import BaseView
|
from snek.system.view import BaseView
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
class RPCView(BaseView):
|
class RPCView(BaseView):
|
||||||
@ -117,7 +118,11 @@ class RPCView(BaseView):
|
|||||||
method = getattr(self,method_name.replace(".","_"),None)
|
method = getattr(self,method_name.replace(".","_"),None)
|
||||||
if not method:
|
if not method:
|
||||||
raise Exception("Method not found")
|
raise Exception("Method not found")
|
||||||
|
try:
|
||||||
result = await method(*args)
|
result = await method(*args)
|
||||||
|
except Exception as ex:
|
||||||
|
result = dict({"callId":call_id,"success": False, "data":{"exception":str(ex),"traceback":traceback.format_exc()}})
|
||||||
|
#dict(error=ex=str(ex),traceback=traceback.format_exc())
|
||||||
await self.ws.send_json({"callId":call_id,"success":True,"data":result})
|
await self.ws.send_json({"callId":call_id,"success":True,"data":result})
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
await self.ws.send_json({"callId":call_id,"success":False,"data":str(ex)})
|
await self.ws.send_json({"callId":call_id,"success":False,"data":str(ex)})
|
||||||
|
Loading…
Reference in New Issue
Block a user