Skip to content

Commit

Permalink
Bugs Resource Manager (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedan2506 authored Jul 18, 2023
1 parent 1ed1696 commit 8ff1bcc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gui/pages/Content/APM/ApmDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default function ApmDashboard() {
padding: '0 8px'
}}>
<span className="text_14 mt_6 ml_6">Agent Performance Monitoring</span>
<button onClick={onClickLayoutChange} className="primary_button">Reset</button>
{/*<button onClick={onClickLayoutChange} className="primary_button">Reset</button>*/}
</div>
<ResponsiveGridLayout
className="layout"
Expand Down
11 changes: 8 additions & 3 deletions gui/pages/Content/Agents/AgentCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export default function AgentCreate({
const [createModal, setCreateModal] = useState(false);

const [scheduleData, setScheduleData] = useState(null);
const [col6ScrollTop, setCol6ScrollTop] = useState(0);

const handleCol3Scroll = (event) => {
setCol6ScrollTop(event.target.scrollTop);
};

useEffect(() => {
getOrganisationConfig(organisationId, "model_api_key")
Expand Down Expand Up @@ -653,7 +658,7 @@ export default function AgentCreate({

return (<>
<div className="row" style={{overflowY: 'scroll', height: 'calc(100vh - 92px)'}}>
<div className="col-3"></div>
<div className="col-3" onScroll={handleCol3Scroll}></div>
<div className="col-6" style={{padding: '25px 20px'}}>
<div>
<div className={styles.page_title}>Create new agent</div>
Expand Down Expand Up @@ -962,9 +967,9 @@ export default function AgentCreate({
src={!permissionDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
alt="expand-icon"/>
</div>
<div style={{marginBottom: '20px'}}>
<div className="mb_34">
{permissionDropdown &&
<div className="custom_select_options" ref={permissionRef} style={{width: '100%'}}>
<div className="custom_select_options mb_30" ref={permissionRef} style={{width: '100%'}}>
{permissions.map((permit, index) => (<div key={index} className="custom_select_option"
onClick={() => handlePermissionSelect(index)}
style={{padding: '12px 14px', maxWidth: '100%'}}>
Expand Down
16 changes: 7 additions & 9 deletions gui/pages/Content/Agents/ResourceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Image from "next/image";
import {downloadFile, downloadAllFiles, formatBytes, returnResourceIcon} from "@/utils/utils";

export default function ResourceList({files, channel, runs}) {
const [selectedRun, setSelectedRun] = useState(null);
const [selectedRunId, setSelectedRunId] = useState(null);
const filesByRun = useMemo(() => runs.map(run => {
const relatedFiles = files.filter(file => file.agent_execution_id === run.id);
return relatedFiles.length !== 0 && {"run": run, "files": relatedFiles};
Expand All @@ -15,7 +15,7 @@ export default function ResourceList({files, channel, runs}) {
runFiles.length !== 0 && downloadAllFiles(runFiles, name);
}

const isAnyFileWithAgentId = files.some(file => file.agent_execution_id !== null)
const isAnyFileWithAgentId = files.some(file => file.agent_execution_id !== null);

const File = ({file, index}) => (
<div key={index} onClick={() => downloadFile(file.id, file.name)} className={styles.history_box}
Expand Down Expand Up @@ -45,10 +45,10 @@ export default function ResourceList({files, channel, runs}) {
{filesByRun.map((filesRun, index) => (
<div key={index}>
<div className="horizontal_container justify_space_between cursor_pointer" style={{padding: '8px 6px'}}
onClick={() => setSelectedRun(filesRun.run === selectedRun ? null : filesRun.run)}>
onClick={() => setSelectedRunId(filesRun.run.id === selectedRunId ? null : filesRun.run.id)}>
<div className="horizontal_container">
<Image
src={selectedRun === filesRun.run ? "/images/arrow_downward_dropdown.svg" : "/images/arrow_forward.svg"}
src={selectedRunId === filesRun.run.id ? "/images/arrow_downward_dropdown.svg" : "/images/arrow_forward.svg"}
alt="arrow" width={14} height={14}/>
<span className="text_12 ml_8">{filesRun.run.name}</span>
<div className="resource_manager_tip ml_8"><Image src="/images/bolt.svg" alt="bolt" width={10}
Expand All @@ -59,10 +59,9 @@ export default function ResourceList({files, channel, runs}) {
onClick={() => downloadRunFiles(filesRun.run.id, filesRun.run.name)}/>
</div>

{selectedRun === filesRun.run && (
{selectedRunId === filesRun.run.id && (
<div className={styles.resources} style={{padding: '2px 8px'}}>
{/* eslint-disable-next-line react/jsx-key */}
{filesRun.files.map((file, index) => <File file={file} index={index}/>)}
{filesRun.files.map((file, index) => <File key={index} file={file}/>)}
</div>
)}
</div>
Expand All @@ -72,8 +71,7 @@ export default function ResourceList({files, channel, runs}) {

{channel === 'input' &&
<div className={styles.resources}>
{/* eslint-disable-next-line react/jsx-key */}
{files.map((file, index) => <File file={file} index={index}/>)}
{files.map((file, index) => <File key={index} file={file}/>)}
</div>}
</div>
)
Expand Down
3 changes: 1 addition & 2 deletions gui/pages/Content/Marketplace/AgentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function AgentTemplate({template, env}) {
setGoals(data.configs.goal.value)
setConstraints(data.configs.constraints.value)
setTools(data.configs.tools.value)
setInstructions(data.configs.instructions ? data.configs.instructions.value : null);
setInstructions(data.configs.instruction ? data.configs.instruction.value : null);
setIsLoading(false)
}

Expand Down Expand Up @@ -175,7 +175,6 @@ export default function AgentTemplate({template, env}) {
{instructions.map((instruction, index) => (
<div key={index} style={{marginTop: '0'}}>
<div className={styles2.description_text}>{index + 1}. {instruction || ''}</div>
{index !== instructions.length - 1 && <br/>}
</div>))}
</div>
</div>}
Expand Down
3 changes: 3 additions & 0 deletions gui/pages/_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@ p {
.mb_10{margin-bottom: 10px;}
.mb_16{margin-bottom: 16px;}
.mb_20{margin-bottom: 20px;}
.mb_24{margin-bottom: 24px;}
.mb_30{margin-bottom: 30px;}
.mb_34{margin-bottom: 34px;}

.ml_24{margin-left:24px;}
.ml_6{margin-left: 6px;}
Expand Down

0 comments on commit 8ff1bcc

Please sign in to comment.