Skip to content

Commit a10e9b0

Browse files
author
Jameson Grieve
authored
Fixed Small Frontend Issues (#148)
* Fixed side-effects of previous #136 fix; * Fixed #83 using cookies-next; * Fixed #134 with TabIndicatorProps; * Fixed linting; * Removed empty page for build;
1 parent 480c124 commit a10e9b0

File tree

15 files changed

+426
-5629
lines changed

15 files changed

+426
-5629
lines changed

frontend/.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["next/babel"],
3+
"plugins": []
4+
}

frontend/.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
extends: ["next", "next/core-web-vitals"],
3+
parser: "@babel/eslint-parser",
4+
parserOptions: {
5+
requireConfigFile: false,
6+
babelOptions: {
7+
presets: ["next/babel"],
8+
},
9+
},
10+
rules: {
11+
// Add any custom rules here
12+
},
13+
};

frontend/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

frontend/components/agent/AgentObjective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function AgentObjective() {
1717
const taskStatus = useSWR(`agent/${agentName}/task`, async () => (running ? (await axios.get(`${process.env.NEXT_PUBLIC_API_URI ?? 'http://localhost:7437'}/api/agent/${agentName}/task`)).data.output.split("\n") : null), { refreshInterval: running?3000:0, revalidateOnFocus: false });
1818
const queryRunning = useCallback(async () => {
1919
setRunning((await axios.get(`${process.env.NEXT_PUBLIC_API_URI ?? 'http://localhost:7437'}/api/agent/${agentName}/task/status`)).data.status, {objective: objective});
20-
}, [agentName]);
20+
}, [agentName, objective]);
2121
useEffect(() => {
2222
queryRunning();
2323
}, [queryRunning])

frontend/components/agent/AgentPanel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import AgentChat from "./AgentChat";
77
import AgentObjective from "./AgentObjective";
88
import AgentInstruct from "./AgentInstruct";
99
import AgentAdmin from "./AgentAdmin";
10+
import { useTheme } from "@mui/material/styles";
1011
export default function AgentPanel() {
1112
const [tab, setTab] = useState(0);
1213

1314
const handleTabChange = (event, newTab) => {
1415
setTab(newTab);
1516
};
16-
17+
const theme = useTheme();
1718
const tabs = [
1819
<AgentChat key="chat" />,
1920
<AgentInstruct key="instruct" />,
@@ -22,7 +23,7 @@ export default function AgentPanel() {
2223
];
2324
return (
2425
<>
25-
<Tabs value={tab} onChange={handleTabChange} sx={{ mb: "0.5rem" }}>
26+
<Tabs value={tab} onChange={handleTabChange} TabIndicatorProps={{ style: { background: theme.palette.mode == "dark"?"#FFF":"#000" } }} sx={{ mb: "0.5rem" }} textColor={theme.palette.mode == "dark"?"white":"black"}>
2627
<Tab label="Chat With Agent" />
2728
<Tab label="Instruct Agent" />
2829
<Tab label="Set Agent Objective" />

frontend/components/chain/ChainControl.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)