error screen; better meshes
This commit is contained in:
+16
-2
@@ -199,15 +199,29 @@ def landing_page():
|
||||
|
||||
def generate():
|
||||
yield loading_screen().data
|
||||
browser_response = execute_from_flask(itemtypes_api.get_collection_items,
|
||||
try:
|
||||
browser_response = execute_from_flask(itemtypes_api.get_collection_items,
|
||||
request, collection_id,
|
||||
skip_valid_check=True)
|
||||
yield browser_response.data
|
||||
|
||||
except Exception as ex:
|
||||
yield error_screen(ex).data
|
||||
|
||||
yield browser_response.data
|
||||
return Response(stream_with_context(generate()))
|
||||
|
||||
return get_response(api_.landing_page(request))
|
||||
|
||||
def error_screen(ex: Exception):
|
||||
"""
|
||||
Loading empty page
|
||||
|
||||
:returns: HTTP response
|
||||
"""
|
||||
content = render_j2_template(api_.tpl_config, 'error_screen.html',{"exception": ex})
|
||||
|
||||
return get_response((request.headers, HTTPStatus.OK, content))
|
||||
|
||||
def loading_screen():
|
||||
"""
|
||||
Loading empty page
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
{% block extrafoot %}
|
||||
|
||||
<script>
|
||||
document.getElementById("loading_screen").style.height = '0px';
|
||||
document.getElementById("loading_screen").remove();
|
||||
|
||||
// attach even to modeSwitch btn
|
||||
document.getElementById("modeSwitch").onclick = switchMode;
|
||||
@@ -524,8 +524,12 @@
|
||||
if (-0.01 < sum_orientation && sum_orientation <0.01){
|
||||
coords[p][c][0][0] += 0.0000001;
|
||||
coords[p][c][0][1] += 0.0000001;
|
||||
|
||||
coords[p][c][1][0] -= 0.0000001;
|
||||
coords[p][c][1][1] -= 0.0000001;
|
||||
|
||||
coords[p][c][2][0] += 0.0000001;
|
||||
coords[p][c][2][1] += 0.0000001;
|
||||
if(polygon_pts.length==3) {
|
||||
createdPolygon = true;
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<div id="loading_screen" style="position: absolute;left: 20px; right: 20px;top:20px;width: fit-content;margin-inline: auto;">
|
||||
{{data['exception']}}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
document.getElementById("loading_screen").remove();
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user