mirror of
https://github.com/ianarawjo/ChainForge.git
synced 2025-03-14 16:26:45 +00:00
fixes
This commit is contained in:
parent
0d13ca2060
commit
f44259c656
@ -4,6 +4,7 @@ import useStore from './store';
|
||||
import StatusIndicator from './StatusIndicatorComponent'
|
||||
import NodeLabel from './NodeLabelComponent'
|
||||
import AlertModal from './AlertModal'
|
||||
import { IconTerminal } from '@tabler/icons-react'
|
||||
|
||||
// Ace code editor
|
||||
import AceEditor from "react-ace";
|
||||
@ -159,9 +160,10 @@ const EvaluatorNode = ({ data, id }) => {
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<div className="node-header">
|
||||
<NodeLabel title={data.title || 'Evaluator Node'}
|
||||
<NodeLabel title={data.title || 'Python Evaluator Node'}
|
||||
nodeId={id}
|
||||
onEdit={hideStatusIndicator} />
|
||||
onEdit={hideStatusIndicator}
|
||||
icon={<IconTerminal size="16px" />} />
|
||||
<StatusIndicator status={status} />
|
||||
<button className="AmitSahoo45-button-3" onClick={handleRunClick}><div className="play-button"></div></button>
|
||||
</div>
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Handle } from 'react-flow-renderer';
|
||||
import useStore from './store';
|
||||
import NodeLabel from './NodeLabelComponent'
|
||||
|
||||
const bucketResponsesByLLM = (responses) => {
|
||||
let responses_by_llm = {};
|
||||
@ -116,8 +117,10 @@ const InspectorNode = ({ data, id }) => {
|
||||
return (
|
||||
<div className="inspector-node">
|
||||
<div className="node-header">
|
||||
Inspect Node
|
||||
</div>
|
||||
<NodeLabel title={data.title || 'Inspect Node'}
|
||||
nodeId={id}
|
||||
icon={'🔍'} />
|
||||
</div>
|
||||
{/* <div className="var-select-toolbar">
|
||||
{varSelects}
|
||||
</div> */}
|
||||
|
@ -2,7 +2,7 @@ import useStore from './store';
|
||||
import { EditText } from 'react-edit-text';
|
||||
import 'react-edit-text/dist/index.css';
|
||||
|
||||
export default function NodeLabel({ title, nodeId, onEdit, onSave }) {
|
||||
export default function NodeLabel({ title, nodeId, icon, onEdit, onSave }) {
|
||||
const setDataPropsForNode = useStore((state) => state.setDataPropsForNode);
|
||||
|
||||
const handleNodeLabelChange = (evt) => {
|
||||
@ -15,13 +15,14 @@ export default function NodeLabel({ title, nodeId, onEdit, onSave }) {
|
||||
if (onEdit) onEdit();
|
||||
};
|
||||
|
||||
return (
|
||||
return (<>
|
||||
{icon ? (<>{icon} </>) : <></>}
|
||||
<EditText className="nodrag" name={nodeId ? nodeId+"-label" : "node-label"}
|
||||
defaultValue={title || 'Node'}
|
||||
style={{width: '80%', margin:'0px', padding:'0px', minHeight:'18px'}}
|
||||
style={{width: '70%', margin:'0px', padding:'0px', minHeight:'18px'}}
|
||||
onEditMode={handleEnterEditMode}
|
||||
onSave={handleNodeLabelChange}
|
||||
inline={true}
|
||||
/>
|
||||
);
|
||||
</>);
|
||||
}
|
@ -291,7 +291,8 @@ const PromptNode = ({ data, id }) => {
|
||||
<div className="node-header drag-handle">
|
||||
<NodeLabel title={data.title || 'Prompt Node'}
|
||||
nodeId={id}
|
||||
onEdit={hideStatusIndicator} />
|
||||
onEdit={hideStatusIndicator}
|
||||
icon={'💬'} />
|
||||
<StatusIndicator status={status} />
|
||||
<AlertModal ref={alertModal} />
|
||||
<button className="AmitSahoo45-button-3 nodrag" onClick={handleRunClick}><div className="play-button"></div></button>
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import { Handle } from 'react-flow-renderer';
|
||||
import { IconTextPlus } from '@tabler/icons-react'
|
||||
import useStore from './store';
|
||||
import NodeLabel from './NodeLabelComponent'
|
||||
import TemplateHooks from './TemplateHooksComponent';
|
||||
@ -96,7 +97,7 @@ const TextFieldsNode = ({ data, id }) => {
|
||||
return (
|
||||
<div className="text-fields-node">
|
||||
<div className="node-header">
|
||||
<NodeLabel title={data.title || 'TextFields Node'} nodeId={id} />
|
||||
<NodeLabel title={data.title || 'TextFields Node'} nodeId={id} icon={<IconTextPlus size="16px" />} />
|
||||
</div>
|
||||
<div ref={ref}>
|
||||
{fields}
|
||||
|
@ -182,7 +182,8 @@ const VisNode = ({ data, id }) => {
|
||||
>
|
||||
<div className="node-header">
|
||||
<NodeLabel title={data.title || 'Vis Node'}
|
||||
nodeId={id} />
|
||||
nodeId={id}
|
||||
icon={'📊'} />
|
||||
</div>
|
||||
<div className="nodrag">{plotlyObj}</div>
|
||||
<Handle
|
||||
|
Loading…
x
Reference in New Issue
Block a user