🔨 refactor(menuBar): remove unused imports and code, add missing semicolon
🔨 refactor(vite.config): remove unused routes and commented code, remove rewrite function
The menuBar component had some unused imports and code that was removed. A missing semicolon was added to the code. The vite.config file had some unused routes and commented code that was removed. The rewrite function was also removed as it was not needed.
This commit is contained in:
parent
7fc7cd0957
commit
e4af874534
2 changed files with 6 additions and 33 deletions
|
|
@ -1,18 +1,12 @@
|
|||
import React, { useContext } from "react";
|
||||
import { useContext } from "react";
|
||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||
import { PopUpContext } from "../../../../contexts/popUpContext";
|
||||
import {
|
||||
Save,
|
||||
Edit,
|
||||
Upload,
|
||||
Download,
|
||||
Code,
|
||||
Plus,
|
||||
ChevronDown,
|
||||
ChevronLeft,
|
||||
Undo,
|
||||
Redo,
|
||||
Settings,
|
||||
Settings2,
|
||||
} from "lucide-react";
|
||||
import {
|
||||
|
|
@ -26,28 +20,20 @@ import {
|
|||
DropdownMenuSeparator,
|
||||
} from "../../../ui/dropdown-menu";
|
||||
|
||||
import RenameLabel from "../../../ui/rename-label";
|
||||
import _ from "lodash";
|
||||
import ImportModal from "../../../../modals/importModal";
|
||||
import ExportModal from "../../../../modals/exportModal";
|
||||
import ApiModal from "../../../../modals/ApiModal";
|
||||
import { alertContext } from "../../../../contexts/alertContext";
|
||||
import { updateFlowInDatabase } from "../../../../controllers/API";
|
||||
import { Link } from "react-router-dom";
|
||||
import { undoRedoContext } from "../../../../contexts/undoRedoContext";
|
||||
import FlowSettingsModal from "../../../../modals/flowSettingsModal";
|
||||
|
||||
export const MenuBar = ({flows, tabId }) => {
|
||||
export const MenuBar = ({ flows, tabId }) => {
|
||||
const { updateFlow, setTabId, addFlow } = useContext(TabsContext);
|
||||
const { setErrorData } = useContext(alertContext);
|
||||
const { openPopUp } = useContext(PopUpContext);
|
||||
const { undo, redo } = useContext(undoRedoContext);
|
||||
|
||||
|
||||
|
||||
function handleAddFlow() {
|
||||
try {
|
||||
addFlow();
|
||||
addFlow(null, true);
|
||||
// saveFlowStyleInDataBase();
|
||||
} catch (err) {
|
||||
setErrorData(err);
|
||||
|
|
@ -61,7 +47,6 @@ export const MenuBar = ({flows, tabId }) => {
|
|||
<ChevronLeft className="w-5" />
|
||||
</Link>
|
||||
<div className="flex items-center font-medium text-sm rounded-md py-1 px-1.5 bg-background gap-0.5">
|
||||
|
||||
{/* <RenameLabel
|
||||
value={current_flow.name}
|
||||
setValue={(value) => {
|
||||
|
|
@ -83,7 +68,7 @@ export const MenuBar = ({flows, tabId }) => {
|
|||
<DropdownMenuLabel>Edit</DropdownMenuLabel>
|
||||
<DropdownMenuItem
|
||||
onClick={() => {
|
||||
openPopUp(<FlowSettingsModal />)
|
||||
openPopUp(<FlowSettingsModal />);
|
||||
}}
|
||||
>
|
||||
<Settings2 className="w-4 h-4 mr-2" />
|
||||
|
|
|
|||
|
|
@ -1,19 +1,7 @@
|
|||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
const apiRoutes = [
|
||||
"/all",
|
||||
"/predict",
|
||||
"^/validate/*",
|
||||
"^/chat/*",
|
||||
"/version",
|
||||
"/health",
|
||||
"/flows/*",
|
||||
"/flows/",
|
||||
"/flows_styles",
|
||||
"/flows_styles/",
|
||||
"/flows_styles/*",
|
||||
];
|
||||
const apiRoutes = ["^/api/v1/"];
|
||||
|
||||
// Use environment variable to determine the target.
|
||||
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
|
||||
|
|
@ -24,7 +12,7 @@ const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
|
|||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
rewrite: (path) => `/api/v1${path}`,
|
||||
// rewrite: (path) => `/api/v1${path}`,
|
||||
};
|
||||
return proxyObj;
|
||||
}, {});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue