feat: add script dry-run functionality and enhance script management
- Introduced a new dry-run endpoint for executing scripts without saving changes. - Implemented a dedicated ScriptDryRunPage for user interaction with dry-run functionality. - Enhanced ScriptsPage to support navigation to the dry-run feature. - Added LogViewer component for displaying logs during script execution. - Created ScriptEditPage for editing scripts with integrated dry-run capabilities. - Updated workflows to include new scripts for fetching and notifying data. - Improved overall user experience with better navigation and error handling.
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
import Editor from "@monaco-editor/react";
|
||||
import { useTheme } from "../theme.jsx";
|
||||
|
||||
export function CodeEditor({ language, value, onChange, height = "50vh" }) {
|
||||
export function CodeEditor({ language, value, onChange, height = "50vh", readOnly = false }) {
|
||||
const { theme } = useTheme();
|
||||
const isMobile = typeof window !== "undefined" && window.innerWidth < 768;
|
||||
|
||||
return (
|
||||
<div className="overflow-hidden rounded-box border border-base-300">
|
||||
<div className="overflow-hidden rounded-box border border-base-300 h-full min-h-0">
|
||||
<Editor
|
||||
height={height}
|
||||
language={language}
|
||||
value={value}
|
||||
onChange={(v) => onChange(v ?? "")}
|
||||
onChange={readOnly ? undefined : (v) => onChange(v ?? "")}
|
||||
theme={theme === "dark" ? "vs-dark" : "light"}
|
||||
options={{
|
||||
readOnly,
|
||||
minimap: { enabled: !isMobile },
|
||||
lineNumbers: "on",
|
||||
tabSize: 2,
|
||||
|
||||
Reference in New Issue
Block a user