fix: use NextJS basePath and WEB_PREFIX to support custom prefix (#19497)
Co-authored-by: johnny0120 <15564476+johnny0120@users.noreply.github.com>
This commit is contained in:
parent
d1c55cb901
commit
49af07f444
33 changed files with 87 additions and 69 deletions
|
|
@ -3,6 +3,7 @@ import type { FC } from 'react'
|
|||
import Editor, { loader } from '@monaco-editor/react'
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import Base from '../base'
|
||||
import { WEB_PREFIX } from '@/config'
|
||||
import cn from '@/utils/classnames'
|
||||
import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'
|
||||
import {
|
||||
|
|
@ -14,7 +15,7 @@ import './style.css'
|
|||
import { noop } from 'lodash-es'
|
||||
|
||||
// load file from local instead of cdn https://github.com/suren-atoyan/monaco-react/issues/482
|
||||
loader.config({ paths: { vs: '/vs' } })
|
||||
loader.config({ paths: { vs: `${WEB_PREFIX}/vs` } })
|
||||
|
||||
const CODE_EDITOR_LINE_HEIGHT = 18
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ const IterationResultPanel: FC<Props> = ({
|
|||
'transition-all duration-200',
|
||||
expandedIterations[index]
|
||||
? 'opacity-100'
|
||||
: 'max-h-0 opacity-0 overflow-hidden',
|
||||
: 'max-h-0 overflow-hidden opacity-0',
|
||||
)}>
|
||||
<TracingPanel
|
||||
list={iteration}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ const LoopResultPanel: FC<Props> = ({
|
|||
'transition-all duration-200',
|
||||
expandedLoops[index]
|
||||
? 'opacity-100'
|
||||
: 'max-h-0 opacity-0 overflow-hidden',
|
||||
: 'max-h-0 overflow-hidden opacity-0',
|
||||
)}>
|
||||
{
|
||||
loopVariableMap?.[index] && (
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ const LoopResultPanel: FC<Props> = ({
|
|||
'transition-all duration-200',
|
||||
expandedLoops[index]
|
||||
? 'opacity-100'
|
||||
: 'max-h-0 opacity-0 overflow-hidden',
|
||||
: 'max-h-0 overflow-hidden opacity-0',
|
||||
)}>
|
||||
<TracingPanel
|
||||
list={loop}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue