From 26b2dee4ef3f0a00bd6fb2989ada48ad9b054972 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Sun, 2 Oct 2022 21:53:01 +0200 Subject: server generate output bugfix --- VERSION | 2 +- src_js/common.js | 6 +++++- src_py/opcut/server.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 1d0ba9e..267577d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +0.4.1 diff --git a/src_js/common.js b/src_js/common.js index b489914..1d718b8 100644 --- a/src_js/common.js +++ b/src_js/common.js @@ -29,9 +29,13 @@ export async function calculate() { if (!res.ok) throw await res.text(); const result = await res.json(); + const selected = { + panel: Object.keys(result.params.panels)[0], + item: null + }; r.change(u.pipe( u.set('result', result), - u.set('selected', states.main.selected) + u.set('selected', selected) )); if (!result) throw 'Could not resolve calculation'; diff --git a/src_py/opcut/server.py b/src_py/opcut/server.py index 379a571..8501aaa 100644 --- a/src_py/opcut/server.py +++ b/src_py/opcut/server.py @@ -94,10 +94,10 @@ class Server(aio.Resource): output = await _generate(output_format, panel, result) - if output_format == common.OutputType.PDF: + if output_format == common.OutputFormat.PDF: content_type = 'application/pdf' - elif output_format == common.OutputType.SVG: + elif output_format == common.OutputFormat.SVG: content_type = 'image/svg+xml' else: -- cgit v1.2.3-70-g09d2