From b3e4478d513545323247bee7fcb339552c2e8c0d Mon Sep 17 00:00:00 2001 From: Cael Date: Mon, 19 Feb 2024 13:39:59 +0800 Subject: [PATCH] feat: add LICENCE --- LICENSE | 21 +++++++++++++++++++ .../src/components/Output/Output.module.css | 6 +++++- frontend/src/components/Output/Output.tsx | 8 ++++++- frontend/src/workers/pyodide-worker.js | 19 +++++++++-------- 4 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b5d057e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Cael + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/frontend/src/components/Output/Output.module.css b/frontend/src/components/Output/Output.module.css index dfd3752..489af0b 100644 --- a/frontend/src/components/Output/Output.module.css +++ b/frontend/src/components/Output/Output.module.css @@ -8,7 +8,11 @@ /* output message */ .output { - @apply whitespace-pre-wrap p-2 bg-stone-100 font-mono empty:hidden; + @apply overflow-x-auto p-2 bg-stone-100 font-mono empty:hidden; +} + +.output p { + @apply whitespace-nowrap; } .wrapper[data-status="error"] .output { diff --git a/frontend/src/components/Output/Output.tsx b/frontend/src/components/Output/Output.tsx index abe195a..2694612 100644 --- a/frontend/src/components/Output/Output.tsx +++ b/frontend/src/components/Output/Output.tsx @@ -7,12 +7,18 @@ import { useAppContext } from "@/contexts/AppProvider"; export default function Output() { const { output, setOutput } = useAppContext(); + const lines = output.msg.split("\n").filter((line) => line !== ""); if (output.status === "idle" || output.status === "loading") return null; return (
-

{output.msg || "Sorry, there is no output"}

+
+ {lines.length === 0 &&

Sorry, there is no output

} + {lines.map((line) => ( +

{line}

+ ))} +