Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffj66 committed Nov 8, 2023
1 parent eb48c38 commit 8cdeef6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
11 changes: 8 additions & 3 deletions src/frontend/src/Components/SelectPipeline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ export default function SelectPipeline(props) {
const [newPipelineName, setNewPipelineName] = useState("")
const [selectedPipeline, setSelectedPipeline] = useState(null)
const [buttonsDisabled, setButtonsDisabled] = useState(true)
//const [forceUpdate, setForceUpdate] = useState(0)
const [forceUpdate, setForceUpdate] = useState(0)

useEffect(() => {
try {
console.log(forceUpdate)
axios.get(`/api/config?id=${pipelinesLabel}`).then(ret => {
if (ret.data === '') {
setPipelines([])
Expand All @@ -202,7 +203,7 @@ export default function SelectPipeline(props) {
} catch (err) {
console.log(err)
}
}, [])
}, [forceUpdate])

const onPipelineNameChange = (event) => {
setNewPipelineName(event.target.value)
Expand Down Expand Up @@ -287,6 +288,10 @@ export default function SelectPipeline(props) {
}
}

const updatePipelineList = () => {
setForceUpdate(forceUpdate + 1)
}

const renderPipelines = () => {
if (pipelines) {
return (
Expand Down Expand Up @@ -340,7 +345,7 @@ export default function SelectPipeline(props) {
<Button content="Prebuilt Vector Embedding Search" primary disabled={buttonsDisabled} onClick={onCreateVectorPipeline} style={{ fontSize: "14px", display: "block", width: "100%", marginBottom: "20px" }} />
</div>
<div style={{ paddingTop: "50px",width: "50%"}}>
<EnterpriseSearch />
<EnterpriseSearch updatePipelineList={updatePipelineList}/>
</div>
</div>
)
Expand Down
23 changes: 13 additions & 10 deletions src/frontend/src/Pages/chat/ChatPipeline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const processTypes = [
}
]

const EnterpriseSearch = () => {
const EnterpriseSearch = (props) => {
const [isConfigPanelOpen, setIsConfigPanelOpen] = useState(false);
const [retrieveCount, setRetrieveCount] = useState(3);

Expand Down Expand Up @@ -200,16 +200,19 @@ const EnterpriseSearch = () => {
const stages = []
let firstStage = {}
let count = 1
for(const c in sc){
if(chatPipeline.includes(sc[c].name)){
console.log(sc[c].name)
if(count === 1){
firstStage = sc[c]
} else {
stages.push(sc[c])
for(const c of chatPipeline){
for(const s in sc){
if(c === sc[s].name){
console.log(sc[s].name)
if(count === 1){
firstStage = sc[s]
} else {
stages.push(sc[s])
}
count++
}
count++
}

}
const newPipeline = {
name : "myDynamicPipeline",
Expand All @@ -226,7 +229,7 @@ const EnterpriseSearch = () => {
currentPipelines.data.pipelines.push(newPipeline)
await axios.post('/api/config', currentPipelines.data)
}
console.log(JSON.stringify(chatPipeline))
props.updatePipelineList()
}

// const onCreateCogSearchPipeline = async () => {
Expand Down

0 comments on commit 8cdeef6

Please sign in to comment.